/**
 * AI Helper Functions
 *
 * Shared utilities for making structured LLM calls.
 */
import type { z } from 'zod';
import type { AiRuntime } from '../../ai/runtime';
/**
 * Custom error class that includes the raw LLM response for debugging.
 */
export declare class AiValidationError extends Error {
    readonly rawText: string;
    readonly parsedJson: unknown;
    constructor(message: string, rawText: string, parsedJson: unknown);
}
/**
 * Make a structured JSON request to the AI model.
 *
 * @param config - Model configuration (model, system prompt, temperature)
 * @param userMessage - The user message to send
 * @param schema - Zod schema for response validation
 * @returns Parsed response matching the schema
 */
export declare function getJsonFromAi<T>(ai: AiRuntime, config: {
    model: string;
    system: string;
    temperature: number;
}, userMessage: string, schema: z.ZodType<T>): Promise<T>;
/**
 * Make a JSON request to the AI model WITHOUT using structured-output response_format.
 *
 * This is useful when the provider rejects parts of the derived JSON schema
 * (e.g. `propertyNames`) for response_format. We still validate the parsed JSON
 * locally using Zod.
 *
 * Throws AiValidationError on validation failure, which includes the raw text
 * and parsed JSON for debugging.
 */
export declare function getJsonFromAiText<T>(ai: AiRuntime, config: {
    model: string;
    system: string;
    temperature: number;
    maxTokens?: number;
}, userMessage: string, schema: z.ZodType<T>): Promise<{
    data: T;
    rawText: string;
}>;
