Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions itk/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

from pyproto import instruction_pb2

from a2a.client import ClientConfig, ClientFactory
from a2a.client import ClientConfig, create_client
from a2a.compat.v0_3 import a2a_v0_3_pb2_grpc
from a2a.compat.v0_3.grpc_handler import CompatGrpcHandler
from a2a.server.agent_execution import AgentExecutor, RequestContext
Expand Down Expand Up @@ -128,10 +128,7 @@ async def handle_call_agent(call: instruction_pb2.CallAgent) -> list[str]:
)

try:
client = await ClientFactory.connect(
call.agent_card_uri,
client_config=config,
)
client = await create_client(call.agent_card_uri, client_config=config)

# Wrap nested instruction
async with client:
Expand Down
4 changes: 2 additions & 2 deletions samples/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import grpc
import httpx

from a2a.client import A2ACardResolver, ClientConfig, ClientFactory
from a2a.client import A2ACardResolver, ClientConfig, create_client
from a2a.types import Message, Part, Role, SendMessageRequest, TaskState


Expand Down Expand Up @@ -79,7 +79,7 @@ async def main() -> None:
print('\n✓ Agent Card Found:')
print(f' Name: {card.name}')

client = await ClientFactory.connect(card, client_config=config)
client = await create_client(card, client_config=config)

actual_transport = getattr(client, '_transport', client)
print(f' Picked Transport: {actual_transport.__class__.__name__}')
Expand Down
7 changes: 6 additions & 1 deletion src/a2a/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
ClientCallContext,
ClientConfig,
)
from a2a.client.client_factory import ClientFactory, minimal_agent_card
from a2a.client.client_factory import (
ClientFactory,
create_client,
minimal_agent_card,
)
from a2a.client.errors import (
A2AClientError,
A2AClientTimeoutError,
Expand All @@ -36,6 +40,7 @@
'ClientFactory',
'CredentialService',
'InMemoryContextCredentialStore',
'create_client',
'create_text_message_object',
'minimal_agent_card',
]
Loading
Loading