agentskit.js

filterParts

Auto-generated API reference for filterParts.

Function: filterParts()

filterParts<T>(parts, kind): (Extract<TextPart, { type: T; }> | Extract<ImagePart, { type: T; }> | Extract<AudioPart, { type: T; }> | Extract<VideoPart, { type: T; }> | Extract<FilePart, { type: T; }>)[]

Defined in: packages/core/src/types/content.ts:118

Filter parts by kind.

#Type Parameters

#T

T extends "text" | "image" | "audio" | "video" | "file"

#Parameters

#parts

ContentPart[]

#kind

T

#Returns

(Extract<TextPart, { type: T; }> | Extract<ImagePart, { type: T; }> | Extract<AudioPart, { type: T; }> | Extract<VideoPart, { type: T; }> | Extract<FilePart, { type: T; }>)[]

Explore nearby

✎ Edit this page on GitHub·Found a problem? Open an issue →·How to contribute →

On this page