You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
ekzhu
changed the title
[Feature Request]: Remove Tools
[Feature Request]: Dynamically removing tools during agent conversation
May 21, 2024
ekzhu
changed the title
[Feature Request]: Dynamically removing tools during agent conversation
[Feature Request]: Dynamically removing tools during agent conversation when the tools are not needed or not useful.
May 21, 2024
there is method update_tool_signature which even has "is_remove" flag. But it seems removing the function only from llm_config["tools"] but from function_map
I am not sure this is an issue for execution..
I was able to acomplish this feature myself with this code:
def remove_tool(agent, tool_name):
"""Remove tool from the tool list"""
tools = agent.llm_config.get("tools")
tools = [tool for tool in tools if tool.get("function", {}).get("name") != tool_name]
agent.llm_config["tools"] = tools
map_ = agent._function_map
del map_[tool_name]
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: