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

isContentPart.md

26 lines545 Bytes

1---
2id: isContentPart
3title: isContentPart
4---
5​
6# Function: isContentPart()
7​
8```ts
9function isContentPart(value): value is ContentPart;
10```
11​
12Defined in: [packages/ai/src/utilities/tool-result.ts:16](https://github.com/TanStack/ai/blob/main/packages/ai/src/utilities/tool-result.ts#L16)
13​
14Structural check for a single `ContentPart`. A text part must carry a string
15`content`; every other modality must carry a `source` with `type` of
16`'url' | 'data'` and a string `value`.
17​
18## Parameters
19​
20### value
21​
22`unknown`
23​
24## Returns
25​
26`value is ContentPart`