Skip to content

Commit

Permalink
chore: update chat response to look at both the content and answer fi…
Browse files Browse the repository at this point in the history
…elds
  • Loading branch information
lholmquist committed Jan 31, 2025
1 parent c9ba007 commit 5c3a960
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/routes/chatbot-ws-route.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ async function chatbotWSRoute (fastify, options) {
const answerStream = await chat(JSONmessage, ws);

for await (const chunk of answerStream) {
console.log(`Got Chat Response: ${chunk.content}`);
console.log(`Got Chat Response: ${chunk.content || chunk.answer}`);

//'{"type":"token","token":" Hello","source":""}'
const formattedAnswer = {
type: 'token',
token: chunk.content,
token: chunk.content || chunk.answer,
source: ''
};

Expand Down

0 comments on commit 5c3a960

Please sign in to comment.