-
Notifications
You must be signed in to change notification settings - Fork 6.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add output_format to AssistantAgent for structured output #6071
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6071 +/- ##
==========================================
+ Coverage 76.96% 76.99% +0.03%
==========================================
Files 192 192
Lines 13438 13455 +17
==========================================
+ Hits 10342 10360 +18
+ Misses 3096 3095 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
python/packages/autogen-agentchat/src/autogen_agentchat/agents/_assistant_agent.py
Outdated
Show resolved
Hide resolved
python/packages/autogen-agentchat/src/autogen_agentchat/agents/_assistant_agent.py
Outdated
Show resolved
Hide resolved
|
||
* If the model returns no tool call, then the response is immediately returned as a :class:`~autogen_agentchat.messages.TextMessage` in :attr:`~autogen_agentchat.base.Response.chat_message`. | ||
If the `output_content_type` is set, the agent will respond with a :class:`~autogen_agentchat.messages.StructuredMessage` | ||
instead of a :class:`~autogen_agentchat.messages.TextMessage` in the final response by default. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps consider adding a note to the docstring mentioning that using output_content_type
currently prevents the agent state from being saved/loaded via the declarative configuration mechanism (due to the check in _to_config
). This would help manage user expectations.
Otherwise a very well-documented and clean PR that has tests and everything.
Resolves #5934
This PR adds ability for
AssistantAgent
to generate aStructuredMessage[T]
whereT
is the content type in base model.How to use?