Package com.bytedesk.ai.springai.service
Interface SpringAIService
- All Known Implementing Classes:
BaseSpringAIService
,SpringAIBaiduService
,SpringAICustomService
,SpringAIDashscopeService
,SpringAIDeepseekService
,SpringAIGiteeService
,SpringAIOllamaService
,SpringAIOpenaiService
,SpringAIOpenrouterService
,SpringAISiliconFlowService
,SpringAITencentService
,SpringAIVolcengineService
,SpringAIZhipuaiService
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
- 机器人实体messageProtobuf
- 消息协议
-
sendSseMessage
void sendSseMessage(String query, RobotProtobuf robot, MessageProtobuf messageProtobufQuery, MessageProtobuf messageProtobufReply, org.springframework.web.servlet.mvc.method.annotation.SseEmitter emitter) 发送Sse消息- Parameters:
message
- 消息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
- 用户查询prompt
- 提示词robot
- 机器人配置- Returns:
- 大模型生成的回复内容
-
persistMessage
void persistMessage(MessageProtobuf messageProtobufQuery, MessageProtobuf messageProtobufReply, Boolean isUnanswered) 消息持久化 用于保存用户查询和机器人回复的消息记录- Parameters:
messageProtobufQuery
-messageProtobufReply
-isUnanswered
-
-