Make it possible to provide a custom download
implementation #3929
Open
Description
Feature Description
Hey! Thanks a ton for the super nice package! 🙌
I was wondering if the ability to customize downloadImplementation
s could be exposed to streamText
via an option.
It seems that the feature is almost there! 👀 I noticed that convertToLanguageModelPrompt
can accept a custom downloadImplementation
:
ai/packages/ai/core/prompt/convert-to-language-model-prompt.ts
Lines 21 to 26 in c738971
So essentially, have this
ai/packages/ai/core/generate-text/stream-text.ts
Lines 431 to 439 in c738971
also provide that option.
Would it be something that we could add to support?
Use Cases
This would make it possible to:
- Get images from somewhere else, not necessarily by making a fetch call. E.g., from an R2 bucket in Cloudflare
- Transform the URL
Additional context
No response