UNPKG

llmforge

Version:

One API, every AI model, instant switching. Change from GPT-4 to Gemini to local models with a single config update. LLMForge is the lightweight, TypeScript-first solution for multi-provider AI applications with zero vendor lock-in.

17 lines (16 loc) 653 B
import { StreamChunk, GenerateContentResponse } from '../../types'; export interface StreamOptions { onChunk?: (chunk: StreamChunk) => void; onComplete?: (response: GenerateContentResponse) => void; onError?: (error: Error) => void; onThinking?: (thinking: string) => void; } export declare class StreamProcessor { private decoder; processStream(response: Response, options?: StreamOptions): Promise<GenerateContentResponse>; private parseStreamChunk; private hasThinkingContent; private extractThinkingContent; private aggregateChunk; createAsyncGenerator(response: Response): AsyncGenerator<StreamChunk>; }