@Configuration
public class ChatClientPrimaryConfig
extends Object
根据spring.ai.model.chat配置动态设置Primary的ChatClient
支持的值:zhipuai, ollama, dashscope, deepseek, baidu, tencent, volcengine, openai, openrouter, siliconflow, gitee, none
-
Field Summary
Fields
private org.springframework.ai.chat.client.ChatClient
private org.springframework.ai.chat.client.ChatClient
private org.springframework.ai.chat.client.ChatClient
private org.springframework.ai.chat.client.ChatClient
private org.springframework.ai.chat.client.ChatClient
private org.springframework.ai.chat.client.ChatClient
private org.springframework.ai.chat.client.ChatClient
private org.springframework.ai.chat.client.ChatClient
private org.springframework.ai.chat.client.ChatClient
private org.springframework.ai.chat.client.ChatClient
private org.springframework.ai.chat.client.ChatClient
-
Constructor Summary
Constructors
-
Method Summary
org.springframework.ai.chat.client.ChatClient
org.springframework.ai.chat.client.ChatClient
org.springframework.ai.chat.client.ChatClient
org.springframework.ai.chat.client.ChatClient
org.springframework.ai.chat.client.ChatClient
org.springframework.ai.chat.client.ChatClient
org.springframework.ai.chat.client.ChatClient
org.springframework.ai.chat.client.ChatClient
org.springframework.ai.chat.client.ChatClient
org.springframework.ai.chat.client.ChatClient
org.springframework.ai.chat.client.ChatClient
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
chatModel
@Value("${spring.ai.model.chat:none}")
private String chatModel
-
zhipuaiChatClient
@Autowired(required=false)
@Qualifier("bytedeskZhipuaiChatClient")
private org.springframework.ai.chat.client.ChatClient zhipuaiChatClient
-
ollamaChatClient
@Autowired(required=false)
@Qualifier("bytedeskOllamaChatClient")
private org.springframework.ai.chat.client.ChatClient ollamaChatClient
-
dashscopeChatClient
@Autowired(required=false)
@Qualifier("bytedeskDashscopeChatClient")
private org.springframework.ai.chat.client.ChatClient dashscopeChatClient
-
deepseekChatClient
@Autowired(required=false)
@Qualifier("deepseekChatClient")
private org.springframework.ai.chat.client.ChatClient deepseekChatClient
-
baiduChatClient
@Autowired(required=false)
@Qualifier("baiduChatClient")
private org.springframework.ai.chat.client.ChatClient baiduChatClient
-
tencentChatClient
@Autowired(required=false)
@Qualifier("tencentChatClient")
private org.springframework.ai.chat.client.ChatClient tencentChatClient
-
volcengineChatClient
@Autowired(required=false)
@Qualifier("volcengineChatClient")
private org.springframework.ai.chat.client.ChatClient volcengineChatClient
-
openaiChatClient
@Autowired(required=false)
@Qualifier("openaiChatClient")
private org.springframework.ai.chat.client.ChatClient openaiChatClient
-
openrouterChatClient
@Autowired(required=false)
@Qualifier("openrouterChatClient")
private org.springframework.ai.chat.client.ChatClient openrouterChatClient
-
siliconflowChatClient
@Autowired(required=false)
@Qualifier("siliconFlowChatClient")
private org.springframework.ai.chat.client.ChatClient siliconflowChatClient
-
giteeChatClient
@Autowired(required=false)
@Qualifier("giteeChatClient")
private org.springframework.ai.chat.client.ChatClient giteeChatClient
-
Constructor Details
-
ChatClientPrimaryConfig
public ChatClientPrimaryConfig()
-
Method Details
-
primaryZhipuaiChatClient
@Bean
@Primary
@ConditionalOnProperty(name="spring.ai.model.chat",
havingValue="zhipuai")
public org.springframework.ai.chat.client.ChatClient primaryZhipuaiChatClient()
-
primaryOllamaChatClient
@Bean
@Primary
@ConditionalOnProperty(name="spring.ai.model.chat",
havingValue="ollama")
public org.springframework.ai.chat.client.ChatClient primaryOllamaChatClient()
-
primaryDashscopeChatClient
@Bean
@Primary
@ConditionalOnProperty(name="spring.ai.model.chat",
havingValue="dashscope")
public org.springframework.ai.chat.client.ChatClient primaryDashscopeChatClient()
-
primaryDeepseekChatClient
@Bean
@Primary
@ConditionalOnProperty(name="spring.ai.model.chat",
havingValue="deepseek")
public org.springframework.ai.chat.client.ChatClient primaryDeepseekChatClient()
-
primaryBaiduChatClient
@Bean
@Primary
@ConditionalOnProperty(name="spring.ai.model.chat",
havingValue="baidu")
public org.springframework.ai.chat.client.ChatClient primaryBaiduChatClient()
-
primaryTencentChatClient
@Bean
@Primary
@ConditionalOnProperty(name="spring.ai.model.chat",
havingValue="tencent")
public org.springframework.ai.chat.client.ChatClient primaryTencentChatClient()
-
primaryVolcengineChatClient
@Bean
@Primary
@ConditionalOnProperty(name="spring.ai.model.chat",
havingValue="volcengine")
public org.springframework.ai.chat.client.ChatClient primaryVolcengineChatClient()
-
primaryOpenaiChatClient
@Bean
@Primary
@ConditionalOnProperty(name="spring.ai.model.chat",
havingValue="openai")
public org.springframework.ai.chat.client.ChatClient primaryOpenaiChatClient()
-
primaryOpenrouterChatClient
@Bean
@Primary
@ConditionalOnProperty(name="spring.ai.model.chat",
havingValue="openrouter")
public org.springframework.ai.chat.client.ChatClient primaryOpenrouterChatClient()
-
primarySiliconflowChatClient
@Bean
@Primary
@ConditionalOnProperty(name="spring.ai.model.chat",
havingValue="silicon")
public org.springframework.ai.chat.client.ChatClient primarySiliconflowChatClient()
-
primaryGiteeChatClient
@Bean
@Primary
@ConditionalOnProperty(name="spring.ai.model.chat",
havingValue="gitee")
public org.springframework.ai.chat.client.ChatClient primaryGiteeChatClient()