Skip to content

Function: isTextBlock()

@providerprotocol/ai


@providerprotocol/ai / @providerprotocol/ai / isTextBlock

isTextBlock(block): block is TextBlock

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

Type guard for TextBlock.

ContentBlock

The content block to check

block is TextBlock

True if the block is a TextBlock

if (isTextBlock(block)) {
console.log(block.text);
}