-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Python: Document generator agent framework demo #10184
base: main
Are you sure you want to change the base?
Python: Document generator agent framework demo #10184
Conversation
cloned_history = history.model_copy(deep=True) | ||
cloned_history.add_user_message_str( | ||
"Now validate the Python code in the latest document draft and summarize any errors." | ||
) |
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.
I notice in group chats, agents often struggle with following the system prompt. An agent will try to continue the conversation instead of executing the task it's given. Adding a user message here can prevent the agent from trying to continue the conversation.
if content: | ||
chat_history.add_message(message) | ||
|
||
chat_history.add_user_message_str( |
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.
In termination and selection strategies, having a user message here also helps to prevent the agent from continueing the conversation.
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.
Cool stuff, left a couple of notes!
python/samples/demos/document_generator/agents/custom_agent_base.py
Outdated
Show resolved
Hide resolved
python/samples/demos/document_generator/custom_selection_strategy.py
Outdated
Show resolved
Hide resolved
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.
small nit added
if content: | ||
chat_history.add_message(message) | ||
|
||
chat_history.add_user_message_str( |
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.
ideally we don't use the add_user_message_str
method but just add_user_message
it uses single dispatch to route based on the type
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.
I changed to add_user_message
. But I have a question:
If we do that, we can no longer see the signature of the method on the IDE (at least VS Code in my case). Is this a common approach to achieve polymorphism?
Motivation and Context
We currently don't have a demo sample that shows how to use the agent framework with multiple agents end-to-end. End-to-end means starting from a task, designing the agents, and observing the agents.
Description
This PR adds a demo app that shows how to use the agent framework with multiple agents to generate technical documents for Semantic Kernel. This automation will greatly improve our productivity in creating more contents.
This sample contains 3 agents, multiple plugins, and the necessary steps to make the agents observable.
Contribution Checklist