@Configuration
public class ChatModelPrimaryConfig
extends Object
根据spring.ai.model.chat配置动态设置Primary的ChatModel
支持的值:zhipuai, ollama, dashscope, deepseek, baidu, tencent, volcengine, openai, openrouter, siliconflow, gitee, none
-
Field Summary
Fields
private org.springframework.ai.chat.model.ChatModel
private org.springframework.ai.chat.model.ChatModel
private org.springframework.ai.chat.model.ChatModel
private org.springframework.ai.chat.model.ChatModel
private org.springframework.ai.chat.model.ChatModel
private org.springframework.ai.chat.model.ChatModel
private org.springframework.ai.chat.model.ChatModel
private org.springframework.ai.chat.model.ChatModel
private org.springframework.ai.chat.model.ChatModel
private org.springframework.ai.chat.model.ChatModel
private org.springframework.ai.chat.model.ChatModel
-
Constructor Summary
Constructors
-
Method Summary
org.springframework.ai.chat.model.ChatModel
org.springframework.ai.chat.model.ChatModel
org.springframework.ai.chat.model.ChatModel
org.springframework.ai.chat.model.ChatModel
org.springframework.ai.chat.model.ChatModel
org.springframework.ai.chat.model.ChatModel
org.springframework.ai.chat.model.ChatModel
org.springframework.ai.chat.model.ChatModel
org.springframework.ai.chat.model.ChatModel
org.springframework.ai.chat.model.ChatModel
org.springframework.ai.chat.model.ChatModel
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
-
zhipuaiChatModel
@Autowired(required=false)
@Qualifier("bytedeskZhipuaiChatModel")
private org.springframework.ai.chat.model.ChatModel zhipuaiChatModel
-
ollamaChatModel
@Autowired(required=false)
@Qualifier("bytedeskOllamaChatModel")
private org.springframework.ai.chat.model.ChatModel ollamaChatModel
-
dashscopeChatModel
@Autowired(required=false)
@Qualifier("bytedeskDashscopeChatModel")
private org.springframework.ai.chat.model.ChatModel dashscopeChatModel
-
deepseekChatModel
@Autowired(required=false)
@Qualifier("deepseekChatModel")
private org.springframework.ai.chat.model.ChatModel deepseekChatModel
-
baiduChatModel
@Autowired(required=false)
@Qualifier("baiduChatModel")
private org.springframework.ai.chat.model.ChatModel baiduChatModel
-
tencentChatModel
@Autowired(required=false)
@Qualifier("tencentChatModel")
private org.springframework.ai.chat.model.ChatModel tencentChatModel
-
volcengineChatModel
@Autowired(required=false)
@Qualifier("volcengineChatModel")
private org.springframework.ai.chat.model.ChatModel volcengineChatModel
-
openaiChatModel
@Autowired(required=false)
@Qualifier("openaiChatModel")
private org.springframework.ai.chat.model.ChatModel openaiChatModel
-
openrouterChatModel
@Autowired(required=false)
@Qualifier("openrouterChatModel")
private org.springframework.ai.chat.model.ChatModel openrouterChatModel
-
siliconflowChatModel
@Autowired(required=false)
@Qualifier("siliconFlowChatModel")
private org.springframework.ai.chat.model.ChatModel siliconflowChatModel
-
giteeChatModel
@Autowired(required=false)
@Qualifier("giteeChatModel")
private org.springframework.ai.chat.model.ChatModel giteeChatModel
-
Constructor Details
-
ChatModelPrimaryConfig
public ChatModelPrimaryConfig()
-
Method Details
-
primaryZhipuaiChatModel
@Bean
@Primary
@ConditionalOnProperty(name="spring.ai.model.chat",
havingValue="zhipuai")
public org.springframework.ai.chat.model.ChatModel primaryZhipuaiChatModel()
-
primaryOllamaChatModel
@Bean
@Primary
@ConditionalOnProperty(name="spring.ai.model.chat",
havingValue="ollama")
public org.springframework.ai.chat.model.ChatModel primaryOllamaChatModel()
-
primaryDashscopeChatModel
@Bean
@Primary
@ConditionalOnProperty(name="spring.ai.model.chat",
havingValue="dashscope")
public org.springframework.ai.chat.model.ChatModel primaryDashscopeChatModel()
-
primaryDeepseekChatModel
@Bean
@Primary
@ConditionalOnProperty(name="spring.ai.model.chat",
havingValue="deepseek")
public org.springframework.ai.chat.model.ChatModel primaryDeepseekChatModel()
-
primaryBaiduChatModel
@Bean
@Primary
@ConditionalOnProperty(name="spring.ai.model.chat",
havingValue="baidu")
public org.springframework.ai.chat.model.ChatModel primaryBaiduChatModel()
-
primaryTencentChatModel
@Bean
@Primary
@ConditionalOnProperty(name="spring.ai.model.chat",
havingValue="tencent")
public org.springframework.ai.chat.model.ChatModel primaryTencentChatModel()
-
primaryVolcengineChatModel
@Bean
@Primary
@ConditionalOnProperty(name="spring.ai.model.chat",
havingValue="volcengine")
public org.springframework.ai.chat.model.ChatModel primaryVolcengineChatModel()
-
primaryOpenaiChatModel
@Bean
@Primary
@ConditionalOnProperty(name="spring.ai.model.chat",
havingValue="openai")
public org.springframework.ai.chat.model.ChatModel primaryOpenaiChatModel()
-
primaryOpenrouterChatModel
@Bean
@Primary
@ConditionalOnProperty(name="spring.ai.model.chat",
havingValue="openrouter")
public org.springframework.ai.chat.model.ChatModel primaryOpenrouterChatModel()
-
primarySiliconflowChatModel
@Bean
@Primary
@ConditionalOnProperty(name="spring.ai.model.chat",
havingValue="silicon")
public org.springframework.ai.chat.model.ChatModel primarySiliconflowChatModel()
-
primaryGiteeChatModel
@Bean
@Primary
@ConditionalOnProperty(name="spring.ai.model.chat",
havingValue="gitee")
public org.springframework.ai.chat.model.ChatModel primaryGiteeChatModel()