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

Method UpdateStep

pkg/reasoning/reasoning.go:105–126  ·  view source on GitHub ↗

UpdateStep 更新推理步骤

(stepID string, updates map[string]any)

Source from the content-addressed store, hash-verified

103
104// UpdateStep 更新推理步骤
105func (c *Chain) UpdateStep(stepID string, updates map[string]any) error {
106 for i, step := range c.Steps {
107 if step.ID == stepID {
108 if result, ok := updates["result"].(string); ok {
109 c.Steps[i].Result = result
110 }
111 if status, ok := updates["status"].(StepStatus); ok {
112 c.Steps[i].Status = status
113 }
114 if confidence, ok := updates["confidence"].(float64); ok {
115 c.Steps[i].Confidence = confidence
116 }
117 if nextAction, ok := updates["next_action"].(NextAction); ok {
118 c.Steps[i].NextAction = nextAction
119 }
120 c.Steps[i].UpdatedAt = time.Now()
121 c.UpdatedAt = time.Now()
122 return nil
123 }
124 }
125 return fmt.Errorf("step not found: %s", stepID)
126}
127
128// GetCurrentStep 获取当前步骤
129func (c *Chain) GetCurrentStep() *Step {

Callers 2

TestUpdateStepFunction · 0.95
TestStepLifecycleFunction · 0.95

Calls

no outgoing calls

Tested by 2

TestUpdateStepFunction · 0.76
TestStepLifecycleFunction · 0.76