Skip to content

Commit

Permalink
Update basic_assistant.js
Browse files Browse the repository at this point in the history
  • Loading branch information
serefyarar committed Jun 27, 2024
1 parent 0adc761 commit 3ab5701
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/src/agents/basic_assistant.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const handleUserMessage = async (

try {
// Find the index of the item with the specific id
const questionIndex = messages.findIndex((m) => m.id === id);
const questionIndex = messages.findIndex((m) => m.id === message.id);

// If the item is found, filter out the item and all subsequent items
const chat_history =
Expand All @@ -47,7 +47,7 @@ export const handleUserMessage = async (
input: {
question: messages[questionIndex].content,
chat_history: chat_history
.filter((m) => m.id !== id)
.filter((m) => m.id !== message.id)
.map((c) => {
return {
id: c.id,
Expand Down

0 comments on commit 3ab5701

Please sign in to comment.