import { FtAgentRagChatResponseFormat, FtSemanticSearchKeyValueFilter } from "../types/ft-server/public"; export interface BaseChunkError { code: number; name: string; message: string; } export interface FtCompletionChunk { id?: string; message?: string; error?: BaseChunkError; } export interface FtRagChunk { id?: string; message?: FtRagJsonMessage | string; error?: BaseChunkError; } export interface FtRagJsonMessage { answer: string; documents?: FtRagJsonDocument[]; } export interface FtRagJsonDocument { url: string; title: string; content: string; } export type FtAgenticChatChunk = FtAgenticChatResponseChunk | FtAgenticChatToolCall | FtAgenticChatReasoning | FtAgenticChatError; export interface FtAgenticChatResponseChunk { type: "response"; content: Partial; } export interface FtAgenticChatToolCall { type: "tool_call"; tool_call_id: string; tool_name: string; args: FtAgenticChatSearchToolCallArgs | FtAgenticChatReadToolCallArgs; } export interface FtAgenticChatSearchToolCallArgs { query: string; filters?: FtSemanticSearchKeyValueFilter[]; } export interface FtAgenticChatReadToolCallArgs { depth?: number; limit?: number; offset?: number; scope?: string; publicationId?: string; tocId?: string; mapTitle?: string; mapUrl?: string; sectionUrl?: string; sectionTitle?: string; } export interface FtAgenticChatReasoning { type: "reasoning"; content: string; } export interface FtAgenticChatError { error: BaseChunkError; } export declare class AIChunkReader { private readonly reader; private decoder; private partialChunk; constructor(reader: ReadableStreamDefaultReader); read(): AsyncGenerator; private readRemainingChunks; private readChunksFromValue; private parseLine; }