import type { AiRoutePolicy, NimiError } from '../types/index.js';
import type { RuntimeMetadata } from './types.js';
import type { NimiFinishReason, NimiReasoningConfig, TextGenerateInput, TextGenerateOutput, TextMessage, TextStreamInput, TextStreamOutput } from './types-media.js';
export type RuntimePrompt = string | TextMessage[];
export type RuntimeGenerateInput = {
    model?: string;
    provider?: string;
    prompt: RuntimePrompt;
    system?: string;
    reasoning?: NimiReasoningConfig;
    maxTokens?: number;
    temperature?: number;
    topP?: number;
    subjectUserId?: string;
    timeoutMs?: number;
    metadata?: RuntimeMetadata;
};
export type RuntimeGenerateResult = {
    text: string;
    usage: {
        inputTokens: number;
        outputTokens: number;
    };
    finishReason: NimiFinishReason | string;
    traceId: string;
    modelResolved: string;
    routeDecision: AiRoutePolicy;
};
export type RuntimeStreamInput = RuntimeGenerateInput & {
    signal?: AbortSignal;
};
export type RuntimeStreamChunk = {
    type: 'text';
    text: string;
} | {
    type: 'reasoning';
    text: string;
} | {
    type: 'done';
    usage: {
        inputTokens: number;
        outputTokens: number;
    };
    finishReason: NimiFinishReason | string;
    traceId: string;
    modelResolved: string;
    routeDecision: AiRoutePolicy;
} | {
    type: 'error';
    error: NimiError;
};
type RuntimeTextGenerateDelegate = {
    ai: {
        text: {
            generate(input: TextGenerateInput): Promise<TextGenerateOutput>;
            stream(input: TextStreamInput): Promise<TextStreamOutput>;
        };
    };
};
export declare function toRuntimeGenerateResult(output: TextGenerateOutput): RuntimeGenerateResult;
export declare function runtimeGenerateConvenience(runtime: RuntimeTextGenerateDelegate, input: RuntimeGenerateInput): Promise<RuntimeGenerateResult>;
export declare function runtimeStreamConvenience(runtime: RuntimeTextGenerateDelegate, input: RuntimeStreamInput): Promise<AsyncIterable<RuntimeStreamChunk>>;
export {};
//# sourceMappingURL=runtime-convenience.d.ts.map