AgentClient
autogen.beta.network.client.agent_client.AgentClient #
Tenant-side handle for one (Agent, identity, hub) registration.
Source code in autogen/beta/network/client/agent_client.py
current_handling_depth property #
Depth of the envelope this agent is currently handling.
Returns 0 when no handler is on the stack (i.e. the agent initiated the call from outside any inbound delivery). Used by delegate to stamp Envelope.depth = current + 1.
receive async #
Hub delivery → fan out to inbox + (suppressible) handler.
Source code in autogen/beta/network/client/agent_client.py
on_envelope #
Override the default notify handler with a custom callback.
Calling with the default handler restores it: pass self._run_default_handler (or simply construct without attach_default_handler=False).
Source code in autogen/beta/network/client/agent_client.py
disconnect async #
open async #
Open a session via the hub and return its :class:Session handle.
target accepts peer names or agent_ids; resolution goes through the bound :class:HubClient so in-process and any future cross-process transport take the same code path.
Source code in autogen/beta/network/client/agent_client.py
ensure_session_inbox #
Create (or fetch) the per-session inbox queue.
Callers that send first and then wait_for_session_event MUST call this BEFORE the send. Otherwise a fast reply (e.g. via LocalLink where dispatch happens on the same event-loop tick) can be delivered to receive before the wait creates the inbox — the envelope would then be dropped silently.
Idempotent: returns the existing queue if one is already bound.
Source code in autogen/beta/network/client/agent_client.py
discard_session_inbox #
Drop the per-session inbox queue.
Callers should invoke this after they've finished waiting on a session so the per-client memory footprint doesn't grow with every consulted session.
Source code in autogen/beta/network/client/agent_client.py
wait_for_session_event async #
Block until an inbound envelope on session_id matches.
Used by delegate to await the consulting respondent's reply. The inbox is created on demand and shared across waits; callers should not hold multiple concurrent waits on the same session.
Raises asyncio.TimeoutError on timeout.
Source code in autogen/beta/network/client/agent_client.py
send_envelope async #
Post an envelope through the hub. Returns the stamped envelope_id.
Source code in autogen/beta/network/client/agent_client.py
set_resume async #
Source code in autogen/beta/network/client/agent_client.py
add_example async #
Append a ResumeExample to this agent's resume.
Fetches the latest resume from the hub first so concurrent set_resume / record_observation updates don't get clobbered.