import { BaseLLM, ChatParams, ChatResult, ClassifyParams, ClassifyResult, SummarizeParams, SummarizeResult, ChatMessage } from '@memberjunction/ai'; import { Mistral } from "@mistralai/mistralai"; export declare class MistralLLM extends BaseLLM { private _client; private _streamingCancellationToken; private _streamingState; constructor(apiKey: string); get Client(): Mistral; /** * Mistral supports streaming */ get SupportsStreaming(): boolean; /** * Mistral natively supports assistant prefill via the prefix flag */ get SupportsPrefill(): boolean; /** * Implementation of non-streaming chat completion for Mistral */ protected nonStreamingChatCompletion(params: ChatParams): Promise; /** * Reset streaming state for a new request */ protected resetStreamingState(): void; /** * Build the per-call Mistral {@link RequestOptions}, threading the caller's cancellation token * through as the `fetch` request's `signal`. `RequestOptions` extends `RequestInit`, so the * signal reaches the underlying `fetch` directly and an abort tears down the HTTP socket. */ private buildRequestOptions; /** Throw immediately (before any socket is opened) when the caller has already cancelled. */ private throwIfCancelled; /** The canonical abort error we raise for a pre-aborted request, shaped like fetch's own. */ private createCancellationError; /** True when this failure is the caller's cancellation rather than a provider/network fault. */ private isCancelled; /** Human-readable reason for a cancellation, preferring the signal's own reason when present. */ private describeCancellation; /** * Build the typed ChatResult for a cancelled request — a normal failed ChatResult, the same * shape every other Mistral error path produces, never an unhandled rejection. */ private buildCancelledResult; /** * Create a streaming request for Mistral */ protected createStreamingRequest(params: ChatParams): Promise; /** * Process a streaming chunk from Mistral */ protected processStreamingChunk(chunk: any): { content: string; finishReason?: string; usage?: any; }; /** * Process pending content to extract thinking blocks * Returns content that should be emitted to the user */ private processThinkingInStreamingContent; /** * Create the final response from streaming results for Mistral */ protected finalizeStreamingResponse(accumulatedContent: string | null | undefined, lastChunk: any | null | undefined, usage: any | null | undefined): ChatResult; SummarizeText(params: SummarizeParams): Promise; ClassifyText(params: ClassifyParams): Promise; protected MapMJMessagesToMistral(messages: ChatMessage[], assistantPrefill?: string): Array; } //# sourceMappingURL=mistral.d.ts.map