Class OpenAiAssistantStreamingGeneratorAutoConfiguration

java.lang.Object
ai.yda.framework.rag.generator.assistant.openai.streaming.autoconfigure.OpenAiAssistantStreamingGeneratorAutoConfiguration

@AutoConfiguration @EnableConfigurationProperties({OpenAiAssistantStreamingGeneratorProperties.class,org.springframework.ai.autoconfigure.openai.OpenAiConnectionProperties.class}) public class OpenAiAssistantStreamingGeneratorAutoConfiguration extends Object
Autoconfiguration class for setting up an OpenAiAssistantStreamingGenerator bean. This class automatically configures the necessary components for integrating with the OpenAI API to create a streaming Assistant Generator. The configuration is based on properties defined in the external configuration files (e.g., application.properties or application.yml) under OpenAiConnectionProperties.CONFIG_PREFIX and OpenAiAssistantStreamingGeneratorProperties.CONFIG_PREFIX namespaces.
Since:
0.1.0
See Also:
  • Constructor Details

  • Method Details

    • openAiGenerator

      @Bean public ai.yda.framework.rag.generator.assistant.openai.streaming.OpenAiAssistantStreamingGenerator openAiGenerator(OpenAiAssistantStreamingGeneratorProperties assistantGeneratorProperties, org.springframework.ai.autoconfigure.openai.OpenAiConnectionProperties openAiProperties, ai.yda.framework.session.core.ReactiveSessionProvider sessionProvider)
      Defines an OpenAiAssistantStreamingGenerator bean. This bean is configured using the provided properties for the streaming Assistant Generator and the OpenAI connection. The generator requires an API key and an Assistant ID, which are retrieved from the external configuration, and a ReactiveSessionProvider for managing User Sessions.
      Parameters:
      assistantGeneratorProperties - the properties related to the Assistant Generator, providing Assistant ID configuration.
      openAiProperties - the properties related to the OpenAI connection, including the API key.
      sessionProvider - the Session Provider responsible for managing User Sessions.
      Returns:
      a configured OpenAiAssistantStreamingGenerator bean ready for use in the application.
    • restClientBuilder

      @Bean @ConditionalOnMissingBean public org.springframework.web.client.RestClient.Builder restClientBuilder()
      Defines a RestClient.Builder bean if none is provided.
      Returns:
      Rest Client builder