|
@@ -3890,6 +3890,10 @@ Q版卡通风格,头大身小,造型圆润可爱,线条简单,色彩明
|
|
|
// Unsupported parameter: 'max_tokens' is not supported with this model.
|
|
// Unsupported parameter: 'max_tokens' is not supported with this model.
|
|
|
// 这里显式移除,防止调用方在 post_data 中残留 max_tokens。
|
|
// 这里显式移除,防止调用方在 post_data 中残留 max_tokens。
|
|
|
unset($post_data['max_tokens']);
|
|
unset($post_data['max_tokens']);
|
|
|
|
|
+ // GPT-5.x(推理型上游)不接受 frequency_penalty / presence_penalty:
|
|
|
|
|
+ // Unsupported parameter: 'frequency_penalty' is not supported with this model.
|
|
|
|
|
+ // 调用方默认传 0,移除后采样行为不变,显式清理避免 400。
|
|
|
|
|
+ unset($post_data['frequency_penalty'], $post_data['presence_penalty']);
|
|
|
// 流式请求显式声明返回 usage(在最后一个 chunk 中返回)
|
|
// 流式请求显式声明返回 usage(在最后一个 chunk 中返回)
|
|
|
$post_data['stream_options'] = ['include_usage' => true];
|
|
$post_data['stream_options'] = ['include_usage' => true];
|
|
|
|
|
|
|
@@ -16292,6 +16296,8 @@ Q版卡通风格,头大身小,造型圆润可爱,线条简单,色彩明
|
|
|
$post_data['max_completion_tokens'] = 100000;
|
|
$post_data['max_completion_tokens'] = 100000;
|
|
|
// GPT-5.x 上游不支持 max_tokens,与 gpt54StreamResponse 保持一致,显式移除避免 400。
|
|
// GPT-5.x 上游不支持 max_tokens,与 gpt54StreamResponse 保持一致,显式移除避免 400。
|
|
|
unset($post_data['max_tokens']);
|
|
unset($post_data['max_tokens']);
|
|
|
|
|
+ // GPT-5.x 上游不接受 frequency_penalty / presence_penalty,移除默认值 0 不影响行为。
|
|
|
|
|
+ unset($post_data['frequency_penalty'], $post_data['presence_penalty']);
|
|
|
|
|
|
|
|
// 确保 stream 为 false
|
|
// 确保 stream 为 false
|
|
|
$post_data['stream'] = false;
|
|
$post_data['stream'] = false;
|