diff --git a/internal/version/VERSION b/internal/version/VERSION index 7f1bca4a..92909cd5 100644 --- a/internal/version/VERSION +++ b/internal/version/VERSION @@ -1 +1 @@ -v5.0.0-beta-2506051747 +v5.0.0-beta-2506051809 diff --git a/mcphost/chat.go b/mcphost/chat.go index 633b9d28..ebe881c1 100644 --- a/mcphost/chat.go +++ b/mcphost/chat.go @@ -25,7 +25,7 @@ import ( // NewChat creates a new chat session func (h *MCPHost) NewChat(ctx context.Context) (*Chat, error) { // Get model config from environment variables - modelConfig, err := ai.GetModelConfig(option.LLMServiceTypeDoubaoVL) + modelConfig, err := ai.GetModelConfig(option.DOUBAO_1_5_THINKING_VISION_PRO_250428) if err != nil { return nil, err } diff --git a/tests/step_ui_test.go b/tests/step_ui_test.go index 2c55ba72..1d6fcbdc 100644 --- a/tests/step_ui_test.go +++ b/tests/step_ui_test.go @@ -8,6 +8,7 @@ import ( hrp "github.com/httprunner/httprunner/v5" "github.com/httprunner/httprunner/v5/uixt/option" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" ) func TestIOSSettingsAction(t *testing.T) { @@ -83,7 +84,7 @@ func TestAndroidAction(t *testing.T) { func TestStartToGoal(t *testing.T) { userInstruction := `连连看是一款经典的益智消除类小游戏,通常以图案或图标为主要元素。以下是连连看的基本规则说明: - 1. 游戏目标: 玩家需要在规定时间内,通过连接相同的图案或图标,将它们从游戏界面中消除。 + 1. 游戏目标: 玩家需要通过连接相同的图案或图标,将它们从游戏界面中消除。 2. 连接规则: - 两个相同的图案可以通过不超过三条直线连接。 - 连接线可以水平或垂直,但不能斜线,也不能跨过其他图案。 @@ -91,9 +92,9 @@ func TestStartToGoal(t *testing.T) { 3. 游戏界面: - 游戏界面通常是一个矩形区域,内含多个图案或图标,排列成行和列。 - 图案或图标在未选中状态下背景为白色,选中状态下背景为绿色。 - 4. 时间限制: 游戏通常设有时间限制,玩家需要在时间耗尽前完成所有图案的消除。 - 5. 得分机制: 每成功连接并消除一对图案,玩家会获得相应的分数。完成游戏后,根据剩余时间和消除效率计算总分。 - 6. 关卡设计: 游戏可能包含多个关卡,随着关卡的推进,图案的复杂度和数量会增加。 + 4. 重试机制: + - 游戏失败后,可以点击「立即复活」按钮,观看视频广告;30秒,点击屏幕右上角关闭图标后可继续游戏。 + - 若无法再复活,可以点击「立即挑战」按钮,重新开始游戏。 注意事项: 1、当连接错误时,顶部的红心会减少一个,需及时调整策略,避免红心变为0个后游戏失败 @@ -105,7 +106,7 @@ func TestStartToGoal(t *testing.T) { testCase := &hrp.TestCase{ Config: hrp.NewConfig("run ui action with start to goal"). - SetLLMService(option.LLMServiceTypeDoubaoVL), + SetLLMService(option.DOUBAO_1_5_THINKING_VISION_PRO_250428), TestSteps: []hrp.IStep{ hrp.NewStep("启动抖音「连了又连」小游戏"). Android(). @@ -117,14 +118,17 @@ func TestStartToGoal(t *testing.T) { StartToGoal(userInstruction, option.WithMaxRetryTimes(100)), }, } - err := hrp.NewRunner(t).Run(testCase) + err := testCase.Dump2JSON("start_llk_game.json") + require.Nil(t, err) + + err = hrp.NewRunner(t).Run(testCase) assert.Nil(t, err) } func TestAIAction(t *testing.T) { testCase := &hrp.TestCase{ Config: hrp.NewConfig("run ui action with ai"). - SetLLMService(option.LLMServiceTypeDoubaoVL), + SetLLMService(option.DOUBAO_1_5_THINKING_VISION_PRO_250428), TestSteps: []hrp.IStep{ hrp.NewStep("launch settings"). Android().AIAction("进入手机系统设置"). diff --git a/uixt/ai/ai.go b/uixt/ai/ai.go index 428490dc..6490ef4a 100644 --- a/uixt/ai/ai.go +++ b/uixt/ai/ai.go @@ -129,12 +129,12 @@ func GetModelConfig(modelType option.LLMServiceType) (*ModelConfig, error) { func validateModelType(modelType option.LLMServiceType, modelName string) error { switch modelType { - case option.LLMServiceTypeUITARS: + case option.DOUBAO_1_5_UI_TARS_250428: if !strings.Contains(modelName, "ui-tars") { return fmt.Errorf("model name %s is not supported for %s", modelName, modelType) } return nil - case option.LLMServiceTypeDoubaoVL: + case option.DOUBAO_1_5_THINKING_VISION_PRO_250428: if !strings.Contains(modelName, "doubao") || !strings.Contains(modelName, "vision") { return fmt.Errorf("model name %s is not supported", modelName) } diff --git a/uixt/ai/asserter.go b/uixt/ai/asserter.go index 6103a593..d3c537b8 100644 --- a/uixt/ai/asserter.go +++ b/uixt/ai/asserter.go @@ -53,7 +53,7 @@ func NewAsserter(ctx context.Context, modelConfig *ModelConfig) (*Asserter, erro systemPrompt: defaultAssertionPrompt, } - if modelConfig.ModelType == option.LLMServiceTypeUITARS { + if modelConfig.ModelType == option.DOUBAO_1_5_UI_TARS_250428 { asserter.systemPrompt += "\n" + uiTarsAssertionResponseFormat } else { // define output format diff --git a/uixt/ai/asserter_test.go b/uixt/ai/asserter_test.go index 0d293f6b..18824ded 100644 --- a/uixt/ai/asserter_test.go +++ b/uixt/ai/asserter_test.go @@ -12,7 +12,7 @@ import ( ) func createAsserter(t *testing.T) *Asserter { - modelConfig, err := GetModelConfig(option.LLMServiceTypeUITARS) + modelConfig, err := GetModelConfig(option.DOUBAO_1_5_UI_TARS_250428) require.NoError(t, err) asserter, err := NewAsserter(context.Background(), modelConfig) require.NoError(t, err) diff --git a/uixt/ai/parser_default.go b/uixt/ai/parser_default.go index 38b4c3e5..0ef914d5 100644 --- a/uixt/ai/parser_default.go +++ b/uixt/ai/parser_default.go @@ -19,7 +19,7 @@ type LLMContentParser interface { func NewLLMContentParser(modelType option.LLMServiceType) LLMContentParser { switch modelType { - case option.LLMServiceTypeUITARS: + case option.DOUBAO_1_5_UI_TARS_250428: return &UITARSContentParser{ systemPrompt: doubao_1_5_ui_tars_planning_prompt, actionMapping: doubao_1_5_ui_tars_action_mapping, diff --git a/uixt/ai/planner.go b/uixt/ai/planner.go index bd71aec9..fd59f639 100644 --- a/uixt/ai/planner.go +++ b/uixt/ai/planner.go @@ -64,7 +64,7 @@ func (p *Planner) History() *ConversationHistory { } func (p *Planner) RegisterTools(tools []*schema.ToolInfo) error { - if p.modelConfig.ModelType == option.LLMServiceTypeUITARS { + if p.modelConfig.ModelType == option.DOUBAO_1_5_UI_TARS_250428 { // tools have been registered in ui-tars system prompt return nil } diff --git a/uixt/ai/planner_test.go b/uixt/ai/planner_test.go index 5cf9fbb5..8be317f4 100644 --- a/uixt/ai/planner_test.go +++ b/uixt/ai/planner_test.go @@ -29,7 +29,7 @@ func TestVLMPlanning(t *testing.T) { userInstruction += "\n\n请基于以上游戏规则,给出下一步可点击的两个图标坐标" - modelConfig, err := GetModelConfig(option.LLMServiceTypeUITARS) + modelConfig, err := GetModelConfig(option.DOUBAO_1_5_UI_TARS_250428) require.NoError(t, err) planner, err := NewPlanner(context.Background(), modelConfig) @@ -72,7 +72,7 @@ func TestXHSPlanning(t *testing.T) { userInstruction := "点击第二个帖子的作者头像" - modelConfig, err := GetModelConfig(option.LLMServiceTypeUITARS) + modelConfig, err := GetModelConfig(option.DOUBAO_1_5_UI_TARS_250428) require.NoError(t, err) planner, err := NewPlanner(context.Background(), modelConfig) @@ -115,7 +115,7 @@ func TestChatList(t *testing.T) { userInstruction := "请结合图片的文字信息,请告诉我一共有多少个群聊,哪些群聊右下角有绿点" - modelConfig, err := GetModelConfig(option.LLMServiceTypeUITARS) + modelConfig, err := GetModelConfig(option.DOUBAO_1_5_UI_TARS_250428) require.NoError(t, err) planner, err := NewPlanner(context.Background(), modelConfig) @@ -147,7 +147,7 @@ func TestChatList(t *testing.T) { func TestHandleSwitch(t *testing.T) { userInstruction := "检查发送框下方的联网搜索开关,蓝色为开启状态,灰色为关闭状态;若开关处于关闭状态,则点击进行开启" - modelConfig, err := GetModelConfig(option.LLMServiceTypeUITARS) + modelConfig, err := GetModelConfig(option.DOUBAO_1_5_UI_TARS_250428) require.NoError(t, err) planner, err := NewPlanner(context.Background(), modelConfig) diff --git a/uixt/android_test.go b/uixt/android_test.go index b1c7b30d..966b6218 100644 --- a/uixt/android_test.go +++ b/uixt/android_test.go @@ -25,7 +25,7 @@ func setupADBDriverExt(t *testing.T) *XTDriver { require.Nil(t, err) driverExt, err := NewXTDriver(driver, option.WithCVService(option.CVServiceTypeVEDEM), - option.WithLLMService(option.LLMServiceTypeDoubaoVL), + option.WithLLMService(option.DOUBAO_1_5_THINKING_VISION_PRO_250428), ) require.Nil(t, err) return driverExt diff --git a/uixt/option/ai.go b/uixt/option/ai.go index bce9fd07..f5aae373 100644 --- a/uixt/option/ai.go +++ b/uixt/option/ai.go @@ -31,10 +31,8 @@ func WithCVService(service CVServiceType) AIServiceOption { type LLMServiceType string const ( - LLMServiceTypeUITARS LLMServiceType = "ui-tars" // not support function calling and json response - LLMServiceTypeDoubaoVL LLMServiceType = "doubao-vision" - LLMServiceTypeGPT LLMServiceType = "gpt" - LLMServiceTypeQwenVL LLMServiceType = "qwen-vl" + DOUBAO_1_5_UI_TARS_250428 LLMServiceType = "doubao-1.5-ui-tars-250428" // not support function calling and json response + DOUBAO_1_5_THINKING_VISION_PRO_250428 LLMServiceType = "doubao-1.5-thinking-vision-pro-250428" ) func WithLLMService(modelType LLMServiceType) AIServiceOption {