-
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
[Feature Request]: Dynamically removing tools during agent conversation when the tools are not needed or not useful. #2666
Comments
Can you please provide an example scenario where this will be useful? |
Sure, I use this in my other chatbot all the time. Let's say you have diferent tools available for the Agent to choose from, but when a tool fails, because it's impossible to execute, you might want to remove it, save tokens, and let the Agent use other tools instead to complete the job. Another example is simply removing tools to save tokens. Very often you can assume that certain tools will not be needed when other tools have been already picked. For example, if the Agent picked a weather_info tool, then you can assume that the stock_info tool might be not needed. So you remove it. |
Some observations:
I am not sure this is an issue for execution.. I was able to acomplish this feature myself with this code:
|
+1 for this feature request In my use case, each function correspond to an action that the agent could perform. As the agent interact with the world,
Example: Agent is first at the pub:
Agent now walks to forest:
|
Since the LLM APIs only support a fixed max number of tools (ex: 128 for OpenAI), it is necessary to be able to provide only the most relevant tools. In order to do this, the user should have the possibility to implement its own "tool pool" with an associated selection strategy. Two ways to do this:
If that's ok with the maintainer I'll start by implementing 1. then we can design 2. |
@JMLX42 happy to feature your extension if you would like to work on an experimentation of this idea as a community package. This will help when it comes to designing of the |
"tool pool" aka "workbench" design proposal issue: #4721 |
Is your feature request related to a problem? Please describe.
To save tokens or improve GPT responses, it makes sense to remove certain tools when they are no longer needed.
Describe the solution you'd like
autogen.agentchat.unregister_function(
hello_world,
caller=picker,
executor=picker
)
Additional context
No response
The text was updated successfully, but these errors were encountered: