opensearch-project / dashboards-assistant

Dashboard assistant is a way for users on OpenSearch Dashboards to interact with an assistant through chat or the different OSD pages
https://opensearch.org/
Apache License 2.0
19 stars 23 forks source link

Optimize the response of AI agent APIs #373

Closed gaobinlong closed 1 day ago

gaobinlong commented 2 weeks ago

Description

When calling the APIs like api/assistant/summary, api/assistant/insight and other related APIs, if OpenSearch cluster returns 4xx error, we just return 500 error or 400 error directly, which is not elegant, we should optimize this by checking the status code, if it's 4xx error, we return the original response, and if it's 5xx error, return an general error message.

Issues Resolved

[List any issues this PR will resolve]

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.

gaobinlong commented 1 day ago

@ruanyl @SuZhou-Joe @Hailong-am @xluo-aws please help to review this PR, thanks!