feat: Add auto chat mode fallback configuration and update related translations

This commit is contained in:
Chenyme committed 2026-04-19 17:35:55 +08:00
1 parent b237714a22
commit 257b60bb63
9 files changed
+19 -9

No files matched your search

+6 -7
View File
@@ -52,12 +52,11 @@ async def reserve_account(
if lease is not None:
return lease, selected_mode_id
if get_config("account.refresh.on_empty_retry_enabled", True):
refresh_svc = get_refresh_service()
if refresh_svc is not None:
await refresh_svc.refresh_on_demand()
lease, selected_mode_id = await _try_reserve()
if lease is not None:
return lease, selected_mode_id
refresh_svc = get_refresh_service()
if refresh_svc is not None:
await refresh_svc.refresh_on_demand()
lease, selected_mode_id = await _try_reserve()
if lease is not None:
return lease, selected_mode_id
return None, original_mode_id
+1
View File
@@ -382,6 +382,7 @@ const SCHEMA_DEF = [
{ key: 'memory', label: '开启会话记忆', labelKey: 'config.schema.fields.memory.label', type: 'bool', desc: '启用 Grok Memory,允许模型跨会话记忆用户偏好与上下文。', descKey: 'config.schema.fields.memory.desc' },
{ key: 'stream', label: '默认流式输出', labelKey: 'config.schema.fields.stream.label', type: 'bool', desc: '请求未显式指定 stream 参数时所采用的默认值。', descKey: 'config.schema.fields.stream.desc' },
{ key: 'thinking', label: '默认思考输出', labelKey: 'config.schema.fields.thinking.label', type: 'bool', desc: '请求未显式指定 thinking 参数时所采用的默认值。启用后将在 reasoning_content 字段返回思考过程。', descKey: 'config.schema.fields.thinking.desc' },
{ key: 'auto_chat_mode_fallback', label: 'AUTO 聊天模式回退', labelKey: 'config.schema.fields.autoChatModeFallback.label', type: 'bool', desc: 'AUTO 聊天模型在 auto 额度不可用时,自动尝试 fast 和 expert 聊天额度窗口。', descKey: 'config.schema.fields.autoChatModeFallback.desc' },
{ key: 'thinking_summary', label: '思考精简输出', labelKey: 'config.schema.fields.thinkingSummary.label', type: 'bool', desc: '启用后将思考过程提炼为结构化摘要。关闭时输出完整的原始推理过程,支持多 Agent 模型的协作详情与工具调用展示。', descKey: 'config.schema.fields.thinkingSummary.desc' },
{ key: 'dynamic_statsig', label: '动态 Statsig', labelKey: 'config.schema.fields.dynamicStatsig.label', type: 'bool', desc: '为每次请求动态生成 Statsig 设备指纹,以降低风控拦截概率。', descKey: 'config.schema.fields.dynamicStatsig.desc' },
{ key: 'enable_nsfw', label: '允许 NSFW 生成', labelKey: 'config.schema.fields.enableNsfw.label', type: 'bool', desc: '允许图像生成接口绕过 NSFW 内容过滤。', descKey: 'config.schema.fields.enableNsfw.desc' },
+1
View File
@@ -372,6 +372,7 @@
"memory": { "label": "Konversationsspeicher" },
"stream": { "label": "Standard-Streaming" },
"thinking": { "label": "Standard-Ausgabe für Reasoning" },
"autoChatModeFallback": { "label": "AUTO-Chatmodus-Fallback" },
"thinkingSummary": { "label": "Kompakte Reasoning-Ausgabe" },
"dynamicStatsig": { "label": "Dynamisches Statsig" },
"enableNsfw": { "label": "NSFW-Erzeugung zulassen" },
+4
View File
@@ -399,6 +399,10 @@
"label": "Default Reasoning Output",
"desc": "Default value applied when the request does not explicitly provide the thinking parameter. When enabled, reasoning steps are returned in reasoning_content."
},
"autoChatModeFallback": {
"label": "AUTO Chat Mode Fallback",
"desc": "When an AUTO chat model has no available auto quota, automatically try the fast and expert chat quota windows."
},
"thinkingSummary": {
"label": "Condensed Reasoning",
"desc": "When enabled, reasoning steps are condensed into a structured summary. When disabled, the full raw reasoning stream is output, with multi-agent collaboration details and tool call traces."
+1
View File
@@ -372,6 +372,7 @@
"memory": { "label": "Memoria de conversación" },
"stream": { "label": "Streaming predeterminado" },
"thinking": { "label": "Salida de razonamiento predeterminada" },
"autoChatModeFallback": { "label": "Reserva de modo AUTO para chat" },
"thinkingSummary": { "label": "Razonamiento condensado" },
"dynamicStatsig": { "label": "Statsig dinámico" },
"enableNsfw": { "label": "Permitir generación NSFW" },
+1
View File
@@ -372,6 +372,7 @@
"memory": { "label": "Mémoire conversationnelle" },
"stream": { "label": "Streaming par défaut" },
"thinking": { "label": "Sortie de raisonnement par défaut" },
"autoChatModeFallback": { "label": "Repli du mode AUTO pour le chat" },
"thinkingSummary": { "label": "Raisonnement condensé" },
"dynamicStatsig": { "label": "Statsig dynamique" },
"enableNsfw": { "label": "Autoriser la génération NSFW" },
+1
View File
@@ -372,6 +372,7 @@
"memory": { "label": "会話メモリ" },
"stream": { "label": "デフォルトのストリーミング" },
"thinking": { "label": "デフォルトの推論出力" },
"autoChatModeFallback": { "label": "AUTO チャットモードのフォールバック" },
"thinkingSummary": { "label": "思考要約出力" },
"dynamicStatsig": { "label": "動的 Statsig" },
"enableNsfw": { "label": "NSFW 生成を許可" },
+4
View File
@@ -399,6 +399,10 @@
"label": "默认思考输出",
"desc": "请求未显式指定 thinking 参数时所采用的默认值。启用后将在 reasoning_content 字段返回思考过程。"
},
"autoChatModeFallback": {
"label": "AUTO 聊天模式回退",
"desc": "AUTO 聊天模型在 auto 额度不可用时,自动尝试 fast 和 expert 聊天额度窗口。"
},
"thinkingSummary": {
"label": "思考精简输出",
"desc": "启用后将思考过程提炼为结构化摘要。关闭时输出完整的原始推理过程,支持多 Agent 模型的协作详情与工具调用展示。"
-2
View File
@@ -32,8 +32,6 @@ stream = true
thinking = true
# 聊天类 AUTO 模型在 auto 额度耗尽时,是否自动降级到 fast/expert
auto_chat_mode_fallback = true
# 当本地额度缓存判定无可用账号时,是否先触发一次按需刷新再重试
on_empty_retry_enabled = true
# 思考精简输出(false=完整原始推理过程,true=提炼结构化摘要)
thinking_summary = false
# 是否动态生成 Statsig 指纹