-
Notifications
You must be signed in to change notification settings - Fork 5.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
Function Calling with GPTAssistantAgent #2375
Function Calling with GPTAssistantAgent #2375
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.
Also add a link in the example page:
In website/docs/Examples.md
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2375 +/- ##
==========================================
- Coverage 38.14% 37.02% -1.12%
==========================================
Files 78 81 +3
Lines 7865 8084 +219
Branches 1683 1724 +41
==========================================
- Hits 3000 2993 -7
- Misses 4615 4840 +225
- Partials 250 251 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@ekzhu the PR is blocked by your change request. |
Head branch was pushed to by a user without write access
Just got around to updating the PR, appreciate your patience on this. I am running into an issue though with the new method @ekzhu suggested The functions are registering with the agents' in the llm_config
However the Agent's don't seem to be able to recognize that they have access to the function:
When I checked the OpenAI Platform, it's showing that the functions are not registered with the Assistant API, even though when I call Have you guys seen this issue before with the new way to configure tools and GPTAssistantAgents? |
It looks like the open ai assistant currently requires the tools to be registered upon agent creation. See: https://platform.openai.com/docs/assistants/tools/function-calling So, instead of using autogen/autogen/function_utils.py Line 211 in 5b6ae32
to generate the JSON schema for the function, and then add it through the |
Thanks, the One thing to note though is that I still had to register the function with the Another thing to note as well:
You can update the tools after the agent is created. I implemented this logic into autogen with the update_gpt_assistant(
self._openai_client,
assistant_id=openai_assistant_id,
assistant_config={
"tools": specified_tools,
"tool_resources": openai_assistant_cfg.get("tool_resources", None),
} I think the notebook is ready to go, but let me know if you want me to make anymore changes. Using the |
Thanks @jtrugman this is looking great now! On this note:
This is clearly a missing feature we need to support to make GPTAssistantAgent and ConversableAgent aligned. Can you create an issue for this? I think the implementation is prettly clear which is to use the |
Totally agree! Here is the GitHub Issue for this (#2575) |
* Function Calling with GPTAssistantAgent * Add Link to Notebook in Website * Add metadata to the notebook * formatting of H2 and H3 text * updated to new method of function calling * Run Pre-commit * utilize get_function_schema
Why are these changes needed?
There currently are not notebooks for using tools with the GPTAssistantAgent, this PR adds a light hearted example of a GPTAssistantAgent based Multiagent system that utilizes tools such as calling an API and writing to a file.
This notebook is designed to fetch Dad jokes related to specific themes and transform them into Sad jokes. The system employs two specialized agents, namely "The Dad" and "The Sad Joker".
Key Features:
Technical Implementation:
Hopefully this notebook helps users autogen more easily adopt the GPTAssistantAgent within their applications.
This change includes
Related issue number
N/A
Checks