Class SpringAISiliconFlowChatService
java.lang.Object
com.bytedesk.ai.service.BaseSpringAIService
com.bytedesk.ai.springai.providers.siliconflow.SpringAISiliconFlowChatService
- All Implemented Interfaces:
SpringAIService
@Service
@ConditionalOnProperty(prefix="spring.ai.siliconflow.chat",
name="enabled",
havingValue="true",
matchIfMissing=false)
public class SpringAISiliconFlowChatService
extends BaseSpringAIService
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate PromptHelperprivate Optional<org.springframework.ai.openai.OpenAiChatModel>private SseMessageHelperprivate TokenUsageHelperFields inherited from class com.bytedesk.ai.service.BaseSpringAIService
applicationEventPublisher, chunkElasticService, chunkVectorService, faqElasticService, faqVectorService, knowledgeBaseSearchHelper, messagePersistCache, messagePersistenceHelper, messageRestService, messageSendService, robotMessageCache, robotRestService, textElasticService, textVectorService, threadRestService, uidUtils, webpageElasticService, webpageVectorService -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate org.springframework.ai.openai.OpenAiChatOptions根据机器人配置创建动态的OpenAiChatOptionsOptional<org.springframework.ai.openai.OpenAiChatModel>protected voidprocessPromptSse(org.springframework.ai.chat.prompt.Prompt prompt, RobotProtobuf robot, MessageProtobuf messageProtobufQuery, MessageProtobuf messageProtobufReply, List<RobotContent.SourceReference> sourceReferences, org.springframework.web.servlet.mvc.method.annotation.SseEmitter emitter) protected StringprocessPromptSync(String message, RobotProtobuf robot) protected voidprocessPromptWebsocket(org.springframework.ai.chat.prompt.Prompt prompt, RobotProtobuf robot, MessageProtobuf messageProtobufQuery, MessageProtobuf messageProtobufReply) Methods inherited from class com.bytedesk.ai.service.BaseSpringAIService
processSyncRequest, sendSseMessage, sendSyncMessage, sendWebsocketMessage
-
Field Details
-
siliconFlowChatModel
@Autowired(required=false) private Optional<org.springframework.ai.openai.OpenAiChatModel> siliconFlowChatModel -
tokenUsageHelper
-
sseMessageHelper
-
promptHelper
-
-
Constructor Details
-
SpringAISiliconFlowChatService
public SpringAISiliconFlowChatService()
-
-
Method Details
-
createDynamicOptions
根据机器人配置创建动态的OpenAiChatOptions- Parameters:
llm- 机器人LLM配置- Returns:
- 根据机器人配置创建的选项
-
processPromptWebsocket
protected void processPromptWebsocket(org.springframework.ai.chat.prompt.Prompt prompt, RobotProtobuf robot, MessageProtobuf messageProtobufQuery, MessageProtobuf messageProtobufReply) - Specified by:
processPromptWebsocketin classBaseSpringAIService
-
processPromptSync
- Specified by:
processPromptSyncin classBaseSpringAIService
-
processPromptSse
protected void processPromptSse(org.springframework.ai.chat.prompt.Prompt prompt, RobotProtobuf robot, MessageProtobuf messageProtobufQuery, MessageProtobuf messageProtobufReply, List<RobotContent.SourceReference> sourceReferences, org.springframework.web.servlet.mvc.method.annotation.SseEmitter emitter) - Specified by:
processPromptSsein classBaseSpringAIService
-
getChatModel
-
isServiceHealthy
-