mirror of
https://github.com/encounter/adk-python.git
synced 2026-07-09 18:19:28 -07:00
fix: Retain the consumers and transport registry when recreating the ClientFactory in remote_a2a_agent.py
PiperOrigin-RevId: 807762203
This commit is contained in:
committed by
Copybara-Service
parent
f7bd3c111c
commit
6bd33e1be3
@@ -188,12 +188,16 @@ class RemoteA2aAgent(BaseAgent):
|
||||
)
|
||||
self._httpx_client_needs_cleanup = True
|
||||
if self._a2a_client_factory:
|
||||
registry = self._a2a_client_factory._registry
|
||||
self._a2a_client_factory = A2AClientFactory(
|
||||
config=dataclasses.replace(
|
||||
self._a2a_client_factory._config,
|
||||
httpx_client=self._httpx_client,
|
||||
)
|
||||
),
|
||||
consumers=self._a2a_client_factory._consumers,
|
||||
)
|
||||
for label, generator in registry.items():
|
||||
self._a2a_client_factory.register(label, generator)
|
||||
if not self._a2a_client_factory:
|
||||
client_config = A2AClientConfig(
|
||||
httpx_client=self._httpx_client,
|
||||
|
||||
Reference in New Issue
Block a user