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

add fill for selected tools #2150

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

xinyual
Copy link
Collaborator

@xinyual xinyual commented Feb 22, 2024

Description

We want to use a MLModelTool to firstly do tool selection and then limit the tool root agent can use. It will improve the tool selection accuracy. To do so, we need to fill the "TOOL_SELECT" field by previous MLMODELTool's output.

The request body would be like:

{
  "name": "Test_Agent_For_RAG_2",
  "type": "flow",
  "description": "Use this tool to transfer natural language to generate PPL and execute PPL to query inside. This tool will select index by itself. The input parameters are: {'question':UserQuestion}",
  "memory": {
    "type": "demo"
  },
  "tools": [
    {
      "type": "MLModelTool",
      "name": "RepCToolSelection",
      "description": "repc",
      "parameters": {
        "model_id": "<repc_id>",
        "prompt": "${parameters.question}"
      }
    },
      {
      "type": "AgentTool",
      "name": "RootAgent",
      "description": "root agent with all tools",
      "parameters": {
        "agent_id": "<root_agent_id>",
        "selected_tools": "[\"${parameters.RepCToolSelection.output}\"]"
      }
    }
  ]
}

Issues Resolved

[List any issues this PR will resolve]

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: xinyual <[email protected]>
Copy link

codecov bot commented Feb 22, 2024

Codecov Report

Attention: 5 lines in your changes are missing coverage. Please review.

Comparison is base (5cba422) 81.87% compared to head (e819e30) 81.85%.
Report is 1 commits behind head on main.

Files Patch % Lines
...nsearch/ml/engine/algorithms/agent/AgentUtils.java 16.66% 4 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #2150      +/-   ##
============================================
- Coverage     81.87%   81.85%   -0.02%     
- Complexity     5662     5663       +1     
============================================
  Files           543      543              
  Lines         22857    22864       +7     
  Branches       2350     2350              
============================================
+ Hits          18714    18716       +2     
- Misses         3203     3207       +4     
- Partials        940      941       +1     
Flag Coverage Δ
ml-commons 81.85% <28.57%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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