Mastra Migration (0.24.6 to 1.0.0-beta.9): FilePart to chatRoute stream not working anymore
We are currently migrating from Mastra version 0.24.6 to 1.0.0-beta.9.
We previously managed to attach files to our chat messages with this code:
Where userInput.files is an array of FilePart objects like:
The issue is that data is not a base64 url, but a real public url like, for example, https://fastly.picsum.photos/id/966/200/300.jpg?hmac=vBALR2x0cV-keVNLecwjd8ZluSHv17AHDvpiYjBqar0
Previously this worked perfectly, the Mastra server was able to process it and answer accordingly, but now we are getting this error:
I know from reading the AI SDK documentation that the data part should be base64, but I can't figure out why the problem only started happening after the migration.
Can you help us?
Thank you in advance
We previously managed to attach files to our chat messages with this code:
Where userInput.files is an array of FilePart objects like:
The issue is that data is not a base64 url, but a real public url like, for example, https://fastly.picsum.photos/id/966/200/300.jpg?hmac=vBALR2x0cV-keVNLecwjd8ZluSHv17AHDvpiYjBqar0
Previously this worked perfectly, the Mastra server was able to process it and answer accordingly, but now we are getting this error:
AI_APICallError: Invalid 'input[3].content[0].image_url'. Expected a base64-encoded data URL with an image MIME type (e.g. 'data:image/png;base64,aW1nIGJ5dGVzIGhlcmU='), but got empty base64-encoded bytes.I know from reading the AI SDK documentation that the data part should be base64, but I can't figure out why the problem only started happening after the migration.
Can you help us?
Thank you in advance