import OpenAI from 'openai';
import * as llm from '../llm/index.js';
import type { APIConnectOptions } from '../types.js';
import { type Expand } from '../utils.js';
import { type AnyString } from './utils.js';
export type OpenAIModels = 'openai/gpt-5.5' | 'openai/gpt-5.4' | 'openai/gpt-5.4-mini' | 'openai/gpt-5.4-nano' | 'openai/gpt-5.3-chat-latest' | 'openai/gpt-5.2' | 'openai/gpt-5.2-chat-latest' | 'openai/gpt-5.1' | 'openai/gpt-5.1-chat-latest' | 'openai/gpt-5' | 'openai/gpt-5-mini' | 'openai/gpt-5-nano' | 'openai/gpt-4.1' | 'openai/gpt-4.1-mini' | 'openai/gpt-4.1-nano' | 'openai/gpt-4o' | 'openai/gpt-4o-mini' | 'openai/chat-latest' | 'openai/gpt-oss-120b';
export type GoogleModels = 'google/gemini-3.1-pro' | 'google/gemini-3-flash' | 'google/gemini-3.1-flash-lite' | 'google/gemini-3.5-flash' | 'google/gemini-2.5-pro' | 'google/gemini-2.5-flash' | 'google/gemini-2.5-flash-lite';
export type MoonshotModels = 'moonshotai/kimi-k2.5' | 'moonshotai/kimi-k2.6';
export type DeepSeekModels = 'deepseek-ai/deepseek-v3' | 'deepseek-ai/deepseek-v3.2';
export type ZAIModels = 'zai/glm-5.1';
export type XAIModels = 'xai/grok-4-1-fast-non-reasoning' | 'xai/grok-4-1-fast-reasoning' | 'xai/grok-4.20-0309-non-reasoning' | 'xai/grok-4.20-0309-reasoning' | 'xai/grok-4.20-multi-agent-0309';
type ChatCompletionPredictionContentParam = Expand<OpenAI.Chat.Completions.ChatCompletionPredictionContent>;
type WebSearchOptions = Expand<OpenAI.Chat.Completions.ChatCompletionCreateParams.WebSearchOptions>;
type ToolChoice = Expand<OpenAI.Chat.Completions.ChatCompletionCreateParams['tool_choice']>;
type ResponseFormat = Expand<OpenAI.Chat.Completions.ChatCompletionCreateParams['response_format']>;
type Verbosity = 'low' | 'medium' | 'high';
export interface ChatCompletionOptions extends Record<string, unknown> {
    frequency_penalty?: number;
    logit_bias?: Record<string, number>;
    logprobs?: boolean;
    max_completion_tokens?: number;
    max_tokens?: number;
    metadata?: Record<string, string>;
    modalities?: Array<'text' | 'audio'>;
    n?: number;
    parallel_tool_calls?: boolean;
    prediction?: ChatCompletionPredictionContentParam | null;
    presence_penalty?: number;
    prompt_cache_key?: string;
    prompt_cache_retention?: 'in_memory' | '24h';
    reasoning_effort?: 'minimal' | 'low' | 'medium' | 'high';
    safety_identifier?: string;
    seed?: number;
    service_tier?: 'auto' | 'default' | 'flex' | 'scale' | 'priority';
    stop?: string | string[];
    store?: boolean;
    temperature?: number;
    top_logprobs?: number;
    top_p?: number;
    user?: string;
    verbosity?: Verbosity;
    web_search_options?: WebSearchOptions;
    tool_choice?: ToolChoice;
    response_format?: ResponseFormat;
}
export type LLMModels = OpenAIModels | GoogleModels | MoonshotModels | DeepSeekModels | ZAIModels | XAIModels | AnyString;
export type InferenceClass = 'priority' | 'standard';
export interface InferenceLLMOptions {
    model: LLMModels;
    provider?: string;
    baseURL: string;
    apiKey: string;
    apiSecret: string;
    modelOptions: ChatCompletionOptions;
    strictToolSchema?: boolean;
    inferenceClass?: InferenceClass;
}
export interface GatewayOptions {
    apiKey: string;
    apiSecret: string;
}
/**
 * Livekit Cloud Inference LLM
 */
export declare class LLM extends llm.LLM {
    private client;
    private opts;
    constructor(opts: {
        model: LLMModels;
        provider?: string;
        baseURL?: string;
        apiKey?: string;
        apiSecret?: string;
        modelOptions?: InferenceLLMOptions['modelOptions'];
        strictToolSchema?: boolean;
        inferenceClass?: InferenceClass;
    });
    label(): string;
    get model(): string;
    get provider(): string;
    static fromModelString(modelString: string): LLM;
    /**
     * Update LLM configuration options used by the next chat call.
     *
     * `modelOptions` replaces the persistent options object instead of merging;
     * pass `{}` to clear it.
     */
    updateOptions({ model, modelOptions, }: {
        model?: LLMModels;
        modelOptions?: ChatCompletionOptions;
    }): void;
    chat({ chatCtx, toolCtx, connOptions, parallelToolCalls, toolChoice, inferenceClass, extraKwargs, }: {
        chatCtx: llm.ChatContext;
        toolCtx?: llm.ToolContext;
        connOptions?: APIConnectOptions;
        parallelToolCalls?: boolean;
        toolChoice?: llm.ToolChoice;
        inferenceClass?: InferenceClass;
        extraKwargs?: Record<string, unknown>;
    }): LLMStream;
}
export declare class LLMStream extends llm.LLMStream {
    private model;
    private provider?;
    private providerFmt;
    private client;
    private modelOptions;
    private strictToolSchema;
    private inferenceClass?;
    private gatewayOptions?;
    private toolCallId?;
    private toolIndex?;
    private fncName?;
    private fncRawArguments?;
    private toolExtra?;
    constructor(llm: LLM, { model, provider, client, chatCtx, toolCtx, gatewayOptions, connOptions, modelOptions, providerFmt, strictToolSchema, inferenceClass, }: {
        model: LLMModels;
        provider?: string;
        client: OpenAI;
        chatCtx: llm.ChatContext;
        toolCtx?: llm.ToolContext;
        gatewayOptions?: GatewayOptions;
        connOptions: APIConnectOptions;
        modelOptions: Record<string, unknown>;
        providerFmt?: llm.ProviderFormat;
        strictToolSchema: boolean;
        inferenceClass?: InferenceClass;
    });
    protected run(): Promise<void>;
    private parseChoice;
    private createRunningToolCallChunk;
    private extractThoughtSignature;
}
export {};
//# sourceMappingURL=llm.d.ts.map