Class SpringAISiliconFlowService
java.lang.Object
com.bytedesk.ai.springai.service.BaseSpringAIService
com.bytedesk.ai.springai.providers.siliconflow.SpringAISiliconFlowService
- All Implemented Interfaces:
SpringAIService
@Service
@ConditionalOnProperty(name="spring.ai.siliconflow.chat.enabled",
havingValue="true",
matchIfMissing=false)
public class SpringAISiliconFlowService
extends BaseSpringAIService
-
Field Summary
FieldsFields inherited from class com.bytedesk.ai.springai.service.BaseSpringAIService
faqService, messagePersistCache, messageSendService, robotMessageCache, robotRestService, springAIVectorService, threadRestService, uidUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate org.springframework.ai.openai.OpenAiChatOptions
根据机器人配置创建动态的OpenAiChatOptionsprotected String
generateFaqPairs
(String prompt) Optional<org.springframework.ai.openai.OpenAiChatModel>
boolean
protected void
processPrompt
(org.springframework.ai.chat.prompt.Prompt prompt, RobotProtobuf robot, MessageProtobuf messageProtobufQuery, MessageProtobuf messageProtobufReply) protected void
processPromptSSE
(org.springframework.ai.chat.prompt.Prompt prompt, RobotProtobuf robot, MessageProtobuf messageProtobufQuery, MessageProtobuf messageProtobufReply, org.springframework.web.servlet.mvc.method.annotation.SseEmitter emitter) protected String
processPromptSync
(String message) Methods inherited from class com.bytedesk.ai.springai.service.BaseSpringAIService
buildKbPrompt, createDynamicOptions, generateFaqPairsAsync, generateFaqPairsSync, handleSseError, isEmitterCompleted, persistMessage, sendMessage, sendSseMessage, sendStreamEndMessage, sendStreamMessage, sendStreamStartMessage, sendWebsocketMessage
-
Field Details
-
siliconFlowChatModel
@Autowired(required=false) private Optional<org.springframework.ai.openai.OpenAiChatModel> siliconFlowChatModel
-
-
Constructor Details
-
SpringAISiliconFlowService
public SpringAISiliconFlowService()
-
-
Method Details
-
createDynamicOptions
根据机器人配置创建动态的OpenAiChatOptions- Parameters:
llm
- 机器人LLM配置- Returns:
- 根据机器人配置创建的选项
-
processPrompt
protected void processPrompt(org.springframework.ai.chat.prompt.Prompt prompt, RobotProtobuf robot, MessageProtobuf messageProtobufQuery, MessageProtobuf messageProtobufReply) - Specified by:
processPrompt
in classBaseSpringAIService
-
generateFaqPairs
- Specified by:
generateFaqPairs
in classBaseSpringAIService
-
processPromptSync
- Specified by:
processPromptSync
in classBaseSpringAIService
-
processPromptSSE
protected void processPromptSSE(org.springframework.ai.chat.prompt.Prompt prompt, RobotProtobuf robot, MessageProtobuf messageProtobufQuery, MessageProtobuf messageProtobufReply, org.springframework.web.servlet.mvc.method.annotation.SseEmitter emitter) - Specified by:
processPromptSSE
in classBaseSpringAIService
-
getChatModel
-
isServiceHealthy
public boolean isServiceHealthy()
-