import { z } from 'zod';
/**
 * Base configuration for AI operations
 */
export declare const AiConfigSchema: z.ZodObject<{
    provider: z.ZodEnum<["openai", "anthropic", "azure", "local"]>;
    model: z.ZodString;
    temperature: z.ZodOptional<z.ZodNumber>;
    maxTokens: z.ZodOptional<z.ZodNumber>;
    stream: z.ZodOptional<z.ZodBoolean>;
    systemPrompt: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
    model: string;
    provider: "azure" | "local" | "openai" | "anthropic";
    temperature?: number | undefined;
    maxTokens?: number | undefined;
    stream?: boolean | undefined;
    systemPrompt?: string | undefined;
}, {
    model: string;
    provider: "azure" | "local" | "openai" | "anthropic";
    temperature?: number | undefined;
    maxTokens?: number | undefined;
    stream?: boolean | undefined;
    systemPrompt?: string | undefined;
}>;
export type AiConfig = z.infer<typeof AiConfigSchema>;
/**
 * Message structure for chat operations
 */
export declare const MessageSchema: z.ZodObject<{
    role: z.ZodEnum<["system", "user", "assistant", "function"]>;
    content: z.ZodString;
    name: z.ZodOptional<z.ZodString>;
    function_call: z.ZodOptional<z.ZodObject<{
        name: z.ZodString;
        arguments: z.ZodString;
    }, "strip", z.ZodTypeAny, {
        name: string;
        arguments: string;
    }, {
        name: string;
        arguments: string;
    }>>;
}, "strip", z.ZodTypeAny, {
    role: "function" | "user" | "system" | "assistant";
    content: string;
    name?: string | undefined;
    function_call?: {
        name: string;
        arguments: string;
    } | undefined;
}, {
    role: "function" | "user" | "system" | "assistant";
    content: string;
    name?: string | undefined;
    function_call?: {
        name: string;
        arguments: string;
    } | undefined;
}>;
export type Message = z.infer<typeof MessageSchema>;
/**
 * Chat completion request
 */
export declare const ChatRequestSchema: z.ZodObject<{
    provider: z.ZodEnum<["openai", "anthropic", "azure", "local"]>;
    model: z.ZodString;
    temperature: z.ZodOptional<z.ZodNumber>;
    maxTokens: z.ZodOptional<z.ZodNumber>;
    stream: z.ZodOptional<z.ZodBoolean>;
    systemPrompt: z.ZodOptional<z.ZodString>;
} & {
    messages: z.ZodArray<z.ZodObject<{
        role: z.ZodEnum<["system", "user", "assistant", "function"]>;
        content: z.ZodString;
        name: z.ZodOptional<z.ZodString>;
        function_call: z.ZodOptional<z.ZodObject<{
            name: z.ZodString;
            arguments: z.ZodString;
        }, "strip", z.ZodTypeAny, {
            name: string;
            arguments: string;
        }, {
            name: string;
            arguments: string;
        }>>;
    }, "strip", z.ZodTypeAny, {
        role: "function" | "user" | "system" | "assistant";
        content: string;
        name?: string | undefined;
        function_call?: {
            name: string;
            arguments: string;
        } | undefined;
    }, {
        role: "function" | "user" | "system" | "assistant";
        content: string;
        name?: string | undefined;
        function_call?: {
            name: string;
            arguments: string;
        } | undefined;
    }>, "many">;
    functions: z.ZodOptional<z.ZodArray<z.ZodObject<{
        name: z.ZodString;
        description: z.ZodOptional<z.ZodString>;
        parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
    }, "strip", z.ZodTypeAny, {
        name: string;
        parameters: Record<string, unknown>;
        description?: string | undefined;
    }, {
        name: string;
        parameters: Record<string, unknown>;
        description?: string | undefined;
    }>, "many">>;
}, "strip", z.ZodTypeAny, {
    model: string;
    provider: "azure" | "local" | "openai" | "anthropic";
    messages: {
        role: "function" | "user" | "system" | "assistant";
        content: string;
        name?: string | undefined;
        function_call?: {
            name: string;
            arguments: string;
        } | undefined;
    }[];
    temperature?: number | undefined;
    maxTokens?: number | undefined;
    stream?: boolean | undefined;
    systemPrompt?: string | undefined;
    functions?: {
        name: string;
        parameters: Record<string, unknown>;
        description?: string | undefined;
    }[] | undefined;
}, {
    model: string;
    provider: "azure" | "local" | "openai" | "anthropic";
    messages: {
        role: "function" | "user" | "system" | "assistant";
        content: string;
        name?: string | undefined;
        function_call?: {
            name: string;
            arguments: string;
        } | undefined;
    }[];
    temperature?: number | undefined;
    maxTokens?: number | undefined;
    stream?: boolean | undefined;
    systemPrompt?: string | undefined;
    functions?: {
        name: string;
        parameters: Record<string, unknown>;
        description?: string | undefined;
    }[] | undefined;
}>;
export type ChatRequest = z.infer<typeof ChatRequestSchema>;
/**
 * Chat completion response
 */
export declare const ChatResponseSchema: z.ZodObject<{
    id: z.ZodString;
    model: z.ZodString;
    created: z.ZodNumber;
    choices: z.ZodArray<z.ZodObject<{
        index: z.ZodNumber;
        message: z.ZodObject<{
            role: z.ZodEnum<["system", "user", "assistant", "function"]>;
            content: z.ZodString;
            name: z.ZodOptional<z.ZodString>;
            function_call: z.ZodOptional<z.ZodObject<{
                name: z.ZodString;
                arguments: z.ZodString;
            }, "strip", z.ZodTypeAny, {
                name: string;
                arguments: string;
            }, {
                name: string;
                arguments: string;
            }>>;
        }, "strip", z.ZodTypeAny, {
            role: "function" | "user" | "system" | "assistant";
            content: string;
            name?: string | undefined;
            function_call?: {
                name: string;
                arguments: string;
            } | undefined;
        }, {
            role: "function" | "user" | "system" | "assistant";
            content: string;
            name?: string | undefined;
            function_call?: {
                name: string;
                arguments: string;
            } | undefined;
        }>;
        finish_reason: z.ZodOptional<z.ZodEnum<["stop", "length", "function_call", "content_filter"]>>;
    }, "strip", z.ZodTypeAny, {
        index: number;
        message: {
            role: "function" | "user" | "system" | "assistant";
            content: string;
            name?: string | undefined;
            function_call?: {
                name: string;
                arguments: string;
            } | undefined;
        };
        finish_reason?: "length" | "stop" | "function_call" | "content_filter" | undefined;
    }, {
        index: number;
        message: {
            role: "function" | "user" | "system" | "assistant";
            content: string;
            name?: string | undefined;
            function_call?: {
                name: string;
                arguments: string;
            } | undefined;
        };
        finish_reason?: "length" | "stop" | "function_call" | "content_filter" | undefined;
    }>, "many">;
    usage: z.ZodOptional<z.ZodObject<{
        prompt_tokens: z.ZodNumber;
        completion_tokens: z.ZodNumber;
        total_tokens: z.ZodNumber;
    }, "strip", z.ZodTypeAny, {
        prompt_tokens: number;
        completion_tokens: number;
        total_tokens: number;
    }, {
        prompt_tokens: number;
        completion_tokens: number;
        total_tokens: number;
    }>>;
}, "strip", z.ZodTypeAny, {
    id: string;
    model: string;
    created: number;
    choices: {
        index: number;
        message: {
            role: "function" | "user" | "system" | "assistant";
            content: string;
            name?: string | undefined;
            function_call?: {
                name: string;
                arguments: string;
            } | undefined;
        };
        finish_reason?: "length" | "stop" | "function_call" | "content_filter" | undefined;
    }[];
    usage?: {
        prompt_tokens: number;
        completion_tokens: number;
        total_tokens: number;
    } | undefined;
}, {
    id: string;
    model: string;
    created: number;
    choices: {
        index: number;
        message: {
            role: "function" | "user" | "system" | "assistant";
            content: string;
            name?: string | undefined;
            function_call?: {
                name: string;
                arguments: string;
            } | undefined;
        };
        finish_reason?: "length" | "stop" | "function_call" | "content_filter" | undefined;
    }[];
    usage?: {
        prompt_tokens: number;
        completion_tokens: number;
        total_tokens: number;
    } | undefined;
}>;
export type ChatResponse = z.infer<typeof ChatResponseSchema>;
/**
 * Streaming chat completion response
 */
export declare const StreamingChatResponseSchema: z.ZodObject<{
    id: z.ZodString;
    model: z.ZodString;
    created: z.ZodNumber;
    choices: z.ZodArray<z.ZodObject<{
        index: z.ZodNumber;
        delta: z.ZodObject<{
            role: z.ZodOptional<z.ZodEnum<["system", "user", "assistant", "function"]>>;
            content: z.ZodOptional<z.ZodString>;
            function_call: z.ZodOptional<z.ZodObject<{
                name: z.ZodOptional<z.ZodString>;
                arguments: z.ZodOptional<z.ZodString>;
            }, "strip", z.ZodTypeAny, {
                name?: string | undefined;
                arguments?: string | undefined;
            }, {
                name?: string | undefined;
                arguments?: string | undefined;
            }>>;
        }, "strip", z.ZodTypeAny, {
            role?: "function" | "user" | "system" | "assistant" | undefined;
            content?: string | undefined;
            function_call?: {
                name?: string | undefined;
                arguments?: string | undefined;
            } | undefined;
        }, {
            role?: "function" | "user" | "system" | "assistant" | undefined;
            content?: string | undefined;
            function_call?: {
                name?: string | undefined;
                arguments?: string | undefined;
            } | undefined;
        }>;
        finish_reason: z.ZodOptional<z.ZodEnum<["stop", "length", "function_call", "content_filter"]>>;
    }, "strip", z.ZodTypeAny, {
        index: number;
        delta: {
            role?: "function" | "user" | "system" | "assistant" | undefined;
            content?: string | undefined;
            function_call?: {
                name?: string | undefined;
                arguments?: string | undefined;
            } | undefined;
        };
        finish_reason?: "length" | "stop" | "function_call" | "content_filter" | undefined;
    }, {
        index: number;
        delta: {
            role?: "function" | "user" | "system" | "assistant" | undefined;
            content?: string | undefined;
            function_call?: {
                name?: string | undefined;
                arguments?: string | undefined;
            } | undefined;
        };
        finish_reason?: "length" | "stop" | "function_call" | "content_filter" | undefined;
    }>, "many">;
}, "strip", z.ZodTypeAny, {
    id: string;
    model: string;
    created: number;
    choices: {
        index: number;
        delta: {
            role?: "function" | "user" | "system" | "assistant" | undefined;
            content?: string | undefined;
            function_call?: {
                name?: string | undefined;
                arguments?: string | undefined;
            } | undefined;
        };
        finish_reason?: "length" | "stop" | "function_call" | "content_filter" | undefined;
    }[];
}, {
    id: string;
    model: string;
    created: number;
    choices: {
        index: number;
        delta: {
            role?: "function" | "user" | "system" | "assistant" | undefined;
            content?: string | undefined;
            function_call?: {
                name?: string | undefined;
                arguments?: string | undefined;
            } | undefined;
        };
        finish_reason?: "length" | "stop" | "function_call" | "content_filter" | undefined;
    }[];
}>;
export type StreamingChatResponse = z.infer<typeof StreamingChatResponseSchema>;
/**
 * Error response from AI operations
 */
export declare const AiErrorSchema: z.ZodObject<{
    code: z.ZodString;
    message: z.ZodString;
    details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
}, "strip", z.ZodTypeAny, {
    code: string;
    message: string;
    details?: Record<string, unknown> | undefined;
}, {
    code: string;
    message: string;
    details?: Record<string, unknown> | undefined;
}>;
export type AiError = z.infer<typeof AiErrorSchema>;
/**
 * Status of an AI operation
 */
export declare enum AiOperationStatus {
    IDLE = "idle",
    LOADING = "loading",
    STREAMING = "streaming",
    SUCCESS = "success",
    ERROR = "error"
}
/**
 * State of an AI operation
 */
export interface AiOperationState {
    status: AiOperationStatus;
    error: AiError | null;
    messages: Message[];
    response: ChatResponse | null;
}
/**
 * Callback for streaming responses
 */
export type StreamingCallback = (response: StreamingChatResponse) => void;
/**
 * Options for AI operations
 */
export interface AiOperationOptions {
    onStream?: StreamingCallback;
    abortSignal?: AbortSignal;
    retryCount?: number;
    retryDelay?: number;
}
/**
 * Result of an AI operation
 */
export interface AiOperationResult {
    response: ChatResponse;
    messages: Message[];
    usage?: {
        prompt_tokens: number;
        completion_tokens: number;
        total_tokens: number;
    };
}
/**
 * AI Provider configuration
 */
export interface AiProviderConfig {
    id: string;
    name: string;
    type: string;
    apiKey?: string;
    endpoint?: string;
    enabled: boolean;
    rateLimit?: number;
    timeout?: number;
}
/**
 * AI Provider capabilities
 */
export interface AiProviderCapabilities {
    chat: boolean;
    completion: boolean;
    embedding: boolean;
    functionCalling: boolean;
    streaming: boolean;
    models: string[];
}
/**
 * AI Provider status
 */
export interface AiProviderStatus {
    available: boolean;
    lastChecked: number;
    error?: string;
    capabilities?: AiProviderCapabilities;
}
/**
 * AI Provider metrics
 */
export interface AiProviderMetrics {
    requests: number;
    tokens: number;
    errors: number;
    latency: number[];
    lastUpdated: number;
}
export declare const AiProviderSchema: z.ZodEnum<["openai", "anthropic", "azure", "local"]>;
export type AiProvider = z.infer<typeof AiProviderSchema>;
export declare const AiRoleSchema: z.ZodEnum<["system", "user", "assistant", "function"]>;
export type AiRole = z.infer<typeof AiRoleSchema>;
export declare const AiFinishReasonSchema: z.ZodEnum<["stop", "length", "function_call", "content_filter"]>;
export type AiFinishReason = z.infer<typeof AiFinishReasonSchema>;
export interface AiMessage {
    role: AiRole;
    content: string;
    name?: string;
    function_call?: {
        name?: string;
        arguments?: string;
    };
}
export interface AiFunction {
    name: string;
    description: string;
    parameters: Record<string, unknown>;
}
export interface AiChatRequest {
    model: string;
    provider: AiProvider;
    messages: AiMessage[];
    systemPrompt?: string;
    temperature?: number;
    maxTokens?: number;
    functions?: AiFunction[];
}
export interface AiChatResponse {
    id: string;
    model: string;
    created: number;
    choices: Array<{
        index: number;
        delta: Partial<AiMessage>;
        finish_reason?: AiFinishReason;
    }>;
    usage?: {
        prompt_tokens: number;
        completion_tokens: number;
        total_tokens: number;
    };
}
export interface AiStreamingCallback {
    onMessage: (message: AiMessage) => void;
    onError: (error: AiError) => void;
    onComplete: () => void;
}
export interface AiService {
    chat(request: AiChatRequest): Promise<AiChatResponse>;
    streamChat(request: AiChatRequest, callback: AiStreamingCallback): Promise<void>;
    generateEmbeddings(text: string): Promise<number[]>;
    analyzeDocument(text: string): Promise<{
        summary: string;
        keyPoints: string[];
        recommendations: string[];
    }>;
}
//# sourceMappingURL=ai.d.ts.map