UNPKG

@tanstack/ai

Version:

Type-safe TypeScript AI SDK for streaming chat, tool calling, agents, structured outputs, and multimodal generation.

14 lines (13 loc) • 665 B
import { MessageSource, ModelMessage } from '../types.js'; export type ReplayToolIdRule = (id: string, context: { foreign: boolean; source: MessageSource | undefined; attempt: number; }) => string; export interface ReplayMessages { messages: Array<ModelMessage>; } /** The pi shortHash algorithm, over UTF-16 code units. */ export declare function hashToolCallId(id: string): string; /** Build a provider request without changing stored history. An absent target only cleans history. */ export declare function transformMessagesForReplay(original: ReadonlyArray<ModelMessage>, target?: MessageSource, toolIdRule?: ReplayToolIdRule): ReplayMessages;