Skip to content

Commit

Permalink
feat: Update toDataStreamResponse method for chat and cohere routes a…
Browse files Browse the repository at this point in the history
…nd dependencies
  • Loading branch information
zaidmukaddam committed Aug 27, 2024
1 parent 9b1c403 commit 3d936f9
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 39 deletions.
2 changes: 1 addition & 1 deletion app/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export async function suggestQuestions(history: any[]) {
model: groq('llama-3.1-70b-versatile'),
temperature: 0,
system:
`You are a search engine query generator. You 'have' to create 3 questions for the search engine based on the message history which has been provided to you.
`You are a search engine query generator. You 'have' to create only '3' questions for the search engine based on the message history which has been provided to you.
The questions should be open-ended and should encourage further discussion while maintaining the whole context. Limit it to 5-10 words per question.
Always put the user input's context is some way so that the next search knows what to search for exactly.
Try to stick to the context of the conversation and avoid asking questions that are too general or too specific.
Expand Down
2 changes: 1 addition & 1 deletion app/api/chat/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -439,5 +439,5 @@ When asked a "What is" question, maintain the same format as the question and an
toolChoice: "auto",
});

return result.toAIStreamResponse();
return result.toDataStreamResponse();
}
2 changes: 1 addition & 1 deletion app/api/cohere/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -401,5 +401,5 @@ Remember to always run the appropriate tool(s) first and compose your response b
toolChoice: "auto",
});

return result.toAIStreamResponse();
return result.toDataStreamResponse();
}
106 changes: 70 additions & 36 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3d936f9

Please sign in to comment.