Skip to content

Commit

Permalink
fixed incorrect message id field used
Browse files Browse the repository at this point in the history
ml-commons changed the agent execution response { name:
'parent_interaction_id' } to { name: 'parent_message_id' }
for conversational_flow type of agent.
This commit update the fields used at FE to make it work for both case.

Signed-off-by: Yulong Ruan <[email protected]>
  • Loading branch information
ruanyl committed Dec 18, 2024
1 parent 581a7ca commit 3a33028
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions server/services/chat/olly_chat_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ interface AgentRunPayload {
}

const MEMORY_ID_FIELD = 'memory_id';
const INTERACTION_ID_FIELD = 'parent_interaction_id';
const INTERACTION_ID_FIELDS = ['parent_message_id', 'parent_interaction_id'];

export class OllyChatService implements ChatService {
static abortControllers: Map<string, AbortController> = new Map();
Expand Down Expand Up @@ -67,7 +67,9 @@ export class OllyChatService implements ChatService {
}>;
const outputBody = agentFrameworkResponse.body.inference_results?.[0]?.output;
const conversationIdItem = outputBody?.find((item) => item.name === MEMORY_ID_FIELD);
const interactionIdItem = outputBody?.find((item) => item.name === INTERACTION_ID_FIELD);
const interactionIdItem = outputBody?.find((item) =>
INTERACTION_ID_FIELDS.includes(item.name)
);
return {
/**
* Interactions will be stored in Agent framework,
Expand Down

0 comments on commit 3a33028

Please sign in to comment.