Package com.bytedesk.ai.springai.service
Interface SpringAIService
- All Known Implementing Classes:
BaseSpringAIService
,SpringAIBaiduChatService
,SpringAIBaiduService
,SpringAICozeService
,SpringAICustomChatService
,SpringAICustomService
,SpringAIDashscopeChatService
,SpringAIDashscopeService
,SpringAIDeepseekChatService
,SpringAIDeepseekService
,SpringAIDifyService
,SpringAIGiteeChatService
,SpringAIGiteeService
,SpringAIMaxkbService
,SpringAIMinimaxChatService
,SpringAIMinimaxService
,SpringAIN8nService
,SpringAIOllamaChatService
,SpringAIOllamaService
,SpringAIOpenaiChatService
,SpringAIOpenaiService
,SpringAIOpenrouterChatService
,SpringAIOpenrouterService
,SpringAIRagflowService
,SpringAISiliconFlowChatService
,SpringAISiliconFlowService
,SpringAITencentChatService
,SpringAITencentService
,SpringAIVolcengineChatService
,SpringAIVolcengineService
,SpringAIZhipuaiChatService
,SpringAIZhipuaiService
,ZhipuaiService
public interface SpringAIService
AI服务接口
定义所有AI服务的通用方法
-
Method Summary
Modifier and TypeMethodDescriptionvoid
persistMessage
(MessageProtobuf messageProtobufQuery, MessageProtobuf messageProtobufReply, Boolean isUnanswered) 消息持久化 用于保存用户查询和机器人回复的消息记录processDirectLlmRequest
(String query, RobotProtobuf robot) 直接处理LLM请求并同步返回结果 主要用于RobotAgentService中的processLlmRequest方法void
sendSseMessage
(String query, RobotProtobuf robot, MessageProtobuf messageProtobufQuery, MessageProtobuf messageProtobufReply, org.springframework.web.servlet.mvc.method.annotation.SseEmitter emitter) 发送Sse消息sendSyncMessage
(String query, RobotProtobuf robot, MessageProtobuf messageProtobufQuery, MessageProtobuf messageProtobufReply) 发送同步消息并返回回复内容void
sendWebsocketMessage
(String query, RobotProtobuf robot, MessageProtobuf messageProtobufQuery, MessageProtobuf messageProtobufReply) 发送websocket消息
-
Method Details
-
sendWebsocketMessage
void sendWebsocketMessage(String query, RobotProtobuf robot, MessageProtobuf messageProtobufQuery, MessageProtobuf messageProtobufReply) 发送websocket消息- Parameters:
query
- 用户查询robot
- 机器人实体messageRequest
- 消息协议
-
sendSseMessage
void sendSseMessage(String query, RobotProtobuf robot, MessageProtobuf messageProtobufQuery, MessageProtobuf messageProtobufReply, org.springframework.web.servlet.mvc.method.annotation.SseEmitter emitter) 发送Sse消息- Parameters:
messageRequest
- 消息emitter
- SseEmitter
-
sendSyncMessage
String sendSyncMessage(String query, RobotProtobuf robot, MessageProtobuf messageProtobufQuery, MessageProtobuf messageProtobufReply) 发送同步消息并返回回复内容- Parameters:
query
- 用户查询robot
- 机器人实体messageProtobufQuery
- 查询消息messageProtobufReply
- 回复消息- Returns:
- 回复内容
-
processDirectLlmRequest
直接处理LLM请求并同步返回结果 主要用于RobotAgentService中的processLlmRequest方法- Parameters:
query
- 用户查询messageRequest
- 提示词robot
- 机器人配置- Returns:
- 大模型生成的回复内容
-
persistMessage
void persistMessage(MessageProtobuf messageProtobufQuery, MessageProtobuf messageProtobufReply, Boolean isUnanswered) 消息持久化 用于保存用户查询和机器人回复的消息记录- Parameters:
messageProtobufQuery
-messageProtobufReply
-isUnanswered
-
-