import type { Context } from "@earendil-works/pi-ai";
import type { LlmApiKeys } from "./generate-text-types.js";
import type { LlmProvider } from "./model-id.js";
import type { ModelRequestOptions } from "./model-options.js";
import type { LlmTokenUsage } from "./types.js";
export type StreamTextWithContextArgs = {
    modelId: string;
    apiKeys: LlmApiKeys;
    context: Context;
    temperature?: number;
    maxOutputTokens?: number;
    timeoutMs: number;
    fetchImpl: typeof fetch;
    forceOpenRouter?: boolean;
    openaiBaseUrlOverride?: string | null;
    anthropicBaseUrlOverride?: string | null;
    googleBaseUrlOverride?: string | null;
    xaiBaseUrlOverride?: string | null;
    ollamaBaseUrlOverride?: string | null;
    forceChatCompletions?: boolean;
    requestOptions?: ModelRequestOptions;
};
export type StreamTextResult = {
    textStream: AsyncIterable<string>;
    canonicalModelId: string;
    provider: LlmProvider;
    usage: Promise<LlmTokenUsage | null>;
    finalText: Promise<string | null>;
    lastError: () => unknown;
};
export declare function streamTextWithContext({ modelId, apiKeys, context, temperature, maxOutputTokens, timeoutMs, fetchImpl, forceOpenRouter, openaiBaseUrlOverride, anthropicBaseUrlOverride, googleBaseUrlOverride, xaiBaseUrlOverride, ollamaBaseUrlOverride, forceChatCompletions, requestOptions, }: StreamTextWithContextArgs): Promise<StreamTextResult>;
