-
Notifications
You must be signed in to change notification settings - Fork 29
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: search index tool #61
feat: search index tool #61
Conversation
Signed-off-by: yuye-aws <[email protected]>
Signed-off-by: yuye-aws <[email protected]>
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #61 +/- ##
=============================================
+ Coverage 46.08% 80.38% +34.29%
- Complexity 31 90 +59
=============================================
Files 6 8 +2
Lines 358 520 +162
Branches 42 70 +28
=============================================
+ Hits 165 418 +253
+ Misses 172 58 -114
- Partials 21 44 +23 ☔ View full report in Codecov by Sentry. |
Please check the codecov report and add more UTs. |
}); | ||
contextBuilder.append(doc).append("\n"); | ||
} | ||
listener.onResponse((T) StringUtils.gson.toJson(contextBuilder.toString())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why we need a toJson here after calling toString?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, there is no need for toJson. Thanks for pointing out.
Signed-off-by: yuye-aws <[email protected]>
Signed-off-by: yuye-aws <[email protected]>
Signed-off-by: yuye-aws <[email protected]>
I have added UT to cover more code. This PR is ready for review now. |
|
||
public static final String TYPE = "SearchIndexTool"; | ||
private static final String DEFAULT_DESCRIPTION = | ||
"Use this tool to search index with a query. You should pass in two parameters: index and query. Index is the index name and the query is an OpenSearch DSL query."; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about : Use this tool to search an index by providing two parameters: 'index' for the index name, and 'query' for the OpenSearch DSL formatted query.
Signed-off-by: yuye-aws <[email protected]>
* add search index tool Signed-off-by: yuye-aws <[email protected]> * run spotless apply Signed-off-by: yuye-aws <[email protected]> * remove unncessary string util operation Signed-off-by: yuye-aws <[email protected]> * add test cases Signed-off-by: yuye-aws <[email protected]> * spotless apply Signed-off-by: yuye-aws <[email protected]> * update tool description and add model group search Signed-off-by: yuye-aws <[email protected]> --------- Signed-off-by: yuye-aws <[email protected]> (cherry picked from commit 2e05330) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* add search index tool * run spotless apply * remove unncessary string util operation * add test cases * spotless apply * update tool description and add model group search --------- (cherry picked from commit 2e05330) Signed-off-by: yuye-aws <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* add search index tool * run spotless apply * remove unncessary string util operation * add test cases * spotless apply * update tool description and add model group search --------- (cherry picked from commit 2e05330) Signed-off-by: yuye-aws <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Signed-off-by: yuye-aws <[email protected]>
Description
Implement SearchIndexTool to support agent framework. It takes in two string parameters: index and query. Here is the sample usage of this tool. Please remember to replace the model id and agent id.
The expected successful response should be
If there is error when parsing the input, the expected error response could be:
Issues Resolved
Check List
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.