autogen_agentchat.ui#

This module implements utility classes for formatting/printing agent messages.

async Console(stream: AsyncGenerator[BaseAgentEvent | BaseChatMessage | T, None], *, no_inline_images: bool = False, output_stats: bool = False, user_input_manager: UserInputManager | None = None) T[source]#

Consumes the message stream from run_stream() or on_messages_stream() and renders the messages to the console. Returns the last processed TaskResult or Response.

Note

output_stats is experimental and the stats may not be accurate. It will be improved in future releases.

Parameters:
Returns:

last_processed – A TaskResult if the stream is from run_stream() or a Response if the stream is from on_messages_stream().

class UserInputManager(callback: Callable[[str], str] | Callable[[str, CancellationToken | None], Awaitable[str]])[source]#

Bases: object

get_wrapped_callback() Callable[[str, CancellationToken | None], Awaitable[str]][source]#
notify_event_received(request_id: str) None[source]#