Skip to content

Commit

Permalink
switch to ml_configuration in agent response as backend changed
Browse files Browse the repository at this point in the history
Signed-off-by: Heng Qian <[email protected]>
  • Loading branch information
qianheng-aws committed Jul 24, 2024
1 parent beac8cc commit b2610ca
Showing 1 changed file with 2 additions and 2 deletions.
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;
} catch (error) {
const errorMessage = JSON.stringify(error.meta?.body) || error;
throw new Error(`get agent ${id} failed, reason: ${errorMessage}`);
Expand Down

0 comments on commit b2610ca

Please sign in to comment.