Merge pull request #2874 from MUTED64/main

feat: Force beta=true parameter for Anthropic channel
This commit is contained in:
Seefs
2026-02-08 00:09:28 +08:00
committed by GitHub
3 changed files with 33 additions and 3 deletions

View File

@@ -170,6 +170,7 @@ const EditChannelModal = (props) => {
allow_service_tier: false,
disable_store: false, // false = 允许透传(默认开启)
allow_safety_identifier: false,
claude_beta_query: false,
};
const [batch, setBatch] = useState(false);
const [multiToSingle, setMultiToSingle] = useState(false);
@@ -633,6 +634,7 @@ const EditChannelModal = (props) => {
data.disable_store = parsedSettings.disable_store || false;
data.allow_safety_identifier =
parsedSettings.allow_safety_identifier || false;
data.claude_beta_query = parsedSettings.claude_beta_query || false;
} catch (error) {
console.error('解析其他设置失败:', error);
data.azure_responses_version = '';
@@ -643,6 +645,7 @@ const EditChannelModal = (props) => {
data.allow_service_tier = false;
data.disable_store = false;
data.allow_safety_identifier = false;
data.claude_beta_query = false;
}
} else {
// 兼容历史数据:老渠道没有 settings 时,默认按 json 展示
@@ -652,6 +655,7 @@ const EditChannelModal = (props) => {
data.allow_service_tier = false;
data.disable_store = false;
data.allow_safety_identifier = false;
data.claude_beta_query = false;
}
if (
@@ -1394,6 +1398,9 @@ const EditChannelModal = (props) => {
settings.allow_safety_identifier =
localInputs.allow_safety_identifier === true;
}
if (localInputs.type === 14) {
settings.claude_beta_query = localInputs.claude_beta_query === true;
}
}
localInputs.settings = JSON.stringify(settings);
@@ -1414,6 +1421,7 @@ const EditChannelModal = (props) => {
delete localInputs.allow_service_tier;
delete localInputs.disable_store;
delete localInputs.allow_safety_identifier;
delete localInputs.claude_beta_query;
let res;
localInputs.auto_ban = localInputs.auto_ban ? 1 : 0;
@@ -3316,6 +3324,24 @@ const EditChannelModal = (props) => {
</div>
</div>
{inputs.type === 14 && (
<Form.Switch
field='claude_beta_query'
label={t('Claude 强制 beta=true')}
checkedText={t('开')}
uncheckedText={t('关')}
onChange={(value) =>
handleChannelOtherSettingsChange(
'claude_beta_query',
value,
)
}
extraText={t(
'开启后,该渠道请求 Claude 时将强制追加 ?beta=true无需客户端手动传参',
)}
/>
)}
{inputs.type === 1 && (
<Form.Switch
field='force_format'