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

Optimize the default prompt and make prompt customizable for create anomaly detector tool #399

Merged
merged 10 commits into from
Sep 29, 2024

Conversation

gaobinlong
Copy link
Contributor

@gaobinlong gaobinlong commented Sep 4, 2024

Description

Optimize the prompt feed to LLM when executing the CreateAnomalyDetectorTool, the change are:

  1. Add (long, integer, double, float, short etc.).
  2. Add you should give at most 3 aggregation fields and corresponding aggregation methods

, and also make the prompt customizable, users can use their customized prompt.

Related Issues

#337

Check List

  • New functionality includes testing.
  • New functionality has been documented.
  • API changes companion pull request created.
  • Commits are signed per the DCO using --signoff.
  • Public documentation issue/PR created.

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.

@gaobinlong
Copy link
Contributor Author

@zane-neo @xinyual please help to review this PR, thank you!

@gaobinlong gaobinlong changed the title Optimize the prompt for create anomaly detector tool Optimize the prompt and make prompt customizable for create anomaly detector tool Sep 29, 2024
@gaobinlong gaobinlong changed the title Optimize the prompt and make prompt customizable for create anomaly detector tool Optimize the default prompt and make prompt customizable for create anomaly detector tool Sep 29, 2024
Signed-off-by: gaobinlong <[email protected]>
Signed-off-by: gaobinlong <[email protected]>
Copy link

codecov bot commented Sep 29, 2024

Codecov Report

Attention: Patch coverage is 66.66667% with 2 lines in your changes missing coverage. Please review.

Project coverage is 77.65%. Comparing base (2b76e3c) to head (477ec5a).
Report is 24 commits behind head on main.

Files with missing lines Patch % Lines
...nsearch/agent/tools/CreateAnomalyDetectorTool.java 66.66% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main     #399      +/-   ##
============================================
- Coverage     81.78%   77.65%   -4.14%     
- Complexity      193      260      +67     
============================================
  Files            11       15       +4     
  Lines           961     1383     +422     
  Branches        137      197      +60     
============================================
+ Hits            786     1074     +288     
- Misses          121      232     +111     
- Partials         54       77      +23     
Flag Coverage Δ
77.65% <66.66%> (?)

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.

@gaobinlong
Copy link
Contributor Author

The test case ./gradlew ':integTest' --tests "org.opensearch.integTest.RAGToolIT.testRAGToolWithNeuralQuery" always fails on MacOS, but not relates to this PR.

Signed-off-by: gaobinlong <[email protected]>
@zane-neo zane-neo merged commit 06a8537 into opensearch-project:main Sep 29, 2024
8 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Sep 29, 2024
…nomaly detector tool (#399)

* Optimize the prompt for create anomaly detector tool

Signed-off-by: gaobinlong <[email protected]>

* Remove whitespace

Signed-off-by: gaobinlong <[email protected]>

* Make prompt for CreateAnomalyDetectorToll customized

Signed-off-by: gaobinlong <[email protected]>

* format the code

Signed-off-by: gaobinlong <[email protected]>

* Fix test failure

Signed-off-by: gaobinlong <[email protected]>

* fix test failure

Signed-off-by: gaobinlong <[email protected]>

* Format the code

Signed-off-by: gaobinlong <[email protected]>

* Add more tests

Signed-off-by: gaobinlong <[email protected]>

---------

Signed-off-by: gaobinlong <[email protected]>
(cherry picked from commit 06a8537)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
zane-neo pushed a commit that referenced this pull request Sep 29, 2024
…nomaly detector tool (#399) (#419)

* Optimize the prompt for create anomaly detector tool



* Remove whitespace



* Make prompt for CreateAnomalyDetectorToll customized



* format the code



* Fix test failure



* fix test failure



* Format the code



* Add more tests



---------


(cherry picked from commit 06a8537)

Signed-off-by: gaobinlong <[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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants