Skip to content

Fix: JSON RPC format in A2AClient to connect with third party a2a servers#55

Merged
themanojdesai merged 2 commits intothemanojdesai:mainfrom
0xrushi:fix/google-a2a-connection
May 25, 2025
Merged

Fix: JSON RPC format in A2AClient to connect with third party a2a servers#55
themanojdesai merged 2 commits intothemanojdesai:mainfrom
0xrushi:fix/google-a2a-connection

Conversation

@0xrushi
Copy link
Contributor

@0xrushi 0xrushi commented May 23, 2025

Before

=== Send Messages to the Agent ===
Type your messages (or 'exit' to quit):

> hi

Sending message to agent...

Agent response:
{"error":{"code":-32600,"data":[{"type":"missing","loc":["SendMessageRequest","params"],"msg":"Field required","input":{"content":{"text":"hi","type":"text"},"role":"user","message_id":"bfafb0c0-56a2-415e-957d-b3765debe760"},"url":"https://errors.pydantic.dev/2.11/v/missing"},{"type":"missing","loc":["SendStreamingMessageRequest","params"],"msg":"Field required","input":{"content":{"text":"hi","type":"text"},"role":"user","message_id":"bfafb0c0-56a2-415e-957d-b3765debe760"},"url":"https://errors.pydantic.dev/2.11/v/missing"},{"type":"missing","loc":["GetTaskRequest","params"],"msg":"Field required","input":{"content":{"text":"hi","type":"text"},"role":"user","message_id":"bfafb0c0-56a2-415e-957d-b3765debe760"},"url":"https://errors.pydantic.dev/2.11/v/missing"},{"type":"missing","loc":["CancelTaskRequest","params"],"msg":"Field required","input":{"content":{"text":"hi","type":"text"},"role":"user","message_id":"bfafb0c0-56a2-415e-957d-b3765debe760"},"url":"https://errors.pydantic.dev/2.11/v/missing"},{"type":"missing","loc":["SetTaskPushNotificationConfigRequest","params"],"msg":"Field required","input":{"content":{"text":"hi","type":"text"},"role":"user","message_id":"bfafb0c0-56a2-415e-957d-b3765debe760"},"url":"https://errors.pydantic.dev/2.11/v/missing"},{"type":"missing","loc":["GetTaskPushNotificationConfigRequest","params"],"msg":"Field required","input":{"content":{"text":"hi","type":"text"},"role":"user","message_id":"bfafb0c0-56a2-415e-957d-b3765debe760"},"url":"https://errors.pydantic.dev/2.11/v/missing"},{"type":"missing","loc":["TaskResubscriptionRequest","params"],"msg":"Field required","input":{"content":{"text":"hi","type":"text"},"role":"user","message_id":"bfafb0c0-56a2-415e-957d-b3765debe760"},"url":"https://errors.pydantic.dev/2.11/v/missing"}],"message":"Request payload validation error"},"jsonrpc":"2.0"}

> 


After

$ uv run simple_client_thirdparty_googlea2a_server.py --external  http://0.0.0.0:8080
✅ All dependencies are installed correctly!

🚀 Connecting to external A2A agent at: http://0.0.0.0:8080
🔌 Connecting to A2A agent at: http://0.0.0.0:8080

=== Agent Information ===
Name: Unknown Agent
Description: Agent card not available
Version: unknown

=== Send Messages to the Agent ===
Type your messages (or 'exit' to quit):

> hi

Sending message to agent...

Agent response:
{"id":1,"jsonrpc":"2.0","result":{"kind":"message","messageId":"8fff72fc-101a-44e0-99ed-92a822b0799c","parts":[{"kind":"text","text":"Hello World"}],"role":"agent"}}

> 

You can try connecting to any of the servers from google a2a repo
https://github.com/google/a2a-python/tree/main/examples

@0xrushi
Copy link
Contributor Author

0xrushi commented May 23, 2025

resolves #56

@themanojdesai themanojdesai merged commit 471fd2d into themanojdesai:main May 25, 2025
0 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants