后端: 1.彻底删除原agent文件夹,并将现agent2文件夹全量重命名为agent(包括全部涉及到的文件以及文档、注释),迁移工作完美结束 2.修复了重试消息的相关逻辑问题 前端: 1.改善了一些交互体验,修复了一些bug,现在只剩少的功能了,现存的bug基本都修复完毕 全仓库: 1.更新了决策记录和README文档
28 lines
1.0 KiB
Go
28 lines
1.0 KiB
Go
package agentsvc
|
|
|
|
import (
|
|
"context"
|
|
|
|
agentrouter "github.com/LoveLosita/smartflow/backend/agent/router"
|
|
"github.com/cloudwego/eino-ext/components/model/ark"
|
|
)
|
|
|
|
// actionRoutingDecision 是 route 层分流结果在 agentsvc 的本地别名。
|
|
//
|
|
// 设计目的:
|
|
// 1. 让 AgentService 对 route 包保持“最小接触面”;
|
|
// 2. 后续若 route 包返回结构调整,只需改这个桥接文件。
|
|
type actionRoutingDecision = agentrouter.RoutingDecision
|
|
|
|
// decideActionRouting 决定当前请求走向哪条业务链路。
|
|
//
|
|
// 职责边界:
|
|
// 1. 只负责调用 route 包拿分流结论;
|
|
// 2. 不负责执行任何业务节点;
|
|
// 3. route 层失败会通过 RoutingDecision.RouteFailed 向上层显式暴露。
|
|
func (s *AgentService) decideActionRouting(ctx context.Context, selectedModel *ark.ChatModel, userMessage string) actionRoutingDecision {
|
|
// 这里保留方法封装,是为了避免上层直接依赖 route 包,降低耦合。
|
|
_ = s
|
|
return agentrouter.DecideActionRouting(ctx, selectedModel, userMessage)
|
|
}
|