Files
smartmate/backend/services/agent/prompt/chat_context.go
Losita d7184b776b Version: 0.9.75.dev.260505
后端:
1.收口阶段 6 agent 结构迁移,将 newAgent 内核与 agentsvc 编排层迁入 services/agent
- 切换 Agent 启动装配与 HTTP handler 直连 agent sv,移除旧 service agent bridge
- 补齐 Agent 对 memory、task、task-class、schedule 的 RPC 适配与契约字段
- 扩展 schedule、task、task-class RPC/contract 支撑 Agent 查询、写入与 provider 切流
- 更新迁移文档、README 与相关注释,明确 agent 当前切流点和剩余 memory 迁移面
2026-05-05 16:00:57 +08:00

34 lines
1.3 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package agentprompt
import (
"strings"
agentmodel "github.com/LoveLosita/smartflow/backend/services/agent/model"
)
// buildChatConversationMessage 生成 chat / deep_answer 共用的真实对话视图。
func buildChatConversationMessage(ctx *agentmodel.ConversationContext) string {
return buildConversationHistoryMessage(ctx, "真实对话记录")
}
// buildChatRoutingWorkspace 渲染 chat 路由节点的轻量补充区。
//
// 设计说明:
// 1. chat 只保留与路由判断直接相关的最小流程标记;
// 2. rough_build_done 仍需显式暴露,否则路由层会丢掉“不要重复粗排”的关键信号;
// 3. 不再展示轮次、阶段锚点、ReAct 摘要等 execute 专属信息。
func buildChatRoutingWorkspace(ctx *agentmodel.ConversationContext) string {
lines := []string{"路由补充:"}
if hasExecuteRoughBuildDone(ctx) {
lines = append(lines, "- 已存在 rough_build_done除非用户明确要求重新粗排否则不要再次触发 rough_build。")
} else {
lines = append(lines, "- 暂无额外流程标记。")
}
return strings.Join(lines, "\n")
}
// buildDeepAnswerWorkspace 渲染 deep_answer 节点的轻量工作区。
func buildDeepAnswerWorkspace() string {
return "回答补充:请直接延续最近对话,聚焦回答用户本轮问题。"
}