-
|
Hi, i have a db that stores all messages from ai and user. However, when using chat on reload ai cannot remember previous messages. How can I feed this messages from user using Vercel AI SDK? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
You need to store the user's ID or some other identification and pass that as the |
Beta Was this translation helpful? Give feedback.
-
|
This discussion was automatically locked because it has not been updated in over 30 days. If you still have questions about this topic, please ask us at community.vercel.com/ai-sdk |
Beta Was this translation helpful? Give feedback.
You need to store the user's ID or some other identification and pass that as the
messagesto the API call. On the client, you can pass the initial messages to theuseChathook withsetMessages. See https://sdk.vercel.ai/docs/api-reference/use-chat#chat-helpers