feat: save screenshots for PlanNextAction

This commit is contained in:
lilong.129
2025-03-22 01:07:28 +08:00
parent 8a3b6b5c4c
commit 12e0f7f9a2
6 changed files with 55 additions and 19 deletions
+3 -1
View File
@@ -13,6 +13,7 @@ import (
"math"
"os"
"strings"
"time"
"github.com/cloudwego/eino-ext/components/model/openai"
"github.com/cloudwego/eino/components/model"
@@ -76,8 +77,9 @@ func (p *Planner) Call(opts *PlanningOptions) (*PlanningResult, error) {
// call model service, generate response
logRequest(p.history)
log.Info().Msg("calling model service...")
startTime := time.Now()
resp, err := p.model.Generate(p.ctx, p.history)
log.Info().Float64("elapsed(s)", time.Since(startTime).Seconds()).Msg("call model service")
if err != nil {
return nil, fmt.Errorf("request model service failed: %w", err)
}