-
Notifications
You must be signed in to change notification settings - Fork 23
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
[Feature] Add rootAgentId config in dashboard yml file #78
[Feature] Add rootAgentId config in dashboard yml file #78
Conversation
Signed-off-by: SuZhou-Joe <[email protected]>
Signed-off-by: SuZhou-Joe <[email protected]>
Signed-off-by: SuZhou-Joe <[email protected]>
Signed-off-by: SuZhou-Joe <[email protected]>
124aedc
to
3278ec2
Compare
Signed-off-by: SuZhou-Joe <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #78 +/- ##
==========================================
+ Coverage 83.52% 89.15% +5.62%
==========================================
Files 43 43
Lines 1026 1033 +7
Branches 239 241 +2
==========================================
+ Hits 857 921 +64
+ Misses 168 111 -57
Partials 1 1 ☔ View full report in Codecov by Sentry. |
Signed-off-by: SuZhou-Joe <[email protected]>
@@ -142,7 +143,11 @@ export function registerChatRoutes(router: IRouter, routeOptions: RoutesOptions) | |||
request, | |||
response | |||
): Promise<IOpenSearchDashboardsResponse<HttpResponsePayload | ResponseError>> => { | |||
const { messages = [], input, sessionId: sessionIdInRequestBody, rootAgentId } = request.body; | |||
if (!routeOptions.rootAgentId) { | |||
context.assistant_plugin.logger.error(AgentIdNotFoundError); |
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 add similar warning message when OSD startup if chat is enabled and rootAgentId not configured?
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.
Sure, sounds reasonable.
Signed-off-by: SuZhou-Joe <[email protected]>
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.
i remember the plan for getting agent_id was to search for the agent first, then fallback to config yaml if there are multiple or no match. Will that be a separate PR or did that plan change?
@@ -74,7 +75,7 @@ export class AssistantPlugin | |||
const checkAccess = (account: Awaited<ReturnType<typeof getAccount>>) => | |||
account.data.roles.some((role) => ['all_access', 'assistant_user'].includes(role)); | |||
|
|||
if (this.config.chat.enabled) { | |||
if (this.config.chat.enabled && this.config.chat.rootAgentId) { |
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.
maybe we still want to show chat UI since it will receive AgentIdNotFoundError
as response
dashboards-assistant/server/routes/chat_routes.ts
Lines 146 to 149 in 7862f42
if (!routeOptions.rootAgentId) { | |
context.assistant_plugin.logger.error(AgentIdNotFoundError); | |
return response.custom({ statusCode: 400, body: AgentIdNotFoundError }); | |
} |
to let web users know why chat is not available?
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.
Yeah, but the final solution has changed and no matter how we are gonna to remove the rootAgentId in request payload. Will optimize this part in another PR.
Is there a default root agent id? or could we update the dev docs to get this root agent id? |
There is not a default root agent id, and there will be a doc in flow plugin to instruct how to setup a root agent id. |
Description
For 2.12, we will store the root agent id into opensearch_dashboards.yml file and only cluster admin will be able to modify that.
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.