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

feat: Add API call tool type #571

Merged
merged 20 commits into from
Oct 4, 2024
Merged

feat: Add API call tool type #571

merged 20 commits into from
Oct 4, 2024

Conversation

creatorrr
Copy link
Contributor

@creatorrr creatorrr commented Oct 2, 2024

  • Add optional description field to agent tools
  • feat(typespec): Add API call tool definition type

Important

Add API call tool type and description field to agent tools, updating models and types accordingly.

  • Behavior:
    • Adds ApiCallDef and ApiCallDefUpdate classes in Tools.py to define API call tools.
    • Adds api_call field to CreateToolRequest, PatchToolRequest, UpdateToolRequest, and Tool classes in Tools.py.
    • Adds description field to CreateToolRequest, PatchToolRequest, UpdateToolRequest, and Tool classes in Tools.py.
    • Updates prepare_chat_context.py and prepare_execution_input.py to include description in tool data.
    • Implements execute_api_call() in excecute_api_call.py to handle API call execution.
  • Types:
    • Adds httpMethod alias in scalars.tsp for valid HTTP methods.
    • Defines ApiCallDef model in models.tsp for API call tools.
  • Misc:
    • Updates create_tools.py and list_tools.py to handle description field in tool records.
    • Adds migration migrate_1727922523_add_description_to_tools.py to add description field to tools table.
    • Adds test workflow: tool call api_call in test_execution_workflow.py to verify API call tool functionality.

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

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.

❌ Changes requested. Reviewed everything up to 5339101 in 16 seconds

More details
  • Looked at 449 lines of code in 7 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 drafted comments based on config settings.

Workflow ID: wflow_gK1AaqWhyGYCAm8B


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

agents-api/agents_api/models/tools/list_tools.py Outdated Show resolved Hide resolved
@creatorrr creatorrr marked this pull request as draft October 2, 2024 23:10
@creatorrr
Copy link
Contributor Author

  • @Vedantsahai18 implement an execute_api_call.py activity similar to agents_api/activities/execute_integration.py for calling arbitrary apis. Use httpx.request for it and the ApiCallDef model.
  • @HamadaSalhab assume that you'll have said execute_api_call activity, then in the workflow execution add support tool type == 'api_call' and run it

@creatorrr creatorrr marked this pull request as ready for review October 3, 2024 23:07
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.

❌ Changes requested. Reviewed everything up to c24e57a in 46 seconds

More details
  • Looked at 939 lines of code in 18 files
  • Skipped 0 files when reviewing.
  • Skipped posting 5 drafted comments based on config settings.
1. agents-api/agents_api/activities/task_steps/base_evaluate.py:56
  • Draft comment:
    Support for nested dictionaries in base_evaluate is a significant change. Ensure that this does not break existing functionality.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The base_evaluate function has been updated to handle nested dictionaries. This change should be noted for its potential impact on existing functionality.
2. agents-api/agents_api/autogen/Tasks.py:947
  • Draft comment:
    Support for nested dictionaries in ToolCallStep.arguments is a significant change. Ensure that this does not break existing functionality.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The ToolCallStep class has been updated to support nested dictionaries in the arguments field. This change should be noted for its potential impact on existing functionality.
3. agents-api/agents_api/autogen/Tools.py:151
  • Draft comment:
    The addition of a description field in ApiCallDef is a significant change. Ensure that this does not break existing functionality.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The ApiCallDef class in Tools.py has been updated to include a description field. This change should be noted for its potential impact on existing functionality.
4. agents-api/agents_api/models/tools/create_tools.py:68
  • Draft comment:
    The addition of a description field in tool records is a significant change. Ensure that this does not break existing functionality.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The create_tools function in create_tools.py has been updated to include a description field in the tool records. This change should be noted for its potential impact on existing functionality.
5. agents-api/agents_api/models/tools/list_tools.py:36
  • Draft comment:
    The addition of a description field in tool records is a significant change. Ensure that this does not break existing functionality.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The list_tools function in list_tools.py has been updated to include a description field in the tool records. This change should be noted for its potential impact on existing functionality.

Workflow ID: wflow_ehEvLpWPZcyPbns2


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

agents-api/agents_api/activities/excecute_api_call.py Outdated Show resolved Hide resolved
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! Incremental review on 3fe372e in 15 seconds

More details
  • Looked at 13 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. agents-api/tests/test_docs_queries.py:43
  • Draft comment:
    The TODO comment is vague. Consider providing more specific guidance or linking to an issue tracker for better clarity on how to resolve the test issue.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The TODO comment suggests a known issue with the test, but it doesn't provide a clear path to resolution. This can be improved by providing more specific guidance or linking to an issue tracker.

Workflow ID: wflow_pIbmmkeU6lkGgPHQ


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

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! Incremental review on 326067a in 15 seconds

More details
  • Looked at 32 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. agents-api/agents_api/activities/excecute_api_call.py:28
  • Draft comment:
    Catching BaseException is too broad and can lead to unintended behavior. Consider catching more specific exceptions like httpx.HTTPStatusError or Exception.
  • Reason this comment was not posted:
    Comment was on unchanged code.

Workflow ID: wflow_qfgRWqiuaxvHzgx6


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

@creatorrr creatorrr merged commit 1c2fb63 into dev Oct 4, 2024
8 of 9 checks passed
@creatorrr creatorrr deleted the f/api-call-tool branch October 4, 2024 00:53
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.

3 participants