function fileSourceFromHandle<TProvider>(handle): ContentPartFileSource<TProvider>;Defined in: packages/ai/src/activities/files/index.ts:104
Build a { type: 'file' } content source from an uploaded FileHandle, for use in a chat message (image/audio/document part source).
The source's value is the handle's wire form: the handle URL when the provider exposes one (Gemini, fal, Grok), otherwise the opaque id (OpenAI, Anthropic). provider records the issuer, so an adapter for a different provider rejects the source rather than sending a handle it cannot resolve.
TProvider extends string
FileHandle<TProvider>
ContentPartFileSource<TProvider>
const handle = await uploadFile({ adapter: openaiFiles(), input })
messages.push({ role: 'user', content: [
{ type: 'image', source: fileSourceFromHandle(handle) },
] })