Refactor skill handling and improve runtime trace capabilities
- Removed the selectSkill method from prepareService and adjusted related logic in the Run method of Service. - Updated tool catalog to parse agent allowed tool codes directly. - Simplified Request and RunInput structures by removing unnecessary fields. - Enhanced the RuntimeTraceCollector to manage skill activation and visibility. - Introduced a new databaseSkillBackend to manage skill definitions and their metadata. - Added tests for skill backend functionalities to ensure correct behavior. - Updated various factory methods to accommodate changes in skill handling. - Improved documentation and descriptions for better clarity.
This commit is contained in:
@@ -43,20 +43,15 @@ func DebugRunSkill(ctx context.Context, req request.SkillDebugRunRequest) (*resp
|
||||
Content: strings.TrimSpace(req.UserMessage),
|
||||
}
|
||||
summary, err := Service.Run(ctx, applicationruntime.Request{
|
||||
Conversation: *conversation,
|
||||
UserMessage: message,
|
||||
AIAgent: *aiAgent,
|
||||
AIConfig: *aiConfig,
|
||||
ManualSkillCode: strings.TrimSpace(req.SkillCode),
|
||||
Conversation: *conversation,
|
||||
UserMessage: message,
|
||||
AIAgent: *aiAgent,
|
||||
AIConfig: *aiConfig,
|
||||
})
|
||||
if err != nil {
|
||||
return buildSkillDebugRunResponse(req, summary, nil), err
|
||||
}
|
||||
selectedSkill := svc.SkillDefinitionService.GetByCode(strings.TrimSpace(req.SkillCode))
|
||||
if summary == nil || strings.TrimSpace(summary.PlannedSkillCode) == "" {
|
||||
return nil, errorsx.InvalidParam("Skill 未命中")
|
||||
}
|
||||
return buildSkillDebugRunResponse(req, summary, selectedSkill), nil
|
||||
return buildSkillDebugRunResponse(req, summary, nil), nil
|
||||
}
|
||||
|
||||
func DebugResumeSkill(ctx context.Context, req request.SkillDebugResumeRequest) (*response.SkillDebugRunResponse, error) {
|
||||
|
||||
Reference in New Issue
Block a user