(lang: str = "cn")
| 13 | |
| 14 | |
| 15 | def main(lang: str = "cn"): |
| 16 | msgs = get_messages(lang) |
| 17 | |
| 18 | print("=" * 60) |
| 19 | print("Phone Agent - Thinking Demo") |
| 20 | print("=" * 60) |
| 21 | |
| 22 | # Configure model |
| 23 | model_config = ModelConfig( |
| 24 | base_url="http://localhost:8000/v1", |
| 25 | model_name="autoglm-phone-9b", |
| 26 | temperature=0.1, |
| 27 | ) |
| 28 | |
| 29 | # Configure Agent (verbose=True enables detailed output) |
| 30 | agent_config = AgentConfig( |
| 31 | max_steps=10, |
| 32 | verbose=True, |
| 33 | lang=lang, |
| 34 | ) |
| 35 | |
| 36 | # Create Agent |
| 37 | agent = PhoneAgent( |
| 38 | model_config=model_config, |
| 39 | agent_config=agent_config, |
| 40 | ) |
| 41 | |
| 42 | # Execute task |
| 43 | print(f"\n📱 {msgs['starting_task']}...\n") |
| 44 | result = agent.run("打开小红书搜索美食攻略") |
| 45 | |
| 46 | print("\n" + "=" * 60) |
| 47 | print(f"📊 {msgs['final_result']}: {result}") |
| 48 | print("=" * 60) |
| 49 | |
| 50 | |
| 51 | if __name__ == "__main__": |
no test coverage detected