export function buildBaseOptions(model, options, apiKey) {
    return {
        temperature: options?.temperature,
        maxTokens: options?.maxTokens || Math.min(model.maxTokens, 32000),
        signal: options?.signal,
        apiKey: apiKey || options?.apiKey,
        cacheRetention: options?.cacheRetention,
        fetchOptions: options?.fetchOptions,
        sessionId: options?.sessionId,
        headers: options?.headers,
        onPayload: options?.onPayload,
        maxRetryDelayMs: options?.maxRetryDelayMs,
        metadata: options?.metadata
    };
}
export function clampReasoning(effort) {
    return effort === 'xhigh' ? 'high' : effort;
}
export function adjustMaxTokensForThinking(baseMaxTokens, modelMaxTokens, reasoningLevel) {
    const budgets = {
        minimal: 1024,
        low: 2048,
        medium: 8192,
        high: 16384
    };
    const minOutputTokens = 1024;
    const level = clampReasoning(reasoningLevel);
    let thinkingBudget = budgets[level];
    const maxTokens = Math.min(baseMaxTokens + thinkingBudget, modelMaxTokens);
    if (maxTokens <= thinkingBudget) {
        thinkingBudget = Math.max(0, maxTokens - minOutputTokens);
    }
    return { maxTokens, thinkingBudget };
}
//# sourceMappingURL=simple-options.js.map