Version: 0.7.1.dev.260320
🧠 agent智能编排:删除了落库相关逻辑。再次重申:agent智能编排旨在为用户预览排程结果,实际的落库由用户决定,并通过按钮触发常规接口进行落库。目前仅保留 ReAct 精排循环链路(待改进)。 📄 修改了 ReAct 智能精排决策文档相关内容。 🔄 undo:当前 agent 智能排程逻辑待改进。
This commit is contained in:
@@ -32,14 +32,8 @@ type AgentService struct {
|
||||
// SmartPlanningRawFunc 调用粗排算法,同时返回展示结构和已分配的任务项。
|
||||
// 由 service/agent_bridge.go 在构造时注入 ScheduleService.SmartPlanningRaw。
|
||||
SmartPlanningRawFunc func(ctx context.Context, userID, taskClassID int) ([]model.UserWeekSchedule, []model.TaskClassItem, error)
|
||||
// BatchApplyPlansFunc 将排程方案批量落库。
|
||||
// 由 service/agent_bridge.go 在构造时注入 TaskClassService.BatchApplyPlans。
|
||||
BatchApplyPlansFunc func(ctx context.Context, taskClassID, userID int, plans *model.UserInsertTaskClassItemToScheduleRequestBatch) error
|
||||
// GetTaskClassByIDFunc 获取任务类详情(含 Items)。
|
||||
// 由 service/agent_bridge.go 在构造时注入。
|
||||
GetTaskClassByIDFunc func(ctx context.Context, taskClassID, userID int) (*model.TaskClass, error)
|
||||
// HybridScheduleWithPlanFunc 构建混合日程(既有日程 + 粗排建议),供 ReAct 精排使用。
|
||||
// 由 service/agent_bridge.go 在构造时注入。可选:未注入时走原有 materialize 路径。
|
||||
// 由 service/agent_bridge.go 在构造时注入。
|
||||
HybridScheduleWithPlanFunc func(ctx context.Context, userID, taskClassID int) ([]model.HybridScheduleEntry, []model.TaskClassItem, error)
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ func (s *AgentService) runSchedulePlanFlow(
|
||||
modelName string,
|
||||
) (string, error) {
|
||||
// 1. 依赖预检:排程依赖函数必须注入,否则无法完成排程链路。
|
||||
if s.SmartPlanningRawFunc == nil || s.BatchApplyPlansFunc == nil || s.GetTaskClassByIDFunc == nil {
|
||||
if s.SmartPlanningRawFunc == nil || s.HybridScheduleWithPlanFunc == nil {
|
||||
return "", errors.New("schedule plan service dependencies are not ready")
|
||||
}
|
||||
if selectedModel == nil {
|
||||
@@ -71,8 +71,6 @@ func (s *AgentService) runSchedulePlanFlow(
|
||||
State: state,
|
||||
Deps: scheduleplan.SchedulePlanToolDeps{
|
||||
SmartPlanningRaw: s.SmartPlanningRawFunc,
|
||||
BatchApplyPlans: s.BatchApplyPlansFunc,
|
||||
GetTaskClassByID: s.GetTaskClassByIDFunc,
|
||||
HybridScheduleWithPlan: s.HybridScheduleWithPlanFunc,
|
||||
},
|
||||
UserMessage: userMessage,
|
||||
|
||||
Reference in New Issue
Block a user