feat: add missing OpenAI/Claude/Gemini request fields (#2971)

* feat: add missing OpenAI/Claude/Gemini request fields and responses stream options

* fix: skip field filtering when request passthrough is enabled

* fix: include subscription in personal sidebar module controls

* feat: gate Claude inference_geo passthrough behind channel setting and add field docs
This commit is contained in:
Calcium-Ion
2026-02-22 23:31:18 +08:00
committed by GitHub
12 changed files with 265 additions and 77 deletions

View File

@@ -86,6 +86,7 @@ const NotificationSettings = ({
channel: true,
models: true,
deployment: true,
subscription: true,
redemption: true,
user: true,
setting: true,
@@ -169,6 +170,7 @@ const NotificationSettings = ({
channel: true,
models: true,
deployment: true,
subscription: true,
redemption: true,
user: true,
setting: true,
@@ -296,6 +298,11 @@ const NotificationSettings = ({
title: t('模型部署'),
description: t('模型部署管理'),
},
{
key: 'subscription',
title: t('订阅管理'),
description: t('订阅套餐管理'),
},
{
key: 'redemption',
title: t('兑换码管理'),

View File

@@ -175,6 +175,8 @@ const EditChannelModal = (props) => {
allow_service_tier: false,
disable_store: false, // false = 允许透传(默认开启)
allow_safety_identifier: false,
allow_include_obfuscation: false,
allow_inference_geo: false,
claude_beta_query: false,
};
const [batch, setBatch] = useState(false);
@@ -646,6 +648,10 @@ const EditChannelModal = (props) => {
data.disable_store = parsedSettings.disable_store || false;
data.allow_safety_identifier =
parsedSettings.allow_safety_identifier || false;
data.allow_include_obfuscation =
parsedSettings.allow_include_obfuscation || false;
data.allow_inference_geo =
parsedSettings.allow_inference_geo || false;
data.claude_beta_query = parsedSettings.claude_beta_query || false;
} catch (error) {
console.error('解析其他设置失败:', error);
@@ -657,6 +663,8 @@ const EditChannelModal = (props) => {
data.allow_service_tier = false;
data.disable_store = false;
data.allow_safety_identifier = false;
data.allow_include_obfuscation = false;
data.allow_inference_geo = false;
data.claude_beta_query = false;
}
} else {
@@ -667,6 +675,8 @@ const EditChannelModal = (props) => {
data.allow_service_tier = false;
data.disable_store = false;
data.allow_safety_identifier = false;
data.allow_include_obfuscation = false;
data.allow_inference_geo = false;
data.claude_beta_query = false;
}
@@ -1453,13 +1463,16 @@ const EditChannelModal = (props) => {
// type === 1 (OpenAI) 或 type === 14 (Claude): 设置字段透传控制(显式保存布尔值)
if (localInputs.type === 1 || localInputs.type === 14) {
settings.allow_service_tier = localInputs.allow_service_tier === true;
// 仅 OpenAI 渠道需要 store safety_identifier
// 仅 OpenAI 渠道需要 store / safety_identifier / include_obfuscation
if (localInputs.type === 1) {
settings.disable_store = localInputs.disable_store === true;
settings.allow_safety_identifier =
localInputs.allow_safety_identifier === true;
settings.allow_include_obfuscation =
localInputs.allow_include_obfuscation === true;
}
if (localInputs.type === 14) {
settings.allow_inference_geo = localInputs.allow_inference_geo === true;
settings.claude_beta_query = localInputs.claude_beta_query === true;
}
}
@@ -1482,6 +1495,8 @@ const EditChannelModal = (props) => {
delete localInputs.allow_service_tier;
delete localInputs.disable_store;
delete localInputs.allow_safety_identifier;
delete localInputs.allow_include_obfuscation;
delete localInputs.allow_inference_geo;
delete localInputs.claude_beta_query;
let res;
@@ -3332,6 +3347,24 @@ const EditChannelModal = (props) => {
'safety_identifier 字段用于帮助 OpenAI 识别可能违反使用政策的应用程序用户。默认关闭以保护用户隐私',
)}
/>
<Form.Switch
field='allow_include_obfuscation'
label={t(
'允许 stream_options.include_obfuscation 透传',
)}
checkedText={t('开')}
uncheckedText={t('关')}
onChange={(value) =>
handleChannelOtherSettingsChange(
'allow_include_obfuscation',
value,
)
}
extraText={t(
'include_obfuscation 用于控制 Responses 流混淆字段。默认关闭以避免客户端关闭该安全保护',
)}
/>
</>
)}
@@ -3357,6 +3390,22 @@ const EditChannelModal = (props) => {
'service_tier 字段用于指定服务层级,允许透传可能导致实际计费高于预期。默认关闭以避免额外费用',
)}
/>
<Form.Switch
field='allow_inference_geo'
label={t('允许 inference_geo 透传')}
checkedText={t('开')}
uncheckedText={t('关')}
onChange={(value) =>
handleChannelOtherSettingsChange(
'allow_inference_geo',
value,
)
}
extraText={t(
'inference_geo 字段用于控制 Claude 数据驻留推理区域。默认关闭以避免未经授权透传地域信息',
)}
/>
</>
)}
</Card>