refactor: mcphost planner

This commit is contained in:
lilong.129
2025-05-18 21:55:01 +08:00
parent e35d644acf
commit 3f1ee03529
13 changed files with 595 additions and 220 deletions
+3 -2
View File
@@ -1,6 +1,7 @@
package uixt
import (
"context"
"encoding/base64"
"fmt"
"path/filepath"
@@ -102,7 +103,7 @@ func (dExt *XTDriver) PlanNextAction(text string, opts ...option.ActionOption) (
Size: size,
}
result, err := dExt.LLMService.Call(planningOpts)
result, err := dExt.LLMService.Call(context.Background(), planningOpts)
if err != nil {
return nil, errors.Wrap(err, "failed to get next action from planner")
}
@@ -139,7 +140,7 @@ func (dExt *XTDriver) AIAssert(assertion string, opts ...option.ActionOption) er
Screenshot: screenShotBase64,
Size: size,
}
result, err := dExt.LLMService.Assert(assertOpts)
result, err := dExt.LLMService.Assert(context.Background(), assertOpts)
if err != nil {
return errors.Wrap(err, "AI assertion failed")
}