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
#kind
T
#Returns
(Extract<TextPart, { type: T; }> | Extract<ImagePart, { type: T; }> | Extract<AudioPart, { type: T; }> | Extract<VideoPart, { type: T; }> | Extract<FilePart, { type: T; }>)[]