/** * Thinking 相关工具函数 * * 实现思考签名整流器和思考预算整流器,参考 CC Switch 的实现。 * 用于自动检测和修复 thinking 参数相关的兼容性问题。 */ /** 思考预算修复时设置的 budget_tokens 目标值 */ export declare const MAX_THINKING_BUDGET = 32000; /** 思考预算修复时设置的 max_tokens 目标值 */ export declare const MAX_TOKENS_VALUE = 64000; /** max_tokens 必须大于 thinking.budget_tokens 的最小值 */ export declare const MIN_MAX_TOKENS_FOR_BUDGET = 32001; /** 思考预算快照 */ export interface ThinkingBudgetSnapshot { maxTokens: number | undefined; thinkingType: string | undefined; thinkingBudgetTokens: number | undefined; } /** 思考预算修复结果 */ export interface BudgetRectifyResult { applied: boolean; before: ThinkingBudgetSnapshot; after: ThinkingBudgetSnapshot; } /** * 检测是否需要修复思考签名错误 * * @param errorMessage API 返回的错误消息 * @returns 是否需要修复 */ export declare function shouldRectifyThinkingSignature(errorMessage: string): boolean; /** * 修复 Anthropic 请求中的思考签名问题 * * @param body 请求体 * @returns 是否应用了修复 */ export declare function rectifyThinkingSignature(body: Record): boolean; /** * 检测是否需要修复思考预算错误 * * @param errorMessage API 返回的错误消息 * @returns 是否需要修复 */ export declare function shouldRectifyThinkingBudget(errorMessage: string): boolean; /** * 创建思考预算快照 * * @param body 请求体 * @returns 思考预算快照 */ export declare function snapshotThinkingBudget(body: Record): ThinkingBudgetSnapshot; /** * 修复思考预算错误 * * @param body 请求体 * @returns 修复结果 */ export declare function rectifyThinkingBudget(body: Record): BudgetRectifyResult; /** * 检查模型是否使用自适应思考 * * @param model 模型名称 * @returns 是否使用自适应思考 */ export declare function usesAdaptiveThinking(model: string): boolean; /** * 标准化模型名称 * * @param model 模型名称 * @returns 标准化后的模型名称 */ export declare function normalizeModelName(model: string): string; /** * 优化思考参数 * * @param body 请求体 * @param enabled 是否启用思考优化 */ export declare function optimizeThinkingParams(body: Record, enabled?: boolean): void; //# sourceMappingURL=thinking-utils.d.ts.map