import type { TokenCredential } from '@azure/identity';
import type { AssistantCreationOptions, AssistantsClient, FunctionDefinition } from '@azure/openai-assistants';
import type { ApiProvider, CallApiContextParams, CallApiOptionsParams, ProviderEmbeddingResponse, ProviderResponse } from '../types';
import type { EnvOverrides } from '../types/env';
export declare const DEFAULT_AZURE_API_VERSION = "2024-12-01-preview";
interface AzureCompletionOptions {
    azureClientId?: string;
    azureClientSecret?: string;
    azureTenantId?: string;
    azureAuthorityHost?: string;
    azureTokenScope?: string;
    o1?: boolean;
    max_completion_tokens?: number;
    deployment_id?: string;
    dataSources?: any;
    apiHost?: string;
    apiBaseUrl?: string;
    apiKey?: string;
    apiKeyEnvar?: string;
    apiVersion?: string;
    max_tokens?: number;
    temperature?: number;
    top_p?: number;
    frequency_penalty?: number;
    presence_penalty?: number;
    best_of?: number;
    functions?: {
        name: string;
        description?: string;
        parameters: any;
    }[];
    function_call?: 'none' | 'auto' | {
        name: string;
    };
    tools?: {
        type: string;
        function: {
            name: string;
            description?: string;
            parameters: any;
        };
    }[];
    tool_choice?: 'none' | 'auto' | {
        type: 'function';
        function?: {
            name: string;
        };
    };
    response_format?: {
        type: 'json_object';
    } | {
        type: 'json_schema';
        json_schema: {
            name: string;
            strict: boolean;
            schema: {
                type: 'object';
                properties: Record<string, any>;
                required?: string[];
                additionalProperties: false;
                $defs?: Record<string, any>;
            };
        };
    };
    stop?: string[];
    seed?: number;
    passthrough?: object;
}
export declare function calculateAzureCost(modelName: string, config: AzureCompletionOptions, promptTokens?: number, completionTokens?: number): number | undefined;
export declare class AzureGenericProvider implements ApiProvider {
    deploymentName: string;
    apiHost?: string;
    apiBaseUrl?: string;
    config: AzureCompletionOptions;
    env?: EnvOverrides;
    authHeaders?: Record<string, string>;
    protected initializationPromise: Promise<void> | null;
    constructor(deploymentName: string, options?: {
        config?: AzureCompletionOptions;
        id?: string;
        env?: EnvOverrides;
    });
    initialize(): Promise<void>;
    ensureInitialized(): Promise<void>;
    getApiKey(): string | undefined;
    getApiKeyOrThrow(): string;
    getAzureTokenCredential(): Promise<TokenCredential>;
    getAccessToken(): Promise<string>;
    getAuthHeaders(): Promise<Record<string, string>>;
    getApiBaseUrl(): string | undefined;
    id(): string;
    toString(): string;
    callApi(prompt: string, context?: CallApiContextParams, callApiOptions?: CallApiOptionsParams): Promise<ProviderResponse>;
}
export declare class AzureEmbeddingProvider extends AzureGenericProvider {
    callEmbeddingApi(text: string): Promise<ProviderEmbeddingResponse>;
}
export declare class AzureCompletionProvider extends AzureGenericProvider {
    callApi(prompt: string, context?: CallApiContextParams, callApiOptions?: CallApiOptionsParams): Promise<ProviderResponse>;
}
export declare class AzureChatCompletionProvider extends AzureGenericProvider {
    getOpenAiBody(prompt: string, context?: CallApiContextParams, callApiOptions?: CallApiOptionsParams): Record<string, any>;
    callApi(prompt: string, context?: CallApiContextParams, callApiOptions?: CallApiOptionsParams): Promise<ProviderResponse>;
}
type AzureAssistantOptions = AzureCompletionOptions & Partial<AssistantCreationOptions> & {
    /**
     * If set, automatically call these functions when the assistant activates
     * these function tools.
     */
    functionToolCallbacks?: Record<FunctionDefinition['name'], (arg: string) => Promise<string>>;
};
export declare class AzureAssistantProvider extends AzureGenericProvider {
    assistantConfig: AzureAssistantOptions;
    assistantsClient: AssistantsClient | undefined;
    constructor(deploymentName: string, options?: {
        config?: AzureAssistantOptions;
        id?: string;
        env?: EnvOverrides;
    });
    initialize(): Promise<void>;
    ensureInitialized(): Promise<void>;
    callApi(prompt: string, context?: CallApiContextParams, callApiOptions?: CallApiOptionsParams): Promise<ProviderResponse>;
}
export {};
//# sourceMappingURL=azure.d.ts.map