Skip to content
Source
Sign inSign up
TanStack/ai
Open History to see the last commit

ContentPartFileSource.md

46 lines1.2 KB

1---
2id: ContentPartFileSource
3title: ContentPartFileSource
4---
5​
6Defined in: [packages/ai/src/types.ts:264](https://github.com/TanStack/ai/blob/main/packages/ai/src/types.ts#L264)
7​
8A provider-issued file handle (Files API). AG-UI `FileSource`: the handle
9is opaque, do not fetch or parse it.
10​
11The media is uploaded once via a `files` adapter (`openaiFiles()`,
12`anthropicFiles()`, `geminiFiles()`, `grokFiles()`, `falFiles()`) and
13referenced here by the returned handle instead of re-sending base64 or a
14public URL on each request. Only the provider that minted a handle can
15resolve it. Adapters that cannot consume file handles at all are rejected
16by the activity-layer preflight before mapping starts.
17​
18## Extends
19​
20- `FileSource`
21​
22## Type Parameters
23​
24### TProvider
25​
26`TProvider` *extends* `string` = `string`
27​
28## Properties
29​
30### provider?
31​
32```ts
33optional provider?: TProvider;
34```
35​
36Defined in: [packages/ai/src/types.ts:272](https://github.com/TanStack/ai/blob/main/packages/ai/src/types.ts#L272)
37​
38The adapter name of the provider that issued the handle (`'openai'`,
39`'gemini'`, ...), the same id TanStack reports as the usage provider.
40When present, an adapter rejects a handle another provider issued.
41​
42#### Overrides
43​
44```ts
45AGUIFileSource.provider
46```