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

switch to ml_configuration in agent response as backend changed #239

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions server/routes/get_agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ export const getAgent = async (id: string, client: OpenSearchClient['transport']
path,
});

if (!response || !response.body.configuration?.agent_id) {
if (!response || !response.body.ml_configuration?.agent_id) {
throw new Error(`cannot get agent ${id} by calling the api: ${path}`);
}
return response.body.configuration.agent_id;
return response.body.ml_configuration.agent_id;
qianheng-aws marked this conversation as resolved.
Show resolved Hide resolved
} catch (error) {
const errorMessage = JSON.stringify(error.meta?.body) || error;
throw new Error(`get agent ${id} failed, reason: ${errorMessage}`);
Expand Down
Loading