-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdemo.py
More file actions
28 lines (23 loc) · 981 Bytes
/
demo.py
File metadata and controls
28 lines (23 loc) · 981 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env python3
import asyncio
import logging
from agent.service import AgentService
from models import AppContext
logging.basicConfig(level=logging.INFO)
async def main():
# Use your device's IP and available model
agent = AgentService(host='192.168.60.101', port=5555)
try:
goal = "Open Settings, click Network & internet, click SIMs"
logging.info(f"Attempting goal: {goal}")
await agent.run(goal=goal, max_steps=25)
except Exception as e:
logging.error(f"Demo failed: {repr(e)}") # Use repr() to get a safe representation
import traceback
traceback.print_exc()
print("\nNext steps:")
print("1. Run 'python test_basic.py' to check individual components")
print("2. Make sure your Android device is unlocked and responsive")
print("3. Check that Ollama is running: 'ollama serve'")
if __name__ == "__main__":
asyncio.run(main())