@tanstack/ai
Version:
Type-safe TypeScript AI SDK for streaming chat, tool calling, agents, structured outputs, and multimodal generation.
32 lines (31 loc) • 984 B
TypeScript
import { InterruptSubmissionError } from '../interrupts.js';
import { ContentPart, StreamChunk, ToolOutputState } from '../types.js';
/**
* Adapter / engine yield before normalize. Public StreamChunk is spec-only.
* This type still allows the old extra fields.
*/
export type AdapterYieldChunk = StreamChunk & {
model?: string;
finishReason?: 'stop' | 'length' | 'content_filter' | 'tool_calls' | null;
usage?: any;
content?: string;
args?: string;
toolName?: string;
toolCallName?: string;
index?: number;
input?: unknown;
output?: unknown;
result?: string | Array<ContentPart>;
state?: ToolOutputState | Record<string, unknown>;
stepId?: string;
stepType?: string;
delta?: string | ReadonlyArray<unknown>;
signature?: string;
error?: {
message: string;
code?: string;
};
'tanstack:interruptErrors'?: ReadonlyArray<InterruptSubmissionError>;
threadId?: string;
runId?: string;
};