Class AIClientConfig

java.lang.Object
com.minicrm.mini_crm_api.config.AIClientConfig

@Configuration public class AIClientConfig extends Object
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 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.