会话总结工作流接入、前后端处理

This commit is contained in:
2026-01-01 15:12:29 +08:00
parent 4e373e6d2c
commit eb15706ccc
22 changed files with 1738 additions and 43 deletions

View File

@@ -35,4 +35,7 @@ public class ChatPrepareData implements Serializable {
@Schema(description = "智能体输入参数,不同智能体可能需要不同的输入参数")
private Map<String, Object> inputsMap;
@Schema(description = "应用类型chat=对话应用workflow=工作流应用默认为chat")
private String appType = "chat";
}

View File

@@ -74,6 +74,13 @@ public interface AgentChatService {
*/
SseEmitter streamChatMessageWithSse(String sessionId);
/**
* 阻塞式对话 - 使用sessionId进行同步调用等待完整结果返回
* @param sessionId 会话标识
* @return ResultDomain<String> 返回AI回复的完整内容
*/
ResultDomain<String> blockingChatMessageWithSession(String sessionId);
/**
* 停止对话生成通过Dify TaskID
* @param filter 会话过滤条件包含agentId, userId, userType
@@ -91,5 +98,23 @@ public interface AgentChatService {
*/
ResultDomain<Boolean> commentChatMessage(TbChat filter, String messageId, String comment);
// ====================== 工作流执行 ======================
/**
* 工作流执行(阻塞模式)- 使用sessionId进行同步调用等待完整结果返回
* @param sessionId 会话标识从prepareChatMessageSession返回
* @return ResultDomain<String> 返回工作流输出结果的JSON字符串
*/
ResultDomain<String> runWorkflowWithSession(String sessionId);
/**
* 执行工作流(阻塞模式)- 直接传入inputs执行工作流
* @param agentId 智能体ID用于获取API Key
* @param inputs 工作流输入参数
* @param userId 用户标识
* @return ResultDomain<String> 返回工作流输出结果的JSON字符串
*/
ResultDomain<String> runWorkflowBlocking(String agentId, java.util.Map<String, Object> inputs, String userId);
}