Skip to content

Variable: ContentBlockType

@providerprotocol/ai


@providerprotocol/ai / @providerprotocol/ai / ContentBlockType

const ContentBlockType: object

Defined in: src/types/content.ts:27

Content block type constants.

Use these constants instead of raw strings for type-safe content handling:

readonly Audio: "audio" = 'audio'

Audio content

readonly Binary: "binary" = 'binary'

Binary/arbitrary data content

readonly Document: "document" = 'document'

Document content (PDFs, text files)

readonly Image: "image" = 'image'

Image content

readonly Reasoning: "reasoning" = 'reasoning'

Reasoning/thinking content from extended thinking models

readonly Text: "text" = 'text'

Text content

readonly Video: "video" = 'video'

Video content

import { ContentBlockType } from 'upp';
if (block.type === ContentBlockType.Text) {
console.log(block.text);
} else if (block.type === ContentBlockType.Image) {
console.log(block.mimeType);
}