diff options
| author | A.J. Shulman <Shulman.aj@gmail.com> | 2024-07-15 12:31:35 -0400 |
|---|---|---|
| committer | A.J. Shulman <Shulman.aj@gmail.com> | 2024-07-15 12:31:35 -0400 |
| commit | ef79b7d617035c52fea159225ba9a39b8222e8f4 (patch) | |
| tree | 2ad28baadada16e2688f922c906216b39652c28b /src/client/views/nodes/ChatBox/Agent.ts | |
| parent | f1cdfc1d02488c4a513fbf67f729f702526a345d (diff) | |
citation parsing working much better
Diffstat (limited to 'src/client/views/nodes/ChatBox/Agent.ts')
| -rw-r--r-- | src/client/views/nodes/ChatBox/Agent.ts | 8 |
1 files changed, 3 insertions, 5 deletions
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; } } } |
