"""Public informational example: pip install a2a-sdk==1.3.0 httpx==0.28.1 No tokens, enrollment, paid Missions or privileged Gateway calls. """ import asyncio from uuid import uuid4 import httpx from google.protobuf.json_format import MessageToDict, ParseDict from a2a.client import A2ACardResolver, ClientConfig, ClientFactory from a2a.types import Message, Part, Role, SendMessageRequest from google.protobuf.struct_pb2 import Value async def main(): async with httpx.AsyncClient(timeout=20,trust_env=False) as http: for origin,part in [ ('https://a2pw.org',Part(text='Find a provider that can photograph a storefront.')), ('https://thrallvision.net',Part(data=ParseDict({'operation':'photo_info'},Value()),media_type='application/json'))]: card=await A2ACardResolver(http,origin).get_agent_card() client=ClientFactory(ClientConfig(httpx_client=http,streaming=False,supported_protocol_bindings=['JSONRPC'],accepted_output_modes=['application/json','text/plain'])).create(card) request=SendMessageRequest(message=Message(message_id=str(uuid4()),role=Role.ROLE_USER,parts=[part])) async for response in client.send_message(request): print(MessageToDict(response)) await client.close() if __name__=='__main__':asyncio.run(main())