Public declaration syntax from forge-ts/packages/forge-core/src/message.ts Original source SHA-256: 7d44394ef531c2ec2bec273b651b8b82a98919738cebe4f9f5b27c3dfa75304b Function bodies and constant values are omitted. This is not the complete implementation. Source line 21 export const Role /* type inferred in source */; Source line 33 export type Role = (typeof Role)[keyof typeof Role]; Source line 43 export interface TextPart { readonly type: 'text'; /** The text content. */ readonly text: string; } Source line 57 export interface ImagePart { readonly type: 'image'; /** Base64-encoded image data, or a URL. */ readonly data: string; /** MIME type (e.g., "image/png"). */ readonly mediaType: string; } Source line 78 export interface ToolCallPart { readonly type: 'tool_call'; /** Unique identifier for this tool call. */ readonly id: string; /** The tool name. */ readonly name: string; /** JSON arguments for the tool. */ readonly arguments: unknown; } Source line 102 export interface ToolResultPart { readonly type: 'tool_result'; /** The tool call ID this result corresponds to. */ readonly toolCallId: string; /** The tool name. */ readonly name: string; /** The result content (typically stringified). */ readonly content: string; /** Whether the tool execution resulted in an error. */ readonly isError: boolean; } Source line 120 export type MessagePart = TextPart | ImagePart | ToolCallPart | ToolResultPart; Source line 133 export function textPart(text: string): TextPart; Source line 149 export function imagePart(data: string, mediaType: string): ImagePart; Source line 166 export function toolCallPart(id: string, name: string, args: unknown): ToolCallPart; Source line 184 export function toolResultPart( toolCallId: string, name: string, content: string, isError: boolean ): ToolResultPart; Source line 199 export function isToolCall(part: MessagePart): part is ToolCallPart; Source line 209 export function isToolResult(part: MessagePart): part is ToolResultPart; Source line 224 export interface ModelMessage { /** The message participant role. */ readonly role: Role; /** One or more content parts. */ readonly parts: readonly MessagePart[]; } Source line 243 export function createMessage(role: Role, parts: MessagePart[]): ModelMessage; Source line 259 export function createTextMessage(role: Role, text: string): ModelMessage; Source line 274 export function getToolCalls(message: ModelMessage): readonly ToolCallPart[]; Source line 289 export function getTextContent(message: ModelMessage): string;