From bbc05513f90123b5978e329aa52952c8fb88b94d Mon Sep 17 00:00:00 2001 From: "lilong.129" Date: Thu, 20 Mar 2025 20:52:59 +0800 Subject: [PATCH] fix: get screen size for planner --- internal/version/VERSION | 2 +- uixt/driver_ext_ai.go | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/internal/version/VERSION b/internal/version/VERSION index cd18d33f..793426cf 100644 --- a/internal/version/VERSION +++ b/internal/version/VERSION @@ -1 +1 @@ -v5.0.0-beta-2503202039 +v5.0.0-beta-2503202053 diff --git a/uixt/driver_ext_ai.go b/uixt/driver_ext_ai.go index 7bbb6764..6440f53f 100644 --- a/uixt/driver_ext_ai.go +++ b/uixt/driver_ext_ai.go @@ -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)