mirror of
https://github.com/microsoft/autogen.git
synced 2025-11-17 10:34:36 +00:00
Misc doc fixes (#4300)
* Misc doc fixes * Update _console.py --------- Co-authored-by: Jack Gerrits <jackgerrits@users.noreply.github.com>
This commit is contained in:
parent
e037596228
commit
3c1ec7108a
@ -27,16 +27,18 @@ async def Console(
|
|||||||
no_inline_images: bool = False,
|
no_inline_images: bool = False,
|
||||||
) -> T:
|
) -> T:
|
||||||
"""
|
"""
|
||||||
Consume the stream from :meth:`~autogen_agentchat.base.Team.run_stream`
|
Consumes the message stream from :meth:`~autogen_agentchat.base.TaskRunner.run_stream`
|
||||||
or :meth:`~autogen_agentchat.base.ChatAgent.on_messages_stream`
|
or :meth:`~autogen_agentchat.base.ChatAgent.on_messages_stream` and renders the messages to the console.
|
||||||
print the messages to the console and return the last processed TaskResult or Response.
|
Returns the last processed TaskResult or Response.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
stream (AsyncGenerator[AgentMessage | TaskResult, None] | AsyncGenerator[AgentMessage | Response, None]): Stream to render
|
stream (AsyncGenerator[AgentMessage | TaskResult, None] | AsyncGenerator[AgentMessage | Response, None]): Message stream to render.
|
||||||
|
This can be from :meth:`~autogen_agentchat.base.TaskRunner.run_stream` or :meth:`~autogen_agentchat.base.ChatAgent.on_messages_stream`.
|
||||||
no_inline_images (bool, optional): If terminal is iTerm2 will render images inline. Use this to disable this behavior. Defaults to False.
|
no_inline_images (bool, optional): If terminal is iTerm2 will render images inline. Use this to disable this behavior. Defaults to False.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
last_processed: The last processed TaskResult or Response.
|
last_processed: A :class:`~autogen_agentchat.base.TaskResult` if the stream is from :meth:`~autogen_agentchat.base.TaskRunner.run_stream`
|
||||||
|
or a :class:`~autogen_agentchat.base.Response` if the stream is from :meth:`~autogen_agentchat.base.ChatAgent.on_messages_stream`.
|
||||||
"""
|
"""
|
||||||
render_image_iterm = _is_running_in_iterm() and _is_output_a_tty() and not no_inline_images
|
render_image_iterm = _is_running_in_iterm() and _is_output_a_tty() and not no_inline_images
|
||||||
start_time = time.time()
|
start_time = time.time()
|
||||||
|
|||||||
@ -237,6 +237,7 @@ class ExternalTermination(TerminationCondition):
|
|||||||
return self._terminated
|
return self._terminated
|
||||||
|
|
||||||
def set(self) -> None:
|
def set(self) -> None:
|
||||||
|
"""Set the termination condition to terminated."""
|
||||||
self._setted = True
|
self._setted = True
|
||||||
|
|
||||||
async def __call__(self, messages: Sequence[AgentMessage]) -> StopMessage | None:
|
async def __call__(self, messages: Sequence[AgentMessage]) -> StopMessage | None:
|
||||||
|
|||||||
@ -28,8 +28,8 @@
|
|||||||
"\n",
|
"\n",
|
||||||
"At a high-level, a team API consists of the following methods:\n",
|
"At a high-level, a team API consists of the following methods:\n",
|
||||||
"\n",
|
"\n",
|
||||||
"- {py:meth}`~autogen_agentchat.base.TaskRunner.run`: To process a task, which can be a {py:class}`str`, {py:class}`~autogen_agentchat.messages.TextMessage`, or {py:class}`~autogen_agentchat.messages.MultiModalMessage`, and returns {py:class}`~autogen_agentchat.base.TaskResult`. The task can also be `None` to resume processing the previous task if the team has not been reset.\n",
|
"- {py:meth}`~autogen_agentchat.base.TaskRunner.run`: Process a task, which can be a {py:class}`str`, {py:class}`~autogen_agentchat.messages.TextMessage`, {py:class}`~autogen_agentchat.messages.MultiModalMessage`, or {py:class}`~autogen_agentchat.messages.HandoffMessage`, and returns {py:class}`~autogen_agentchat.base.TaskResult`. The task can also be `None` to resume processing the previous task if the team has not been reset.\n",
|
||||||
"- {py:meth}`~autogen_agentchat.base.TaskRunner.run_stream`: Same as {py:meth}`~autogen_agentchat.base.TaskRunner.run`, but returns a async generator of messages and the final task result.\n",
|
"- {py:meth}`~autogen_agentchat.base.TaskRunner.run_stream`: Similar to {py:meth}`~autogen_agentchat.base.TaskRunner.run`, but it returns an async generator of messages and the final task result.\n",
|
||||||
"- {py:meth}`~autogen_agentchat.base.Team.reset`: To reset the team state if the next task is not related to the previous task. Otherwise, the team can utilize the context from the previous task to process the next one.\n",
|
"- {py:meth}`~autogen_agentchat.base.Team.reset`: To reset the team state if the next task is not related to the previous task. Otherwise, the team can utilize the context from the previous task to process the next one.\n",
|
||||||
"\n",
|
"\n",
|
||||||
"In this section, we will be using the\n",
|
"In this section, we will be using the\n",
|
||||||
@ -782,7 +782,7 @@
|
|||||||
"name": "python",
|
"name": "python",
|
||||||
"nbconvert_exporter": "python",
|
"nbconvert_exporter": "python",
|
||||||
"pygments_lexer": "ipython3",
|
"pygments_lexer": "ipython3",
|
||||||
"version": "3.11.5"
|
"version": "3.12.6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nbformat": 4,
|
"nbformat": 4,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user