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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionai.yda.framework.rag.generator.assistant.openai.streaming.OpenAiAssistantStreamingGeneratoropenAiGenerator(OpenAiAssistantStreamingGeneratorProperties assistantGeneratorProperties, org.springframework.ai.autoconfigure.openai.OpenAiConnectionProperties openAiProperties, ai.yda.framework.session.core.ReactiveSessionProvider sessionProvider) Defines anOpenAiAssistantStreamingGeneratorbean.org.springframework.web.client.RestClient.BuilderDefines aRestClient.Builderbean if none is provided.
-
Constructor Details
-
OpenAiAssistantStreamingGeneratorAutoConfiguration
public OpenAiAssistantStreamingGeneratorAutoConfiguration()Default constructor forOpenAiAssistantStreamingGeneratorAutoConfiguration.
-
-
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 anOpenAiAssistantStreamingGeneratorbean. 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 aReactiveSessionProviderfor 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
OpenAiAssistantStreamingGeneratorbean ready for use in the application.
-
restClientBuilder
@Bean @ConditionalOnMissingBean public org.springframework.web.client.RestClient.Builder restClientBuilder()Defines aRestClient.Builderbean if none is provided.- Returns:
- Rest Client builder
-