You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've got my Q & A bot working with private data, works really well! I was wondering if there are any native methods yet to retrieve the chat history of a conversation yet? If not I'll probably add it to the system prompt but that is not ideal since it would quickly balloon the prompt size..
Would it make sense to basically use the Memory store and save a message conversation on the fly and vectorize that to use the the memory/history?
I also found this and maybe that is your recommended approach?
public function answerQuestionFromChat(array $messages): StreamedResponse
{
// First we need to give the context to openAI with the good instructions
$userQuestion = $messages[count($messages) - 1]->content;
$systemMessage = $this->searchDocumentAndCreateSystemMessage($userQuestion);
$this->openAIChat->setSystemMessage($systemMessage);
// Then we can just give the conversation
return $this->openAIChat->generateChatStream($messages);
}
Thanks in advance for your help :-)
The text was updated successfully, but these errors were encountered:
Hey @BoweFrankema ,
Did you have a look at the example qa-chatbot-laravel-vercel? The basic idea is that your frontend has the history of the chat and can send it to the back (see here).
It can work well for quite a lot of messages. After that you may need to summarize the conversation instead of sending all the messages or just send the last messages. They are multiple strategy for this.
I did not see that! This is basically exactly how I wanted to solve it.. I am already storing the conversation in a Laravel model so I'll follow that example.. maybe I'll count the total characters and then see if I can run a seperate API request to summarise once it hits a certain size to summarise. Thank you Maxime!
I've got my Q & A bot working with private data, works really well! I was wondering if there are any native methods yet to retrieve the chat history of a conversation yet? If not I'll probably add it to the system prompt but that is not ideal since it would quickly balloon the prompt size..
Would it make sense to basically use the Memory store and save a message conversation on the fly and vectorize that to use the the memory/history?
I also found this and maybe that is your recommended approach?
Thanks in advance for your help :-)
The text was updated successfully, but these errors were encountered: