Skip to content

Commit

Permalink
Adjust to the change of Get config API
Browse files Browse the repository at this point in the history
Signed-off-by: gaobinlong <[email protected]>
  • Loading branch information
gaobinlong committed Sep 3, 2024
1 parent 474ef28 commit 50c4628
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions server/routes/assistant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,14 @@ export default class AssistantService {
});

if (
!getAgentResponse ||
!getAgentResponse['configuration'] ||
!getAgentResponse['configuration']['agent_id']
!getAgentResponse || !(getAgentResponse.ml_configuration?.agent_id || getAgentResponse.configuration?.agent_id)
) {
throw new Error(
'Cannot get flow agent id for generating anomaly detector'
);
}

const agentId = getAgentResponse['configuration']['agent_id'];
const agentId = getAgentResponse.ml_configuration?.agent_id || getAgentResponse.configuration?.agent_id;

const executeAgentResponse = await callWithRequest('ml.executeAgent', {
agentId: agentId,
Expand Down

0 comments on commit 50c4628

Please sign in to comment.