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

Search root agent id by rootAgentName specified in opensearch_dashboards.yml #86

Merged
merged 3 commits into from
Dec 28, 2023

Conversation

gaobinlong
Copy link
Collaborator

@gaobinlong gaobinlong commented Dec 27, 2023

Description

This PR aims to change the behavior of getting root agent id, users have to specify the name of the root agent in the yml, and when they send the first message in the chat box, the node server will call the search agent api in ml-commons to get the root agent id, if multiple root agents are found, we only fetch the latest one.

This PR also lets users to change the root agent dynamically, they can delete the old root agent firstly and create a new one with the old name, when sending message, the api in backend will throw 404 error with message resource_not_found_exception, this time the node server will retry to search the root agent by the specified name, if found, the new root agent id will be used and cached.

Check List

  • New functionality includes testing.
    • All tests pass, including unit test, integration test and doctest
  • New functionality has been documented.
    • New functionality has javadoc added
    • New functionality has user manual doc 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.

server/plugin.ts Outdated Show resolved Hide resolved
Copy link

codecov bot commented Dec 27, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (510b685) 93.26% compared to head (60abf5a) 93.44%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #86      +/-   ##
==========================================
+ Coverage   93.26%   93.44%   +0.17%     
==========================================
  Files          46       46              
  Lines        1218     1251      +33     
  Branches      291      298       +7     
==========================================
+ Hits         1136     1169      +33     
  Misses         80       80              
  Partials        2        2              

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

Co-authored-by: SuZhou-Joe <[email protected]>
Signed-off-by: gaobinlong <[email protected]>
server/routes/chat_routes.ts Show resolved Hide resolved
server/routes/chat_routes.ts Outdated Show resolved Hide resolved
server/routes/chat_routes.ts Outdated Show resolved Hide resolved
server/services/chat/olly_chat_service.ts Outdated Show resolved Hide resolved
server/services/chat/olly_chat_service.ts Show resolved Hide resolved
Signed-off-by: gaobinlong <[email protected]>
@gaobinlong gaobinlong merged commit 4e065f1 into opensearch-project:main Dec 28, 2023
10 checks passed
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.

4 participants