fix: get screen size for planner

This commit is contained in:
lilong.129 2025-03-20 20:52:59 +08:00
parent 868acd45ac
commit bbc05513f9
2 changed files with 8 additions and 1 deletions

View File

@ -1 +1 @@
v5.0.0-beta-2503202039
v5.0.0-beta-2503202053

View File

@ -2,6 +2,7 @@ package uixt
import (
"github.com/cloudwego/eino/schema"
"github.com/httprunner/httprunner/v5/code"
"github.com/httprunner/httprunner/v5/uixt/ai"
"github.com/httprunner/httprunner/v5/uixt/option"
"github.com/pkg/errors"
@ -17,6 +18,11 @@ func (dExt *XTDriver) PlanNextAction(text string, opts ...option.ActionOption) (
return nil, err
}
size, err := dExt.IDriver.WindowSize()
if err != nil {
return nil, errors.Wrap(code.DeviceGetInfoError, err.Error())
}
planningOpts := &ai.PlanningOptions{
UserInstruction: text,
ConversationHistory: []*schema.Message{
@ -32,6 +38,7 @@ func (dExt *XTDriver) PlanNextAction(text string, opts ...option.ActionOption) (
},
},
},
Size: size,
}
result, err := dExt.LLMService.Call(planningOpts)