Skip to content

Instantly share code, notes, and snippets.

@anjijava16
Last active September 23, 2025 17:57
Show Gist options
  • Save anjijava16/7ef0bb2139cb65bcefed63b652f6a16d to your computer and use it in GitHub Desktop.
Save anjijava16/7ef0bb2139cb65bcefed63b652f6a16d to your computer and use it in GitHub Desktop.
A2A Documents
1041 s -ltr
1042 ls -lte
1043 pwd
1044 mkdir new_A2A
1045 cd new_A2A
1046 git clone https://github.com/a2aproject/a2a-samples.git -b main --depth 1\ncd a2a-samples
1047 ls -ltr
1048 pwd
1049 ls -ltr samples/python/
1050 more samples/python/pyproject.toml
1051 more samples/python/requirements.txt
1052 python -m venv .venv
1053 source .venv/bin/activate
1054 pip install -r samples/python/requirements.txt
1055 python -c "import a2a; print('A2A SDK imported successfully')"
(.venv) welcome@jaisairams-Laptop a2a-samples %
python samples/python/agents/helloworld/__main__.py
http://localhost:9999/.well-known/agent.json
# Start the Langgraph A2A Server
1. cd samples/python/agents/langgraph/
2. uv sync
3. source .ven/bin/activate
4. python __main__.py
5. http://localhost:10000/.well-known/agent.json
(a2a-sample-agent-langgraph) welcome@jaisairams-Laptop langgraph % cd app
(a2a-sample-agent-langgraph) welcome@jaisairams-Laptop app % python __main__.py
INFO: Started server process [63320]
INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: Uvicorn running on http://localhost:10000 (Press CTRL+C to quit)
WARNING:a2a.server.apps.jsonrpc.jsonrpc_app:Deprecated agent card endpoint '/.well-known/agent.json' accessed. Please use '/.well-known/agent-card.json' instead. This endpoint will be removed in a future version.
INFO: ::1:59797 - "GET /.well-known/agent.json HTTP/1.1" 200 OK
INFO: ::1:59797 - "GET /favicon.ico HTTP/1.1" 404 Not Found
# TEST Code
(a2a-sample-agent-langgraph) welcome@jaisairams-Laptop app % pwd
/Users/welcome/Desktop/Tech_Repos/python_envs/A2A/new_A2A/a2a-samples/samples/python/agents/langgraph/app
(a2a-sample-agent-langgraph) welcome@jaisairams-Laptop app % python test_client.py
INFO:__main__:Attempting to fetch public agent card from: http://localhost:10000/.well-known/agent-card.json
INFO:httpx:HTTP Request: GET http://localhost:10000/.well-known/agent-card.json "HTTP/1.1 200 OK"
INFO:a2a.client.card_resolver:Successfully fetched agent card data from http://localhost:10000/.well-known/agent-card.json: {'capabilities': {'pushNotifications': True, 'streaming': True}, 'defaultInputModes': ['text', 'text/plain'], 'defaultOutputModes': ['text', 'text/plain'], 'description': 'Helps with exchange rates for currencies', 'name': 'Currency Agent', 'preferredTransport': 'JSONRPC', 'protocolVersion': '0.3.0', 'skills': [{'description': 'Helps with exchange values between various currencies', 'examples': ['What is exchange rate between USD and GBP?'], 'id': 'convert_currency', 'name': 'Currency Exchange Rates Tool', 'tags': ['currency conversion', 'currency exchange']}], 'url': 'http://localhost:10000/', 'version': '1.0.0'}
INFO:__main__:Successfully fetched public agent card:
INFO:__main__:{
"capabilities": {
"pushNotifications": true,
"streaming": true
},
"defaultInputModes": [
"text",
"text/plain"
],
"defaultOutputModes": [
"text",
"text/plain"
],
"description": "Helps with exchange rates for currencies",
"name": "Currency Agent",
"preferredTransport": "JSONRPC",
"protocolVersion": "0.3.0",
"skills": [
{
"description": "Helps with exchange values between various currencies",
"examples": [
"What is exchange rate between USD and GBP?"
],
"id": "convert_currency",
"name": "Currency Exchange Rates Tool",
"tags": [
"currency conversion",
"currency exchange"
]
}
],
"url": "http://localhost:10000/",
"version": "1.0.0"
}
INFO:__main__:
Using PUBLIC agent card for client initialization (default).
INFO:__main__:
Public card does not indicate support for an extended card. Using public card.
/Users/welcome/Desktop/Tech_Repos/python_envs/A2A/new_A2A/a2a-samples/samples/python/agents/langgraph/app/test_client.py:109: DeprecationWarning: A2AClient is deprecated and will be removed in a future version. Use ClientFactory to create a client with a JSON-RPC transport.
client = A2AClient(
INFO:__main__:A2AClient initialized.
INFO:httpx:HTTP Request: POST http://localhost:10000/ "HTTP/1.1 200 OK"
{'id': '3193d7b3-b3a6-4883-8070-b73fce376af6', 'jsonrpc': '2.0', 'result': {'artifacts': [{'artifactId': '592eadf2-7f1e-4ae7-8b25-8846f3daabd8', 'name': 'conversion_result', 'parts': [{'kind': 'text', 'text': '10 USD is 887.7 INR.'}]}], 'contextId': '3b32c9a5-44e1-488f-910a-ed0c46c27a11', 'history': [{'contextId': '3b32c9a5-44e1-488f-910a-ed0c46c27a11', 'kind': 'message', 'messageId': '69b01891c0324e0cb5c10269d5d17bc0', 'parts': [{'kind': 'text', 'text': 'how much is 10 USD in INR?'}], 'role': 'user', 'taskId': '7d9f5077-0c5d-458f-8c53-c31cf2b724c3'}, {'contextId': '3b32c9a5-44e1-488f-910a-ed0c46c27a11', 'kind': 'message', 'messageId': '146796e2-a46b-4bd2-affb-284b6577824f', 'parts': [{'kind': 'text', 'text': 'Looking up the exchange rates...'}], 'role': 'agent', 'taskId': '7d9f5077-0c5d-458f-8c53-c31cf2b724c3'}, {'contextId': '3b32c9a5-44e1-488f-910a-ed0c46c27a11', 'kind': 'message', 'messageId': '76241b43-20fd-4b3f-a0cc-8382ee8e937b', 'parts': [{'kind': 'text', 'text': 'Processing the exchange rates..'}], 'role': 'agent', 'taskId': '7d9f5077-0c5d-458f-8c53-c31cf2b724c3'}], 'id': '7d9f5077-0c5d-458f-8c53-c31cf2b724c3', 'kind': 'task', 'status': {'state': 'completed', 'timestamp': '2025-09-23T17:45:51.587564+00:00'}}}
INFO:httpx:HTTP Request: POST http://localhost:10000/ "HTTP/1.1 200 OK"
{'id': 'a22d49e6-0a95-411f-9d69-73591dac75a9', 'jsonrpc': '2.0', 'result': {'contextId': '758f8388-7a85-43f9-8419-9b05dc5049a3', 'history': [{'contextId': '758f8388-7a85-43f9-8419-9b05dc5049a3', 'kind': 'message', 'messageId': 'c320c8658efc46cf8066f72ca2558f1e', 'parts': [{'kind': 'text', 'text': 'How much is the exchange rate for 1 USD?'}], 'role': 'user', 'taskId': 'e9f75a6d-566d-4a88-b400-e13454d2048e'}], 'id': 'e9f75a6d-566d-4a88-b400-e13454d2048e', 'kind': 'task', 'status': {'message': {'contextId': '758f8388-7a85-43f9-8419-9b05dc5049a3', 'kind': 'message', 'messageId': '2af99be4-5790-4d92-b633-a91fd8389391', 'parts': [{'kind': 'text', 'text': 'Could you please specify which currency you would like to convert to? For example, you could say "How much is the exchange rate for 1 USD to EUR?"'}], 'role': 'agent', 'taskId': 'e9f75a6d-566d-4a88-b400-e13454d2048e'}, 'state': 'input-required', 'timestamp': '2025-09-23T17:45:54.477804+00:00'}}}
INFO:httpx:HTTP Request: POST http://localhost:10000/ "HTTP/1.1 200 OK"
{'id': 'fc3c2a53-f253-463d-ac0a-acaaddfb3bfe', 'jsonrpc': '2.0', 'result': {'artifacts': [{'artifactId': 'fa756d76-1307-4024-af57-d186da5d9289', 'name': 'conversion_result', 'parts': [{'kind': 'text', 'text': 'The exchange rate for 1 USD to CAD is 1.3828.'}]}], 'contextId': '758f8388-7a85-43f9-8419-9b05dc5049a3', 'history': [{'contextId': '758f8388-7a85-43f9-8419-9b05dc5049a3', 'kind': 'message', 'messageId': 'c320c8658efc46cf8066f72ca2558f1e', 'parts': [{'kind': 'text', 'text': 'How much is the exchange rate for 1 USD?'}], 'role': 'user', 'taskId': 'e9f75a6d-566d-4a88-b400-e13454d2048e'}, {'contextId': '758f8388-7a85-43f9-8419-9b05dc5049a3', 'kind': 'message', 'messageId': '2af99be4-5790-4d92-b633-a91fd8389391', 'parts': [{'kind': 'text', 'text': 'Could you please specify which currency you would like to convert to? For example, you could say "How much is the exchange rate for 1 USD to EUR?"'}], 'role': 'agent', 'taskId': 'e9f75a6d-566d-4a88-b400-e13454d2048e'}, {'contextId': '758f8388-7a85-43f9-8419-9b05dc5049a3', 'kind': 'message', 'messageId': 'b66b004e2d3c490c9ef6abd0198ec3a3', 'parts': [{'kind': 'text', 'text': 'CAD'}], 'role': 'user', 'taskId': 'e9f75a6d-566d-4a88-b400-e13454d2048e'}, {'contextId': '758f8388-7a85-43f9-8419-9b05dc5049a3', 'kind': 'message', 'messageId': 'ede1e318-952d-4684-b000-e59bd952a181', 'parts': [{'kind': 'text', 'text': 'Looking up the exchange rates...'}], 'role': 'agent', 'taskId': 'e9f75a6d-566d-4a88-b400-e13454d2048e'}, {'contextId': '758f8388-7a85-43f9-8419-9b05dc5049a3', 'kind': 'message', 'messageId': '7ec03a7f-fedc-4a90-a3e8-21e97d11d7c7', 'parts': [{'kind': 'text', 'text': 'Processing the exchange rates..'}], 'role': 'agent', 'taskId': 'e9f75a6d-566d-4a88-b400-e13454d2048e'}], 'id': 'e9f75a6d-566d-4a88-b400-e13454d2048e', 'kind': 'task', 'status': {'state': 'completed', 'timestamp': '2025-09-23T17:45:56.495454+00:00'}}}
INFO:httpx:HTTP Request: POST http://localhost:10000/ "HTTP/1.1 200 OK"
{'id': '3c0b263b-9d20-449c-894d-fa3c3260cadd', 'jsonrpc': '2.0', 'result': {'contextId': '08f0dbcc-9128-4724-811a-daf990bcd18a', 'history': [{'contextId': '08f0dbcc-9128-4724-811a-daf990bcd18a', 'kind': 'message', 'messageId': '69b01891c0324e0cb5c10269d5d17bc0', 'parts': [{'kind': 'text', 'text': 'how much is 10 USD in INR?'}], 'role': 'user', 'taskId': 'ee9c8820-f84e-443f-86db-ab05b32302fe'}], 'id': 'ee9c8820-f84e-443f-86db-ab05b32302fe', 'kind': 'task', 'status': {'state': 'submitted'}}}
{'id': '3c0b263b-9d20-449c-894d-fa3c3260cadd', 'jsonrpc': '2.0', 'result': {'contextId': '08f0dbcc-9128-4724-811a-daf990bcd18a', 'final': False, 'kind': 'status-update', 'status': {'message': {'contextId': '08f0dbcc-9128-4724-811a-daf990bcd18a', 'kind': 'message', 'messageId': '758106b9-4e6a-45e9-87a3-a8d510de065e', 'parts': [{'kind': 'text', 'text': 'Looking up the exchange rates...'}], 'role': 'agent', 'taskId': 'ee9c8820-f84e-443f-86db-ab05b32302fe'}, 'state': 'working', 'timestamp': '2025-09-23T17:45:57.115904+00:00'}, 'taskId': 'ee9c8820-f84e-443f-86db-ab05b32302fe'}}
{'id': '3c0b263b-9d20-449c-894d-fa3c3260cadd', 'jsonrpc': '2.0', 'result': {'contextId': '08f0dbcc-9128-4724-811a-daf990bcd18a', 'final': False, 'kind': 'status-update', 'status': {'message': {'contextId': '08f0dbcc-9128-4724-811a-daf990bcd18a', 'kind': 'message', 'messageId': '25adbff9-5b33-4436-975b-92b418c0455c', 'parts': [{'kind': 'text', 'text': 'Processing the exchange rates..'}], 'role': 'agent', 'taskId': 'ee9c8820-f84e-443f-86db-ab05b32302fe'}, 'state': 'working', 'timestamp': '2025-09-23T17:45:57.666691+00:00'}, 'taskId': 'ee9c8820-f84e-443f-86db-ab05b32302fe'}}
{'id': '3c0b263b-9d20-449c-894d-fa3c3260cadd', 'jsonrpc': '2.0', 'result': {'artifact': {'artifactId': 'ed2b15a4-8db5-4078-b20c-5b8d427a43ca', 'name': 'conversion_result', 'parts': [{'kind': 'text', 'text': '10 USD is currently 887.7 INR.'}]}, 'contextId': '08f0dbcc-9128-4724-811a-daf990bcd18a', 'kind': 'artifact-update', 'taskId': 'ee9c8820-f84e-443f-86db-ab05b32302fe'}}
{'id': '3c0b263b-9d20-449c-894d-fa3c3260cadd', 'jsonrpc': '2.0', 'result': {'contextId': '08f0dbcc-9128-4724-811a-daf990bcd18a', 'final': True, 'kind': 'status-update', 'status': {'state': 'completed', 'timestamp': '2025-09-23T17:45:59.048153+00:00'}, 'taskId': 'ee9c8820-f84e-443f-86db-ab05b32302fe'}}
(a2a-sample-agent-langgraph) welcome@jaisairams-Laptop app %
# ADK_Facts
cd /Users/welcome/Desktop/Tech_Repos/python_envs/A2A/new_A2A/a2a-samples/samples/python/agents/adk_facts/
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
uvicorn agent:a2a_app --host localhost --port 8001
http://localhost:8001/.well-known/agent.json
{
"capabilities": {},
"defaultInputModes": [
"text/plain"
],
"defaultOutputModes": [
"text/plain"
],
"description": "Agent to give interesting facts.",
"name": "facts_agent",
"preferredTransport": "JSONRPC",
"protocolVersion": "0.3.0",
"skills": [
{
"description": "Agent to give interesting facts. I am a helpful agent who can provide interesting facts.",
"id": "facts_agent",
"name": "model",
"tags": [
"llm"
]
},
{
"description": "google_search",
"id": "facts_agent-google_search",
"name": "google_search",
"tags": [
"llm",
"tools"
]
}
],
"supportsAuthenticatedExtendedCard": false,
"url": "http://localhost:8001",
"version": "0.0.1"
}
(.venv) welcome@jaisairams-Laptop adk_facts % uvicorn agent:a2a_app --host localhost --port 8001
/Users/welcome/Desktop/Tech_Repos/python_envs/A2A/new_A2A/a2a-samples/samples/python/agents/adk_facts/agent.py:16: UserWarning: [EXPERIMENTAL] to_a2a: ADK Implementation for A2A support (A2aAgentExecutor, RemoteA2aAgent and corresponding supporting components etc.) is in experimental mode and is subjected to breaking changes. A2A protocol and SDK arethemselves not experimental. Once it's stable enough the experimental mode will be removed. Your feedback is welcome.
a2a_app = to_a2a(root_agent, port=int(os.getenv('PORT', '8001')))
/Users/welcome/Desktop/Tech_Repos/python_envs/A2A/new_A2A/a2a-samples/samples/python/agents/adk_facts/.venv/lib/python3.12/site-packages/google/adk/a2a/utils/agent_to_a2a.py:134: UserWarning: [EXPERIMENTAL] A2aAgentExecutor: ADK Implementation for A2A support (A2aAgentExecutor, RemoteA2aAgent and corresponding supporting components etc.) is in experimental mode and is subjected to breaking changes. A2A protocol and SDK arethemselves not experimental. Once it's stable enough the experimental mode will be removed. Your feedback is welcome.
agent_executor = A2aAgentExecutor(
/Users/welcome/Desktop/Tech_Repos/python_envs/A2A/new_A2A/a2a-samples/samples/python/agents/adk_facts/.venv/lib/python3.12/site-packages/google/adk/a2a/executor/a2a_agent_executor.py:95: UserWarning: [EXPERIMENTAL] A2aAgentExecutorConfig: ADK Implementation for A2A support (A2aAgentExecutor, RemoteA2aAgent and corresponding supporting components etc.) is in experimental mode and is subjected to breaking changes. A2A protocol and SDK arethemselves not experimental. Once it's stable enough the experimental mode will be removed. Your feedback is welcome.
self._config = config or A2aAgentExecutorConfig()
/Users/welcome/Desktop/Tech_Repos/python_envs/A2A/new_A2A/a2a-samples/samples/python/agents/adk_facts/.venv/lib/python3.12/site-packages/google/adk/a2a/utils/agent_to_a2a.py:146: UserWarning: [EXPERIMENTAL] AgentCardBuilder: ADK Implementation for A2A support (A2aAgentExecutor, RemoteA2aAgent and corresponding supporting components etc.) is in experimental mode and is subjected to breaking changes. A2A protocol and SDK arethemselves not experimental. Once it's stable enough the experimental mode will be removed. Your feedback is welcome.
card_builder = AgentCardBuilder(
INFO: Started server process [75694]
INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: Uvicorn running on http://localhost:8001 (Press CTRL+C to quit)
2025-09-23 13:55:53,737 - WARNING - jsonrpc_app.py:556 - Deprecated agent card endpoint '/.well-known/agent.json' accessed. Please use '/.well-known/agent-card.json' instead. This endpoint will be removed in a future version.
INFO: ::1:60837 - "GET /.well-known/agent.json HTTP/1.1" 200 OK
INFO: ::1:60837 - "GET /favicon.ico HTTP/1.1" 404 Not Found
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment