Skip to content

Commit 4beda8a

Browse files
committed
fix: add range hint to max_retries translations
1 parent 6243c1a commit 4beda8a

5 files changed

Lines changed: 11 additions & 7 deletions

File tree

astrbot/core/config/default.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2514,7 +2514,7 @@
25142514
"max_retries": {
25152515
"description": "最大重试次数",
25162516
"type": "int",
2517-
"hint": "API 调用失败时的最大重试次数,默认为 10。",
2517+
"hint": "API 调用失败时的最大重试次数,范围 1-50,默认为 10。",
25182518
},
25192519
"mimo-stt-system-prompt": {
25202520
"description": "系统提示词",

dashboard/src/i18n/locales/en-US/features/config-metadata.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1514,9 +1514,10 @@
15141514
"description": "Timeout",
15151515
"hint": "Timeout in seconds."
15161516
},
1517-
"max_retries": {
1517+
"max_retries": {
15181518
"description": "Max Retries",
1519-
"hint": "Maximum number of retries when API call fails, default is 10."
1519+
"type": "int",
1520+
"hint": "Maximum number of retries when API call fails, range 1-50, default is 10."
15201521
},
15211522
"mimo-stt-system-prompt": {
15221523
"description": "System prompt",

dashboard/src/i18n/locales/ru-RU/features/config-metadata.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1511,9 +1511,10 @@
15111511
"description": "Таймаут (сек)",
15121512
"hint": "Максимальное время ожидания ответа."
15131513
},
1514-
"max_retries": {
1514+
"max_retries": {
15151515
"description": "Макс. попыток",
1516-
"hint": "Максимальное количество повторных попыток при ошибке API, по умолчанию 10."
1516+
"type": "int",
1517+
"hint": "Максимальное количество повторных попыток при ошибке API, диапазон 1-50, по умолчанию 10."
15171518
},
15181519
"mimo-stt-system-prompt": {
15191520
"description": "Системный промпт",

dashboard/src/i18n/locales/zh-CN/features/config-metadata.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1516,9 +1516,10 @@
15161516
"description": "超时时间",
15171517
"hint": "超时时间,单位为秒。"
15181518
},
1519-
"max_retries": {
1519+
"max_retries": {
15201520
"description": "最大重试次数",
1521-
"hint": "API 调用失败时的最大重试次数,默认为 10。"
1521+
"type": "int",
1522+
"hint": "API 调用失败时的最大重试次数,范围 1-50,默认为 10。"
15221523
},
15231524
"mimo-stt-system-prompt": {
15241525
"description": "系统提示词",

pr_update.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"title": "feat: 为 OpenAI provider 添加可配置的最大重试次数", "body": "## 问题描述\n\nOpenAI provider 的 \\max_retries\\ 硬编码为 10,导致超时时最长等待 20 分钟。\n\n## 修复方案\n\n添加可配置的 \\max_retries\\ 选项,允许用户控制最大重试次数。默认值保持 10。\n\n## 修改内容\n\n- \\openai_source.py\\:从 provider 配置读取 \\max_retries\\,不再使用硬编码值\n- \\default.py\\:在 OpenAI provider 模板中添加 \\max_retries: 10- \\config-metadata.json\\:添加中英俄三语翻译\n\n## 关联 Issue\n\nFixes #7956\n\n## Summary by Sourcery\n\nMake the OpenAI provider retry limit configurable via provider settings while keeping the existing default.\n\nNew Features:\n- Introduce a configurable max_retries option for the OpenAI provider to control API call retry attempts.\n\nEnhancements:\n- Use the provider configuration to determine max_retries in OpenAI text chat and streaming calls instead of a hardcoded value.\n- Extend default OpenAI provider configuration and i18n metadata to surface the new max_retries setting in the UI."}

0 commit comments

Comments
 (0)