Skip to main content

AgentListener

A concrete orchestration class that manages the logging lifecycle. Wraps an AgentLogger and manages the concurrent listening task whilst piping events into the logger.
The following are key methods:
  • listen - Starts the async task that receives chunks
  • close - Cancels the listening task

set_default_agent_listener

Set the default agent listener for all agents and agentic functions in the current scope. This is the StandardListener by default.
This will be over-ridden by any contextual logging or listeners provided on spawning and invoking an agentic function or agent. See here for more information.
Parameters
Callable[[], AgentListener] | None
The listener constructor for logging an agent or agentic function’s activity and chat history. If None, no listener will be used.
bool
If True, is only for this Context.