From 2a5ee7a2d20a29c71396af70abe2359b956af700 Mon Sep 17 00:00:00 2001 From: liuyongbin Date: Wed, 10 Dec 2025 18:23:35 +0800 Subject: [PATCH] fix: code style and typo fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fix typo: throught -> thought in prompts_en.py - Apply ruff-format to main.py, prompts_en.py, prompts_zh.py 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- main.py | 4 ++-- phone_agent/config/prompts_en.py | 11 ++++++++--- phone_agent/config/prompts_zh.py | 9 +++++++-- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/main.py b/main.py index 097172d..79deefd 100644 --- a/main.py +++ b/main.py @@ -204,7 +204,7 @@ def check_model_api(base_url: str, model_name: str, api_key: str = "EMPTY") -> b print("✅ OK") # Check 2: Model exists - ''' + """ print(f"2. Checking model '{model_name}'...", end=" ") if model_name in available_models: print("✅ OK") @@ -217,7 +217,7 @@ def check_model_api(base_url: str, model_name: str, api_key: str = "EMPTY") -> b if len(available_models) > 10: print(f" ... and {len(available_models) - 10} more") all_passed = False - ''' + """ except Exception as e: print("❌ FAILED") diff --git a/phone_agent/config/prompts_en.py b/phone_agent/config/prompts_en.py index 0da3a2b..d734b80 100644 --- a/phone_agent/config/prompts_en.py +++ b/phone_agent/config/prompts_en.py @@ -1,10 +1,14 @@ """System prompts for the AI agent.""" + from datetime import datetime today = datetime.today() formatted_date = today.strftime("%Y-%m-%d, %A") -SYSTEM_PROMPT = "The current date: " + formatted_date + ''' +SYSTEM_PROMPT = ( + "The current date: " + + formatted_date + + """ # Setup You are a professional Android operation agent assistant that can fulfill the user's high-level instructions. Given a screenshot of the Android interface at each step, you first analyze the situation, then plan the best course of action using Python-style pseudo-code. @@ -16,7 +20,7 @@ Provide the action: Use ... to return a single line of pseudo-c Your output should STRICTLY follow the format: -[Your throught] +[Your thought] [Your operation code] @@ -71,4 +75,5 @@ REMEMBER: - Think before you act: Always analyze the current UI and the best course of action before executing any step, and output in part. - Only ONE LINE of action in part per response: Each step must contain exactly one line of executable code. - Generate execution code strictly according to format requirements. -''' \ No newline at end of file +""" +) diff --git a/phone_agent/config/prompts_zh.py b/phone_agent/config/prompts_zh.py index 2e5f29d..dc85476 100644 --- a/phone_agent/config/prompts_zh.py +++ b/phone_agent/config/prompts_zh.py @@ -1,4 +1,5 @@ """System prompts for the AI agent.""" + from datetime import datetime today = datetime.today() @@ -6,7 +7,10 @@ weekday_names = ["星期一", "星期二", "星期三", "星期四", "星期五" weekday = weekday_names[today.weekday()] formatted_date = today.strftime("%Y年%m月%d日") + " " + weekday -SYSTEM_PROMPT = "今天的日期是: " + formatted_date + ''' +SYSTEM_PROMPT = ( + "今天的日期是: " + + formatted_date + + """ 你是一个智能体分析专家,可以根据操作历史和当前状态图执行一系列操作来完成任务。 你必须严格按照要求输出以下格式: {think} @@ -69,4 +73,5 @@ SYSTEM_PROMPT = "今天的日期是: " + formatted_date + ''' 16. 在做游戏任务时如果在战斗页面如果有自动战斗一定要开启自动战斗,如果多轮历史状态相似要检查自动战斗是否开启。 17. 如果没有合适的搜索结果,可能是因为搜索页面不对,请返回到搜索页面的上一级尝试重新搜索,如果尝试三次返回上一级搜索后仍然没有符合要求的结果,执行 finish(message="原因")。 18. 在结束任务前请一定要仔细检查任务是否完整准确的完成,如果出现错选、漏选、多选的情况,请返回之前的步骤进行纠正。 -''' \ No newline at end of file +""" +)