Skip to content
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

fix: Fix updating tools #1886

Merged
merged 5 commits into from
Oct 15, 2024
Merged

fix: Fix updating tools #1886

merged 5 commits into from
Oct 15, 2024

Conversation

mattzh72
Copy link
Collaborator

@mattzh72 mattzh72 commented Oct 15, 2024

Description

Currently, adding tools in the dev portal causes all the existing tools to be removed, making the tools unusable. This is due to a bug, as adding tools is currently done by invoking update_agent with a list of the desired tool name, which completely replaces the entire tool list, instead of appending.

This PR introduces two new API endpoints:

  • add_tools_to_agent: appends a list of tools to the existing tools for an agent
  • remove_tools_from_agent: removes a list of tools from the existing tools for an agent

We fix a variety of bugs with the tools, for example, where descriptions are not being properly set on update.

Testing

We write a comprehensive unit test that adds two tools step by step, confirms that both are in, and selectively removes one of the tools.

Copy link
Collaborator

@sarahwooders sarahwooders left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@sarahwooders sarahwooders linked an issue Oct 15, 2024 that may be closed by this pull request
@mattzh72 mattzh72 merged commit 174f31b into main Oct 15, 2024
16 checks passed
@cpacker cpacker deleted the matt-fix-update-tools branch October 16, 2024 03:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

existing tools are removed from an agent with tools are updated
2 participants