@threadplane/chatTypeAliasv0.3.4

ContentBlock

A structured message segment containing text, an image, a tool invocation, or a tool result.

import type { ContentBlock } from '@threadplane/chat';

Declaration

export type ContentBlock = {
    type: 'text';
    text: string;
} | {
    type: 'image';
    url: string;
    alt?: string;
} | {
    type: 'tool_use';
    id: string;
    name: string;
    args: unknown;
} | {
    type: 'tool_result';
    toolCallId: string;
    result: unknown;
    isError?: boolean;
};