Class OpenAiAssistantGeneratorAutoConfiguration
java.lang.Object
ai.yda.framework.rag.generator.assistant.openai.autoconfigure.OpenAiAssistantGeneratorAutoConfiguration
@AutoConfiguration
@EnableConfigurationProperties({OpenAiAssistantGeneratorProperties.class,org.springframework.ai.autoconfigure.openai.OpenAiConnectionProperties.class})
public class OpenAiAssistantGeneratorAutoConfiguration
extends Object
Autoconfiguration class for setting up an
OpenAiAssistantGenerator bean. This class automatically configures
the necessary components for integrating with the OpenAI API to create an 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 OpenAiAssistantGeneratorProperties.CONFIG_PREFIX
namespaces.- Since:
- 0.1.0
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionai.yda.framework.rag.generator.assistant.openai.OpenAiAssistantGeneratoropenAiGenerator(OpenAiAssistantGeneratorProperties assistantGeneratorProperties, org.springframework.ai.autoconfigure.openai.OpenAiConnectionProperties openAiProperties, ai.yda.framework.session.core.SessionProvider sessionProvider) Defines anOpenAiAssistantGeneratorbean.
-
Constructor Details
-
OpenAiAssistantGeneratorAutoConfiguration
public OpenAiAssistantGeneratorAutoConfiguration()Default constructor forOpenAiAssistantGeneratorAutoConfiguration.
-
-
Method Details
-
openAiGenerator
@Bean public ai.yda.framework.rag.generator.assistant.openai.OpenAiAssistantGenerator openAiGenerator(OpenAiAssistantGeneratorProperties assistantGeneratorProperties, org.springframework.ai.autoconfigure.openai.OpenAiConnectionProperties openAiProperties, ai.yda.framework.session.core.SessionProvider sessionProvider) Defines anOpenAiAssistantGeneratorbean. This bean is configured using the provided properties for the Assistant Generator and the OpenAI connection. The Generator requires an API key and an Assistant ID, which are retrieved from the external configuration, and aSessionProviderfor 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
OpenAiAssistantGeneratorbean ready for use in the application.
-