MCPcopy Create free account
hub / github.com/astercloud/aster / extractWorkflowInfo

Method extractWorkflowInfo

pkg/agent/agent.go:710–745  ·  view source on GitHub ↗

extractWorkflowInfo 提取 Workflow 上下文信息

()

Source from the content-addressed store, hash-verified

708
709// extractWorkflowInfo 提取 Workflow 上下文信息
710func (a *Agent) extractWorkflowInfo() *WorkflowContextInfo {
711 if a.config.Metadata == nil {
712 return nil
713 }
714
715 workflowID, ok := a.config.Metadata["workflow_id"].(string)
716 if !ok || workflowID == "" {
717 return nil
718 }
719
720 info := &WorkflowContextInfo{
721 WorkflowID: workflowID,
722 }
723
724 if currentStep, ok := a.config.Metadata["workflow_current_step"].(string); ok {
725 info.CurrentStep = currentStep
726 }
727
728 if totalSteps, ok := a.config.Metadata["workflow_total_steps"].(int); ok {
729 info.TotalSteps = totalSteps
730 }
731
732 if stepIndex, ok := a.config.Metadata["workflow_step_index"].(int); ok {
733 info.StepIndex = stepIndex
734 }
735
736 if prevStep, ok := a.config.Metadata["workflow_previous_step"].(string); ok {
737 info.PreviousStep = prevStep
738 }
739
740 if nextStep, ok := a.config.Metadata["workflow_next_step"].(string); ok {
741 info.NextStep = nextStep
742 }
743
744 return info
745}
746
747// extractCustomInstructions 提取自定义指令
748func (a *Agent) extractCustomInstructions() string {

Callers 1

buildSystemPromptMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected