Replies: 5 comments 2 replies
-
|
When you create a new assistant thread, have you tried creating an initial user and assistant message using their API? https://platform.openai.com/docs/api-reference/messages/createMessage |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
|
How does that work in the new version 5? |
Beta Was this translation helpful? Give feedback.
-
You're right — just adding a message to the messages state only updates the UI, it doesn’t actually initialize a thread or trigger the model pipeline. To make the assistant start the conversation (and have it included in the thread state), you need to submit an assistant message via the useActions API instead of directly mutating the UI state.
|
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.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello!
I'm sure this is obvious. How can I make the assistant start the conversation with the user? I'm using the https://chat.vercel.ai/ codebase and I just want the assistant to start the conversation with the user instead of the user having to make the first move.
Of course I can just "fake it" in the UI but I want the thread to be aware of this first message. Just adding it to the messages array doesn't seen to do it. Like this:
Beta Was this translation helpful? Give feedback.
All reactions