-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_e2e.py
More file actions
36 lines (33 loc) · 1.1 KB
/
Copy pathtest_e2e.py
File metadata and controls
36 lines (33 loc) · 1.1 KB
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
29
30
31
32
33
34
35
36
import httpx
import uuid
import json
import asyncio
async def main():
pa_url = "http://127.0.0.1:9000/a2a/personal_assistant"
payload = {
"jsonrpc": "2.0",
"method": "message/send",
"params": {
"message": {
"message_id": str(uuid.uuid4()),
"role": "user",
"parts": [{"text": "I want to book a flight to Dublin on 2026-05-15. Please handle everything."}]
},
"metadata": {}
},
"id": 1
}
print(f"Sending request to Personal Assistant at {pa_url}...")
async with httpx.AsyncClient() as client:
try:
response = await client.post(pa_url, json=payload, timeout=120.0)
print(f"Status: {response.status_code}")
if response.status_code == 200:
print("Response from PA:")
print(json.dumps(response.json(), indent=2))
else:
print(f"Error: {response.text}")
except Exception as e:
print(f"Request failed: {e}")
if __name__ == "__main__":
asyncio.run(main())