Package com.minicrm.mini_crm_api.config
Class AIClientConfig
java.lang.Object
com.minicrm.mini_crm_api.config.AIClientConfig
Configuration class to explicitly create the ChatClient bean.
This is necessary to bridge the auto-configured OpenAiChatModel with the
newer, fluent ChatClient API used in the AIService.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.ai.chat.client.ChatClientchatClient(org.springframework.ai.openai.OpenAiChatModel chatModel) Creates a ChatClient bean using the auto-configured OpenAiChatModel.
-
Constructor Details
-
AIClientConfig
public AIClientConfig()
-
-
Method Details
-
chatClient
@Bean public org.springframework.ai.chat.client.ChatClient chatClient(org.springframework.ai.openai.OpenAiChatModel chatModel) Creates a ChatClient bean using the auto-configured OpenAiChatModel. The Spring AI starter provides the OpenAiChatModel, and we use it to build the ChatClient that our service requires.- Parameters:
chatModel- The auto-configured OpenAiChatModel.- Returns:
- A configured ChatClient bean.
-