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

DocumentPart.md

52 lines972 Bytes

1---
2id: DocumentPart
3title: DocumentPart
4---
5​
6# Interface: DocumentPart\<TMetadata\>
7​
8Defined in: [types.ts:160](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L160)
9​
10Document content part for multimodal messages (e.g., PDFs).
11​
12## Type Parameters
13​
14### TMetadata
15​
16`TMetadata` = `unknown`
17​
18Provider-specific metadata type (e.g., Anthropic's media_type)
19​
20## Properties
21​
22### metadata?
23​
24```ts
25optional metadata: TMetadata;
26```
27​
28Defined in: [types.ts:165](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L165)
29​
30Provider-specific metadata (e.g., media_type for PDFs)
31​
32***
33​
34### source
35​
36```ts
37source: ContentPartSource;
38```
39​
40Defined in: [types.ts:163](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L163)
41​
42Source of the document content
43​
44***
45​
46### type
47​
48```ts
49type: "document";
50```
51​
52Defined in: [types.ts:161](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L161)