feat: gate Claude inference_geo passthrough behind channel setting and add field docs

This commit is contained in:
Seefs
2026-02-21 14:25:58 +08:00
parent 2c5af0df36
commit a546871a80
6 changed files with 101 additions and 26 deletions

View File

@@ -171,6 +171,7 @@ const EditChannelModal = (props) => {
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);
@@ -637,6 +638,8 @@ const EditChannelModal = (props) => {
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);
@@ -649,6 +652,7 @@ const EditChannelModal = (props) => {
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 {
@@ -660,6 +664,7 @@ const EditChannelModal = (props) => {
data.disable_store = false;
data.allow_safety_identifier = false;
data.allow_include_obfuscation = false;
data.allow_inference_geo = false;
data.claude_beta_query = false;
}
@@ -1406,6 +1411,7 @@ const EditChannelModal = (props) => {
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;
}
}
@@ -1429,6 +1435,7 @@ const EditChannelModal = (props) => {
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;
@@ -3322,6 +3329,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>