升级到v1.3.0:新增auto推理模式和完善推理级别文档
主要功能更新: - 新增auto推理级别,完全遵循客户端原始请求参数 - 支持五档推理级别:auto/off/low/medium/high - auto模式零干预:不修改推理字段和anthropic-beta头 - 除gpt-5-codex外,所有模型默认设为auto模式 文档完善: - 更新核心功能说明,突出智能推理级别控制 - 新增auto推理模式详细说明和使用场景 - 添加推理级别对比表格和配置示例 - 增强FAQ部分,分场景解答推理相关问题 - 提供OpenAI和Anthropic模型字段对应关系 技术实现: - 更新getModelReasoning函数支持auto选项 - 完善所有transformer的auto模式处理逻辑 - 优化routes.js中直接转发端点的auto支持 - 确保auto模式下头信息和请求体完全透传
This commit is contained in:
@@ -94,14 +94,20 @@ export function transformToOpenAI(openaiRequest) {
|
||||
|
||||
// Handle reasoning field based on model configuration
|
||||
const reasoningLevel = getModelReasoning(openaiRequest.model);
|
||||
if (reasoningLevel) {
|
||||
// Add reasoning field based on model configuration
|
||||
if (reasoningLevel === 'auto') {
|
||||
// Auto mode: preserve original request's reasoning field exactly as-is
|
||||
if (openaiRequest.reasoning !== undefined) {
|
||||
targetRequest.reasoning = openaiRequest.reasoning;
|
||||
}
|
||||
// If original request has no reasoning field, don't add one
|
||||
} else if (reasoningLevel && ['low', 'medium', 'high'].includes(reasoningLevel)) {
|
||||
// Specific level: override with model configuration
|
||||
targetRequest.reasoning = {
|
||||
effort: reasoningLevel,
|
||||
summary: 'auto'
|
||||
};
|
||||
} else {
|
||||
// If reasoning is off or invalid, explicitly remove reasoning field
|
||||
// Off or invalid: explicitly remove reasoning field
|
||||
// This ensures any reasoning field from the original request is deleted
|
||||
delete targetRequest.reasoning;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user