Variable: ContentBlockType
@providerprotocol/ai / @providerprotocol/ai / ContentBlockType
Variable: ContentBlockType
Section titled “Variable: ContentBlockType”
constContentBlockType:object
Defined in: src/types/content.ts:27
Content block type constants.
Use these constants instead of raw strings for type-safe content handling:
Type Declaration
Section titled “Type Declaration”
readonlyAudio:"audio"='audio'
Audio content
Binary
Section titled “Binary”
readonlyBinary:"binary"='binary'
Binary/arbitrary data content
Document
Section titled “Document”
readonlyDocument:"document"='document'
Document content (PDFs, text files)
readonlyImage:"image"='image'
Image content
Reasoning
Section titled “Reasoning”
readonlyReasoning:"reasoning"='reasoning'
Reasoning/thinking content from extended thinking models
readonlyText:"text"='text'
Text content
readonlyVideo:"video"='video'
Video content
Example
Section titled “Example”import { ContentBlockType } from 'upp';
if (block.type === ContentBlockType.Text) { console.log(block.text);} else if (block.type === ContentBlockType.Image) { console.log(block.mimeType);}