We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
So I'm having the same issue as this user: #1290
I'm using the vercel ai chat template and I've implemented a custom ai provider. Like shaded-blue mentioned, messages dissapear from my aistate.
`sync function submitUserMessage(content: string) { 'use server'
const aiState = getMutableAIState()
console.log('this is content', content)
// Retrieve the current messages before the update const currentMessages = aiState.get().messages;
// Log the number of messages currently stored console.log('Current number of messages before update:', currentMessages.length);
// Log each message in the current state currentMessages.forEach((msg, index) => { console.log(Message ${index + 1}:, msg); }); `
Message ${index + 1}:
When I have this in chat/lib/chat/actions.tsx - on each user message the current messages performs weird, showing different things like 0/1
sync function submitUserMessage(content: string) { 'use server'
// Log each message in the current state currentMessages.forEach((msg, index) => { console.log(Message ${index + 1}:, msg); });
No response
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Description
So I'm having the same issue as this user: #1290
I'm using the vercel ai chat template and I've implemented a custom ai provider.
Like shaded-blue mentioned, messages dissapear from my aistate.
`sync function submitUserMessage(content: string) {
'use server'
const aiState = getMutableAIState()
console.log('this is content', content)
// Retrieve the current messages before the update
const currentMessages = aiState.get().messages;
// Log the number of messages currently stored
console.log('Current number of messages before update:', currentMessages.length);
// Log each message in the current state
currentMessages.forEach((msg, index) => {
console.log(
Message ${index + 1}:
, msg);});
`
When I have this in chat/lib/chat/actions.tsx - on each user message the current messages performs weird, showing different things like 0/1
Code example
sync function submitUserMessage(content: string) {
'use server'
const aiState = getMutableAIState()
console.log('this is content', content)
// Retrieve the current messages before the update
const currentMessages = aiState.get().messages;
// Log the number of messages currently stored
console.log('Current number of messages before update:', currentMessages.length);
// Log each message in the current state
currentMessages.forEach((msg, index) => {
console.log(
Message ${index + 1}:
, msg);});
Additional context
No response
The text was updated successfully, but these errors were encountered: