support stream thinking

This commit is contained in:
yongbin-buaa
2025-12-13 00:41:40 +08:00
parent b2e985a790
commit 0653d6ea65
2 changed files with 54 additions and 8 deletions

View File

@@ -169,6 +169,10 @@ class PhoneAgent:
# Get model response
try:
msgs = get_messages(self.agent_config.lang)
print("\n" + "=" * 50)
print(f"💭 {msgs['thinking']}:")
print("-" * 50)
response = self.model_client.request(self._context)
except Exception as e:
if self.agent_config.verbose:
@@ -191,11 +195,6 @@ class PhoneAgent:
if self.agent_config.verbose:
# Print thinking process
msgs = get_messages(self.agent_config.lang)
print("\n" + "=" * 50)
print(f"💭 {msgs['thinking']}:")
print("-" * 50)
print(response.thinking)
print("-" * 50)
print(f"🎯 {msgs['action']}:")
print(json.dumps(action, ensure_ascii=False, indent=2))