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(agents-api): Remove unnecessary 'type' property from tool type definition #574

Merged
merged 2 commits into from
Oct 4, 2024

Conversation

creatorrr
Copy link
Contributor

@creatorrr creatorrr commented Oct 3, 2024

Signed-off-by: Diwank Singh Tomer diwank.singh@gmail.com


Important

Removed 'type' property from tool classes and added computed 'type' property using a function in Tools.py, openapi_model.py, and tasks.py.

  • Behavior:
    • Removed type property from CreateToolRequest, NamedToolChoice, PatchToolRequest, Tool, and UpdateToolRequest in Tools.py.
    • Added computed type property to TaskTool, Tool, UpdateToolRequest, and PatchToolRequest in openapi_model.py.
    • Updated task_to_spec() in tasks.py to use computed type property.
  • Misc:
    • Removed type property from Tool and NamedToolChoice in models.tsp.

This description was created by Ellipsis for 289e87e. It will automatically update as commits are pushed.

…finition

Signed-off-by: Diwank Singh Tomer <diwank.singh@gmail.com>
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Reviewed everything up to 289e87e in 11 seconds

More details
  • Looked at 273 lines of code in 4 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. agents-api/agents_api/common/protocol/tasks.py:227
  • Draft comment:
    Ensure that the 'type' property is correctly set for each tool before accessing it here. The removal of the 'type' property from the Tool model means it must be dynamically determined or set elsewhere.
  • Reason this comment was not posted:
    Comment did not seem useful.

Workflow ID: wflow_aLixZCUrGZZ83gGG


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@creatorrr
Copy link
Contributor Author

@Vedantsahai18 this fixes the problem that you had while creating the tool for agent. So now this snippet works correctly:

[ins] In [1]: client.agents.tools.create(agent_id=agent.id,
         ...:     name="web_search",
         ...:     integration={
         ...:         "provider": "brave",
         ...:         "method": "search",
         ...:         "setup": {},
         ...:     },
         ...: )

@creatorrr creatorrr merged commit 51f5e65 into dev Oct 4, 2024
5 of 6 checks passed
@creatorrr creatorrr deleted the x/integration-creation-failed-fix branch October 4, 2024 00:11
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.

1 participant