-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Saving chat history in PostgreSQL #96
Comments
There are many ways to save your data, I've changed onChunk to create a temp and save those values there than send to a job, but I've moved away of it The simplest one will be on the client side with onFinish method const { messages, append, setMessages } = useChat({
api: `${baseUrl}api/chat`,
onFinish: (message: Message) => {
saveMessageInBackground(message.content);
},
}); |
ronal2do
added a commit
to ronal2do/rag-chat
that referenced
this issue
Dec 21, 2024
- Implemented an `onFinish` callback. - Added a new test. closes upstash#96
@rajdeep-ghosh this PR aims to implement onFinish callback |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Saving chat history in Redis is very simple, but for my use case, I want to save all the chat history in Postgres. How do I do this?
Like in Vercel AI SDK we can call the
onStart
andonCompletion
callbacks on the stream to save data into dbAs
ragChat.chat()
oraiUseChatAdapter
does not provide any such methods, how can I achieve a similar experience?Stack: - upstash/rag-chat & vercel ai sdk
The text was updated successfully, but these errors were encountered: