Skip to content

Commit 50c4628

Browse files
committed
Adjust to the change of Get config API
Signed-off-by: gaobinlong <gbinlong@amazon.com>
1 parent 474ef28 commit 50c4628

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

server/routes/assistant.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,14 @@ export default class AssistantService {
5656
});
5757

5858
if (
59-
!getAgentResponse ||
60-
!getAgentResponse['configuration'] ||
61-
!getAgentResponse['configuration']['agent_id']
59+
!getAgentResponse || !(getAgentResponse.ml_configuration?.agent_id || getAgentResponse.configuration?.agent_id)
6260
) {
6361
throw new Error(
6462
'Cannot get flow agent id for generating anomaly detector'
6563
);
6664
}
6765

68-
const agentId = getAgentResponse['configuration']['agent_id'];
66+
const agentId = getAgentResponse.ml_configuration?.agent_id || getAgentResponse.configuration?.agent_id;
6967

7068
const executeAgentResponse = await callWithRequest('ml.executeAgent', {
7169
agentId: agentId,

0 commit comments

Comments
 (0)