From ef79b7d617035c52fea159225ba9a39b8222e8f4 Mon Sep 17 00:00:00 2001 From: "A.J. Shulman" Date: Mon, 15 Jul 2024 12:31:35 -0400 Subject: citation parsing working much better --- src/client/views/nodes/ChatBox/Agent.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/client/views/nodes/ChatBox/Agent.ts') diff --git a/src/client/views/nodes/ChatBox/Agent.ts b/src/client/views/nodes/ChatBox/Agent.ts index 6757b2ce8..fd3c6e5e8 100644 --- a/src/client/views/nodes/ChatBox/Agent.ts +++ b/src/client/views/nodes/ChatBox/Agent.ts @@ -95,6 +95,8 @@ export class Agent { break; } else { console.log('Error: No valid action'); + this.interMessages.push({ role: 'user', content: 'No valid action, try again.' }); + break; } } else if (key === 'action_input') { const actionInput = builder.build({ action_input: step[key] }); @@ -116,11 +118,7 @@ export class Agent { } } else if (key === 'answer') { console.log('Answer found. Ending query.'); - const answerContent = builder.build({ answer: step[key] }); - this.messages.push({ role: 'assistant', content: answerContent }); - this.interMessages = []; - console.log(this.messages); - return answerContent; + return result; } } } -- cgit v1.2.3-70-g09d2