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
When using useChat() for ai/react with @ai-sdk/openai, experimental_attachments only works with handleSubmit().
reload() and append() don't handle the attachments given via experimental_attachments.
Code example
import{useChat}from'ai/react';const{ handleSubmit, append, reload }=useChat();// ...handleSubmit(event,{experimental_attachments: files});// Works as expected// ...reload({experimental_attachments: files});// Doesn't add attachments to the message// ...append({role: 'user',content: 'What do you see in this image?',experimental_attachments: files});// Adds the message without attachments
Description
When using
useChat()
forai/react
with@ai-sdk/openai
,experimental_attachments
only works withhandleSubmit()
.reload()
andappend()
don't handle the attachments given viaexperimental_attachments
.Code example
AI provider
@ai-sdk/openai v1.1.2
Additional context
The package version is up-to-date: v4.1.5
I use the following code for handling requests:
The text was updated successfully, but these errors were encountered: