Conversation
# Conflicts: # autogen/agentchat/conversable_agent.py
Contributor
Author
Now added! |
Contributor
Author
|
@sonichi Is this test currently expected to fail? OpenAI4ContribTests / CompressionTest (ubuntu-latest, 3.9) (pull_request_target) |
Contributor
This was referenced Jan 7, 2024
Closed
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why are these changes needed?
It’s often useful to combine multiple advanced capabilities into a single agent, as OpenAI has done with their recently released GPTs and Assistants, for which function calling, code interpreter, and RAG capabilities can work together in a composable and chainable way. But AutoGen makes it hard to chain advanced capabilities because
ConversableAgentobtains each agent reply from just one registered reply function. Given the mutual exclusivity among registered reply functions, the capabilities of (for example)RetrieveAssistantAgentandTeachableAgentcannot be easily chained (combined in producing a single response) today; any given reply can leverage one or the other but not both.This PR enhances
ConversableAgentto support chainable capabilities by means of a lightweight hook-registration mechanism allowing multiple capabilities to contribute to each agent reply. Leveraging this new mechanism, teachability can now be added to any agent that inherits fromConversableAgentby instantiating aTeachabilityobject (which replaces the originalTeachableAgentclass) and calling itsadd_to_agent(agent)method. For illustration, teachability can now be added to OpenAI Assistants throughGPTAssistantAgent(unmodified by this PR), successfully combining teachability in a chain with whatever capabilities the particular OpenAI Assistants have (tools including functions, code interpreter, and retrieval). Teachable OpenAI Assistants are demonstrated in a new notebook.The original teachability tests, notebook, documentation, and blog post are all updated.
Related issue number
Closes #534, #535, #782
Checks