Package com.bytedesk.ai.springai.service
Class ChatClientInfoService
java.lang.Object
com.bytedesk.ai.springai.service.ChatClientInfoService
ChatClient信息查询服务
提供查看所有ChatClient和Primary ChatClient的服务
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.springframework.context.ApplicationContextprivate org.springframework.ai.chat.client.ChatClientprivate org.springframework.ai.chat.client.ChatClientprivate org.springframework.ai.chat.client.ChatClientprivate org.springframework.ai.chat.client.ChatClientprivate org.springframework.ai.chat.client.ChatClientprivate org.springframework.ai.chat.client.ChatClientprivate org.springframework.ai.chat.client.ChatClientprivate Stringprivate org.springframework.ai.chat.client.ChatClientprivate org.springframework.ai.chat.client.ChatClientprivate org.springframework.ai.chat.client.ChatClientprivate org.springframework.ai.chat.client.ChatClient -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddChatClientInfoIfAvailable(List<Map<String, Object>> chatClients, String provider, org.springframework.ai.chat.client.ChatClient client, boolean isPrimary) 添加ChatClient信息(如果可用)获取所有ChatClient信息private org.springframework.ai.chat.client.ChatClientgetChatClientByProvider(String provider) 根据提供商获取ChatClientgetChatClientInfo(String provider, org.springframework.ai.chat.client.ChatClient client, boolean isPrimary) 获取单个ChatClient的详细信息private org.springframework.ai.chat.client.ChatClient获取Primary ChatClient获取Primary ChatClient信息private StringgetProviderClientType(String provider) 获取提供商客户端类型private StringgetProviderDescription(String provider) 获取提供商描述获取RAG使用的ChatClient信息测试所有可用的ChatClienttestChatClient(String provider) 测试指定的ChatClient
-
Field Details
-
applicationContext
private final org.springframework.context.ApplicationContext applicationContext -
-
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
-
ChatClientInfoService
public ChatClientInfoService()
-
-
Method Details
-
testChatClient
测试指定的ChatClient -
testAllChatClients
测试所有可用的ChatClient -
getAllChatClientsInfo
获取所有ChatClient信息 -
getPrimaryChatClientInfo
获取Primary ChatClient信息 -
getRagChatClientInfo
获取RAG使用的ChatClient信息 -
addChatClientInfoIfAvailable
private void addChatClientInfoIfAvailable(List<Map<String, Object>> chatClients, String provider, org.springframework.ai.chat.client.ChatClient client, boolean isPrimary) 添加ChatClient信息(如果可用) -
getChatClientInfo
private Map<String,Object> getChatClientInfo(String provider, org.springframework.ai.chat.client.ChatClient client, boolean isPrimary) 获取单个ChatClient的详细信息 -
getProviderDescription
获取提供商描述 -
getProviderClientType
获取提供商客户端类型 -
getChatClientByProvider
根据提供商获取ChatClient -
getPrimaryChatClient
private org.springframework.ai.chat.client.ChatClient getPrimaryChatClient()获取Primary ChatClient
-