agentconnect.clients.registry_client module¶
Registry Client for AgentConnect
This client provides a high-level interface for interacting with the AgentConnect Registry API Server. It mimics the interface of agentconnect.core.registry.AgentRegistry, but uses HTTPX for asynchronous requests.
- with_retry(max_retries=None, retry_backoff_factor=None, retryable_status_codes=None)¶
Decorator to add exponential backoff retry logic to async methods.
- class RegistryAPIClient(base_url=None, timeout=None, connect_timeout=None, read_timeout=None, pool_timeout=None, max_connections=None, max_keepalive_connections=None)¶
Bases:
objectClient for interacting with the AgentConnect Registry API Server. This client mimics the interface of agentconnect.core.registry.AgentRegistry.
- Quickstart Example:
import asyncio from agentconnect.clients import RegistryAPIClient async def main(): async with RegistryAPIClient() as client: # Get all registered agents agents = await client.get_all_agents() print(f"Found {len(agents)} agents") # Search for agents by capability results = await client.get_by_capability_semantic( capability_description="data analysis", limit=5 ) for agent, score in results: print(f"{agent.name}: {score:.3f}") asyncio.run(main())
- Parameters:
- async close()¶
Closes the underlying HTTPX client. Should be called on cleanup.
- async ensure_initialized()¶
Mimics AgentRegistry’s ensure_initialized. For the client, this is a no-op.
- async register(registration)¶
Register a new agent.
- Return type:
- Parameters:
registration (AgentRegistration)
- async unregister(agent_id)¶
Remove agent from registry.
- async get_registration(agent_id)¶
Get agent registration details.
- Return type:
- Parameters:
agent_id (str)
- async get_all_agents()¶
Get a list of all agents registered in the system.
- Return type:
- async update_registration(agent_id, updates)¶
Update agent registration details.
- async get_by_capability_semantic(capability_description, limit=10, similarity_threshold=0.1, filters=None)¶
Find agents by capability description using semantic search.
- async get_by_capability(capability_name, limit=10, similarity_threshold=0.1)¶
Find agents by capability name (exact match).
- Return type:
- Parameters:
- async get_all_capabilities()¶
Get a list of all unique capability names registered in the system.
- async get_agent_type(agent_id)¶
Get the type of an agent.
- async get_by_interaction_mode(mode)¶
Find agents by interaction mode.
- Return type:
- Parameters:
mode (InteractionMode)
- async get_by_organization(organization)¶
Find agents by organization.
- Return type:
- Parameters:
organization (str)
- async get_verified_agents()¶
Get all verified agents.
- Return type:
- async verify_agent(agent_id)¶
Verify an agent’s identity (triggers verification process on server).