Closed
Description
Description
I'm doing a pretty standard streamText
on the back-end with useChat()
on the front-end.
If I send this from the client, the LLM tells me it can't access any files.
append({
role: "user",
content: "what is in this file?"
parts: [
{ type: "text", text: "what is in this file?" },
{ type: "file", mimeType: "application/pdf", data: "data:application/pdf;base64,…" }
]
})
but if I do this
append({
role: "user",
content: "what is in this file?"
parts: [
{ type: "text", text: "what is in this file?" }
]
},
{
experimental_attachments: [
{ name: "file", contentType: "application/pdf", data: "data:application/pdf;base64,…" }
]
})
it works.
I'm probably doing something wrong, but shouldn't the former also work?
AI SDK Version
ai@4.3.16
@ai-sdk/google@1.2.19