From 5bdedd64ae164dad2c5f265aaa346e5b8605e4e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BA=A2=E8=B1=86=E7=B3=95?= <3083636750@qq.com> Date: Thu, 5 Nov 2026 20:17:36 +0800 Subject: [PATCH 01/10] fix(qqofficial): stop logging image payload on upload failure (#10740) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(qqofficial): stop logging image payload on upload failure 图片上传最终失败时,warning 把整包 payload 写进日志,其中 file_data 是整张 图片的 base64(单张卡片常见数 MB)。一条这样的日志足以拖慢日志写入,并让 WebUI 的日志流卡住,表现为服务器/面板几乎不可用。 - 失败日志只保留 file_type、接收方与数据体积,不再包含图片二进制; - 图片上传重试 5 次 → 3 次,并关闭逐次 WARNING(保留一条汇总),避免一次 失败在指数退避下占住事件循环 30s 以上、同时刷屏; - 新增回归测试,断言失败日志中不含 base64 数据且尝试次数为 3。 * Delete tests/test_qqofficial_image_upload_log.py --------- Co-authored-by: Soulter <37870767+Soulter@users.noreply.github.com> --- .../qqofficial/qqofficial_message_event.py | 18 ++++++++++++++---- changelogs/unreleased.md | 2 ++ 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/astrbot/core/platform/sources/qqofficial/qqofficial_message_event.py b/astrbot/core/platform/sources/qqofficial/qqofficial_message_event.py index 8b9a9174d79..906344b7891 100644 --- a/astrbot/core/platform/sources/qqofficial/qqofficial_message_event.py +++ b/astrbot/core/platform/sources/qqofficial/qqofficial_message_event.py @@ -54,6 +54,9 @@ class APIReturnNoneError(Exception): pass +_IMAGE_UPLOAD_MAX_ATTEMPTS = 3 + + def _patch_qq_botpy_formdata() -> None: """Patch qq-botpy for aiohttp>=3.12 compatibility. @@ -74,7 +77,7 @@ def _patch_qq_botpy_formdata() -> None: _patch_qq_botpy_formdata() -def _qqofficial_retry(max_attempts: int = 5): +def _qqofficial_retry(max_attempts: int = 5, *, log_retries: bool = True): """Retry decorator for QQ Official API transient errors (HTTP 500/504)""" return retry( retry=retry_if_exception_type( @@ -88,7 +91,7 @@ def _qqofficial_retry(max_attempts: int = 5): ), stop=stop_after_attempt(max_attempts), wait=wait_exponential(multiplier=2, min=2, max=30), - before_sleep=before_sleep_log(logger, logging.WARNING), + before_sleep=before_sleep_log(logger, logging.WARNING) if log_retries else None, reraise=True, ) @@ -807,7 +810,7 @@ async def upload_group_and_c2c_image( "srv_send_msg": False, } - @_qqofficial_retry() + @_qqofficial_retry(_IMAGE_UPLOAD_MAX_ATTEMPTS, log_retries=False) async def _do_upload(): if "openid" in kwargs: payload["openid"] = kwargs["openid"] @@ -833,7 +836,14 @@ async def _do_upload(): try: result = await _do_upload() except APIReturnNoneError: - logger.warning(f"上传图片API返回None,共尝试5次后放弃: {payload}") + logger.warning( + "[QQOfficial] 上传图片失败:API 返回 None(共尝试 %s 次)," + "file_type=%s, target=%s, data_size=%s bytes", + _IMAGE_UPLOAD_MAX_ATTEMPTS, + file_type, + kwargs.get("group_openid") or kwargs.get("openid") or "-", + len(image_base64), + ) raise if not isinstance(result, dict): diff --git a/changelogs/unreleased.md b/changelogs/unreleased.md index 79e701b844d..b06e68235cc 100644 --- a/changelogs/unreleased.md +++ b/changelogs/unreleased.md @@ -1 +1,3 @@ # Unreleased + +- QQ Official: a failed image upload no longer dumps the base64 payload into the log (a single multi-MB line could freeze log writing and the web dashboard), and image upload retries drop from 5 to 3 with a single summary warning instead of one per attempt. From 75c135861573b284938227d25da886945ffe2ad1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BA=A2=E8=B1=86=E7=B3=95?= <3083636750@qq.com> Date: Thu, 5 Nov 2026 20:17:43 +0800 Subject: [PATCH 02/10] fix(webui): wrap long plugin commands (#10860) Allow command names in plugin details to wrap instead of truncating them with an ellipsis. Keep command-group controls, indentation, and table column widths unchanged. Fixes #10856 --- dashboard/src/views/extension/PluginDetailPage.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dashboard/src/views/extension/PluginDetailPage.vue b/dashboard/src/views/extension/PluginDetailPage.vue index c94ee39b627..f26e1b3557d 100644 --- a/dashboard/src/views/extension/PluginDetailPage.vue +++ b/dashboard/src/views/extension/PluginDetailPage.vue @@ -1329,10 +1329,10 @@ onBeforeUnmount(() => { background-color: rgba(var(--v-theme-primary), 0.1); border-radius: 4px; font-size: 0.9em; - overflow: hidden; + min-width: 0; + overflow-wrap: anywhere; padding: 2px 6px; - text-overflow: ellipsis; - white-space: nowrap; + white-space: normal; } .command-cell code.command-code--group { From 3b1e7d90153701bdc037202348e0c81003b6da52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BA=A2=E8=B1=86=E7=B3=95?= <3083636750@qq.com> Date: Thu, 5 Nov 2026 20:17:53 +0800 Subject: [PATCH 03/10] fix: preserve animation guidance with persistent montage images (#10837) * fix: preserve animation guidance with persistent montage images * test: focus animation guidance coverage on history replay --------- Co-authored-by: Anka <1350989414@qq.com> --- astrbot/core/utils/image_input.py | 6 +++++- tests/test_process_stage_images.py | 32 +++++++++++++++++++++++++++++- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/astrbot/core/utils/image_input.py b/astrbot/core/utils/image_input.py index f3f9558b596..7c1b79a00ed 100644 --- a/astrbot/core/utils/image_input.py +++ b/astrbot/core/utils/image_input.py @@ -159,6 +159,7 @@ async def prepare_request_images( ) oversized = None montage = None + has_persistent_montage = False for result, index, temporary in rows: name = f"Image {index}" if index is not None else "Image Attachment" origin = " in quoted message" if result["quoted"] else "" @@ -167,6 +168,7 @@ async def prepare_request_images( if result["montage"]: status = "; animation converted to a 3x3 frame montage" montage = result + has_persistent_montage |= not temporary elif result["status"] == "oversized": status = ( f"; skipped: exceeds {MODEL_IMAGE_MAX_INPUT_BYTES // (1024 * 1024)} MiB" @@ -200,7 +202,9 @@ async def prepare_request_images( "Images labeled as animation montages contain frames in reading order. " "Treat them as animations; do not mention the conversion or frame layout.\n" "" - ).mark_as_temp() + ) + if not has_persistent_montage: + advice.mark_as_temp() montage["notices"].append(advice) parts.append(advice) req.extra_user_content_parts = parts diff --git a/tests/test_process_stage_images.py b/tests/test_process_stage_images.py index ffa9717dcd2..4d749ff56fc 100644 --- a/tests/test_process_stage_images.py +++ b/tests/test_process_stage_images.py @@ -17,7 +17,9 @@ from astrbot.core import astr_main_agent as main from astrbot.core.agent.message import ( ImageURLPart, + Message, TextPart, + bind_checkpoint_messages, dump_messages_with_checkpoints, ) from astrbot.core.agent.tool import FunctionTool, ToolSet @@ -352,7 +354,7 @@ async def test_animation_montage_notice_reaches_model(harness, tmp_path): ] assert len(notices) == int(expected) if expected: - assert notices[0]._no_save + assert not notices[0]._no_save assert notices[0].text.startswith("\n") assert notices[0].text.endswith("\n") assert "contain frames in reading order" in notices[0].text @@ -360,6 +362,34 @@ async def test_animation_montage_notice_reaches_model(harness, tmp_path): assert "do not mention the conversion or frame layout" in notices[0].text +@pytest.mark.asyncio +async def test_persistent_animation_guidance_survives_history_reload(harness, tmp_path): + req = ProviderRequest( + prompt="describe", + image_urls=[str(source_image(tmp_path))], + ) + await image_input.prepare_request_images( + req, + make_event(), + max_size=90, + output_dir=harness.work, + prepared={}, + ) + + message = Message.model_validate(await req.assemble_context()) + sent = Provider._ensure_message_to_dicts(harness.provider, [message]) + saved = dump_messages_with_checkpoints([message]) + replayed = Provider._ensure_message_to_dicts( + harness.provider, bind_checkpoint_messages(saved) + ) + + assert any( + "Images labeled as animation montages" in part.get("text", "") + for part in sent[0]["content"] + ) + assert replayed == sent + + @pytest.mark.asyncio async def test_profile_reload_and_concurrent_requests(harness, tmp_path): source = source_image(tmp_path) From c847f4a8ff3435b6b03386277002029b135a2970 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BA=A2=E8=B1=86=E7=B3=95?= <3083636750@qq.com> Date: Thu, 5 Nov 2026 20:18:02 +0800 Subject: [PATCH 04/10] fix(provider): default Gemini TTS to gemini-3.8-flash-tts (#10828) * fix(provider): default Gemini TTS to gemini-3.8-flash-tts Co-Authored-By: Claude Sonnet 5.5 * test: remove Gemini TTS default model tests --------- Co-authored-by: Claude Sonnet 5.5 Co-authored-by: Anka <1350989414@qq.com> --- astrbot/core/config/default.py | 2 +- astrbot/core/provider/sources/gemini_tts_source.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/astrbot/core/config/default.py b/astrbot/core/config/default.py index 0073dbecacd..e08887eb1f5 100644 --- a/astrbot/core/config/default.py +++ b/astrbot/core/config/default.py @@ -1951,7 +1951,7 @@ def get_local_permission_defaults(system: str | None = None) -> dict: "gemini_tts_api_key": "", "gemini_tts_api_base": "", "gemini_tts_timeout": 20, - "gemini_tts_model": "gemini-2.5-flash-preview-tts", + "gemini_tts_model": "gemini-3.8-flash-tts", "gemini_tts_prefix": "", "gemini_tts_voice_name": "Leda", "proxy": "", diff --git a/astrbot/core/provider/sources/gemini_tts_source.py b/astrbot/core/provider/sources/gemini_tts_source.py index 136916aa1db..e7937b471e2 100644 --- a/astrbot/core/provider/sources/gemini_tts_source.py +++ b/astrbot/core/provider/sources/gemini_tts_source.py @@ -45,7 +45,7 @@ def __init__( self.client._api_client._http_options.headers.pop("user-agent", None) self.model: str = provider_config.get( "gemini_tts_model", - "gemini-2.5-flash-preview-tts", + "gemini-3.8-flash-tts", ) self.prefix: str | None = provider_config.get( "gemini_tts_prefix", From bd517c095751eacfbcf3ae7217dbf40d7149d8f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BA=A2=E8=B1=86=E7=B3=95?= <3083636750@qq.com> Date: Thu, 5 Nov 2026 20:18:09 +0800 Subject: [PATCH 05/10] fix(telegram): fall back to display name for senders without a username (#10715) * fix(telegram): fall back to display name for senders without a username Co-authored-by: Cursor * test: remove sender nickname fallback test --------- Co-authored-by: Cursor Co-authored-by: Anka <1350989414@qq.com> --- astrbot/core/platform/sources/telegram/tg_adapter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/astrbot/core/platform/sources/telegram/tg_adapter.py b/astrbot/core/platform/sources/telegram/tg_adapter.py index 54588016ee1..0567b16dd92 100644 --- a/astrbot/core/platform/sources/telegram/tg_adapter.py +++ b/astrbot/core/platform/sources/telegram/tg_adapter.py @@ -659,7 +659,7 @@ def _apply_caption() -> None: return None message.sender = MessageMember( str(_from_user.id), - _from_user.username or "Unknown", + _from_user.username or _from_user.full_name or "Unknown", ) message.self_id = str(context.bot.username) message.raw_message = update From fda7358eefa33a0a364f4ec2c8dbbf91b9ebcbd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BA=A2=E8=B1=86=E7=B3=95?= <3083636750@qq.com> Date: Thu, 5 Nov 2026 20:18:20 +0800 Subject: [PATCH 06/10] chore: replace legacy AstrBot icons with new artwork (#10997) --- .../src/assets/images/icon-no-shadow.svg | 15 ++++++++++++++- docs/public/logo.png | Bin 1467 -> 946 bytes docs/public/logo_prod.png | Bin 80735 -> 28050 bytes 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/dashboard/src/assets/images/icon-no-shadow.svg b/dashboard/src/assets/images/icon-no-shadow.svg index 4268e03e22c..e4f30733bdc 100644 --- a/dashboard/src/assets/images/icon-no-shadow.svg +++ b/dashboard/src/assets/images/icon-no-shadow.svg @@ -1 +1,14 @@ -
\ No newline at end of file + + + + + + + + diff --git a/docs/public/logo.png b/docs/public/logo.png index 88d34417d88a6ab314a2871b6ff1837d5a24a1ac..22cb0fe9cd7cd3fcb66bce52719e03725b997736 100644 GIT binary patch delta 925 zcmV;O17iHU3$h20BYy*VNkl{{*Y}RW-aGhVJ)uzkbs_f>+K; zz@k|RNE-WB%f?%D+)}>FY9LD`z&>f^l$J(^uvw>C{? zVQB>D&{0qQ8=3<|;n@9Ns33r)5MZCSGU{>Qd=_JfVBb9~)Zv4$EEGNRc4*< z=0Mn?Zx+#`K7StXrU+1S%Y_=vXLv0>dNi5-?r4ti%_2JH@wZo3O1`ja1RcG{8*9h? zmUmfwhS%f6(I2J1XG|8L77p}kenRNrJwGa5ZS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|$)NZ(e6RTLLGkt*wZ#8$yKTP>+mMFF&y_ zwUjy6cK5=Vx(kj0deou&yT>scxcx~G$em|f(zawCPd~V*vkl=wpN73P06-S@E zwiE+x0X<*w-S&HHg#bb!+DSKL?)6^KCSYD!p%_ibw@siQy!OpeZ+5Ngb2vIi1oqhH z`60#@fMha-tlT;pEdn&8`@)YLDwf{hpG5$^=Cm%c^0fp=0`dh%{G(kO3etepz1XX9 z+T_vt&Io~35#dh?ASh$wY$`A*x87diyl_{P(68983rAmX zD|%-VFk=51PWOL@(-DT{^~yoQ(K+BnTSsNL>j1Qp+4QsZEN&gP2t`~LL%UR7IGVZx z?1Kx}O00C1f!;v3LBH^GGhIU!cmA_$=vH7TA0~{kIl>K)oCY^H%Fxb;W$`ck$3TB7 z>Gix|yCw)zc)3{VX$1O$@YLWFT^z>*2ISNh7m9|f)@m~UJKPfp+M-MsCbV`o+X!na z0jy^Wu(^%Q-*@2mBCz66%AfnM2?PJokRWhkW?TL*5%-@bD`JE|g(S6R^7`QGBdlp5 jx Date: Thu, 5 Nov 2026 20:19:00 +0800 Subject: [PATCH 07/10] test: prune low-value and duplicate cases from audited suites (#11005) - remove stdlib self-tests, docs snapshots, and redundant coverage - parameterize timeout, image, download, CLI, reply, and backoff cases - merge System One template defaults and assert unknown provider no-op 5311 passed, 35 skipped (was 5345 passed) --- tests/test_astrbot_path.py | 28 ++--- tests/test_builtin_office_skills.py | 16 --- tests/test_builtin_pdf_skill.py | 14 --- tests/test_computer_skill_sync.py | 7 -- tests/test_decision_provider.py | 37 ++---- tests/test_dingtalk_adapter.py | 30 +++-- tests/test_httpx_socks_dependency.py | 49 -------- tests/test_pip_helper_modules.py | 18 --- ...test_platform_image_format_preservation.py | 39 +++--- tests/test_qqofficial_stream_buffer_copy.py | 18 --- tests/test_security_fixes.py | 54 -------- tests/test_weixin_oc_adapter_timeout_floor.py | 40 +++--- tests/unit/test_aiocqhttp_reply.py | 119 +++--------------- tests/unit/test_astrbot_message.py | 103 --------------- tests/unit/test_cli_plugin_utils.py | 25 ++-- tests/unit/test_io_download_file.py | 38 ++---- tests/unit/test_persona_mgr.py | 17 --- .../unit/test_third_party_agent_sub_stage.py | 100 +++------------ 18 files changed, 123 insertions(+), 629 deletions(-) diff --git a/tests/test_astrbot_path.py b/tests/test_astrbot_path.py index 58c5f1498bc..72e4461e976 100644 --- a/tests/test_astrbot_path.py +++ b/tests/test_astrbot_path.py @@ -2,27 +2,27 @@ import tempfile from pathlib import Path +import pytest + from astrbot.core.utils.astrbot_path import get_astrbot_system_tmp_path -def test_system_tmp_path_lives_in_the_system_temp_dir(monkeypatch, tmp_path): +@pytest.mark.parametrize("existing_dir", [False, True]) +def test_system_tmp_path_lives_in_the_system_temp_dir( + monkeypatch, tmp_path, existing_dir +): system_temp = tmp_path / "system_temp" - system_temp.mkdir() + target = system_temp / ".astrbot" + if existing_dir: + target.mkdir(parents=True) + else: + system_temp.mkdir() monkeypatch.setattr(tempfile, "tempdir", str(system_temp)) - assert get_astrbot_system_tmp_path() == os.path.realpath( - str(system_temp / ".astrbot") - ) - - -def test_system_tmp_path_keeps_an_existing_directory(monkeypatch, tmp_path): - system_temp = tmp_path / "system_temp" - (system_temp / ".astrbot").mkdir(parents=True) - monkeypatch.setattr(tempfile, "tempdir", str(system_temp)) + resolved = get_astrbot_system_tmp_path() - assert get_astrbot_system_tmp_path() == os.path.realpath( - str(system_temp / ".astrbot") - ) + assert resolved == os.path.realpath(str(target)) + assert Path(resolved).is_dir() is existing_dir def test_system_tmp_path_never_shadows_the_init_marker_file(monkeypatch, tmp_path): diff --git a/tests/test_builtin_office_skills.py b/tests/test_builtin_office_skills.py index aae86d47c58..4d77bc6785a 100644 --- a/tests/test_builtin_office_skills.py +++ b/tests/test_builtin_office_skills.py @@ -133,19 +133,3 @@ def test_document_skill_inspects_validates_scrubs_and_extracts_table( ["项目", "状态"], ["DOCX Skill", "完成"], ] - - -def test_office_skill_docs_cover_advanced_workflows() -> None: - spreadsheets = (BUILTIN_SKILLS_DIR / "spreadsheets" / "SKILL.md").read_text( - encoding="utf-8" - ) - documents = (BUILTIN_SKILLS_DIR / "documents" / "SKILL.md").read_text( - encoding="utf-8" - ) - - for text in ("keep_vba=True", "conditional formatting", "data validation"): - assert text in spreadsheets - for text in ("tracked revisions", "content controls", "digital signature"): - assert text in documents - assert "Codex" not in spreadsheets - assert "Codex" not in documents diff --git a/tests/test_builtin_pdf_skill.py b/tests/test_builtin_pdf_skill.py index 1d6d21a8ccf..02f710f7b6e 100644 --- a/tests/test_builtin_pdf_skill.py +++ b/tests/test_builtin_pdf_skill.py @@ -74,17 +74,3 @@ def test_builtin_pdf_skill_rejects_unsupported_default_font_character( assert result.returncode != 0 assert "Pass --font" in result.stderr assert not output.exists() - - -def test_builtin_pdf_skill_documents_system_and_downloaded_fonts() -> None: - skill = (PDF_SKILL_DIR / "SKILL.md").read_text(encoding="utf-8") - - assert "search common system locations" in skill - assert "--font path/to/font.ttf" in skill - assert "https://hyperos.mi.com/font/zh/download/" in skill - assert "https://github.com/notofonts/noto-cjk/" in skill - assert "https://edgeone.gh-proxy.com/https://github.com/" in skill - assert "https://hk.gh-proxy.com/" in skill - assert "https://gh-proxy.com/" in skill - assert "https://gh.dpik.top/" in skill - assert "Never send credentials" in skill diff --git a/tests/test_computer_skill_sync.py b/tests/test_computer_skill_sync.py index a1977c9c71b..7032dec2dcc 100644 --- a/tests/test_computer_skill_sync.py +++ b/tests/test_computer_skill_sync.py @@ -267,13 +267,6 @@ def test_sync_skills_skips_inactive_plugin_provided_skills( assert any(cmd == "rm -f skills/skills.zip" for cmd in booter.shell.commands) -def test_build_scan_command_frontmatter_newline_is_escaped_literal(): - command = computer_client._build_scan_command() - script = _extract_embedded_python(command) - - assert 'frontmatter = "\\n".join(lines[1:end_idx])' in script - - def test_build_scan_command_embedded_python_is_syntax_valid(): command = computer_client._build_scan_command() script = _extract_embedded_python(command) diff --git a/tests/test_decision_provider.py b/tests/test_decision_provider.py index dfc1a1d4831..232b074a70d 100644 --- a/tests/test_decision_provider.py +++ b/tests/test_decision_provider.py @@ -138,7 +138,7 @@ def handler(request: httpx.Request) -> httpx.Response: assert captured["url"] == expected_url -def test_system_one_templates_use_a_single_key_and_two_second_timeout(): +def test_system_one_templates_expose_required_defaults(): templates = CONFIG_METADATA_2["provider_group"]["metadata"]["provider"][ "config_template" ] @@ -148,34 +148,11 @@ def test_system_one_templates_use_a_single_key_and_two_second_timeout(): "Vercel System One", "Custom System One", ): - assert templates[name]["key"] == "" - assert templates[name]["timeout"] == 2 - - -def test_system_one_templates_expose_total_timeout(): - templates = CONFIG_METADATA_2["provider_group"]["metadata"]["provider"][ - "config_template" - ] - for name in ( - "TypeSafe System One", - "OpenRouter System One", - "Vercel System One", - "Custom System One", - ): - assert templates[name]["total_timeout"] == 5 - - -def test_system_one_templates_expose_max_concurrency(): - templates = CONFIG_METADATA_2["provider_group"]["metadata"]["provider"][ - "config_template" - ] - for name in ( - "TypeSafe System One", - "OpenRouter System One", - "Vercel System One", - "Custom System One", - ): - assert templates[name]["max_concurrency"] == 4 + template = templates[name] + assert template["key"] == "" + assert template["timeout"] == 2 + assert template["total_timeout"] == 5 + assert template["max_concurrency"] == 4 @pytest.mark.asyncio @@ -654,7 +631,9 @@ async def test_provider_manager_ignores_unknown_provider_id(): persona_manager.default_persona = "" manager = ProviderManager(acm, MagicMock(), persona_manager) + assert manager.inst_map == {} await manager.terminate_provider("missing") + assert manager.inst_map == {} @pytest.mark.asyncio diff --git a/tests/test_dingtalk_adapter.py b/tests/test_dingtalk_adapter.py index 6139e1bb061..1db53cc54e9 100644 --- a/tests/test_dingtalk_adapter.py +++ b/tests/test_dingtalk_adapter.py @@ -54,22 +54,20 @@ def _dingtalk_group_message(**payload) -> dingtalk_stream.ChatbotMessage: ) -def test_dingtalk_reconnect_delay_uses_exponential_backoff(): - assert [_dingtalk_reconnect_delay(i) for i in range(1, 5)] == [ - 10, - 20, - 40, - 80, - ] - - -def test_dingtalk_reconnect_delay_has_minimum_delay(): - assert _dingtalk_reconnect_delay(0) == DINGTALK_RECONNECT_INITIAL_DELAY - assert _dingtalk_reconnect_delay(-1) == DINGTALK_RECONNECT_INITIAL_DELAY - - -def test_dingtalk_reconnect_delay_is_capped(): - assert _dingtalk_reconnect_delay(20) == DINGTALK_RECONNECT_MAX_DELAY +@pytest.mark.parametrize( + ("retry_count", "expected"), + [ + (0, DINGTALK_RECONNECT_INITIAL_DELAY), + (-1, DINGTALK_RECONNECT_INITIAL_DELAY), + (1, 10), + (2, 20), + (3, 40), + (4, 80), + (20, DINGTALK_RECONNECT_MAX_DELAY), + ], +) +def test_dingtalk_reconnect_delay_backs_off_and_is_clamped(retry_count, expected): + assert _dingtalk_reconnect_delay(retry_count) == expected @pytest.mark.asyncio diff --git a/tests/test_httpx_socks_dependency.py b/tests/test_httpx_socks_dependency.py index 7f5c386e0ce..e9ef5838d5b 100644 --- a/tests/test_httpx_socks_dependency.py +++ b/tests/test_httpx_socks_dependency.py @@ -1,8 +1,6 @@ import re from pathlib import Path -import pytest - from astrbot.core.utils.toml_parser import read_pyproject_project_dependencies PROJECT_ROOT = Path(__file__).resolve().parents[1] @@ -63,50 +61,3 @@ def test_httpx_socks_dependency_spec_matches_between_dependency_files() -> None: "and pyproject.toml for SOCKS proxy support" ) - -@pytest.mark.parametrize( - "entry", - [ - "httpx[socks]", - "httpx[socks]==0.27.0", - "httpx[socks]==0.28.1", - "httpx[socks]>=0.27.0,<0.28.0", - "httpx[socks]>=0.27,<0.29", - 'httpx[socks]; python_version >= "3.11"', - 'httpx[socks]>=0.27.0 ; python_version < "3.13"', - 'httpx[socks] ; python_version < "3.13"', - 'httpx[socks] >=0.27 ; python_version < "3.13"', - ], -) -def test_httpx_socks_pattern_matches_valid_variants(entry: str) -> None: - match = HTTPX_SOCKS_PATTERN.match(entry) - - assert match is not None, ( - f"Expected httpx[socks] dependency pattern to match valid entry for " - f"SOCKS proxy support: {entry}" - ) - assert match.group(0) == entry, ( - f"Expected httpx[socks] dependency pattern to fully match valid entry " - f"for SOCKS proxy support: {entry}" - ) - - -@pytest.mark.parametrize( - "entry", - [ - "httpx", - "httpx==0.27.0", - "httpx[http2]", - "httpx[socks-extra]", - "httpx [socks]", - "someprefix httpx[socks]", - "httpx[socks] trailing-text", - "httpx[socks] extra ; markers", - "httpx[socks]andmore", - ], -) -def test_httpx_socks_pattern_rejects_invalid_variants(entry: str) -> None: - assert HTTPX_SOCKS_PATTERN.match(entry) is None, ( - f"Expected httpx[socks] dependency pattern to reject invalid entry for " - f"SOCKS proxy support: {entry}" - ) diff --git a/tests/test_pip_helper_modules.py b/tests/test_pip_helper_modules.py index 84aed7e7028..012a70bdd96 100644 --- a/tests/test_pip_helper_modules.py +++ b/tests/test_pip_helper_modules.py @@ -181,24 +181,6 @@ def test_build_missing_requirements_install_lines_returns_empty_tuple_when_all_s assert install_lines == () -def test_build_missing_requirements_install_lines_returns_none_for_option_lines( - tmp_path, -): - requirements_path = tmp_path / "requirements.txt" - requirements_path.write_text( - "--extra-index-url https://example.com/simple\nboto3\n", - encoding="utf-8", - ) - - install_lines = requirements_utils.build_missing_requirements_install_lines( - str(requirements_path), - ["--extra-index-url https://example.com/simple", "boto3"], - {"boto3"}, - ) - - assert install_lines is None - - def test_build_missing_requirements_install_lines_skips_inactive_marker_lines( tmp_path, ): diff --git a/tests/test_platform_image_format_preservation.py b/tests/test_platform_image_format_preservation.py index a2ba2f27ffd..35483cd8b64 100644 --- a/tests/test_platform_image_format_preservation.py +++ b/tests/test_platform_image_format_preservation.py @@ -16,39 +16,28 @@ @pytest.mark.asyncio -async def test_satori_image_data_url_preserves_png_mime_type(): +@pytest.mark.parametrize( + ("image_format", "mode", "color", "mime_type"), + [ + ("PNG", "RGBA", (255, 0, 0, 128), "image/png"), + ("JPEG", "RGB", (0, 255, 0), "image/jpeg"), + ], +) +async def test_satori_image_data_url_preserves_mime_type( + image_format, mode, color, mime_type +): image_buffer = BytesIO() - PILImage.new("RGBA", (2, 2), (255, 0, 0, 128)).save( - image_buffer, - format="PNG", - ) - image_ref = ( - "data:image/png;base64," + base64.b64encode(image_buffer.getvalue()).decode() - ) - - result = await SatoriPlatformEvent._convert_component_to_satori_static( - Image(file=image_ref), - ) - - assert result.startswith(' None assert "".join(texts) == "不稀罕" -def test_append_stream_delta_old_reference_style_loses_first_char() -> None: - """Document the broken pre-fix behavior (reference assign + extend).""" - event = _make_group_event() - shared = MessageChain(chain=[Plain("不")]) - - # Pre-fix group path: - # if not send_buffer: send_buffer = chain - # else: send_buffer.chain.extend(chain.chain) - event.send_buffer = shared - shared.chain[0].text = "稀" - event.send_buffer.chain.extend(shared.chain) - - # After mutation + extend-on-self, leading "不" is gone. - joined = "".join(c.text for c in event.send_buffer.chain if isinstance(c, Plain)) - assert "不" not in joined - assert joined.startswith("稀") - - @pytest.mark.asyncio async def test_group_stream_keeps_first_character_when_delta_reused() -> None: """End-to-end group send_streaming with reused/mutated MessageChain.""" diff --git a/tests/test_security_fixes.py b/tests/test_security_fixes.py index d4e455541f5..12ceb3f9e1a 100644 --- a/tests/test_security_fixes.py +++ b/tests/test_security_fixes.py @@ -1,7 +1,6 @@ """Tests for security fixes - cryptographic random number generation and SSL context.""" import os -import ssl import sys # Add project root to sys.path @@ -94,58 +93,5 @@ async def test_nonce_generation(): asyncio.run(test_nonce_generation()) -def test_ssl_context_fallback_explicit(): - """Test that SSL context fallback is properly configured.""" - # This test verifies the SSL context configuration - # We can't easily test the full io.py functions without network calls, - # but we can verify that ssl.CERT_NONE and check_hostname=False are valid settings - - # Create a context similar to what's used in io.py - ssl_context = ssl.create_default_context() - ssl_context.check_hostname = False - ssl_context.verify_mode = ssl.CERT_NONE - - # Verify the settings are applied correctly - assert ssl_context.check_hostname is False - assert ssl_context.verify_mode == ssl.CERT_NONE - - # This configuration should work but is intentionally insecure for fallback - # The actual code only uses this when certificate validation fails - - -def test_io_module_has_ssl_imports(): - """Verify that io.py properly imports ssl module.""" - from astrbot.core.utils import io - - # Check that ssl is available in the module - assert hasattr(io, "ssl") - - # Check that CERT_NONE constant is accessible - assert hasattr(io.ssl, "CERT_NONE") - - -def test_secrets_module_randomness_quality(): - """Test that secrets module provides high-quality randomness.""" - import secrets - - # Generate a large set of random numbers - random_numbers = [secrets.randbelow(100) for _ in range(1000)] - - # Basic statistical test: should have good distribution - unique_values = len(set(random_numbers)) - - # With 1000 random numbers from 0-99, we should see most values at least once - # This is a very basic test - real cryptographic random should pass this easily - assert unique_values >= 60 # Should see at least 60 different values out of 100 - - # Test secrets.choice for string generation - chars = "abcdefghijklmnopqrstuvwxyz0123456789" - random_chars = [secrets.choice(chars) for _ in range(1000)] - - # Should have good character distribution - unique_chars = len(set(random_chars)) - assert unique_chars >= 20 # Should see at least 20 different characters - - if __name__ == "__main__": pytest.main([__file__, "-v"]) diff --git a/tests/test_weixin_oc_adapter_timeout_floor.py b/tests/test_weixin_oc_adapter_timeout_floor.py index 8ba9db9965a..86b22c12378 100644 --- a/tests/test_weixin_oc_adapter_timeout_floor.py +++ b/tests/test_weixin_oc_adapter_timeout_floor.py @@ -13,6 +13,8 @@ import asyncio +import pytest + from astrbot.core.platform.sources.weixin_oc.weixin_oc_adapter import ( WeixinOCAdapter, ) @@ -30,30 +32,22 @@ def _adapter(**overrides) -> WeixinOCAdapter: return WeixinOCAdapter(config, {"settings": {}}, asyncio.Queue()) -def test_cleared_api_timeout_falls_back_to_a_positive_floor(): - adapter = _adapter(weixin_oc_api_timeout_ms=0) - assert adapter.api_timeout_ms == MINIMUM_TIMEOUT_MS - # the value that actually reaches aiohttp.ClientTimeout(total=...) - assert adapter.client.api_timeout_ms == MINIMUM_TIMEOUT_MS - - -def test_cleared_long_poll_timeout_falls_back_to_a_positive_floor(): - adapter = _adapter(weixin_oc_long_poll_timeout_ms=0) - assert adapter.long_poll_timeout_ms == MINIMUM_TIMEOUT_MS - - -def test_negative_timeouts_are_clamped_like_the_login_flow(): - adapter = _adapter( - weixin_oc_api_timeout_ms=-1, - weixin_oc_long_poll_timeout_ms=-35_000, - ) - assert adapter.api_timeout_ms == MINIMUM_TIMEOUT_MS - assert adapter.long_poll_timeout_ms == MINIMUM_TIMEOUT_MS - +@pytest.mark.parametrize( + ("config_key", "value", "attr"), + [ + ("weixin_oc_api_timeout_ms", 0, "api_timeout_ms"), + ("weixin_oc_long_poll_timeout_ms", 0, "long_poll_timeout_ms"), + ("weixin_oc_api_timeout_ms", -1, "api_timeout_ms"), + ("weixin_oc_long_poll_timeout_ms", -35_000, "long_poll_timeout_ms"), + ("weixin_oc_api_timeout_ms", 200, "api_timeout_ms"), + ], +) +def test_timeouts_below_the_floor_are_clamped(config_key, value, attr): + adapter = _adapter(**{config_key: value}) -def test_config_value_below_the_floor_still_clamped(): - adapter = _adapter(weixin_oc_api_timeout_ms=200) - assert adapter.api_timeout_ms == MINIMUM_TIMEOUT_MS + assert getattr(adapter, attr) == MINIMUM_TIMEOUT_MS + if attr == "api_timeout_ms": + assert adapter.client.api_timeout_ms == MINIMUM_TIMEOUT_MS def test_a_tuned_value_is_kept(): diff --git a/tests/unit/test_aiocqhttp_reply.py b/tests/unit/test_aiocqhttp_reply.py index ac32bee6d32..e71e4ca0ef7 100644 --- a/tests/unit/test_aiocqhttp_reply.py +++ b/tests/unit/test_aiocqhttp_reply.py @@ -28,48 +28,6 @@ # ============================================================ -def test_reply_to_dict_contains_only_id_in_data(): - """Reply.toDict() 应当只输出 id 字段,不含 chain、sender_id 等多余字段。 - - 当前实际行为:继承了 BaseMessageComponent.toDict(),会将所有 - 非 None 的默认值(chain: [], sender_id: 0, qq: 0, seq: 0 等) - 一起序列化,违反了 OneBot V11 的 reply 段格式约定。 - """ - reply = Comp.Reply(id="123456") - - result = reply.toDict() - - assert result["type"] == "reply" - assert "id" in result["data"] - - # 这些字段不应出现在 OneBot 协议的 reply segment 中 - unexpectedFields = ["chain", "sender_id", "qq", "seq", "text"] - for field in unexpectedFields: - if field in result["data"]: - pytest.fail( - f"Reply.toDict() 的 data 中不应包含 '{field}' 字段," - f"但实际输出了 {field}={result['data'][field]!r}。" - f"完整输出: {result}" - ) - - -def test_reply_to_dict_outputs_only_id(): - """Reply.toDict() 应当只输出 id 字段,不含任何多余字段。""" - reply = Comp.Reply(id="123456") - result = reply.toDict() - - assert result["type"] == "reply" - assert set(result["data"].keys()) == {"id"}, ( - f"Reply.toDict() data 中包含多余字段: {set(result['data'].keys()) - {'id'}}" - ) - assert result["data"]["id"] == "123456" - - -# ============================================================ -# _parse_onebot_json 输出测试 -# ============================================================ - - @pytest.mark.asyncio async def test_parse_onebot_json_reply_produces_extra_fields(): """_parse_onebot_json 处理 Reply 时会输出多余字段。 @@ -102,54 +60,16 @@ async def test_parse_onebot_json_reply_produces_extra_fields(): @pytest.mark.asyncio -async def test_send_private_msg_with_reply_includes_extra_fields(): - """验证私聊发送带 Reply 的消息时,实际传给 bot.send_private_msg 的 - payload 包含多余字段。 - - 这是导致私聊下 'message not found' 的直接原因: - OneBot 协议端收到的 reply 段数据不符合标准格式。 - """ - bot = AsyncMock() - chain = MessageChain([Comp.Reply(id="123456"), Comp.Plain("你好")]) - - await AiocqhttpMessageEvent.send_message( - bot=bot, - message_chain=chain, - event=None, - is_group=False, # 私聊 - session_id="987654", - ) - - # 验证调用了 send_private_msg(而非 send_group_msg) - bot.send_private_msg.assert_awaited_once() - - callArgs = bot.send_private_msg.call_args - assert callArgs.kwargs["user_id"] == 987654 - - messages = callArgs.kwargs["message"] - assert len(messages) >= 1 - replySegment = messages[0] - assert replySegment["type"] == "reply" - - # 检查 payload 中的多余字段 - extraFields = [k for k in replySegment["data"] if k != "id"] - if extraFields: - pytest.fail( - f"send_private_msg 的 message[0] reply 段包含了多余的 data 字段: " - f"{extraFields}。\n" - f"这是导致私聊引用回复报 'message not found' 的根因。\n" - f"完整 payload: {messages}" - ) - - -@pytest.mark.asyncio -async def test_send_group_msg_with_reply_also_includes_extra_fields(): - """对比:群聊发送带 Reply 的消息同样包含多余字段。 - - 如果群聊引用回复正常而私聊失败,可能的原因是不同协议端 - 对多余字段的容忍度不同(例如 napcat 在 send_group_msg 中 - 忽略了多余字段,但在 send_private_msg 中严格校验)。 - """ +@pytest.mark.parametrize( + ("is_group", "method_name", "target_key", "session_id"), + [ + (False, "send_private_msg", "user_id", "987654"), + (True, "send_group_msg", None, "123456"), + ], +) +async def test_send_msg_with_reply_uses_standard_segment( + is_group, method_name, target_key, session_id +): bot = AsyncMock() chain = MessageChain([Comp.Reply(id="123456"), Comp.Plain("你好")]) @@ -157,23 +77,20 @@ async def test_send_group_msg_with_reply_also_includes_extra_fields(): bot=bot, message_chain=chain, event=None, - is_group=True, - session_id="123456", + is_group=is_group, + session_id=session_id, ) - bot.send_group_msg.assert_awaited_once() + method = getattr(bot, method_name) + method.assert_awaited_once() - callArgs = bot.send_group_msg.call_args + callArgs = method.call_args + if target_key: + assert callArgs.kwargs[target_key] == int(session_id) messages = callArgs.kwargs["message"] replySegment = messages[0] assert replySegment["type"] == "reply" - - extraFields = [k for k in replySegment["data"] if k != "id"] - if extraFields: - pytest.fail( - f"send_group_msg 的 reply 段也包含多余字段: {extraFields}。\n" - f"完整 payload: {messages}" - ) + assert replySegment["data"] == {"id": "123456"} # ============================================================ diff --git a/tests/unit/test_astrbot_message.py b/tests/unit/test_astrbot_message.py index 902fbbcec81..4be4323fe97 100644 --- a/tests/unit/test_astrbot_message.py +++ b/tests/unit/test_astrbot_message.py @@ -3,7 +3,6 @@ import time from unittest.mock import patch -from astrbot.core.message.components import Image, Plain from astrbot.core.platform.astrbot_message import AstrBotMessage, Group, MessageMember from astrbot.core.platform.message_type import MessageType @@ -11,20 +10,6 @@ class TestMessageMember: """Tests for MessageMember dataclass.""" - def test_message_member_creation_basic(self): - """Test creating a MessageMember with required fields.""" - member = MessageMember(user_id="user123") - - assert member.user_id == "user123" - assert member.nickname is None - - def test_message_member_creation_with_nickname(self): - """Test creating a MessageMember with nickname.""" - member = MessageMember(user_id="user123", nickname="TestUser") - - assert member.user_id == "user123" - assert member.nickname == "TestUser" - def test_message_member_str_with_nickname(self): """Test __str__ method with nickname.""" member = MessageMember(user_id="user123", nickname="TestUser") @@ -45,39 +30,6 @@ def test_message_member_str_without_nickname(self): class TestGroup: """Tests for Group dataclass.""" - def test_group_creation_basic(self): - """Test creating a Group with required fields.""" - group = Group(group_id="group123") - - assert group.group_id == "group123" - assert group.group_name is None - assert group.group_avatar is None - assert group.group_owner is None - assert group.group_admins is None - assert group.members is None - assert group.member_count is None - - def test_group_creation_with_all_fields(self): - """Test creating a Group with all fields.""" - members = [MessageMember(user_id="user1"), MessageMember(user_id="user2")] - group = Group( - group_id="group123", - group_name="Test Group", - group_avatar="http://example.com/avatar.jpg", - group_owner="owner123", - group_admins=["admin1", "admin2"], - members=members, - member_count=2, - ) - - assert group.group_id == "group123" - assert group.group_name == "Test Group" - assert group.group_avatar == "http://example.com/avatar.jpg" - assert group.group_owner == "owner123" - assert group.group_admins == ["admin1", "admin2"] - assert group.members == members - assert group.member_count == 2 - def test_group_str_with_all_fields(self): """Test __str__ method with all fields.""" members = [MessageMember(user_id="user1", nickname="User One")] @@ -132,27 +84,6 @@ def test_astrbot_message_timestamp(self): message = AstrBotMessage() assert message.timestamp == 1234567890 - def test_astrbot_message_all_attributes(self): - """Test setting all attributes on AstrBotMessage.""" - message = AstrBotMessage() - message.type = MessageType.FRIEND_MESSAGE - message.self_id = "bot123" - message.session_id = "session123" - message.message_id = "msg123" - message.sender = MessageMember(user_id="user123", nickname="TestUser") - message.message = [Plain(text="Hello")] - message.message_str = "Hello" - message.raw_message = {"raw": "data"} - - assert message.type == MessageType.FRIEND_MESSAGE - assert message.self_id == "bot123" - assert message.session_id == "session123" - assert message.message_id == "msg123" - assert message.sender.user_id == "user123" - assert len(message.message) == 1 - assert message.message_str == "Hello" - assert message.raw_message == {"raw": "data"} - def test_astrbot_message_str(self): """Test __str__ method.""" message = AstrBotMessage() @@ -238,37 +169,3 @@ def test_other_message_type(self): assert message.type == MessageType.OTHER_MESSAGE assert message.type.value == "OtherMessage" - - -class TestAstrBotMessageChain: - """Tests for AstrBotMessage message chain.""" - - def test_message_chain_with_plain_text(self): - """Test message chain with plain text.""" - message = AstrBotMessage() - message.message = [Plain(text="Hello world")] - - assert len(message.message) == 1 - assert isinstance(message.message[0], Plain) - assert message.message[0].text == "Hello world" - - def test_message_chain_with_multiple_components(self): - """Test message chain with multiple components.""" - message = AstrBotMessage() - message.message = [ - Plain(text="Hello "), - Plain(text="world"), - Image(file="http://example.com/img.jpg"), - ] - - assert len(message.message) == 3 - assert isinstance(message.message[0], Plain) - assert isinstance(message.message[1], Plain) - assert isinstance(message.message[2], Image) - - def test_message_chain_empty(self): - """Test empty message chain.""" - message = AstrBotMessage() - message.message = [] - - assert len(message.message) == 0 diff --git a/tests/unit/test_cli_plugin_utils.py b/tests/unit/test_cli_plugin_utils.py index afd185a71a4..ce904d39cac 100644 --- a/tests/unit/test_cli_plugin_utils.py +++ b/tests/unit/test_cli_plugin_utils.py @@ -2,6 +2,8 @@ from pathlib import Path from zipfile import ZipFile +import pytest + from astrbot.cli.utils.plugin import PluginStatus, build_plug_list, download_repository @@ -106,15 +108,19 @@ def test_build_plug_list_merges_local_and_remote_plugins(monkeypatch, tmp_path): assert len(plugins) == 3 -def test_build_plug_list_treats_file_plugin_path_as_empty_local_set( - monkeypatch, tmp_path +@pytest.mark.parametrize("path_kind", ["file", "missing"]) +def test_build_plug_list_treats_unusable_path_as_empty_local_set( + monkeypatch, tmp_path, path_kind ): - plugins_file = tmp_path / "plugins" - plugins_file.write_text("not a directory", encoding="utf-8") + plugins_path = tmp_path / "plugins" + if path_kind == "file": + plugins_path.write_text("not a directory", encoding="utf-8") + else: + plugins_path = tmp_path / "completely_non_existent_path" monkeypatch.setattr("astrbot.cli.utils.plugin.httpx.Client", FakeClient) - plugins = build_plug_list(plugins_file) + plugins = build_plug_list(plugins_path) assert [plugin["name"] for plugin in plugins] == ["local-plugin", "remote-only"] assert all(plugin["status"] == PluginStatus.NOT_INSTALLED for plugin in plugins) @@ -140,12 +146,3 @@ def test_build_plug_list_local_version_equal_or_newer(monkeypatch, tmp_path): assert plugins_newer_by_name["local-plugin"]["status"] == PluginStatus.INSTALLED -def test_build_plug_list_non_existent_path(monkeypatch, tmp_path): - non_existent_dir = tmp_path / "completely_non_existent_path" - - monkeypatch.setattr("astrbot.cli.utils.plugin.httpx.Client", FakeClient) - - plugins = build_plug_list(non_existent_dir) - - assert [plugin["name"] for plugin in plugins] == ["local-plugin", "remote-only"] - assert all(plugin["status"] == PluginStatus.NOT_INSTALLED for plugin in plugins) diff --git a/tests/unit/test_io_download_file.py b/tests/unit/test_io_download_file.py index 5cea2f0e507..46449899d8d 100644 --- a/tests/unit/test_io_download_file.py +++ b/tests/unit/test_io_download_file.py @@ -56,37 +56,23 @@ def _patch_download_sessions(monkeypatch, responses: list[_FakeResponse | Except @pytest.mark.asyncio -async def test_download_file_rejects_non_200_response(monkeypatch, tmp_path): - target_path = tmp_path / "missing.bin" - _patch_download_session( - monkeypatch, - _FakeResponse(status=404, chunks=[b"not found"]), - ) - - with pytest.raises(io.DownloadFileHTTPError, match="HTTP status code: 404"): - await io.download_file("https://example.test/missing", str(target_path)) - - assert not target_path.exists() - - -@pytest.mark.asyncio -async def test_download_file_rejects_non_200_response_after_ssl_fallback( - monkeypatch, - tmp_path, +@pytest.mark.parametrize("ssl_fallback", [False, True]) +async def test_download_file_rejects_non_200_response( + monkeypatch, tmp_path, ssl_fallback ): class FakeSSLError(Exception): pass target_path = tmp_path / "missing.bin" - _patch_download_sessions( - monkeypatch, - [ - FakeSSLError(), - _FakeResponse(status=404, chunks=[b"not found"]), - ], - ) - monkeypatch.setattr(io.aiohttp, "ClientConnectorSSLError", FakeSSLError) - monkeypatch.setattr(io.aiohttp, "ClientConnectorCertificateError", FakeSSLError) + response = _FakeResponse(status=404, chunks=[b"not found"]) + if ssl_fallback: + _patch_download_sessions(monkeypatch, [FakeSSLError(), response]) + monkeypatch.setattr(io.aiohttp, "ClientConnectorSSLError", FakeSSLError) + monkeypatch.setattr( + io.aiohttp, "ClientConnectorCertificateError", FakeSSLError + ) + else: + _patch_download_session(monkeypatch, response) with pytest.raises(io.DownloadFileHTTPError, match="HTTP status code: 404"): await io.download_file("https://example.test/missing", str(target_path)) diff --git a/tests/unit/test_persona_mgr.py b/tests/unit/test_persona_mgr.py index c7b1464e4ef..ef2ccaa2736 100644 --- a/tests/unit/test_persona_mgr.py +++ b/tests/unit/test_persona_mgr.py @@ -127,23 +127,6 @@ async def test_get_default_persona_v3_uses_db_default(): assert resolved["prompt"] == "USER DEFAULT" -@pytest.mark.asyncio -async def test_resolve_selected_persona_matches_db_default(): - manager = make_manager([make_persona("default", "USER DEFAULT")]) - - with patch.object(pm.sp, "get_async", new=AsyncMock(return_value={})): - persona_id, persona, _, _ = await manager.resolve_selected_persona( - umo="test:umo", - conversation_persona_id="default", - platform_name="webchat", - provider_settings={}, - ) - - assert persona_id == "default" - assert persona is not None - assert persona["prompt"] == "USER DEFAULT" - - @pytest.mark.asyncio async def test_resolve_selected_persona_webchat_implicit_uses_chatui_default(): manager = make_manager([make_persona("default", "USER DEFAULT")]) diff --git a/tests/unit/test_third_party_agent_sub_stage.py b/tests/unit/test_third_party_agent_sub_stage.py index 34561450618..b791a414230 100644 --- a/tests/unit/test_third_party_agent_sub_stage.py +++ b/tests/unit/test_third_party_agent_sub_stage.py @@ -97,90 +97,20 @@ def __new__(cls): assert runner_factory_calls == [True] @pytest.mark.asyncio -async def test_third_party_skips_unavailable_voice_attachment( - monkeypatch: pytest.MonkeyPatch, -): - """An unresolvable voice attachment must not abort the third-party request.""" - runner = MagicMock() - runner.reset = AsyncMock() - runner.get_final_llm_resp.return_value = LLMResponse( - role="assistant", - result_chain=MessageChain().message("done"), - ) - runner.close = AsyncMock() - - async def step_until_done(max_step: int = 30): - _ = max_step - if False: - yield None - - runner.step_until_done = step_until_done - - class RunnerFactory: - @classmethod - def __class_getitem__(cls, item): - _ = item - return cls - - def __new__(cls): - return runner - - monkeypatch.setattr(third_party, "DifyAgentRunner", RunnerFactory) - monkeypatch.setattr( - third_party, "AstrAgentContext", MagicMock(return_value=object()) - ) - monkeypatch.setattr( - third_party, "AgentContextWrapper", MagicMock(return_value=object()) - ) - monkeypatch.setattr(third_party, "call_event_hook", AsyncMock(return_value=False)) - monkeypatch.setattr(third_party.Metric, "upload", AsyncMock(return_value=None)) - - async def unavailable(self): - raise Exception(f"not a valid file: {self.file}") - - monkeypatch.setattr(Record, "convert_to_file_path", unavailable) - - config = { - "agent_runner": {"runner_type": "dify", "config": {"dify_api_key": "k"}}, - "provider_settings": { - "streaming_response": False, - "unsupported_streaming_strategy": "turn_off", - "third_party_stream_consumption_close_timeout_sec": 30, - }, - } - stage = third_party.ThirdPartyAgentSubStage() - await stage.initialize( - SimpleNamespace( - astrbot_config=config, - plugin_manager=SimpleNamespace( - context=SimpleNamespace( - conversation_manager=MagicMock(), - persona_manager=MagicMock(), - ) - ), - ) - ) - stage._resolve_persona_custom_error_message = AsyncMock(return_value=None) - - event = MagicMock() - event.message_str = "hello" - event.unified_msg_origin = "webchat:FriendMessage:test" - event.message_obj.message = [Record(file="")] - event.platform_meta.support_streaming_message = True - event.get_extra.return_value = None - - results = [item async for item in stage.process(event, "")] - - assert results == [None] - request = runner.reset.await_args.kwargs["request"] - assert request.audio_urls == [] - assert request.prompt == "hello" - -@pytest.mark.asyncio -async def test_third_party_skips_unavailable_image_attachment( +@pytest.mark.parametrize( + ("component", "patch_method", "request_attr"), + [ + (Record, "convert_to_file_path", "audio_urls"), + (Image, "convert_to_base64", "image_urls"), + ], +) +async def test_third_party_skips_unavailable_attachment( monkeypatch: pytest.MonkeyPatch, + component, + patch_method: str, + request_attr: str, ): - """An unresolvable image attachment must not abort the third-party request.""" + """An unresolvable attachment must not abort the third-party request.""" runner = MagicMock() runner.reset = AsyncMock() runner.get_final_llm_resp.return_value = LLMResponse( @@ -218,7 +148,7 @@ def __new__(cls): async def unavailable(self): raise ValueError("No valid file or URL provided") - monkeypatch.setattr(Image, "convert_to_base64", unavailable) + monkeypatch.setattr(component, patch_method, unavailable) config = { "agent_runner": {"runner_type": "dify", "config": {"dify_api_key": "k"}}, @@ -245,7 +175,7 @@ async def unavailable(self): event = MagicMock() event.message_str = "hello" event.unified_msg_origin = "webchat:FriendMessage:test" - event.message_obj.message = [Image(file="")] + event.message_obj.message = [component(file="")] event.platform_meta.support_streaming_message = True event.get_extra.return_value = None @@ -253,5 +183,5 @@ async def unavailable(self): assert results == [None] request = runner.reset.await_args.kwargs["request"] - assert request.image_urls == [] + assert getattr(request, request_attr) == [] assert request.prompt == "hello" From f259020e252eb942c6f78517d2d3bccabe8212c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BA=A2=E8=B1=86=E7=B3=95?= <3083636750@qq.com> Date: Thu, 5 Nov 2026 20:19:08 +0800 Subject: [PATCH 08/10] fix(scripts): honor --no-dashboard and align local coverage (#11009) Keep an explicit dashboard choice instead of overwriting it with the full-profile default, and run the full suite against ./tests with --cov=astrbot to match CI. --- scripts/pr_test_env.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) mode change 100755 => 100644 scripts/pr_test_env.sh diff --git a/scripts/pr_test_env.sh b/scripts/pr_test_env.sh old mode 100755 new mode 100644 index 23bc529792e..94c0b429508 --- a/scripts/pr_test_env.sh +++ b/scripts/pr_test_env.sh @@ -9,7 +9,8 @@ PROFILE="neo" RUN_SYNC=true RUN_LINT=true RUN_SMOKE=true -RUN_DASHBOARD=false +# Empty means follow the profile default; flags set an explicit choice. +RUN_DASHBOARD="" usage() { cat <<'EOF' @@ -72,8 +73,12 @@ while (($# > 0)); do esac done -if [[ "$PROFILE" == "full" && "$RUN_DASHBOARD" == false ]]; then - RUN_DASHBOARD=true +if [[ -z "$RUN_DASHBOARD" ]]; then + if [[ "$PROFILE" == "full" ]]; then + RUN_DASHBOARD=true + else + RUN_DASHBOARD=false + fi fi echo "==> Profile: $PROFILE" @@ -110,7 +115,7 @@ if [[ "$PROFILE" == "neo" ]]; then ) uv run pytest -q "${NEO_TESTS[@]}" ${PYTEST_ARGS:-} else - uv run pytest --cov=. -v -o log_cli=true -o log_level=DEBUG ${PYTEST_ARGS:-} + uv run pytest ./tests --cov=astrbot -v -o log_cli=true -o log_level=DEBUG ${PYTEST_ARGS:-} fi run_smoke_test() { From 1fdc5be1ca651ba69a4d274958f0e8f002525bae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BA=A2=E8=B1=86=E7=B3=95?= <3083636750@qq.com> Date: Thu, 5 Nov 2026 20:23:38 +0800 Subject: [PATCH 09/10] fix: condition Gemini embedding queries and documents separately `gemini_embedding_source.py` embedded queries and documents with the same configuration, so retrieval similarity had little to no discriminative power. Two separate problems were involved. Task conditioning was missing entirely: - `gemini-embedding-001` supports `task_type` (`RETRIEVAL_QUERY` / `RETRIEVAL_DOCUMENT`) but only `output_dimensionality` was sent. - `gemini-embedding-2` dropped support for `task_type` and expects the task baked into the text instead (`task: search result | query: {text}` for queries, `title: none | text: {text}` for documents); neither was applied. Separately, FAISS stored and searched raw provider vectors. `IndexFlatL2` with `score = 1 - distance / 2` only equals cosine similarity for unit vectors, and Gemini returns unnormalized vectors below 3072 dimensions whose magnitude drifts with text length. The score was therefore dominated by vector magnitude rather than meaning, which is why no similarity threshold could separate relevant from irrelevant memories. Changes: - Add `EmbeddingProvider.get_query_embedding()`, defaulting to `get_embedding()` so other providers are unaffected. `FaissVecDB.retrieve()` and the dashboard query embedding now use it. - Gemini adapter branches on model generation, with a `embedding_task_type_mode` escape hatch (`auto` / `never` / `always`). - L2-normalize vectors on insert, batch insert and search. - Re-normalize existing indexes once on load so upgraded instances do not end up with normalized queries against unnormalized stored vectors. The rewrite is idempotent (zero vectors excluded from the check so they cannot retrigger it), keeps the id-to-vector mapping intact, is skipped for index types that cannot be reconstructed, and a failed write only warns instead of preventing the knowledge base from starting. - Accept `title: none` for untitled documents, and fall back to `search result` for an unrecognized task name rather than failing the retrieval path. Closes #11006 --- astrbot/core/config/default.py | 10083 ++++++++-------- .../db/vec_db/faiss_impl/embedding_storage.py | 481 +- astrbot/core/db/vec_db/faiss_impl/vec_db.py | 705 +- astrbot/core/provider/provider.py | 977 +- .../sources/gemini_embedding_source.py | 386 +- astrbot/dashboard/utils.py | 334 +- changelogs/unreleased.md | 7 +- .../en-US/features/config-metadata.json | 4168 +++---- .../zh-CN/features/config-metadata.json | 4210 +++---- tests/test_gemini_embedding_source.py | 247 + tests/unit/test_faiss_vec_db.py | 709 +- 11 files changed, 11651 insertions(+), 10656 deletions(-) create mode 100644 tests/test_gemini_embedding_source.py diff --git a/astrbot/core/config/default.py b/astrbot/core/config/default.py index e08887eb1f5..f1529fb345f 100644 --- a/astrbot/core/config/default.py +++ b/astrbot/core/config/default.py @@ -1,5039 +1,5044 @@ -"""如需修改配置,请在 `data/cmd_config.json` 中修改或者在管理面板中可视化修改。""" - -import os - -from astrbot import __version__ -from astrbot.core.computer.booters.cua_defaults import CUA_DEFAULT_CONFIG -from astrbot.core.utils.astrbot_path import get_astrbot_data_path - -from .agent_runner import get_agent_runner_config_default - - -def get_local_permission_defaults(system: str | None = None) -> dict: - """Return fresh Local permission defaults shared by all operating systems. - - Args: - system: Retained for callers supplying an operating system name. - - Returns: - Workspace files without execution for members and unrestricted local - execution for administrators. Neither policy requires process isolation. - """ - return { - "member": { - "allow_execution": False, - "allow_network": False, - "filesystem_scope": "workspace", - }, - "admin": { - "allow_execution": True, - "allow_network": True, - "filesystem_scope": "host", - }, - } - - -VERSION = __version__ - -DB_PATH = os.path.join(get_astrbot_data_path(), "data_v4.db") -PERSONAL_WECHAT_CONFIG_METADATA = { - "weixin_oc_base_url": { - "description": "Base URL", - "type": "string", - "hint": "默认值: https://ilinkai.weixin.qq.com", - }, - "weixin_oc_bot_type": { - "description": "扫码参数 bot_type", - "type": "string", - "hint": "默认值: 3", - "invisible": True, - }, - "weixin_oc_qr_poll_interval": { - "description": "二维码状态轮询间隔(秒)", - "type": "int", - "hint": "每隔多少秒轮询一次二维码状态。", - "invisible": True, - }, - "weixin_oc_long_poll_timeout_ms": { - "description": "getUpdates 长轮询超时时间(毫秒)", - "type": "int", - "hint": "会话消息拉取接口超时参数。", - }, - "weixin_oc_api_timeout_ms": { - "description": "HTTP 请求超时(毫秒)", - "type": "int", - "hint": "通用 API 请求超时参数。", - }, - "weixin_oc_token": { - "description": "登录后 token(可留空)", - "type": "string", - "hint": "扫码登录成功后会自动写入;高级场景可手动填写。", - "secret": True, - "invisible": True, - }, - "weixin_oc_account_id": {"invisible": True}, - "weixin_oc_sync_buf": {"invisible": True}, - "weixin_oc_context_tokens": {"invisible": True}, -} - -WEBHOOK_SUPPORTED_PLATFORMS = [ - "qq_official_webhook", - "weixin_official_account", - "wecom", - "wecom_ai_bot", - "slack", - "lark", - "line", - "mattermost", -] - -# 默认配置 -DEFAULT_CONFIG = { - "config_version": 5, - "platform_settings": { - "unique_session": False, - "rate_limit": { - "time": 60, - "count": 30, - "strategy": "stall", # stall, discard - }, - "reply_prefix": "", - "forward_threshold": 1500, - "enable_id_white_list": True, - "id_whitelist": [], - "id_whitelist_log": True, - "wl_ignore_admin_on_group": True, - "wl_ignore_admin_on_friend": True, - "reply_with_mention": False, - "reply_with_quote": False, - "path_mapping": [], - "segmented_reply": { - "enable": False, - "only_llm_result": True, - "interval_method": "random", - "interval": "1.5,3.5", - "log_base": 2.6, - "words_count_threshold": 150, - "split_mode": "regex", # regex 或 words - "regex": ".*?[。?!~…]+|.+$", - "split_words": [ - "。", - "?", - "!", - "~", - "…", - ], # 当 split_mode 为 words 时使用 - "content_cleanup_rule": "", - }, - "no_permission_reply": True, - "empty_mention_waiting": True, - "empty_mention_waiting_need_reply": True, - "friend_message_needs_wake_prefix": False, - "ignore_bot_self_message": False, - "ignore_at_all": False, - }, - "provider_sources": [], # provider sources - "provider": [], # models from provider_sources - "provider_settings": { - "enable": True, - "default_image_caption_provider_id": "", - "image_caption_prompt": "Please describe the image using Chinese.", - "provider_pool": ["*"], # "*" 表示使用所有可用的提供者 - "wake_prefix": "", - "web_search": False, - "websearch_provider": "tavily", - "websearch_tavily_key": [], - "websearch_bocha_key": [], - "websearch_brave_key": [], - "websearch_baidu_app_builder_key": "", - "websearch_firecrawl_key": [], - "websearch_exa_key": [], - "websearch_anysearch_key": [], - "websearch_deepseek_key": [], - "websearch_serpapi_key": [], - "web_search_link": False, - "display_reasoning_text": False, - "identifier": False, - "group_name_display": False, - "datetime_system_prompt": True, - "persona_pool": ["*"], - "prompt_prefix": "{{prompt}}", - "streaming_response": False, - "show_tool_use_status": False, - "show_tool_call_result": False, - "buffer_intermediate_messages": False, - "max_quoted_fallback_images": 20, - "quoted_message_parser": { - "max_component_chain_depth": 4, - "max_forward_node_depth": 6, - "max_forward_fetch": 32, - "warn_on_action_failure": False, - }, - "unsupported_streaming_strategy": "realtime_segmenting", - "reachability_check": False, - "file_extract": { - "enable": False, - "provider": "moonshotai", - "moonshotai_api_key": "", - }, - "proactive_capability": { - "add_cron_tools": True, - }, - "computer_use_runtime": "none", - "computer_use_local_permissions": get_local_permission_defaults(), - "computer_use_require_admin": True, - "sandbox": { - "booter": "shipyard_neo", - "shipyard_endpoint": "", - "shipyard_access_token": "", - "shipyard_ttl": 3600, - "shipyard_max_sessions": 10, - "shipyard_neo_endpoint": "", - "shipyard_neo_access_token": "", - "shipyard_neo_profile": "python-default", - "shipyard_neo_ttl": 3600, - "cua_image": CUA_DEFAULT_CONFIG["image"], - "cua_os_type": CUA_DEFAULT_CONFIG["os_type"], - "cua_idle_timeout": CUA_DEFAULT_CONFIG["idle_timeout"], - "cua_telemetry_enabled": CUA_DEFAULT_CONFIG["telemetry_enabled"], - "cua_local": CUA_DEFAULT_CONFIG["local"], - "cua_api_key": CUA_DEFAULT_CONFIG["api_key"], - }, - "image_compress_options": { - "max_size": 1280, - }, - }, - "agent_runner": { - "runner_type": "local", - "config": get_agent_runner_config_default("local"), - }, - # SubAgent orchestrator mode: - # - main_enable = False: disabled; main LLM mounts tools normally (persona selection). - # - main_enable = True: enabled; main LLM keeps its own tools and includes handoff - # tools (transfer_to_*). remove_main_duplicate_tools can remove tools that are - # duplicated on subagents from the main LLM toolset. - "subagent_orchestrator": { - "main_enable": False, - "remove_main_duplicate_tools": False, - "router_system_prompt": ( - "You are a task router. Your job is to chat naturally, recognize user intent, " - "and delegate work to the most suitable subagent using transfer_to_* tools. " - "Do not try to use domain tools yourself. If no subagent fits, respond directly." - ), - "agents": [], - }, - "provider_stt_settings": { - "enable": False, - "provider_id": "", - }, - "provider_tts_settings": { - "enable": False, - "provider_id": "", - "dual_output": False, - "use_file_service": False, - "trigger_probability": 1.0, - }, - "provider_ltm_settings": { - "group_icl_enable": False, - "group_message_max_cnt": 1000, - "image_caption": False, - "image_caption_provider_id": "", - "group_message_history_enable": False, - "group_message_history_max_cnt": 700, - "active_reply": { - "enable": False, - "method": "possibility_reply", - "possibility_reply": 0.1, - "whitelist": [], - }, - }, - "content_safety": { - "also_use_in_response": False, - "internal_keywords": {"enable": True, "extra_keywords": []}, - "baidu_aip": {"enable": False, "app_id": "", "api_key": "", "secret_key": ""}, - }, - "admins_id": ["astrbot"], - "t2i": False, - "t2i_word_threshold": 150, - "t2i_strategy": "remote", - "t2i_endpoint": "", - "t2i_use_file_service": False, - "t2i_active_template": "base", - "http_proxy": "", - "no_proxy": ["localhost", "127.0.0.1", "::1", "10.*", "192.168.*"], - "dashboard": { - "enable": True, - "username": "astrbot", - "password": "", - "pbkdf2_password": "", - "password_storage_upgraded": False, - "password_change_required": False, - "jwt_secret": "", - "host": "0.0.0.0", - "port": 6185, - "disable_access_log": True, - "trust_proxy_headers": False, - "auth_rate_limit": { - "enable": True, - "average_interval": 1.0, - "max_burst": 3, - }, - "totp": { - "enable": False, - "secret": "", - "recovery_code_hash": "", - }, - "ssl": { - "enable": False, - "cert_file": "", - "key_file": "", - "ca_certs": "", - }, - }, - "platform": [], - "platform_specific": { - # 平台特异配置:按平台分类,平台下按功能分组 - "lark": { - "pre_ack_emoji": {"enable": False, "emojis": ["Typing"]}, - }, - "telegram": { - "pre_ack_emoji": {"enable": False, "emojis": ["✍️"]}, - }, - "discord": { - "pre_ack_emoji": {"enable": False, "emojis": ["🤔"]}, - }, - }, - "wake_prefix": ["/"], - "log_level": "INFO", - "log_file_enable": False, - "log_file_path": "logs/astrbot.log", - "log_file_max_mb": 20, - "temp_dir_max_size": 1024, - "trace_enable": False, - "trace_db_path": "logs/traces.db", - "trace_db_max_mb": 80, - "trace_retention_days": 7, - "pip_install_arg": "", - "pypi_index_url": "https://mirrors.aliyun.com/pypi/simple/", - "persona": [], # deprecated - "timezone": "Asia/Shanghai", - "callback_api_base": "", - "default_kb_collection": "", # 默认知识库名称, 已经过时 - "plugin_set": ["*"], # "*" 表示使用所有可用的插件, 空列表表示不使用任何插件 - "kb_names": [], # 默认知识库名称列表 - "kb_fusion_top_k": 20, # 知识库检索融合阶段返回结果数量 - "kb_final_top_k": 5, # 知识库检索最终返回结果数量 - "kb_agentic_mode": False, - "disable_builtin_commands": False, - "disable_metrics": False, -} - - -""" -AstrBot v3 时代的配置元数据,目前仅承担以下功能: - -1. 保存配置时,配置项的类型验证 -2. WebUI 展示提供商和平台适配器模版 - -WebUI 的配置文件在 `CONFIG_METADATA_3` 中。 - -未来将会逐步淘汰此配置元数据。 -""" -CONFIG_METADATA_2 = { - "platform_group": { - "metadata": { - "platform": { - "description": "消息平台适配器", - "type": "list", - "config_template": { - "QQ 官方机器人(Websocket, 推荐)": { - "id": "default", - "type": "qq_official", - "enable": True, - "appid": "", - "secret": "", - "enable_group_c2c": True, - "enable_guild_direct_message": True, - "use_markdown": True, - }, - "QQ 官方机器人(Webhook)": { - "id": "default", - "type": "qq_official_webhook", - "enable": True, - "appid": "", - "secret": "", - "use_markdown": True, - "is_sandbox": False, - "unified_webhook_mode": True, - "webhook_uuid": "", - "callback_server_host": "0.0.0.0", - "port": 6196, - }, - "OneBot v11": { - "id": "default", - "type": "aiocqhttp", - "enable": True, - "ws_reverse_host": "0.0.0.0", - "ws_reverse_port": 6199, - "ws_reverse_token": "", - }, - "飞书(Lark)": { - "id": "lark", - "type": "lark", - "enable": True, - "app_id": "", - "app_secret": "", - "domain": "https://open.feishu.cn", - "lark_connection_mode": "socket", # webhook, socket - "webhook_uuid": "", - "lark_encrypt_key": "", - "lark_verification_token": "", - }, - "个人微信": { - "id": "weixin_personal", - "type": "weixin_oc", - "enable": True, - "weixin_oc_base_url": "https://ilinkai.weixin.qq.com", - "weixin_oc_bot_type": "3", - "weixin_oc_qr_poll_interval": 1, - "weixin_oc_long_poll_timeout_ms": 35_000, - "weixin_oc_api_timeout_ms": 120_000, - }, - "企业微信 (智能机器人)": { - "id": "wecom_ai_bot", - "type": "wecom_ai_bot", - "hint": "如果发现字段有异常,请重新创建", - "enable": True, - "wecom_ai_bot_connection_mode": "long_connection", # long_connection, webhook - "wecom_ai_bot_name": "", - "wecomaibot_ws_bot_id": "", - "wecomaibot_ws_secret": "", - "wecomaibot_token": "", - "wecomaibot_encoding_aes_key": "", - "wecomaibot_init_respond_text": "", - "wecomaibot_friend_message_welcome_text": "", - "msg_push_webhook_url": "", - "only_use_webhook_url_to_send": False, - "wecomaibot_ws_url": "wss://openws.work.weixin.qq.com", - "wecomaibot_heartbeat_interval": 30, - "unified_webhook_mode": True, - "webhook_uuid": "", - "callback_server_host": "0.0.0.0", - "port": 6198, - }, - "企业微信应用 & 微信客服": { - "id": "wecom", - "type": "wecom", - "enable": True, - "corpid": "", - "secret": "", - "token": "", - "encoding_aes_key": "", - "kf_name": "", - "api_base_url": "https://qyapi.weixin.qq.com/cgi-bin/", - "unified_webhook_mode": True, - "webhook_uuid": "", - "callback_server_host": "0.0.0.0", - "port": 6195, - }, - "微信公众平台": { - "id": "weixin_official_account", - "type": "weixin_official_account", - "enable": True, - "appid": "", - "secret": "", - "token": "", - "encoding_aes_key": "", - "api_base_url": "https://api.weixin.qq.com/cgi-bin/", - "unified_webhook_mode": True, - "webhook_uuid": "", - "callback_server_host": "0.0.0.0", - "port": 6194, - "active_send_mode": False, - }, - "钉钉(DingTalk)": { - "id": "dingtalk", - "type": "dingtalk", - "enable": True, - "client_id": "", - "client_secret": "", - "card_template_id": "", - }, - "Telegram": { - "id": "telegram", - "type": "telegram", - "enable": True, - "telegram_token": "", - "start_message": "Hello, I'm AstrBot!", - "telegram_api_base_url": "https://api.telegram.org/bot", - "telegram_file_base_url": "https://api.telegram.org/file/bot", - "telegram_command_register": True, - "telegram_command_auto_refresh": True, - "telegram_command_register_interval": 300, - "telegram_polling_restart_delay": 5.0, - }, - "Discord": { - "id": "discord", - "type": "discord", - "enable": True, - "discord_token": "", - "discord_proxy": "", - "discord_command_register": True, - "discord_activity_name": "", - "discord_allow_bot_messages": False, - }, - "Misskey": { - "id": "misskey", - "type": "misskey", - "enable": True, - "misskey_instance_url": "https://misskey.example", - "misskey_token": "", - "misskey_default_visibility": "public", - "misskey_local_only": False, - "misskey_enable_chat": True, - # download / security options - "misskey_allow_insecure_downloads": False, - "misskey_download_timeout": 15, - "misskey_download_chunk_size": 65536, - "misskey_max_download_bytes": None, - "misskey_enable_file_upload": True, - "misskey_upload_concurrency": 3, - "misskey_upload_folder": "", - }, - "Slack": { - "id": "slack", - "type": "slack", - "enable": True, - "bot_token": "", - "app_token": "", - "signing_secret": "", - "slack_connection_mode": "socket", # webhook, socket - "unified_webhook_mode": True, - "webhook_uuid": "", - "slack_webhook_host": "0.0.0.0", - "slack_webhook_port": 6197, - "slack_webhook_path": "/astrbot-slack-webhook/callback", - }, - "Line": { - "id": "line", - "type": "line", - "enable": True, - "channel_access_token": "", - "channel_secret": "", - "unified_webhook_mode": True, - "webhook_uuid": "", - }, - "Satori": { - "id": "satori", - "type": "satori", - "enable": True, - "satori_api_base_url": "http://localhost:5140/satori/v1", - "satori_endpoint": "ws://localhost:5140/satori/v1/events", - "satori_token": "", - "satori_auto_reconnect": True, - "satori_heartbeat_interval": 10, - "satori_reconnect_delay": 5, - }, - "KOOK": { - "id": "kook", - "type": "kook", - "enable": True, - "kook_bot_token": "", - "kook_reconnect_delay": 1, - "kook_max_reconnect_delay": 60, - "kook_max_retry_delay": 60, - "kook_heartbeat_interval": 30, - "kook_heartbeat_timeout": 6, - "kook_max_heartbeat_failures": 3, - "kook_max_consecutive_failures": 5, - }, - "Mattermost": { - "id": "mattermost", - "type": "mattermost", - "enable": True, - "mattermost_url": "https://chat.example.com", - "mattermost_bot_token": "", - "mattermost_reconnect_delay": 5.0, - "unified_webhook_mode": True, - "webhook_uuid": "", - }, - # "WebChat": { - # "id": "webchat", - # "type": "webchat", - # "enable": False, - # "webchat_link_path": "", - # "webchat_present_type": "fullscreen", - # }, - }, - "items": { - # "webchat_link_path": { - # "description": "链接路径", - # "_special": "webchat_link_path", - # "type": "string", - # }, - # "webchat_present_type": { - # "_special": "webchat_present_type", - # "description": "展现形式", - # "type": "string", - # "options": ["fullscreen", "embedded"], - # }, - "app_id": { - "description": "应用 ID", - "type": "string", - "hint": "消息平台开放平台中的应用 ID。", - "show_key": True, - }, - "app_secret": { - "description": "应用密钥", - "type": "string", - "hint": "消息平台开放平台中的应用密钥。请妥善保管,避免泄露。", - "show_key": True, - "secret": True, - }, - "domain": { - "description": "开放平台 API 地址", - "type": "string", - "hint": "开放平台 API 的基础地址。使用默认官方服务时通常无需修改。", - "show_key": True, - }, - "corpid": { - "description": "企业 ID", - "type": "string", - "hint": "企业微信后台中的企业 ID(CorpID)。", - "show_key": True, - }, - "token": { - "description": "回调 Token", - "type": "string", - "hint": "消息平台回调配置中用于验证请求的 Token。", - "show_key": True, - "secret": True, - }, - "encoding_aes_key": { - "description": "消息加密密钥", - "type": "string", - "hint": "消息平台回调配置中的 EncodingAESKey,用于加密和解密消息。", - "show_key": True, - "secret": True, - }, - "api_base_url": { - "description": "API 基础地址", - "type": "string", - "hint": "消息平台 API 的基础地址。使用默认官方服务时通常无需修改。", - "show_key": True, - }, - "client_id": { - "description": "客户端 ID", - "type": "string", - "hint": "消息平台开放平台中的客户端 ID。", - "show_key": True, - }, - "client_secret": { - "description": "客户端密钥", - "type": "string", - "hint": "消息平台开放平台中的客户端密钥。请妥善保管,避免泄露。", - "show_key": True, - "secret": True, - }, - "start_message": { - "description": "Start 命令回复", - "type": "string", - "hint": "用户向 Telegram 机器人发送 /start 命令时回复的内容。", - "show_key": True, - }, - "telegram_api_base_url": { - "description": "API 地址", - "type": "string", - "hint": "Telegram Bot API 的基础地址。使用官方服务时通常无需修改。", - "show_key": True, - }, - "telegram_file_base_url": { - "description": "文件 API 地址", - "type": "string", - "hint": "Telegram Bot API 文件下载接口的基础地址。使用官方服务时通常无需修改。", - "show_key": True, - }, - "bot_token": { - "description": "Slack Bot Token", - "type": "string", - "hint": "Slack 应用的 Bot User OAuth Token,通常以 xoxb- 开头。", - "show_key": True, - "secret": True, - }, - "app_token": { - "description": "Slack App Token", - "type": "string", - "hint": "Slack Socket Mode 使用的 App-Level Token,通常以 xapp- 开头。", - "condition": { - "slack_connection_mode": "socket", - }, - "show_key": True, - "secret": True, - }, - "signing_secret": { - "description": "Slack Signing Secret", - "type": "string", - "hint": "Slack 应用的 Signing Secret,用于验证 Webhook 请求。", - "condition": { - "slack_connection_mode": "webhook", - }, - "show_key": True, - "secret": True, - }, - "channel_access_token": { - "description": "LINE 频道访问令牌", - "type": "string", - "hint": "LINE Messaging API 频道的 Channel Access Token。", - "show_key": True, - "secret": True, - }, - "channel_secret": { - "description": "LINE 频道密钥", - "type": "string", - "hint": "LINE Messaging API 频道的 Channel Secret。", - "show_key": True, - "secret": True, - }, - "lark_connection_mode": { - "description": "订阅方式", - "type": "string", - "options": ["socket", "webhook"], - "labels": ["长连接模式", "推送至服务器模式"], - }, - "lark_encrypt_key": { - "description": "Encrypt Key", - "type": "string", - "hint": "用于解密飞书回调数据的加密密钥", - "secret": True, - "condition": { - "lark_connection_mode": "webhook", - }, - }, - "lark_verification_token": { - "description": "Verification Token", - "type": "string", - "hint": "用于验证飞书回调请求的令牌", - "secret": True, - "condition": { - "lark_connection_mode": "webhook", - }, - }, - "is_sandbox": { - "description": "沙箱模式", - "type": "bool", - }, - "satori_api_base_url": { - "description": "Satori API 终结点", - "type": "string", - "hint": "Satori API 的基础地址。", - }, - "satori_endpoint": { - "description": "Satori WebSocket 终结点", - "type": "string", - "hint": "Satori 事件的 WebSocket 端点。", - }, - "satori_token": { - "description": "Satori 令牌", - "type": "string", - "hint": "用于 Satori API 身份验证的令牌。", - "secret": True, - }, - "satori_auto_reconnect": { - "description": "启用自动重连", - "type": "bool", - "hint": "断开连接时是否自动重新连接 WebSocket。", - }, - "satori_heartbeat_interval": { - "description": "Satori 心跳间隔", - "type": "int", - "hint": "发送心跳消息的间隔(秒)。", - }, - "satori_reconnect_delay": { - "description": "Satori 重连延迟", - "type": "int", - "hint": "尝试重新连接前的延迟时间(秒)。", - }, - "slack_connection_mode": { - "description": "Slack Connection Mode", - "type": "string", - "options": ["webhook", "socket"], - "hint": "The connection mode for Slack. `webhook` uses a webhook server, `socket` uses Slack's Socket Mode.", - }, - "slack_webhook_host": { - "description": "Slack Webhook Host", - "type": "string", - "hint": "Only valid when Slack connection mode is `webhook`.", - "condition": { - "slack_connection_mode": "webhook", - "unified_webhook_mode": False, - }, - }, - "slack_webhook_port": { - "description": "Slack Webhook Port", - "type": "int", - "hint": "Only valid when Slack connection mode is `webhook`.", - "condition": { - "slack_connection_mode": "webhook", - "unified_webhook_mode": False, - }, - }, - "slack_webhook_path": { - "description": "Slack Webhook Path", - "type": "string", - "hint": "Only valid when Slack connection mode is `webhook`.", - "condition": { - "slack_connection_mode": "webhook", - "unified_webhook_mode": False, - }, - }, - "active_send_mode": { - "description": "是否换用主动发送接口", - "type": "bool", - "desc": "只有企业认证的公众号才能主动发送。主动发送接口的限制会少一些。", - }, - "wpp_active_message_poll": { - "description": "是否启用主动消息轮询", - "type": "bool", - "hint": "只有当你发现微信消息没有按时同步到 AstrBot 时,才需要启用这个功能,默认不启用。", - }, - "wpp_active_message_poll_interval": { - "description": "主动消息轮询间隔", - "type": "int", - "hint": "主动消息轮询间隔,单位为秒,默认 3 秒,最大不要超过 60 秒,否则可能被认为是旧消息。", - }, - "kf_name": { - "description": "微信客服账号名", - "type": "string", - "hint": "可选。微信客服账号名(不是 ID)。可在 https://kf.weixin.qq.com/kf/frame#/accounts 获取", - }, - "telegram_token": { - "description": "Bot Token", - "type": "string", - "hint": "如果你的网络环境为中国大陆,请在 `其他配置` 处设置代理或更改 api_base。", - "secret": True, - }, - "mattermost_url": { - "description": "Mattermost URL", - "type": "string", - "hint": "Mattermost 服务地址,例如 https://chat.example.com。", - }, - "mattermost_bot_token": { - "description": "Mattermost Bot Token", - "type": "string", - "hint": "在 Mattermost 中创建 Bot 账户后生成的访问令牌。", - "secret": True, - }, - "mattermost_reconnect_delay": { - "description": "Mattermost 重连延迟", - "type": "float", - "hint": "WebSocket 断开后的重连等待时间,单位为秒。默认 5 秒。", - }, - "misskey_instance_url": { - "description": "Misskey 实例 URL", - "type": "string", - "hint": "例如 https://misskey.example,填写 Bot 账号所在的 Misskey 实例地址", - }, - "misskey_token": { - "description": "Misskey Access Token", - "type": "string", - "hint": "连接服务设置生成的 API 鉴权访问令牌(Access token)", - "secret": True, - }, - "misskey_default_visibility": { - "description": "默认帖子可见性", - "type": "string", - "options": ["public", "home", "followers"], - "hint": "机器人发帖时的默认可见性设置。public:公开,home:主页时间线,followers:仅关注者。", - }, - "misskey_local_only": { - "description": "仅限本站(不参与联合)", - "type": "bool", - "hint": "启用后,机器人发出的帖子将仅在本实例可见,不会联合到其他实例", - }, - "misskey_enable_chat": { - "description": "启用聊天消息响应", - "type": "bool", - "hint": "启用后,机器人将会监听和响应私信聊天消息", - }, - "misskey_enable_file_upload": { - "description": "启用文件上传到 Misskey", - "type": "bool", - "hint": "启用后,适配器会尝试将消息链中的文件上传到 Misskey。URL 文件会先尝试服务器端上传,异步上传失败时会回退到下载后本地上传。", - }, - "misskey_allow_insecure_downloads": { - "description": "允许不安全下载(禁用 SSL 验证)", - "type": "bool", - "hint": "当远端服务器存在证书问题导致无法正常下载时,自动禁用 SSL 验证作为回退方案。适用于某些图床的证书配置问题。启用有安全风险,仅在必要时使用。", - }, - "misskey_download_timeout": { - "description": "远端下载超时时间(秒)", - "type": "int", - "hint": "下载远程文件时的超时时间(秒),用于异步上传回退到本地上传的场景。", - }, - "misskey_download_chunk_size": { - "description": "流式下载分块大小(字节)", - "type": "int", - "hint": "流式下载和计算 MD5 时使用的每次读取字节数,过小会增加开销,过大会占用内存。", - }, - "misskey_max_download_bytes": { - "description": "最大允许下载字节数(超出则中止)", - "type": "int", - "hint": "如果希望限制下载文件的最大大小以防止 OOM,请填写最大字节数;留空或 null 表示不限制。", - }, - "misskey_upload_concurrency": { - "description": "并发上传限制", - "type": "int", - "hint": "同时进行的文件上传任务上限(整数,默认 3)。", - }, - "misskey_upload_folder": { - "description": "上传到网盘的目标文件夹 ID", - "type": "string", - "hint": "可选:填写 Misskey 网盘中目标文件夹的 ID,上传的文件将放置到该文件夹内。留空则使用账号网盘根目录。", - }, - "card_template_id": { - "description": "卡片模板 ID", - "type": "string", - "hint": "可选。钉钉互动卡片模板 ID。启用后将使用互动卡片进行流式回复。", - }, - "telegram_command_register": { - "description": "命令注册", - "type": "bool", - "hint": "启用后,AstrBot 将会自动注册 Telegram 命令。", - "show_key": True, - }, - "telegram_command_auto_refresh": { - "description": "命令自动刷新", - "type": "bool", - "hint": "启用后,AstrBot 将会在运行时自动刷新 Telegram 命令。(单独设置此项无效)", - "show_key": True, - }, - "telegram_command_register_interval": { - "description": "命令自动刷新间隔", - "type": "int", - "hint": "Telegram 命令自动刷新间隔,单位为秒。", - "show_key": True, - }, - "telegram_polling_restart_delay": { - "description": "轮询重启延迟", - "type": "float", - "hint": "当轮询意外结束尝试自动重启时的延迟时间,理论上越短恢复越快,但过短(<0.1s)可能导致死循环针对 API 服务器的请求阻断。单位为秒。默认为 5s。", - "show_key": True, - }, - "id": { - "description": "机器人名称", - "type": "string", - "hint": "机器人名称", - }, - "type": { - "description": "适配器类型", - "type": "string", - "invisible": True, - }, - "enable": { - "description": "启用", - "type": "bool", - "hint": "是否启用该适配器。未启用的适配器对应的消息平台将不会接收到消息。", - }, - "appid": { - "description": "appid", - "type": "string", - "hint": "必填项。当前消息平台的 AppID。如何获取请参考对应平台接入文档。", - }, - "secret": { - "description": "secret", - "type": "string", - "hint": "必填项。", - "secret": True, - }, - "enable_group_c2c": { - "description": "启用消息列表单聊", - "type": "bool", - "hint": "启用后,机器人可以接收到 QQ 消息列表中的私聊消息。你可能需要在 QQ 机器人平台上通过扫描二维码的方式添加机器人为你的好友。详见文档。", - }, - "enable_guild_direct_message": { - "description": "启用频道私聊", - "type": "bool", - "hint": "启用后,机器人可以接收到频道的私聊消息。", - }, - "use_markdown": { - "description": "主动消息使用 Markdown", - "type": "bool", - "hint": "启用后,机器人主动发送消息默认以 Markdown 模式发送;插件显式调用 use_markdown() 指定行为时不受此配置影响。", - }, - "ws_reverse_host": { - "description": "反向 Websocket 主机", - "type": "string", - "hint": "AstrBot 将作为服务器端。", - }, - "ws_reverse_port": { - "description": "反向 Websocket 端口", - "type": "int", - }, - "ws_reverse_token": { - "description": "反向 Websocket Token", - "type": "string", - "hint": "反向 Websocket Token。未设置则不启用 Token 验证。", - "secret": True, - }, - "wecom_ai_bot_name": { - "description": "企业微信智能机器人的名字", - "type": "string", - "hint": "请务必填写正确,否则无法使用一些指令。", - }, - "wecom_ai_bot_connection_mode": { - "description": "企业微信智能机器人连接模式", - "type": "string", - "options": ["webhook", "long_connection"], - "labels": ["Webhook 回调", "长连接"], - "hint": "Webhook 回调模式需要配置 Token/EncodingAESKey。长连接模式需要配置 BotID/Secret。", - }, - "wecomaibot_init_respond_text": { - "description": "企业微信智能机器人初始响应文本", - "type": "string", - "hint": "当机器人收到消息时,首先回复的文本内容。留空则不设置。", - }, - "wecomaibot_friend_message_welcome_text": { - "description": "企业微信智能机器人私聊欢迎语", - "type": "string", - "hint": "当用户当天进入智能机器人单聊会话,回复欢迎语,留空则不回复。", - }, - "wecomaibot_token": { - "description": "企业微信智能机器人 Token", - "type": "string", - "hint": "用于 Webhook 回调模式的身份验证。", - "secret": True, - "condition": { - "wecom_ai_bot_connection_mode": "webhook", - }, - }, - "wecomaibot_encoding_aes_key": { - "description": "企业微信智能机器人 EncodingAESKey", - "type": "string", - "hint": "用于 Webhook 回调模式的消息加密解密。", - "secret": True, - "condition": { - "wecom_ai_bot_connection_mode": "webhook", - }, - }, - "msg_push_webhook_url": { - "description": "企业微信消息推送 Webhook URL", - "type": "string", - "hint": "用于 send_by_session 主动消息推送。格式示例: https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=xxx", - "secret": True, - }, - "only_use_webhook_url_to_send": { - "description": "仅使用 Webhook 发送消息", - "type": "bool", - "hint": "启用后,企业微信智能机器人的所有回复都改为通过消息推送 Webhook 发送。消息推送 Webhook 支持更多的消息类型(如图片、文件等)。", - }, - "wecomaibot_ws_bot_id": { - "description": "长连接 BotID", - "type": "string", - "hint": "企业微信智能机器人长连接模式凭证 BotID。", - "condition": { - "wecom_ai_bot_connection_mode": "long_connection", - }, - }, - "wecomaibot_ws_secret": { - "description": "长连接 Secret", - "type": "string", - "hint": "企业微信智能机器人长连接模式凭证 Secret。", - "secret": True, - "condition": { - "wecom_ai_bot_connection_mode": "long_connection", - }, - }, - "wecomaibot_ws_url": { - "description": "长连接 WebSocket 地址", - "type": "string", - "invisible": True, - "hint": "默认值为 wss://openws.work.weixin.qq.com,一般无需修改。", - "condition": { - "wecom_ai_bot_connection_mode": "long_connection", - }, - }, - "wecomaibot_heartbeat_interval": { - "description": "长连接心跳间隔", - "type": "int", - "invisible": True, - "hint": "长连接模式心跳间隔(秒),建议 30 秒。", - "condition": { - "wecom_ai_bot_connection_mode": "long_connection", - }, - }, - "discord_token": { - "description": "Discord Bot Token", - "type": "string", - "hint": "在此处填入你的Discord Bot Token", - "secret": True, - }, - "discord_proxy": { - "description": "Discord 代理地址", - "type": "string", - "hint": "可选的代理地址:http://ip:port", - }, - "discord_command_register": { - "description": "注册 Discord 指令", - "hint": "启用后,自动将插件指令注册为 Discord 斜杠指令", - "type": "bool", - }, - "discord_activity_name": { - "description": "Discord 活动名称", - "type": "string", - "hint": "可选的 Discord 活动名称。留空则不设置活动。", - }, - "discord_allow_bot_messages": { - "description": "允许接收机器人消息", - "type": "bool", - "hint": "启用后,AstrBot 将接收来自其他 Discord 机器人的消息。适用于机器人间通信场景(如消息转发)。默认关闭。", - }, - "port": { - "description": "回调服务器端口", - "type": "int", - "hint": "回调服务器端口。留空则不启用回调服务器。", - "condition": { - "unified_webhook_mode": False, - }, - }, - "callback_server_host": { - "description": "回调服务器主机", - "type": "string", - "hint": "回调服务器主机。留空则不启用回调服务器。", - "condition": { - "unified_webhook_mode": False, - }, - }, - "unified_webhook_mode": { - "description": "统一 Webhook 模式", - "type": "bool", - "hint": "Webhook 模式下使用 AstrBot 统一 Webhook 入口,无需单独开启端口。回调地址为 /api/platform/webhook/{webhook_uuid}。", - }, - **PERSONAL_WECHAT_CONFIG_METADATA, - "webhook_uuid": { - "invisible": True, - "description": "Webhook UUID", - "type": "string", - "hint": "统一 Webhook 模式下的唯一标识符,创建平台时自动生成。", - }, - "kook_bot_token": { - "description": "机器人 Token", - "type": "string", - "hint": "必填项。从 KOOK 开发者平台获取的机器人 Token。", - "secret": True, - }, - "kook_reconnect_delay": { - "description": "重连延迟", - "type": "int", - "hint": "重连延迟时间(秒),使用指数退避策略。", - }, - "kook_max_reconnect_delay": { - "description": "最大重连延迟", - "type": "int", - "hint": "重连延迟的最大值(秒)。", - }, - "kook_max_retry_delay": { - "description": "最大重试延迟", - "type": "int", - "hint": "重试的最大延迟时间(秒)。", - }, - "kook_heartbeat_interval": { - "description": "心跳间隔", - "type": "int", - "hint": "心跳检测间隔时间(秒)。", - }, - "kook_heartbeat_timeout": { - "description": "心跳超时时间", - "type": "int", - "hint": "心跳检测超时时间(秒)。", - }, - "kook_max_heartbeat_failures": { - "description": "最大心跳失败次数", - "type": "int", - "hint": "允许的最大心跳失败次数,超过后断开连接。", - }, - "kook_max_consecutive_failures": { - "description": "最大连续失败次数", - "type": "int", - "hint": "允许的最大连续失败次数,超过后停止重试。", - }, - }, - }, - "platform_settings": { - "type": "object", - "items": { - "unique_session": { - "type": "bool", - }, - "rate_limit": { - "type": "object", - "items": { - "time": {"type": "int"}, - "count": {"type": "int"}, - "strategy": { - "type": "string", - "options": ["stall", "discard"], - }, - }, - }, - "no_permission_reply": { - "type": "bool", - "hint": "启用后,当用户没有权限执行某个操作时,机器人会回复一条消息。", - }, - "empty_mention_waiting": { - "type": "bool", - "hint": "启用后,当消息内容只有 @ 机器人时,会触发等待,在 60 秒内的该用户的任意一条消息均会唤醒机器人。这在某些平台不支持 @ 和语音/图片等消息同时发送时特别有用。", - }, - "empty_mention_waiting_need_reply": { - "type": "bool", - "hint": "在上面一个配置项中,如果启用了触发等待,启用此项后,机器人会使用 LLM 生成一条回复。否则,将不回复而只是等待。", - }, - "friend_message_needs_wake_prefix": { - "type": "bool", - "hint": "启用后,私聊消息需要唤醒前缀才会被处理,同群聊一样。", - }, - "ignore_bot_self_message": { - "type": "bool", - "hint": "某些平台会将自身账号在其他 APP 端发送的消息也当做消息事件下发导致给自己发消息时唤醒机器人", - }, - "ignore_at_all": { - "type": "bool", - "hint": "启用后,机器人会忽略 @ 全体成员 的消息事件。", - }, - "segmented_reply": { - "type": "object", - "items": { - "enable": { - "type": "bool", - }, - "only_llm_result": { - "type": "bool", - }, - "interval_method": { - "type": "string", - "options": ["random", "log"], - }, - "interval": { - "type": "string", - }, - "log_base": { - "type": "float", - }, - "words_count_threshold": { - "type": "int", - }, - "regex": { - "type": "string", - }, - "content_cleanup_rule": { - "type": "string", - }, - }, - }, - "reply_prefix": { - "type": "string", - "hint": "机器人回复消息时带有的前缀。", - }, - "forward_threshold": { - "type": "int", - "hint": "超过一定字数后,机器人会将消息折叠成 QQ 群聊的 “转发消息”,以防止刷屏。目前仅 QQ 平台适配器适用。", - }, - "enable_id_white_list": { - "type": "bool", - }, - "id_whitelist": { - "type": "list", - "_special": "umo", - "items": {"type": "string"}, - "hint": "只处理填写的 ID 发来的消息事件,为空时不启用。可使用 /sid 指令获取在平台上的会话 ID(类似 abc:GroupMessage:123)。管理员可在 WebUI 的配置文件 -> 访问控制 -> 白名单中管理白名单。", - }, - "id_whitelist_log": { - "type": "bool", - "hint": "启用后,当一条消息没通过白名单时,会输出 INFO 级别的日志。", - }, - "wl_ignore_admin_on_group": { - "type": "bool", - }, - "wl_ignore_admin_on_friend": { - "type": "bool", - }, - "reply_with_mention": { - "type": "bool", - "hint": "启用后,机器人回复消息时会 @ 发送者。实际效果以具体的平台适配器为准。", - }, - "reply_with_quote": { - "type": "bool", - "hint": "启用后,机器人回复消息时会引用原消息。实际效果以具体的平台适配器为准。", - }, - "path_mapping": { - "type": "list", - "items": {"type": "string"}, - "hint": "此功能解决由于文件系统不一致导致路径不存在的问题。格式为 <原路径>:<映射路径>。如 `/app/.config/QQ:/var/lib/docker/volumes/xxxx/_data`。这样,当消息平台下发的事件中图片和语音路径以 `/app/.config/QQ` 开头时,开头被替换为 `/var/lib/docker/volumes/xxxx/_data`。这在 AstrBot 或者平台协议端使用 Docker 部署时特别有用。", - }, - }, - }, - "content_safety": { - "type": "object", - "items": { - "also_use_in_response": { - "type": "bool", - "hint": "启用后,大模型的响应也会通过内容安全审核。", - }, - "baidu_aip": { - "type": "object", - "items": { - "enable": { - "type": "bool", - "hint": "启用此功能前,您需要手动在设备中安装 baidu-aip 库。一般来说,安装指令如下: `pip3 install baidu-aip`", - }, - "app_id": {"description": "APP ID", "type": "string"}, - "api_key": { - "description": "API Key", - "type": "string", - "secret": True, - }, - "secret_key": { - "type": "string", - "secret": True, - }, - }, - }, - "internal_keywords": { - "type": "object", - "items": { - "enable": { - "type": "bool", - }, - "extra_keywords": { - "type": "list", - "items": {"type": "string"}, - "hint": "额外的屏蔽关键词列表,支持正则表达式。", - }, - }, - }, - }, - }, - }, - }, - "provider_group": { - "name": "服务提供商", - "metadata": { - "provider": { - "type": "list", - # provider sources templates - "config_template": { - "OpenAI Compatible": { - "id": "openai", - "provider": "openai", - "type": "openai_chat_completion", - "provider_type": "chat_completion", - "enable": True, - "key": [], - "api_base": "https://api.openai.com/v1", - "timeout": 120, - "proxy": "", - "custom_headers": {}, - }, - "OpenAI Responses": { - "id": "openai-responses", - "provider": "openai", - "type": "openai_responses", - "provider_type": "chat_completion", - "enable": True, - "key": [], - "api_base": "https://api.openai.com/v1", - "timeout": 120, - "proxy": "", - "custom_headers": {}, - }, - "Google Gemini": { - "id": "google_gemini", - "provider": "google", - "type": "googlegenai_chat_completion", - "provider_type": "chat_completion", - "enable": True, - "key": [], - "api_base": "https://generativelanguage.googleapis.com/", - "timeout": 120, - "gm_resp_image_modal": False, - "gm_native_search": False, - "gm_native_coderunner": False, - "gm_url_context": False, - "gm_safety_settings": { - "harassment": "BLOCK_MEDIUM_AND_ABOVE", - "hate_speech": "BLOCK_MEDIUM_AND_ABOVE", - "sexually_explicit": "BLOCK_MEDIUM_AND_ABOVE", - "dangerous_content": "BLOCK_MEDIUM_AND_ABOVE", - }, - "gm_thinking_config": {"budget": 0, "level": "HIGH"}, - "proxy": "", - }, - "Anthropic": { - "id": "anthropic", - "provider": "anthropic", - "type": "anthropic_chat_completion", - "provider_type": "chat_completion", - "enable": True, - "key": [], - "api_base": "https://api.anthropic.com", - "timeout": 120, - "proxy": "", - "custom_headers": {}, - "anth_thinking_config": {"type": "", "budget": 0, "effort": ""}, - }, - "Kimi Coding Plan": { - "id": "kimi-code", - "provider": "kimi-code", - "type": "kimi_code_chat_completion", - "provider_type": "chat_completion", - "enable": True, - "key": [], - "api_base": "https://api.kimi.com/coding", - "timeout": 120, - "proxy": "", - "custom_headers": {}, - "anth_thinking_config": {"type": "", "budget": 0, "effort": ""}, - }, - "Moonshot": { - "id": "moonshot", - "provider": "moonshot", - "type": "openai_chat_completion", - "provider_type": "chat_completion", - "enable": True, - "key": [], - "timeout": 120, - "api_base": "https://api.moonshot.cn/v1", - "proxy": "", - "custom_headers": {}, - }, - "MiniMax": { - "id": "minimax", - "provider": "minimax", - "type": "openai_chat_completion", - "provider_type": "chat_completion", - "enable": True, - "key": [], - "api_base": "https://api.minimaxi.com/v1", - "timeout": 120, - "proxy": "", - "custom_headers": {}, - }, - "MiniMax Token Plan": { - "id": "minimax-token-plan", - "provider": "minimax-token-plan", - "type": "minimax_token_plan", - "provider_type": "chat_completion", - "enable": True, - "key": [], - "api_base": "https://api.minimaxi.com/anthropic", - "timeout": 120, - "proxy": "", - "custom_headers": {}, - "anth_thinking_config": {"type": "", "budget": 0, "effort": ""}, - }, - "Xiaomi": { - "id": "xiaomi", - "provider": "xiaomi", - "type": "xiaomi_chat_completion", - "provider_type": "chat_completion", - "enable": True, - "key": [], - "api_base": "https://api.xiaomimimo.com/v1", - "timeout": 120, - "proxy": "", - "custom_headers": {}, - }, - "Xiaomi Token Plan": { - "id": "xiaomi-token-plan", - "provider": "xiaomi-token-plan", - "type": "xiaomi_token_plan", - "provider_type": "chat_completion", - "enable": True, - "key": [], - "api_base": "https://token-plan-cn.xiaomimimo.com/anthropic", - "timeout": 120, - "proxy": "", - "custom_headers": {}, - "anth_thinking_config": {"type": "", "budget": 0, "effort": ""}, - }, - "xAI": { - "id": "xai", - "provider": "xai", - "type": "openai_responses", - "provider_type": "chat_completion", - "enable": True, - "key": [], - "api_base": "https://api.x.ai/v1", - "timeout": 120, - "proxy": "", - "custom_headers": {}, - }, - "DeepSeek": { - "id": "deepseek", - "provider": "deepseek", - "type": "openai_chat_completion", - "provider_type": "chat_completion", - "enable": True, - "key": [], - "api_base": "https://api.deepseek.com/v1", - "timeout": 120, - "proxy": "", - "custom_headers": {}, - }, - "DeepSeek Responses": { - "id": "deepseek-responses", - "provider": "deepseek", - "type": "openai_responses", - "provider_type": "chat_completion", - "enable": True, - "key": [], - "api_base": "https://api.deepseek.com/v1", - "timeout": 120, - "proxy": "", - "custom_headers": {}, - }, - "Zhipu": { - "id": "zhipu", - "provider": "zhipu", - "type": "zhipu_chat_completion", - "provider_type": "chat_completion", - "enable": True, - "key": [], - "timeout": 120, - "api_base": "https://open.bigmodel.cn/api/paas/v4/", - "proxy": "", - "custom_headers": {}, - }, - "LongCat": { - "id": "longcat", - "provider": "longcat", - "type": "longcat_chat_completion", - "provider_type": "chat_completion", - "enable": True, - "key": [], - "api_base": "https://api.longcat.chat/openai", - "timeout": 120, - "proxy": "", - "custom_headers": {}, - }, - "AIHubMix": { - "id": "aihubmix", - "provider": "aihubmix", - "type": "aihubmix_chat_completion", - "provider_type": "chat_completion", - "enable": True, - "key": [], - "timeout": 120, - "api_base": "https://aihubmix.com/v1", - "proxy": "", - "custom_headers": {}, - }, - "MiraRouter": { - "id": "mirarouter", - "provider": "mirarouter", - "type": "mirarouter_chat_completion", - "provider_type": "chat_completion", - "enable": True, - "key": [], - "timeout": 120, - "api_base": "https://api.mirarouter.com/v1", - "proxy": "", - "custom_headers": {}, - }, - "OpenRouter": { - "id": "openrouter", - "provider": "openrouter", - "type": "openrouter_chat_completion", - "provider_type": "chat_completion", - "enable": True, - "key": [], - "timeout": 120, - "api_base": "https://openrouter.ai/api/v1", - "proxy": "", - "custom_headers": {}, - }, - "SSYCloud(胜算云)": { - "id": "ssycloud", - "provider": "ssycloud", - "type": "ssycloud_chat_completion", - "provider_type": "chat_completion", - "enable": True, - "key": [], - "timeout": 120, - "api_base": "https://router.shengsuanyun.com/api/v1", - "proxy": "", - "custom_headers": {"X-Title": "AstrBot"}, - }, - "NVIDIA": { - "id": "nvidia", - "provider": "nvidia", - "type": "openai_chat_completion", - "provider_type": "chat_completion", - "enable": True, - "key": [], - "api_base": "https://integrate.api.nvidia.com/v1", - "timeout": 120, - "proxy": "", - "custom_headers": {}, - }, - "Azure OpenAI": { - "id": "azure_openai", - "provider": "azure", - "type": "openai_chat_completion", - "provider_type": "chat_completion", - "enable": True, - "api_version": "2024-05-01-preview", - "key": [], - "api_base": "", - "timeout": 120, - "proxy": "", - "custom_headers": {}, - }, - "Ollama": { - "id": "ollama", - "provider": "ollama", - "type": "openai_chat_completion", - "provider_type": "chat_completion", - "enable": True, - "key": ["ollama"], # ollama 的 key 默认是 ollama - "api_base": "http://127.0.0.1:11434/v1", - "proxy": "", - "custom_headers": {}, - "ollama_disable_thinking": False, - }, - "LM Studio": { - "id": "lm_studio", - "provider": "lm_studio", - "type": "openai_chat_completion", - "provider_type": "chat_completion", - "enable": True, - "key": ["lmstudio"], - "api_base": "http://127.0.0.1:1234/v1", - "proxy": "", - "custom_headers": {}, - }, - "Gemini_OpenAI_API": { - "id": "google_gemini_openai", - "provider": "google", - "type": "openai_chat_completion", - "provider_type": "chat_completion", - "enable": True, - "key": [], - "api_base": "https://generativelanguage.googleapis.com/v1beta/openai/", - "timeout": 120, - "proxy": "", - "custom_headers": {}, - }, - "Groq": { - "id": "groq", - "provider": "groq", - "type": "groq_chat_completion", - "provider_type": "chat_completion", - "enable": True, - "key": [], - "api_base": "https://api.groq.com/openai/v1", - "timeout": 120, - "proxy": "", - "custom_headers": {}, - }, - "302.AI": { - "id": "302ai", - "provider": "302ai", - "type": "openai_chat_completion", - "provider_type": "chat_completion", - "enable": True, - "key": [], - "api_base": "https://api.302.ai/v1", - "timeout": 120, - "proxy": "", - "custom_headers": {}, - }, - "SiliconFlow": { - "id": "siliconflow", - "provider": "siliconflow", - "type": "openai_chat_completion", - "provider_type": "chat_completion", - "enable": True, - "key": [], - "timeout": 120, - "api_base": "https://api.siliconflow.cn/v1", - "proxy": "", - "custom_headers": {}, - }, - "PPIO": { - "id": "ppio", - "provider": "ppio", - "type": "openai_chat_completion", - "provider_type": "chat_completion", - "enable": True, - "key": [], - "api_base": "https://api.ppinfra.com/v3/openai", - "timeout": 120, - "proxy": "", - "custom_headers": {}, - }, - "TokenPony": { - "id": "tokenpony", - "provider": "tokenpony", - "type": "openai_chat_completion", - "provider_type": "chat_completion", - "enable": True, - "key": [], - "api_base": "https://api.tokenpony.cn/v1", - "timeout": 120, - "proxy": "", - "custom_headers": {}, - }, - "Compshare": { - "id": "compshare", - "provider": "compshare", - "type": "openai_chat_completion", - "provider_type": "chat_completion", - "enable": True, - "key": [], - "api_base": "https://api.modelverse.cn/v1", - "timeout": 120, - "proxy": "", - "custom_headers": {}, - }, - "ModelScope": { - "id": "modelscope", - "provider": "modelscope", - "type": "openai_chat_completion", - "provider_type": "chat_completion", - "enable": True, - "key": [], - "timeout": 120, - "api_base": "https://api-inference.modelscope.cn/v1", - "proxy": "", - "custom_headers": {}, - }, - "FastGPT": { - "id": "fastgpt", - "provider": "fastgpt", - "type": "openai_chat_completion", - "provider_type": "chat_completion", - "enable": True, - "key": [], - "api_base": "https://api.fastgpt.in/api/v1", - "timeout": 60, - "proxy": "", - "custom_headers": {}, - "custom_extra_body": {}, - }, - "Whisper(API)": { - "id": "whisper", - "provider": "openai", - "type": "openai_whisper_api", - "provider_type": "speech_to_text", - "enable": False, - "api_key": "", - "api_base": "", - "model": "whisper-1", - "proxy": "", - }, - "MiMo STT(API)": { - "id": "mimo_stt", - "provider": "mimo", - "type": "mimo_stt_api", - "provider_type": "speech_to_text", - "enable": False, - "api_key": "", - "api_base": "https://api.xiaomimimo.com/v1", - "model": "mimo-v2.5-asr", - "timeout": "20", - "proxy": "", - }, - "Whisper(Local)": { - "provider": "openai", - "type": "openai_whisper_selfhost", - "provider_type": "speech_to_text", - "enable": False, - "id": "whisper_selfhost", - "model": "tiny", - "whisper_device": "cpu", - }, - "SenseVoice(Local)": { - "type": "sensevoice_stt_selfhost", - "provider": "sensevoice", - "provider_type": "speech_to_text", - "enable": False, - "id": "sensevoice", - "stt_model": "iic/SenseVoiceSmall", - "is_emotion": False, - }, - "OpenAI TTS(API)": { - "id": "openai_tts", - "type": "openai_tts_api", - "provider": "openai", - "provider_type": "text_to_speech", - "enable": False, - "api_key": "", - "api_base": "", - "model": "tts-1", - "openai-tts-voice": "alloy", - "timeout": "20", - "proxy": "", - }, - "MiMo TTS(API)": { - "id": "mimo_tts", - "type": "mimo_tts_api", - "provider": "mimo", - "provider_type": "text_to_speech", - "enable": False, - "api_key": "", - "api_base": "https://api.xiaomimimo.com/v1", - "model": "mimo-v2.5-tts", - "mimo-tts-voice": "mimo_default", - "mimo-tts-format": "wav", - "mimo-tts-style-prompt": "", - "mimo-tts-dialect": "", - "mimo-tts-seed-text": "Hello, MiMo, have you had lunch?", - "timeout": "20", - "proxy": "", - }, - "Genie TTS": { - "id": "genie_tts", - "provider": "genie_tts", - "type": "genie_tts", - "provider_type": "text_to_speech", - "enable": False, - "genie_character_name": "mika", - "genie_onnx_model_dir": "CharacterModels/v2ProPlus/mika/tts_models", - "genie_language": "Japanese", - "genie_refer_audio_path": "", - "genie_refer_text": "", - "timeout": 20, - }, - "Edge TTS": { - "id": "edge_tts", - "provider": "microsoft", - "type": "edge_tts", - "provider_type": "text_to_speech", - "enable": False, - "edge-tts-voice": "zh-CN-XiaoxiaoNeural", - "rate": "+0%", - "volume": "+0%", - "pitch": "+0Hz", - "timeout": 20, - }, - "GSV TTS(Local)": { - "id": "gsv_tts", - "enable": False, - "provider": "gpt_sovits", - "type": "gsv_tts_selfhost", - "provider_type": "text_to_speech", - "api_base": "http://127.0.0.1:9880", - "gpt_weights_path": "", - "sovits_weights_path": "", - "timeout": 60, - "gsv_default_parms": { - "gsv_ref_audio_path": "", - "gsv_prompt_text": "", - "gsv_prompt_lang": "zh", - "gsv_aux_ref_audio_paths": "", - "gsv_text_lang": "zh", - "gsv_top_k": 5, - "gsv_top_p": 1.0, - "gsv_temperature": 1.0, - "gsv_text_split_method": "cut3", - "gsv_batch_size": 1, - "gsv_batch_threshold": 0.75, - "gsv_split_bucket": True, - "gsv_speed_factor": 1, - "gsv_fragment_interval": 0.3, - "gsv_streaming_mode": False, - "gsv_seed": -1, - "gsv_parallel_infer": True, - "gsv_repetition_penalty": 1.35, - "gsv_media_type": "wav", - }, - }, - "GSVI TTS(API)": { - "id": "gsvi_tts", - "type": "gsvi_tts_api", - "provider": "gpt_sovits_inference", - "provider_type": "text_to_speech", - "enable": False, - "api_key": "", - "api_base": "http://127.0.0.1:8000", - "version": "v4", - "character": "", - "prompt_text_lang": "中文", - "emotion": "默认", - "text_lang": "中文", - "timeout": 20, - }, - "FishAudio TTS(API)": { - "id": "fishaudio_tts", - "provider": "fishaudio", - "type": "fishaudio_tts_api", - "provider_type": "text_to_speech", - "enable": False, - "api_key": "", - "api_base": "https://api.fish.audio/v1", - "model": "s2-pro", - "fishaudio-tts-character": "可莉", - "fishaudio-tts-reference-id": "", - "timeout": "20", - "proxy": "", - }, - "阿里云百炼 TTS(API)": { - "hint": "API Key 从 https://bailian.console.aliyun.com/?tab=model#/api-key 获取。模型和音色的选择文档请参考: 阿里云百炼语音合成音色名称。具体可参考 https://help.aliyun.com/zh/model-studio/speech-synthesis-and-speech-recognition", - "id": "dashscope_tts", - "provider": "dashscope", - "type": "dashscope_tts", - "provider_type": "text_to_speech", - "enable": False, - "api_key": "", - "model": "cosyvoice-v1", - "dashscope_tts_voice": "loongstella", - "timeout": "20", - }, - "Azure TTS": { - "id": "azure_tts", - "type": "azure_tts", - "provider": "azure", - "provider_type": "text_to_speech", - "enable": True, - "azure_tts_voice": "zh-CN-YunxiaNeural", - "azure_tts_style": "cheerful", - "azure_tts_role": "Boy", - "azure_tts_rate": "1", - "azure_tts_volume": "100", - "azure_tts_subscription_key": "", - "azure_tts_region": "eastus", - "proxy": "", - }, - "MiniMax TTS(API)": { - "id": "minimax_tts", - "type": "minimax_tts_api", - "provider": "minimax", - "provider_type": "text_to_speech", - "enable": False, - "api_key": "", - "api_base": "https://api.minimax.chat/v1/t2a_v2", - "minimax-group-id": "", - "model": "speech-02-turbo", - "minimax-langboost": "auto", - "minimax-voice-speed": 1.0, - "minimax-voice-vol": 1.0, - "minimax-voice-pitch": 0, - "minimax-is-timber-weight": False, - "minimax-voice-id": "female-shaonv", - "minimax-timber-weight": '[\n {\n "voice_id": "Chinese (Mandarin)_Warm_Girl",\n "weight": 25\n },\n {\n "voice_id": "Chinese (Mandarin)_BashfulGirl",\n "weight": 50\n }\n]', - "minimax-voice-emotion": "auto", - "minimax-voice-latex": False, - "minimax-voice-english-normalization": False, - "timeout": 20, - "proxy": "", - }, - "火山引擎_TTS(API)": { - "id": "volcengine_tts", - "type": "volcengine_tts", - "provider": "volcengine", - "provider_type": "text_to_speech", - "enable": False, - "api_key": "", - "appid": "", - "volcengine_cluster": "volcano_tts", - "volcengine_voice_type": "", - "volcengine_speed_ratio": 1.0, - "api_base": "https://openspeech.bytedance.com/api/v1/tts", - "timeout": 20, - "proxy": "", - }, - "Gemini TTS": { - "id": "gemini_tts", - "type": "gemini_tts", - "provider": "google", - "provider_type": "text_to_speech", - "enable": False, - "gemini_tts_api_key": "", - "gemini_tts_api_base": "", - "gemini_tts_timeout": 20, - "gemini_tts_model": "gemini-3.8-flash-tts", - "gemini_tts_prefix": "", - "gemini_tts_voice_name": "Leda", - "proxy": "", - }, - "ElevenLabs TTS(API)": { - "hint": "API Key 从 https://elevenlabs.io/app/settings/api-keys 获取。Voice ID 可在 https://elevenlabs.io/app/voice-library 浏览选择。", - "id": "elevenlabs_tts", - "type": "elevenlabs_tts_api", - "provider": "elevenlabs", - "provider_type": "text_to_speech", - "enable": False, - "api_key": "", - "api_base": "https://api.elevenlabs.io/v1", - "model": "eleven_multilingual_v2", - "elevenlabs-tts-voice-id": "JBFqnCBsd6RMkjVDRZzb", - "elevenlabs-tts-output-format": "mp3_44100_128", - "elevenlabs-tts-stability": "", - "elevenlabs-tts-similarity-boost": "", - "elevenlabs-tts-style": "", - "elevenlabs-tts-use-speaker-boost": True, - "timeout": "20", - "proxy": "", - }, - "OpenAI Embedding": { - "id": "openai_embedding", - "type": "openai_embedding", - "provider": "openai", - "provider_type": "embedding", - "hint": "provider_group.provider.openai_embedding.hint", - "enable": True, - "embedding_api_key": "", - "embedding_api_base": "", - "embedding_model": "", - "embedding_dimensions": 1024, - "embedding_dimensions_mode": "auto", - "timeout": 20, - "proxy": "", - }, - "Gemini Embedding": { - "id": "gemini_embedding", - "type": "gemini_embedding", - "provider": "google", - "provider_type": "embedding", - "hint": "provider_group.provider.gemini_embedding.hint", - "enable": True, - "embedding_api_key": "", - "embedding_api_base": "", - "embedding_model": "gemini-embedding-001", - "embedding_dimensions": 768, - "timeout": 20, - "proxy": "", - }, - "NVIDIA Embedding": { - "id": "nvidia_embedding", - "type": "nvidia_embedding", - "provider": "nvidia", - "provider_type": "embedding", - "hint": "provider_group.provider.nvidia_embedding.hint", - "enable": True, - "embedding_api_key": "", - "embedding_api_base": "https://integrate.api.nvidia.com/v1", - "embedding_model": "nvidia/nemotron-3-embed-1b", - "input_type": "passage", - "embedding_dimensions": 2048, - "timeout": 20, - "proxy": "", - }, - "Ollama Embedding": { - "id": "ollama_embedding", - "type": "ollama_embedding", - "provider": "ollama", - "provider_type": "embedding", - "hint": "provider_group.provider.ollama_embedding.hint", - "enable": True, - "embedding_api_base": "http://localhost:11434", - "embedding_model": "nomic-embed-text", - "embedding_dimensions": 768, - "timeout": 60, - "proxy": "", - }, - "DashScope Embedding": { - "id": "dashscope_embedding", - "type": "dashscope_embedding", - "provider": "dashscope", - "provider_type": "embedding", - "hint": "provider_group.provider.dashscope_embedding.hint", - "enable": True, - "embedding_api_key": "", - "embedding_api_base": "https://dashscope.aliyuncs.com/api/v1", - "embedding_model": "text-embedding-v4", - "embedding_dimensions": 1024, - "timeout": 60, - "proxy": "", - }, - "vLLM Rerank": { - "id": "vllm_rerank", - "type": "vllm_rerank", - "provider": "vllm", - "provider_type": "rerank", - "enable": True, - "rerank_api_key": "", - "rerank_api_base": "http://127.0.0.1:8000", - "rerank_api_suffix": "/v1/rerank", - "rerank_model": "BAAI/bge-reranker-base", - "timeout": 20, - }, - "Xinference Rerank": { - "id": "xinference_rerank", - "type": "xinference_rerank", - "provider": "xinference", - "provider_type": "rerank", - "enable": True, - "rerank_api_key": "", - "rerank_api_base": "http://127.0.0.1:9997", - "rerank_model": "BAAI/bge-reranker-base", - "timeout": 20, - "launch_model_if_not_running": False, - }, - "阿里云百炼重排序": { - "id": "bailian_rerank", - "type": "bailian_rerank", - "provider": "bailian", - "provider_type": "rerank", - "enable": True, - "rerank_api_key": "", - "rerank_api_base": "https://dashscope.aliyuncs.com/api/v1/services/rerank/text-rerank/text-rerank", - "rerank_model": "qwen3-rerank", - "timeout": 30, - "return_documents": False, - "instruct": "", - }, - "NVIDIA Rerank": { - "id": "nvidia_rerank", - "type": "nvidia_rerank", - "provider": "nvidia", - "provider_type": "rerank", - "enable": True, - "nvidia_rerank_api_key": "", - "nvidia_rerank_api_base": "https://ai.api.nvidia.com/v1/retrieval", - "nvidia_rerank_model": "nvidia/llama-nemotron-rerank-vl-1b-v2", - "nvidia_rerank_model_endpoint": "/reranking", - "timeout": 20, - "nvidia_rerank_truncate": "", - }, - "TEI Rerank": { - "id": "tei_rerank", - "type": "tei_rerank", - "provider": "huggingface", - "provider_type": "rerank", - "enable": True, - "rerank_api_key": "", - "rerank_api_base": "http://127.0.0.1:8080", - "timeout": 20, - "tei_rerank_truncate": False, - "tei_rerank_truncation_direction": "Right", - "tei_rerank_raw_scores": False, - "tei_rerank_return_text": False, - }, - "TypeSafe System One": { - "id": "typesafe_decision", - "type": "system_one_decision", - "provider": "typesafe", - "provider_type": "decision", - "enable": True, - "key": "", - "api_base": "https://api.typesafe.ai/v1/systemone", - "model": "jev-latest", - "timeout": 2, - "total_timeout": 5, - "max_concurrency": 4, - "proxy": "", - "custom_headers": {}, - }, - "OpenRouter System One": { - "id": "openrouter_decision", - "type": "system_one_decision", - "provider": "openrouter", - "provider_type": "decision", - "enable": True, - "key": "", - "api_base": "https://openrouter.ai/api/v1/systemone", - "model": "jev-latest", - "timeout": 2, - "total_timeout": 5, - "max_concurrency": 4, - "proxy": "", - "custom_headers": {}, - }, - "Vercel System One": { - "id": "vercel_decision", - "type": "system_one_decision", - "provider": "vercel", - "provider_type": "decision", - "enable": True, - "key": "", - "api_base": "https://ai-gateway.vercel.sh/typesafe/v1/systemone", - "model": "typesafe-ai/jev", - "timeout": 2, - "total_timeout": 5, - "max_concurrency": 4, - "proxy": "", - "custom_headers": {}, - }, - "Custom System One": { - "id": "custom_decision", - "type": "system_one_decision", - "provider": "custom", - "provider_type": "decision", - "enable": True, - "key": "", - "api_base": "", - "model": "", - "timeout": 2, - "total_timeout": 5, - "max_concurrency": 4, - "proxy": "", - "custom_headers": {}, - }, - "Xinference STT": { - "id": "xinference_stt", - "type": "xinference_stt", - "provider": "xinference", - "provider_type": "speech_to_text", - "enable": False, - "api_key": "", - "api_base": "http://127.0.0.1:9997", - "model": "whisper-large-v3", - "timeout": 180, - "launch_model_if_not_running": False, - }, - }, - "items": { - "genie_onnx_model_dir": { - "description": "ONNX Model Directory", - "type": "string", - "hint": "The directory path containing the ONNX model files", - }, - "genie_language": { - "description": "Language", - "type": "string", - "options": ["Japanese", "English", "Chinese"], - }, - "provider_source_id": { - "invisible": True, - "type": "string", - }, - "api_key": { - "description": "API Key", - "type": "string", - "secret": True, - }, - "dashscope_api_key": { - "description": "DashScope API Key", - "type": "string", - "secret": True, - }, - "gemini_tts_api_key": { - "description": "Gemini API Key", - "type": "string", - "secret": True, - }, - "xai_native_search": { - "description": "启用原生搜索功能", - "type": "bool", - "hint": "启用后,将通过 xAI 的 Chat Completions 原生 Live Search 进行联网检索(按需计费)。仅对 xAI 提供商生效。", - "condition": { - "provider": "xai", - "type": "xai_chat_completion", - }, - }, - "rerank_api_base": { - "description": "重排序模型 API Base URL", - "type": "string", - "hint": "最终请求路径由 Base URL 和路径后缀拼接而成(默认为 /v1/rerank)。", - }, - "rerank_api_suffix": { - "description": "API URL 路径后缀", - "type": "string", - "hint": "追加到 base_url 后的路径,如 /v1/rerank。留空则不追加。", - }, - "rerank_api_key": { - "description": "API Key", - "type": "string", - "hint": "如果不需要 API Key, 请留空。", - "secret": True, - }, - "rerank_model": { - "description": "重排序模型名称", - "type": "string", - }, - "return_documents": { - "description": "是否在排序结果中返回文档原文", - "type": "bool", - "hint": "默认值false,以减少网络传输开销。", - }, - "instruct": { - "description": "自定义排序任务类型说明", - "type": "string", - "hint": "仅在使用 qwen3-rerank 模型时生效。建议使用英文撰写。", - }, - "launch_model_if_not_running": { - "description": "模型未运行时自动启动", - "type": "bool", - "hint": "如果模型当前未在 Xinference 服务中运行,是否尝试自动启动它。在生产环境中建议关闭。", - }, - "nvidia_rerank_api_base": { - "description": "API Base URL", - "type": "string", - }, - "nvidia_rerank_api_key": { - "description": "API Key", - "type": "string", - "secret": True, - }, - "nvidia_rerank_model": { - "description": "重排序模型名称", - "type": "string", - "hint": "请参照NVIDIA Docs中模型名称填写。", - }, - "nvidia_rerank_model_endpoint": { - "description": "自定义模型端点", - "type": "string", - "hint": "自定义URL末尾端点,默认为 /reranking", - }, - "nvidia_rerank_truncate": { - "description": "文本截断策略", - "type": "string", - "hint": "当输入文本过长时,是否截断输入以适应模型的最大上下文长度。", - "options": [ - "", - "NONE", - "END", - ], - }, - "tei_rerank_truncate": { - "description": "截断超长文本", - "type": "bool", - "hint": "当输入超过模型最大上下文长度时,是否自动截断。启用后需配合 截断方向 使用。", - }, - "tei_rerank_truncation_direction": { - "description": "截断方向", - "type": "string", - "options": ["left", "right"], - "hint": "选择从文本的左侧(left)还是右侧(right)开始截断。仅在 截断超长文本 为 True 时生效。", - }, - "tei_rerank_raw_scores": { - "description": "返回原始分数", - "type": "bool", - "hint": "如果为 True,返回模型原始 logit 分数(可能为负值),不经过 sigmoid 归一化。默认 False。", - }, - "tei_rerank_return_text": { - "description": "返回排序结果中的文档原文", - "type": "bool", - "hint": "如果为 True,每个排序结果将附带原始文本。默认 False 以减少网络传输。", - }, - "modalities": { - "description": "模型能力", - "type": "list", - "items": {"type": "string"}, - "options": ["text", "image", "audio", "tool_use"], - "labels": ["文本", "图像", "音频", "工具使用"], - "render_type": "checkbox", - "hint": "模型支持的模态及能力。", - }, - "custom_headers": { - "description": "自定义请求头", - "type": "dict", - "items": {}, - "hint": "此处添加的键值对将作为自定义 HTTP 请求头,附加到 AstrBot 发往模型服务商的请求中。值必须为字符串。", - }, - "ollama_disable_thinking": { - "description": "关闭思考模式", - "type": "bool", - "hint": "关闭 Ollama 思考模式。", - }, - "custom_extra_body": { - "description": "自定义请求体参数", - "type": "dict", - "items": {}, - "hint": "用于在请求时添加额外的参数,如 temperature, top_p, max_tokens, reasoning_effort 等。", - "template_schema": { - "temperature": { - "name": "Temperature", - "description": "温度参数", - "hint": "控制输出的随机性,范围通常为 0-2。值越高越随机。", - "type": "float", - "default": 0.6, - "slider": {"min": 0, "max": 2, "step": 0.1}, - }, - "top_p": { - "name": "Top-p", - "description": "Top-p 采样", - "hint": "核采样参数,范围通常为 0-1。控制模型考虑的概率质量。", - "type": "float", - "default": 1.0, - "slider": {"min": 0, "max": 1, "step": 0.01}, - }, - "max_tokens": { - "name": "Max Tokens", - "description": "最大词元(Tokens)数", - "hint": "生成的最大词元(Tokens)数。", - "type": "int", - "default": 8192, - }, - "reasoning_effort": { - "name": "Reasoning Effort", - "description": "推理强度", - "hint": "控制推理模型的推理强度,支持的值取决于具体模型。", - "type": "string", - "default": "high", - }, - }, - }, - "provider": { - "type": "string", - "invisible": True, - }, - "gpt_weights_path": { - "description": "GPT模型文件路径", - "type": "string", - "hint": "即“.ckpt”后缀的文件,请使用绝对路径,路径两端不要带双引号,不填则默认用GPT_SoVITS内置的SoVITS模型(建议直接在GPT_SoVITS中改默认模型)", - }, - "sovits_weights_path": { - "description": "SoVITS模型文件路径", - "type": "string", - "hint": "即“.pth”后缀的文件,请使用绝对路径,路径两端不要带双引号,不填则默认用GPT_SoVITS内置的SoVITS模型(建议直接在GPT_SoVITS中改默认模型)", - }, - "gsv_default_parms": { - "description": "GPT_SoVITS默认参数", - "hint": "参考音频文件路径、参考音频文本必填,其他参数根据个人爱好自行填写", - "type": "object", - "items": { - "gsv_ref_audio_path": { - "description": "参考音频文件路径", - "type": "string", - "hint": "必填!请使用绝对路径!路径两端不要带双引号!", - }, - "gsv_prompt_text": { - "description": "参考音频文本", - "type": "string", - "hint": "必填!请填写参考音频讲述的文本", - }, - "gsv_prompt_lang": { - "description": "参考音频文本语言", - "type": "string", - "hint": "请填写参考音频讲述的文本的语言,默认为中文", - }, - "gsv_aux_ref_audio_paths": { - "description": "辅助参考音频文件路径", - "type": "string", - "hint": "辅助参考音频文件,可不填", - }, - "gsv_text_lang": { - "description": "文本语言", - "type": "string", - "hint": "默认为中文", - }, - "gsv_top_k": { - "description": "生成语音的多样性", - "type": "int", - "hint": "", - }, - "gsv_top_p": { - "description": "核采样的阈值", - "type": "float", - "hint": "", - }, - "gsv_temperature": { - "description": "生成语音的随机性", - "type": "float", - "hint": "", - }, - "gsv_text_split_method": { - "description": "切分文本的方法", - "type": "string", - "hint": "可选值: `cut0`:不切分 `cut1`:四句一切 `cut2`:50字一切 `cut3`:按中文句号切 `cut4`:按英文句号切 `cut5`:按标点符号切", - "options": [ - "cut0", - "cut1", - "cut2", - "cut3", - "cut4", - "cut5", - ], - }, - "gsv_batch_size": { - "description": "批处理大小", - "type": "int", - "hint": "", - }, - "gsv_batch_threshold": { - "description": "批处理阈值", - "type": "float", - "hint": "", - }, - "gsv_split_bucket": { - "description": "将文本分割成桶以便并行处理", - "type": "bool", - "hint": "", - }, - "gsv_speed_factor": { - "description": "语音播放速度", - "type": "float", - "hint": "1为原始语速", - }, - "gsv_fragment_interval": { - "description": "语音片段之间的间隔时间", - "type": "float", - "hint": "", - }, - "gsv_streaming_mode": { - "description": "启用流模式", - "type": "bool", - "hint": "", - }, - "gsv_seed": { - "description": "随机种子", - "type": "int", - "hint": "用于结果的可重复性", - }, - "gsv_parallel_infer": { - "description": "并行执行推理", - "type": "bool", - "hint": "", - }, - "gsv_repetition_penalty": { - "description": "重复惩罚因子", - "type": "float", - "hint": "", - }, - "gsv_media_type": { - "description": "输出媒体的类型", - "type": "string", - "hint": "建议用wav", - }, - }, - }, - "embedding_dimensions": { - "description": "嵌入维度", - "type": "int", - "hint": "嵌入向量的维度。根据模型不同,可能需要调整,请参考具体模型的文档。此配置项请务必填写正确,否则将导致向量数据库无法正常工作。", - "_special": "get_embedding_dim", - }, - "embedding_dimensions_mode": { - "description": "嵌入维度参数发送模式", - "type": "string", - "options": ["auto", "always", "never"], - "hint": "控制是否在 OpenAI 兼容 Embedding 请求中发送 dimensions 参数。auto 会仅对官方 OpenAI embedding-3 模型自动发送;第三方兼容 API 如需该参数可改为 always,报错时改为 never。", - }, - "embedding_model": { - "description": "嵌入模型", - "type": "string", - "hint": "嵌入模型名称。", - }, - "embedding_api_key": { - "description": "API Key", - "type": "string", - "secret": True, - }, - "embedding_api_base": { - "description": "API Base URL", - "type": "string", - }, - "volcengine_cluster": { - "type": "string", - "description": "火山引擎集群", - "hint": "若使用语音复刻大模型,可选volcano_icl或volcano_icl_concurr,默认使用volcano_tts", - }, - "volcengine_voice_type": { - "type": "string", - "description": "火山引擎音色", - "hint": "输入声音id(Voice_type)", - }, - "volcengine_speed_ratio": { - "type": "float", - "description": "语速设置", - "hint": "语速设置,范围为 0.2 到 3.0,默认值为 1.0", - }, - "volcengine_volume_ratio": { - "type": "float", - "description": "音量设置", - "hint": "音量设置,范围为 0.0 到 2.0,默认值为 1.0", - }, - "azure_tts_voice": { - "type": "string", - "description": "音色设置", - "hint": "API 音色", - }, - "azure_tts_style": { - "type": "string", - "description": "风格设置", - "hint": "声音特定的讲话风格。 可以表达快乐、同情和平静等情绪。", - }, - "azure_tts_role": { - "type": "string", - "description": "模仿设置(可选)", - "hint": "讲话角色扮演。 声音可以模仿不同的年龄和性别,但声音名称不会更改。 例如,男性语音可以提高音调和改变语调来模拟女性语音,但语音名称不会更改。 如果角色缺失或不受声音的支持,则会忽略此属性。", - "options": [ - "Boy", - "Girl", - "YoungAdultFemale", - "YoungAdultMale", - "OlderAdultFemale", - "OlderAdultMale", - "SeniorFemale", - "SeniorMale", - "禁用", - ], - }, - "azure_tts_rate": { - "type": "string", - "description": "语速设置", - "hint": "指示文本的讲出速率。可在字词或句子层面应用语速。 速率变化应为原始音频的 0.5 到 2 倍。", - }, - "azure_tts_volume": { - "type": "string", - "description": "语音音量设置", - "hint": "指示语音的音量级别。 可在句子层面应用音量的变化。以从 0.0 到 100.0(从最安静到最大声,例如 75)的数字表示。 默认值为 100.0。", - }, - "azure_tts_region": { - "type": "string", - "description": "API 地区", - "hint": "Azure_TTS 处理数据所在区域,具体参考 https://learn.microsoft.com/zh-cn/azure/ai-services/speech-service/regions", - "options": [ - "southafricanorth", - "eastasia", - "southeastasia", - "australiaeast", - "centralindia", - "japaneast", - "japanwest", - "koreacentral", - "canadacentral", - "northeurope", - "westeurope", - "francecentral", - "germanywestcentral", - "norwayeast", - "swedencentral", - "switzerlandnorth", - "switzerlandwest", - "uksouth", - "uaenorth", - "brazilsouth", - "qatarcentral", - "centralus", - "eastus", - "eastus2", - "northcentralus", - "southcentralus", - "westcentralus", - "westus", - "westus2", - "westus3", - ], - }, - "azure_tts_subscription_key": { - "type": "string", - "description": "服务订阅密钥", - "hint": "Azure_TTS 服务的订阅密钥(注意不是令牌)", - "secret": True, - }, - "dashscope_tts_voice": {"description": "音色", "type": "string"}, - "gm_resp_image_modal": { - "description": "启用图片模态", - "type": "bool", - "hint": "启用后,将支持返回图片内容。需要模型支持,否则会报错。具体支持模型请查看 Google Gemini 官方网站。温馨提示,如果您需要生成图片,请关闭 `启用群员识别` 配置获得更好的效果。", - }, - "gm_native_search": { - "description": "启用原生搜索功能", - "type": "bool", - "hint": "仅 Gemini 3 及以上模型支持与函数工具同时使用;Gemini 3 及以上模型的原生搜索仅限付费层级,计费规则请查阅官方文档", - }, - "gm_native_coderunner": { - "description": "启用原生代码执行器", - "type": "bool", - "hint": "仅 Gemini 3 及以上模型支持与函数工具同时使用", - }, - "gm_url_context": { - "description": "启用URL上下文功能", - "type": "bool", - "hint": "仅 Gemini 3 及以上模型支持与函数工具同时使用", - }, - "gm_safety_settings": { - "description": "安全过滤器", - "type": "object", - "hint": "设置模型输入的内容安全过滤级别。过滤级别分类为NONE(不屏蔽)、HIGH(高风险时屏蔽)、MEDIUM_AND_ABOVE(中等风险及以上屏蔽)、LOW_AND_ABOVE(低风险及以上时屏蔽),具体参见Gemini API文档。", - "items": { - "harassment": { - "description": "骚扰内容", - "type": "string", - "hint": "负面或有害评论", - "options": [ - "BLOCK_NONE", - "BLOCK_ONLY_HIGH", - "BLOCK_MEDIUM_AND_ABOVE", - "BLOCK_LOW_AND_ABOVE", - ], - }, - "hate_speech": { - "description": "仇恨言论", - "type": "string", - "hint": "粗鲁、无礼或亵渎性质内容", - "options": [ - "BLOCK_NONE", - "BLOCK_ONLY_HIGH", - "BLOCK_MEDIUM_AND_ABOVE", - "BLOCK_LOW_AND_ABOVE", - ], - }, - "sexually_explicit": { - "description": "露骨色情内容", - "type": "string", - "hint": "包含性行为或其他淫秽内容的引用", - "options": [ - "BLOCK_NONE", - "BLOCK_ONLY_HIGH", - "BLOCK_MEDIUM_AND_ABOVE", - "BLOCK_LOW_AND_ABOVE", - ], - }, - "dangerous_content": { - "description": "危险内容", - "type": "string", - "hint": "宣扬、助长或鼓励有害行为的信息", - "options": [ - "BLOCK_NONE", - "BLOCK_ONLY_HIGH", - "BLOCK_MEDIUM_AND_ABOVE", - "BLOCK_LOW_AND_ABOVE", - ], - }, - }, - }, - "gm_thinking_config": { - "description": "Thinking Config", - "type": "object", - "items": { - "budget": { - "description": "Thinking Budget", - "type": "int", - "hint": "Guides the model on the specific number of thinking tokens to use for reasoning. See: https://ai.google.dev/gemini-api/docs/thinking#set-budget", - }, - "level": { - "description": "Thinking Level", - "type": "string", - "hint": "Recommended for Gemini 3 models and onwards, lets you control reasoning behavior.See: https://ai.google.dev/gemini-api/docs/thinking#thinking-levels", - "options": [ - "MINIMAL", - "LOW", - "MEDIUM", - "HIGH", - ], - }, - }, - }, - "anth_thinking_config": { - "description": "思考配置", - "type": "object", - "items": { - "type": { - "description": "思考类型", - "type": "string", - "options": ["", "adaptive"], - "hint": "Opus 4.6+ / Sonnet 4.6+ 推荐设为 'adaptive'。留空则使用手动 budget 模式。参见: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking", - }, - "budget": { - "description": "思考预算", - "type": "int", - "hint": "手动 budget_tokens,需 >= 1024。仅在 type 为空时生效。Opus 4.6 / Sonnet 4.6 上已弃用。参见: https://platform.claude.com/docs/en/build-with-claude/extended-thinking", - }, - "effort": { - "description": "思考深度", - "type": "string", - "options": ["", "low", "medium", "high", "max"], - "hint": "type 为 'adaptive' 时控制思考深度。默认 'high'。'max' 仅限 Opus 4.6。参见: https://platform.claude.com/docs/en/build-with-claude/effort", - }, - }, - }, - "minimax-group-id": { - "type": "string", - "description": "用户组", - "hint": "于账户管理->基本信息中可见", - }, - "minimax-langboost": { - "type": "string", - "description": "指定语言/方言", - "hint": "增强对指定的小语种和方言的识别能力,设置后可以提升在指定小语种/方言场景下的语音表现", - "options": [ - "Chinese", - "Chinese,Yue", - "English", - "Arabic", - "Russian", - "Spanish", - "French", - "Portuguese", - "German", - "Turkish", - "Dutch", - "Ukrainian", - "Vietnamese", - "Indonesian", - "Japanese", - "Italian", - "Korean", - "Thai", - "Polish", - "Romanian", - "Greek", - "Czech", - "Finnish", - "Hindi", - "auto", - ], - }, - "minimax-voice-speed": { - "type": "float", - "description": "语速", - "hint": "生成声音的语速, 取值[0.5, 2], 默认为1.0, 取值越大,语速越快", - }, - "minimax-voice-vol": { - "type": "float", - "description": "音量", - "hint": "生成声音的音量, 取值(0, 10], 默认为1.0, 取值越大,音量越高", - }, - "minimax-voice-pitch": { - "type": "int", - "description": "语调", - "hint": "生成声音的语调, 取值[-12, 12], 默认为0", - }, - "minimax-is-timber-weight": { - "type": "bool", - "description": "启用混合音色", - "hint": "启用混合音色, 支持以自定义权重混合最多四种音色, 启用后自动忽略单一音色设置", - }, - "minimax-timber-weight": { - "type": "string", - "description": "混合音色", - "editor_mode": True, - "hint": "混合音色及其权重, 最多支持四种音色, 权重为整数, 取值[1, 100]. 可在官网API语音调试台预览代码获得预设以及编写模板, 需要严格按照json字符串格式编写, 可以查看控制台判断是否解析成功. 具体结构可参照默认值以及官网代码预览.", - }, - "minimax-voice-id": { - "type": "string", - "description": "单一音色", - "hint": "单一音色编号, 详见官网文档", - }, - "minimax-voice-emotion": { - "type": "string", - "description": "情绪", - "hint": "控制合成语音的情绪。当为 auto 时,将根据文本内容自动选择情绪。", - "options": [ - "auto", - "happy", - "sad", - "angry", - "fearful", - "disgusted", - "surprised", - "calm", - "fluent", - "whisper", - ], - }, - "minimax-voice-latex": { - "type": "bool", - "description": "支持朗读latex公式", - "hint": "朗读latex公式, 但是需要确保输入文本按官网要求格式化", - }, - "minimax-voice-english-normalization": { - "type": "bool", - "description": "支持英语文本规范化", - "hint": "可提升数字阅读场景的性能,但会略微增加延迟", - }, - "rag_options": { - "description": "RAG 选项", - "type": "object", - "hint": "检索知识库设置, 非必填。仅 Agent 应用类型支持(智能体应用, 包括 RAG 应用)。阿里云百炼应用开启此功能后将无法多轮对话。", - "items": { - "pipeline_ids": { - "description": "知识库 ID 列表", - "type": "list", - "items": {"type": "string"}, - "hint": "对指定知识库内所有文档进行检索, 前往 https://bailian.console.aliyun.com/ 数据应用->知识索引创建和获取 ID。", - }, - "file_ids": { - "description": "非结构化文档 ID, 传入该参数将对指定非结构化文档进行检索。", - "type": "list", - "items": {"type": "string"}, - "hint": "对指定非结构化文档进行检索。前往 https://bailian.console.aliyun.com/ 数据管理创建和获取 ID。", - }, - "output_reference": { - "description": "是否输出知识库/文档的引用", - "type": "bool", - "hint": "在每次回答尾部加上引用源。默认为 False。", - }, - }, - }, - "sensevoice_hint": { - "description": "部署SenseVoice", - "type": "string", - "hint": "启用前请 pip 安装 funasr、funasr_onnx、torchaudio、torch、modelscope、jieba 库(默认使用CPU,大约下载 1 GB),并且安装 ffmpeg。否则将无法正常转文字。", - }, - "is_emotion": { - "description": "情绪识别", - "type": "bool", - "hint": "是否开启情绪识别。happy|sad|angry|neutral|fearful|disgusted|surprised|unknown", - }, - "stt_model": { - "description": "模型名称", - "type": "string", - "hint": "modelscope 上的模型名称。默认:iic/SenseVoiceSmall。", - }, - "variables": { - "description": "工作流固定输入变量", - "type": "object", - "items": {}, - "hint": "可选。工作流固定输入变量,将会作为工作流的输入。也可以在对话时使用 /set 指令动态设置变量。如果变量名冲突,优先使用动态设置的变量。", - "invisible": True, - }, - "dashscope_app_type": { - "description": "应用类型", - "type": "string", - "hint": "百炼应用的应用类型。", - "options": [ - "agent", - "agent-arrange", - "dialog-workflow", - "task-workflow", - ], - }, - "timeout": { - "description": "超时时间", - "type": "int", - "hint": "超时时间,单位为秒。", - }, - "total_timeout": { - "description": "总超时时间", - "type": "float", - "hint": "单次决策请求的总超时时间(秒),包含等待并发名额、重试与退避;默认 5 秒。", - "condition": {"type": "system_one_decision"}, - }, - "max_concurrency": { - "description": "最大并发数", - "type": "int", - "hint": "该提供商同时进行的决策请求上限;默认 4。", - "condition": {"type": "system_one_decision"}, - }, - "openai-tts-voice": { - "description": "voice", - "type": "string", - "hint": "OpenAI TTS 的声音。OpenAI 默认支持:'alloy', 'echo', 'fable', 'onyx', 'nova', 'shimmer'", - }, - "mimo-tts-voice": { - "description": "音色", - "type": "string", - "hint": "MiMo TTS 的音色名称。可选值包括 'mimo_default'、'default_en'、'default_zh'。", - }, - "mimo-tts-format": { - "description": "输出格式", - "type": "string", - "hint": "MiMo TTS 生成音频的格式。支持 'wav'、'mp3'、'pcm'。", - }, - "mimo-tts-style-prompt": { - "description": "风格提示词", - "type": "string", - "hint": "会以 标签形式添加到待合成文本开头,用于控制语速、情绪、角色或风格,例如 开心、变快、孙悟空、悄悄话。可留空。", - }, - "mimo-tts-dialect": { - "description": "方言", - "type": "string", - "hint": "会与风格提示词一起写入开头的 标签中,例如 东北话、四川话、河南话、粤语。可留空。", - }, - "mimo-tts-seed-text": { - "description": "种子文本", - "type": "string", - "hint": "作为可选的 user 消息发送,用于辅助调节语气和风格,不会拼接到待合成文本中。", - }, - "fishaudio-tts-character": { - "description": "character", - "type": "string", - "hint": "fishaudio TTS 的角色。默认为可莉。更多角色请访问:https://fish.audio/zh-CN/discovery", - }, - "fishaudio-tts-reference-id": { - "description": "reference_id", - "type": "string", - "hint": "fishaudio TTS 的参考模型ID(可选)。如果填入此字段,将直接使用模型ID而不通过角色名称查询。例如:626bb6d3f3364c9cbc3aa6a67300a664。更多模型请访问:https://fish.audio/zh-CN/discovery,进入模型详情界面后可复制模型ID", - }, - "whisper_hint": { - "description": "本地部署 Whisper 模型须知", - "type": "string", - "hint": "启用前请 pip 安装 openai-whisper 库(N卡用户大约下载 2GB,主要是 torch 和 cuda,CPU 用户大约下载 1 GB),并且安装 ffmpeg。否则将无法正常转文字。", - }, - "whisper_device": { - "description": "推理设备", - "type": "string", - "hint": "Whisper 推理设备。Apple Silicon 可选 mps;其他环境建议使用 cpu。若指定 mps 但当前环境不可用,将自动回退到 cpu。", - "options": ["cpu", "mps"], - }, - "id": { - "description": "ID", - "type": "string", - }, - "type": { - "description": "模型提供商种类", - "type": "string", - "invisible": True, - }, - "provider_type": { - "description": "模型提供商能力种类", - "type": "string", - "invisible": True, - }, - "enable": { - "description": "启用", - "type": "bool", - }, - "key": { - "description": "API Key", - "type": "list", - "items": {"type": "string"}, - "secret": True, - }, - "api_base": { - "description": "API Base URL", - "type": "string", - }, - "proxy": { - "description": "provider_group.provider.proxy.description", - "type": "string", - "hint": "provider_group.provider.proxy.hint", - }, - "model": { - "description": "模型 ID", - "type": "string", - "hint": "模型名称,如 gpt-4o-mini, deepseek-chat。", - }, - "max_context_tokens": { - "description": "模型上下文窗口大小", - "type": "int", - "hint": "模型最大上下文 Token 大小。如果为 0,则会自动从模型元数据填充(如有)", - }, - "dify_api_key": { - "description": "API Key", - "type": "string", - "hint": "Dify API Key。此项必填。", - "secret": True, - }, - "dify_api_base": { - "description": "API Base URL", - "type": "string", - "hint": "Dify API Base URL。默认为 https://api.dify.ai/v1", - }, - "dify_api_type": { - "description": "Dify 应用类型", - "type": "string", - "hint": "Dify API 类型。根据 Dify 官网,目前支持 chat, chatflow, agent, workflow 三种应用类型。", - "options": ["chat", "chatflow", "agent", "workflow"], - }, - "dify_workflow_output_key": { - "description": "Dify Workflow 输出变量名", - "type": "string", - "hint": "Dify Workflow 输出变量名。当应用类型为 workflow 时才使用。默认为 astrbot_wf_output。", - }, - "dify_query_input_key": { - "description": "Prompt 输入变量名", - "type": "string", - "hint": "发送的消息文本内容对应的输入变量名。默认为 astrbot_text_query。", - "obvious": True, - }, - "coze_api_key": { - "description": "Coze API Key", - "type": "string", - "hint": "Coze API 密钥,用于访问 Coze 服务。", - "secret": True, - }, - "bot_id": { - "description": "Bot ID", - "type": "string", - "hint": "Coze 机器人的 ID,在 Coze 平台上创建机器人后获得。", - }, - "coze_api_base": { - "description": "API Base URL", - "type": "string", - "hint": "Coze API 的基础 URL 地址,默认为 https://api.coze.cn", - }, - "deerflow_api_base": { - "description": "API Base URL", - "type": "string", - "hint": "DeerFlow API 网关地址,默认为 http://127.0.0.1:2026", - }, - "deerflow_api_key": { - "description": "DeerFlow API Key", - "type": "string", - "hint": "可选。若 DeerFlow 网关配置了 Bearer 鉴权,则在此填写。", - "secret": True, - }, - "deerflow_auth_header": { - "description": "Authorization Header", - "type": "string", - "hint": "可选。自定义 Authorization 请求头,优先级高于 DeerFlow API Key。", - "secret": True, - }, - "deerflow_assistant_id": { - "description": "Assistant ID", - "type": "string", - "hint": "DeerFlow 2.0 LangGraph assistant_id,默认为 lead_agent。", - }, - "deerflow_model_name": { - "description": "模型名称覆盖", - "type": "string", - "hint": "可选。覆盖 DeerFlow 默认模型(对应运行时 configurable 的 model_name)。", - }, - "deerflow_thinking_enabled": { - "description": "启用思考模式", - "type": "bool", - }, - "deerflow_plan_mode": { - "description": "启用计划模式", - "type": "bool", - "hint": "对应 DeerFlow 2.0 运行时 configurable 的 is_plan_mode。", - }, - "deerflow_subagent_enabled": { - "description": "启用子智能体", - "type": "bool", - "hint": "对应 DeerFlow 2.0 运行时 configurable 的 subagent_enabled。", - }, - "deerflow_max_concurrent_subagents": { - "description": "子智能体最大并发数", - "type": "int", - "hint": "对应 DeerFlow 2.0 运行时 configurable 的 max_concurrent_subagents。仅在启用子智能体时生效,默认 3。", - }, - "deerflow_recursion_limit": { - "description": "递归深度上限", - "type": "int", - "hint": "对应 LangGraph recursion_limit。", - }, - "auto_save_history": { - "description": "由 Coze 管理对话记录", - "type": "bool", - "hint": "启用后,将由 Coze 进行对话历史记录管理, 此时 AstrBot 本地保存的上下文不会生效(仅供浏览), 对 AstrBot 的上下文进行的操作也不会生效。如果为禁用, 则使用 AstrBot 管理上下文。", - }, - }, - }, - "provider_settings": { - "type": "object", - "items": { - "enable": { - "type": "bool", - }, - "wake_prefix": { - "type": "string", - }, - "web_search": { - "type": "bool", - }, - "web_search_link": { - "type": "bool", - }, - "display_reasoning_text": { - "type": "bool", - }, - "identifier": { - "type": "bool", - }, - "group_name_display": { - "type": "bool", - }, - "datetime_system_prompt": { - "type": "bool", - }, - "prompt_prefix": { - "type": "string", - }, - "streaming_response": { - "type": "bool", - }, - "show_tool_use_status": { - "type": "bool", - }, - "show_tool_call_result": { - "type": "bool", - }, - "buffer_intermediate_messages": { - "type": "bool", - }, - "unsupported_streaming_strategy": { - "type": "string", - }, - "file_extract": { - "type": "object", - "items": { - "enable": { - "type": "bool", - }, - "provider": { - "type": "string", - }, - "moonshotai_api_key": { - "type": "string", - "secret": True, - }, - }, - }, - "proactive_capability": { - "type": "object", - "items": { - "add_cron_tools": { - "type": "bool", - }, - }, - }, - }, - }, - "agent_runner": { - "type": "object", - "items": { - "runner_type": {"type": "string"}, - "config": {"type": "dict"}, - }, - }, - "provider_stt_settings": { - "type": "object", - "items": { - "enable": { - "type": "bool", - }, - "provider_id": { - "type": "string", - }, - }, - }, - "provider_tts_settings": { - "type": "object", - "items": { - "enable": { - "type": "bool", - }, - "provider_id": { - "type": "string", - }, - "dual_output": { - "type": "bool", - }, - "use_file_service": { - "type": "bool", - }, - "trigger_probability": { - "type": "float", - }, - }, - }, - "provider_ltm_settings": { - "type": "object", - "items": { - "group_icl_enable": { - "type": "bool", - }, - "group_message_max_cnt": { - "type": "int", - }, - "image_caption": { - "type": "bool", - }, - "image_caption_provider_id": { - "type": "string", - }, - "image_caption_prompt": { - "type": "string", - }, - "group_message_history_enable": { - "type": "bool", - }, - "group_message_history_max_cnt": { - "type": "int", - }, - "active_reply": { - "type": "object", - "items": { - "enable": { - "type": "bool", - }, - "whitelist": { - "type": "list", - "items": {"type": "string"}, - }, - "method": { - "type": "string", - "options": ["possibility_reply"], - }, - "possibility_reply": { - "type": "float", - }, - }, - }, - }, - }, - }, - }, - "misc_config_group": { - "metadata": { - "wake_prefix": { - "type": "list", - "items": {"type": "string"}, - }, - "t2i": { - "type": "bool", - }, - "t2i_word_threshold": { - "type": "int", - }, - "admins_id": { - "type": "list", - "_special": "sender_id", - "items": {"type": "string"}, - }, - "http_proxy": { - "type": "string", - }, - "no_proxy": { - "description": "直连地址列表", - "type": "list", - "items": {"type": "string"}, - "hint": "在此处添加不希望通过代理访问的地址,例如内部服务地址。回车添加,可添加多个,如未设置代理请忽略此配置", - }, - "timezone": { - "type": "string", - }, - "callback_api_base": { - "type": "string", - }, - "disable_metrics": { - "description": "禁用匿名使用统计", - "type": "bool", - "hint": "禁用后,AstrBot 将不再上传匿名使用统计数据。", - }, - "log_level": { - "type": "string", - "options": ["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"], - }, - "dashboard.ssl.enable": {"type": "bool"}, - "dashboard.trust_proxy_headers": {"type": "bool"}, - "dashboard.auth_rate_limit.enable": {"type": "bool"}, - "dashboard.auth_rate_limit.average_interval": {"type": "float"}, - "dashboard.auth_rate_limit.max_burst": {"type": "int"}, - "dashboard.ssl.cert_file": { - "type": "string", - "condition": {"dashboard.ssl.enable": True}, - }, - "dashboard.ssl.key_file": { - "type": "string", - "condition": {"dashboard.ssl.enable": True}, - }, - "dashboard.ssl.ca_certs": { - "type": "string", - "condition": {"dashboard.ssl.enable": True}, - }, - "log_file_enable": {"type": "bool"}, - "log_file_path": {"type": "string", "condition": {"log_file_enable": True}}, - "log_file_max_mb": {"type": "int", "condition": {"log_file_enable": True}}, - "temp_dir_max_size": {"type": "int"}, - "trace_enable": {"type": "bool"}, - "trace_db_path": {"type": "string"}, - "trace_db_max_mb": {"type": "int"}, - "trace_retention_days": {"type": "int"}, - "t2i_strategy": { - "type": "string", - "options": ["remote", "local"], - }, - "t2i_endpoint": { - "type": "string", - }, - "t2i_use_file_service": { - "type": "bool", - }, - "pip_install_arg": { - "type": "string", - }, - "pypi_index_url": { - "type": "string", - }, - "default_kb_collection": { - "type": "string", - }, - "kb_names": {"type": "list", "items": {"type": "string"}}, - "kb_fusion_top_k": {"type": "int", "default": 20}, - "kb_final_top_k": {"type": "int", "default": 5}, - "kb_agentic_mode": {"type": "bool"}, - }, - }, -} - - -""" -Since v4.7.0, fields such as name, description, and hint support i18n. -Their resources are stored in: - -- dashboard/src/i18n/locales//features/config-metadata.json - -When adding configuration fields here, update this file for every supported -Dashboard locale. -""" -CONFIG_METADATA_3 = { - "ai_group": { - "name": "AI", - "metadata": { - "agent_runner": { - "description": "Agent 执行方式", - "hint": "选择 AI 对话的执行器。切换执行器会使用新类型的默认配置,不保留上一类型的参数。", - "type": "object", - "items": { - "provider_settings.enable": { - "description": "启用", - "type": "bool", - "hint": "AI 对话总开关", - }, - "agent_runner.runner_type": { - "description": "执行器", - "type": "string", - "options": ["local", "dify", "coze", "dashscope", "deerflow"], - "labels": [ - "内置 Agent", - "Dify", - "Coze", - "阿里云百炼应用", - "DeerFlow", - ], - "_special": "agent_runner_type", - "runner_defaults": { - runner_type: get_agent_runner_config_default(runner_type) - for runner_type in ( - "local", - "dify", - "coze", - "dashscope", - "deerflow", - ) - }, - "condition": { - "provider_settings.enable": True, - }, - }, - }, - }, - "dify_runner": { - "description": "Dify 配置", - "type": "object", - "condition": { - "provider_settings.enable": True, - "agent_runner.runner_type": "dify", - }, - "items": { - "agent_runner.config.dify_api_type": { - "description": "应用类型", - "type": "string", - "options": ["chat", "chatflow", "agent", "workflow"], - }, - "agent_runner.config.dify_api_key": { - "description": "API Key", - "type": "string", - "secret": True, - }, - "agent_runner.config.dify_api_base": { - "description": "API Base URL", - "type": "string", - }, - "agent_runner.config.dify_workflow_output_key": { - "description": "Workflow 输出变量名", - "type": "string", - }, - "agent_runner.config.dify_query_input_key": { - "description": "Prompt 输入变量名", - "type": "string", - }, - "agent_runner.config.variables": { - "description": "变量", - "type": "dict", - }, - "agent_runner.config.timeout": { - "description": "超时时间(秒)", - "type": "int", - }, - "agent_runner.config.proxy": { - "description": "代理地址", - "type": "string", - }, - }, - }, - "coze_runner": { - "description": "Coze 配置", - "type": "object", - "condition": { - "provider_settings.enable": True, - "agent_runner.runner_type": "coze", - }, - "items": { - "agent_runner.config.coze_api_key": { - "description": "API Key", - "type": "string", - "secret": True, - }, - "agent_runner.config.bot_id": { - "description": "Bot ID", - "type": "string", - }, - "agent_runner.config.coze_api_base": { - "description": "API Base URL", - "type": "string", - }, - "agent_runner.config.auto_save_history": { - "description": "由 Coze 管理对话记录", - "type": "bool", - }, - "agent_runner.config.timeout": { - "description": "超时时间(秒)", - "type": "int", - }, - "agent_runner.config.proxy": { - "description": "代理地址", - "type": "string", - }, - }, - }, - "dashscope_runner": { - "description": "阿里云百炼应用配置", - "type": "object", - "condition": { - "provider_settings.enable": True, - "agent_runner.runner_type": "dashscope", - }, - "items": { - "agent_runner.config.dashscope_app_type": { - "description": "应用类型", - "type": "string", - "options": ["agent", "workflow"], - }, - "agent_runner.config.dashscope_api_key": { - "description": "API Key", - "type": "string", - "secret": True, - }, - "agent_runner.config.dashscope_app_id": { - "description": "应用 ID", - "type": "string", - }, - "agent_runner.config.rag_options.pipeline_ids": { - "description": "知识库 Pipeline ID", - "type": "list", - "items": {"type": "string"}, - }, - "agent_runner.config.rag_options.file_ids": { - "description": "文件 ID", - "type": "list", - "items": {"type": "string"}, - }, - "agent_runner.config.rag_options.output_reference": { - "description": "输出引用", - "type": "bool", - }, - "agent_runner.config.variables": { - "description": "变量", - "type": "dict", - }, - "agent_runner.config.timeout": { - "description": "超时时间(秒)", - "type": "int", - }, - "agent_runner.config.proxy": { - "description": "代理地址", - "type": "string", - }, - }, - }, - "deerflow_runner": { - "description": "DeerFlow 配置", - "type": "object", - "condition": { - "provider_settings.enable": True, - "agent_runner.runner_type": "deerflow", - }, - "items": { - "agent_runner.config.deerflow_api_base": { - "description": "API Base URL", - "type": "string", - }, - "agent_runner.config.deerflow_api_key": { - "description": "API Key", - "type": "string", - "secret": True, - }, - "agent_runner.config.deerflow_auth_header": { - "description": "Authorization Header", - "type": "string", - "secret": True, - }, - "agent_runner.config.deerflow_assistant_id": { - "description": "Assistant ID", - "type": "string", - }, - "agent_runner.config.deerflow_model_name": { - "description": "模型名称覆盖", - "type": "string", - }, - "agent_runner.config.deerflow_thinking_enabled": { - "description": "启用思考模式", - "type": "bool", - }, - "agent_runner.config.deerflow_plan_mode": { - "description": "启用计划模式", - "type": "bool", - }, - "agent_runner.config.deerflow_subagent_enabled": { - "description": "启用子智能体", - "type": "bool", - }, - "agent_runner.config.deerflow_max_concurrent_subagents": { - "description": "子智能体最大并发数", - "type": "int", - }, - "agent_runner.config.deerflow_recursion_limit": { - "description": "递归深度上限", - "type": "int", - }, - "agent_runner.config.timeout": { - "description": "超时时间(秒)", - "type": "int", - }, - "agent_runner.config.proxy": { - "description": "代理地址", - "type": "string", - }, - }, - }, - "ai": { - "description": "模型", - "hint": "配置内置 Agent 使用的对话模型,以及通用的图片转述、语音模型。", - "type": "object", - "items": { - "agent_runner.config.model.provider_id": { - "description": "对话模型", - "type": "string", - "_special": "select_provider", - "hint": "留空时使用第一个模型", - "condition": { - "agent_runner.runner_type": "local", - }, - }, - "agent_runner.config.model.fallback_provider_ids": { - "description": "回退对话模型", - "type": "list", - "items": {"type": "string"}, - "_special": "select_providers", - "hint": "主聊天模型请求失败时,按顺序切换到这些模型。", - "condition": { - "agent_runner.runner_type": "local", - }, - }, - "agent_runner.config.model.request_max_retries": { - "description": "异常重试次数", - "type": "int", - "hint": "单次模型请求遇到可重试错误时的最大尝试次数。", - "condition": { - "agent_runner.runner_type": "local", - }, - }, - "provider_settings.default_image_caption_provider_id": { - "description": "图片转述模型", - "type": "string", - "_special": "select_provider", - "hint": "当对话模型不支持图片输入时,调用图片转述模型来获得图片描述。留空代表不使用。", - }, - "provider_stt_settings.enable": { - "description": "语音识别", - "type": "bool", - "hint": "使用语音转文字模型将用户语音转述为文本,方便模型理解。", - }, - "provider_stt_settings.provider_id": { - "description": "默认语音转文本模型", - "type": "string", - "hint": "也可使用 /provider 指令单独选择会话的模型。", - "_special": "select_provider_stt", - "condition": { - "provider_stt_settings.enable": True, - }, - }, - "provider_tts_settings.enable": { - "description": "语音回复", - "type": "bool", - "hint": "使用文字转语音模型将文字转为语音回复。", - }, - "provider_tts_settings.provider_id": { - "description": "默认文本转语音模型", - "hint": "也可使用 /provider 指令单独选择会话的模型。", - "type": "string", - "_special": "select_provider_tts", - "condition": { - "provider_tts_settings.enable": True, - }, - }, - "provider_tts_settings.trigger_probability": { - "description": "TTS 触发概率", - "hint": "采用随机概率触发语音回复。", - "type": "float", - "slider": {"min": 0, "max": 1, "step": 0.05}, - "condition": { - "provider_tts_settings.enable": True, - }, - }, - "provider_settings.image_caption_prompt": { - "description": "图片转述提示词", - "hint": "用于图片转述模型的提示词。", - "type": "text", - "collapsed": True, - }, - }, - "condition": { - "provider_settings.enable": True, - }, - }, - "persona": { - "description": "人格", - "hint": "", - "type": "object", - "items": { - "agent_runner.config.persona.persona_id": { - "description": "默认采用的人格", - "type": "string", - "_special": "select_persona", - }, - "agent_runner.config.persona.safety_mode": { - "description": "健康模式", - "type": "bool", - "hint": "引导模型输出健康、安全的内容,避免有害或敏感话题。", - }, - "agent_runner.config.persona.safety_mode_strategy": { - "description": "健康模式策略", - "type": "string", - "invisible": True, - "options": ["system_prompt"], - "hint": "选择健康模式的实现策略。", - "condition": { - "agent_runner.config.persona.safety_mode": True, - }, - }, - }, - "condition": { - "agent_runner.runner_type": "local", - "provider_settings.enable": True, - }, - }, - "knowledgebase": { - "description": "知识库", - "hint": "", - "type": "object", - "items": { - "kb_names": { - "description": "知识库列表", - "type": "list", - "items": {"type": "string"}, - "_special": "select_knowledgebase", - "hint": "支持多选", - }, - "kb_fusion_top_k": { - "description": "融合检索结果数", - "type": "int", - "hint": "多个知识库检索结果融合后的返回结果数量", - }, - "kb_final_top_k": { - "description": "最终返回结果数", - "type": "int", - "hint": "从知识库中检索到的结果数量,越大可能获得越多相关信息,但也可能引入噪音。建议根据实际需求调整", - }, - "kb_agentic_mode": { - "description": "Agentic 知识库检索", - "type": "bool", - "hint": "启用后,知识库检索将作为 LLM Tool,由模型自主决定何时调用知识库进行查询。需要模型支持函数调用能力。", - }, - }, - "condition": { - "agent_runner.runner_type": "local", - "provider_settings.enable": True, - }, - }, - "websearch": { - "description": "网页搜索", - "hint": "", - "type": "object", - "items": { - "provider_settings.web_search": { - "description": "启用网页搜索", - "type": "bool", - }, - "provider_settings.websearch_provider": { - "description": "网页搜索提供商", - "type": "string", - "options": [ - "serpapi", - "deepseek", - "tavily", - "baidu_ai_search", - "bocha", - "brave", - "firecrawl", - "exa", - "anysearch", - ], - "labels": [ - "SerpApi", - "DeepSeek Search API", - "Tavily", - "Baidu AI Search", - "Bocha", - "Brave", - "Firecrawl", - "Exa", - "AnySearch", - ], - "subtitles": [ - "Google 网页、新闻、图片、学术和财经搜索", - "DeepSeek 官方搜索接口", - "", - "", - "", - "", - "", - "", - "", - ], - "condition": { - "provider_settings.web_search": True, - }, - }, - "provider_settings.websearch_tavily_key": { - "description": "Tavily API Key", - "type": "list", - "items": {"type": "string"}, - "hint": "可添加多个 Key 进行轮询。", - "secret": True, - "condition": { - "provider_settings.websearch_provider": "tavily", - "provider_settings.web_search": True, - }, - }, - "provider_settings.websearch_bocha_key": { - "description": "BoCha API Key", - "type": "list", - "items": {"type": "string"}, - "hint": "可添加多个 Key 进行轮询。", - "secret": True, - "condition": { - "provider_settings.websearch_provider": "bocha", - "provider_settings.web_search": True, - }, - }, - "provider_settings.websearch_brave_key": { - "description": "Brave Search API Key", - "type": "list", - "items": {"type": "string"}, - "hint": "可添加多个 Key 进行轮询。", - "secret": True, - "condition": { - "provider_settings.websearch_provider": "brave", - "provider_settings.web_search": True, - }, - }, - "provider_settings.websearch_firecrawl_key": { - "description": "Firecrawl API Key", - "type": "list", - "items": {"type": "string"}, - "hint": "可添加多个 Key 进行轮询。", - "secret": True, - "condition": { - "provider_settings.websearch_provider": "firecrawl", - "provider_settings.web_search": True, - }, - }, - "provider_settings.websearch_baidu_app_builder_key": { - "description": "百度千帆智能云 APP Builder API Key", - "type": "string", - "hint": "参考:https://console.bce.baidu.com/iam/#/iam/apikey/list", - "secret": True, - "condition": { - "provider_settings.websearch_provider": "baidu_ai_search", - "provider_settings.web_search": True, - }, - }, - "provider_settings.websearch_exa_key": { - "description": "Exa API Key", - "type": "list", - "items": {"type": "string"}, - "hint": "可添加多个 Key 进行轮询。Get a key at https://dashboard.exa.ai", - "secret": True, - "condition": { - "provider_settings.websearch_provider": "exa", - "provider_settings.web_search": True, - }, - }, - "provider_settings.websearch_anysearch_key": { - "description": "AnySearch API Key", - "type": "list", - "items": {"type": "string"}, - "hint": "可添加多个 Key 进行轮询。留空则使用匿名模式(每日免费额度)。申请地址:https://anysearch.com/console/api-keys", - "condition": { - "provider_settings.websearch_provider": "anysearch", - "provider_settings.web_search": True, - }, - }, - "provider_settings.websearch_deepseek_key": { - "description": "DeepSeek API Key", - "type": "list", - "items": {"type": "string"}, - "hint": "Configure a DeepSeek API key for search and page extraction. Multiple keys rotate. Get a key: [https://platform.deepseek.com/api_keys](https://platform.deepseek.com/api_keys)", - "secret": True, - "condition": { - "provider_settings.websearch_provider": "deepseek", - "provider_settings.web_search": True, - }, - }, - "provider_settings.websearch_serpapi_key": { - "description": "SerpApi API Key", - "type": "list", - "items": {"type": "string"}, - "hint": "支持 Google 网页、新闻、图片、学术和财经搜索。可添加多个 Key 轮询。获取 Key:[https://serpapi.com/manage-api-key](https://serpapi.com/manage-api-key)", - "secret": True, - "condition": { - "provider_settings.websearch_provider": "serpapi", - "provider_settings.web_search": True, - }, - }, - "provider_settings.web_search_link": { - "description": "显示来源引用", - "type": "bool", - "condition": { - "provider_settings.web_search": True, - }, - }, - }, - "condition": { - "agent_runner.runner_type": "local", - "provider_settings.enable": True, - }, - }, - "agent_computer_use": { - "description": "Agent Computer Use", - "hint": "", - "type": "object", - "items": { - "provider_settings.computer_use_runtime": { - "description": "Computer Use Runtime", - "type": "string", - "options": ["none", "local", "sandbox"], - "labels": [ - "不允许任何环境", - "本机环境", - "第三方沙箱环境", - ], - "hint": "选择 Computer Use 运行环境。", - }, - "provider_settings.computer_use_local_permissions": { - "description": "本地权限策略", - "type": "object", - "_special": "local_permission_matrix", - "full_width": True, - "items": { - "member": { - "type": "object", - "items": { - "allow_execution": {"type": "bool"}, - "allow_network": {"type": "bool"}, - "filesystem_scope": { - "type": "string", - "options": ["none", "workspace", "host"], - }, - }, - }, - "admin": { - "type": "object", - "items": { - "allow_execution": {"type": "bool"}, - "allow_network": {"type": "bool"}, - "filesystem_scope": { - "type": "string", - "options": ["none", "workspace", "host"], - }, - }, - }, - }, - "condition": { - "provider_settings.computer_use_runtime": "local", - }, - }, - "provider_settings.computer_use_require_admin": { - "description": "沙箱能力需要 AstrBot 管理员权限", - "type": "bool", - "hint": "开启后,需要 AstrBot 管理员权限才能调用远程沙箱能力。在配置文件 -> 访问控制 -> 管理员 -> 管理员 ID 中可添加管理员。给机器人发送 /sid 指令以获取 ID。", - "condition": { - "provider_settings.computer_use_runtime": "sandbox", - }, - }, - "provider_settings.sandbox.booter": { - "description": "沙箱环境驱动器", - "type": "string", - "options": ["shipyard_neo", "shipyard", "cua"], - "labels": ["Shipyard Neo", "Shipyard", "CUA"], - "condition": { - "provider_settings.computer_use_runtime": "sandbox", - }, - }, - "provider_settings.sandbox.shipyard_neo_endpoint": { - "description": "Shipyard Neo API Endpoint", - "type": "string", - "hint": "Shipyard Neo(Bay) 服务的 API 地址,默认 http://127.0.0.1:8114。", - "condition": { - "provider_settings.computer_use_runtime": "sandbox", - "provider_settings.sandbox.booter": "shipyard_neo", - }, - }, - "provider_settings.sandbox.shipyard_neo_access_token": { - "description": "Shipyard Neo Access Token", - "type": "string", - "hint": "Bay 的 API Key(sk-bay-...)。留空时自动从 credentials.json 发现。", - "secret": True, - "condition": { - "provider_settings.computer_use_runtime": "sandbox", - "provider_settings.sandbox.booter": "shipyard_neo", - }, - }, - "provider_settings.sandbox.shipyard_neo_profile": { - "description": "Shipyard Neo Profile", - "type": "string", - "hint": "Shipyard Neo 沙箱 profile,如 python-default。留空时自动选择能力更完整的 profile。", - "condition": { - "provider_settings.computer_use_runtime": "sandbox", - "provider_settings.sandbox.booter": "shipyard_neo", - }, - }, - "provider_settings.sandbox.shipyard_neo_ttl": { - "description": "Shipyard Neo Sandbox TTL", - "type": "int", - "hint": "Shipyard Neo 沙箱生存时间(秒)。", - "condition": { - "provider_settings.computer_use_runtime": "sandbox", - "provider_settings.sandbox.booter": "shipyard_neo", - }, - }, - "provider_settings.sandbox.cua_image": { - "description": "CUA Image", - "type": "string", - "hint": "CUA 沙箱镜像/系统类型,默认 linux。可填写 linux、macos、windows、android,具体取决于 CUA SDK 支持。", - "condition": { - "provider_settings.computer_use_runtime": "sandbox", - "provider_settings.sandbox.booter": "cua", - }, - }, - "provider_settings.sandbox.cua_os_type": { - "description": "CUA OS Type", - "type": "string", - "options": ["linux", "macos", "windows", "android"], - "labels": ["Linux", "macOS", "Windows", "Android"], - "hint": "CUA 沙箱操作系统类型,默认 linux。", - "condition": { - "provider_settings.computer_use_runtime": "sandbox", - "provider_settings.sandbox.booter": "cua", - }, - }, - "provider_settings.sandbox.cua_idle_timeout": { - "description": "CUA Idle Timeout", - "type": "int", - "hint": "Idle timeout for CUA sandbox sessions in seconds. When greater than 0, AstrBot proactively shuts down an idle CUA sandbox after that amount of inactivity; 0 disables it.", - "condition": { - "provider_settings.computer_use_runtime": "sandbox", - "provider_settings.sandbox.booter": "cua", - }, - }, - "provider_settings.sandbox.cua_telemetry_enabled": { - "description": "CUA Telemetry", - "type": "bool", - "hint": "是否允许 CUA SDK 发送遥测数据。默认关闭。", - "condition": { - "provider_settings.computer_use_runtime": "sandbox", - "provider_settings.sandbox.booter": "cua", - }, - }, - "provider_settings.sandbox.cua_local": { - "description": "CUA Local Sandbox", - "type": "bool", - "hint": "是否优先使用 CUA 本地沙箱。默认开启,避免云端沙箱要求 CUA_API_KEY。关闭后可使用 CUA 云端沙箱。", - "condition": { - "provider_settings.computer_use_runtime": "sandbox", - "provider_settings.sandbox.booter": "cua", - }, - }, - "provider_settings.sandbox.cua_api_key": { - "description": "CUA API Key", - "type": "string", - "hint": "CUA 云端沙箱 API Key。仅在关闭本地沙箱时需要。也可以通过 CUA_API_KEY 环境变量提供。", - "obvious_hint": True, - "secret": True, - "condition": { - "provider_settings.computer_use_runtime": "sandbox", - "provider_settings.sandbox.booter": "cua", - "provider_settings.sandbox.cua_local": False, - }, - }, - "provider_settings.sandbox.shipyard_endpoint": { - "description": "Shipyard API Endpoint", - "type": "string", - "hint": "Shipyard 服务的 API 访问地址。", - "condition": { - "provider_settings.computer_use_runtime": "sandbox", - "provider_settings.sandbox.booter": "shipyard", - }, - "_special": "check_shipyard_connection", - }, - "provider_settings.sandbox.shipyard_access_token": { - "description": "Shipyard Access Token", - "type": "string", - "hint": "用于访问 Shipyard 服务的访问令牌。", - "secret": True, - "condition": { - "provider_settings.computer_use_runtime": "sandbox", - "provider_settings.sandbox.booter": "shipyard", - }, - }, - "provider_settings.sandbox.shipyard_ttl": { - "description": "Shipyard Session TTL", - "type": "int", - "hint": "Shipyard 会话的生存时间(秒)。", - "condition": { - "provider_settings.computer_use_runtime": "sandbox", - "provider_settings.sandbox.booter": "shipyard", - }, - }, - "provider_settings.sandbox.shipyard_max_sessions": { - "description": "Shipyard Max Sessions", - "type": "int", - "hint": "Shipyard 最大会话数量。", - "condition": { - "provider_settings.computer_use_runtime": "sandbox", - "provider_settings.sandbox.booter": "shipyard", - }, - }, - }, - "condition": { - "agent_runner.runner_type": "local", - "provider_settings.enable": True, - }, - }, - # "file_extract": { - # "description": "文档解析能力 [beta]", - # "type": "object", - # "items": { - # "provider_settings.file_extract.enable": { - # "description": "启用文档解析能力", - # "type": "bool", - # }, - # "provider_settings.file_extract.provider": { - # "description": "文档解析提供商", - # "type": "string", - # "options": ["moonshotai"], - # "condition": { - # "provider_settings.file_extract.enable": True, - # }, - # }, - # "provider_settings.file_extract.moonshotai_api_key": { - # "description": "Moonshot AI API Key", - # "type": "string", - # "condition": { - # "provider_settings.file_extract.provider": "moonshotai", - # "provider_settings.file_extract.enable": True, - # }, - # }, - # }, - # "condition": { - # "agent_runner.runner_type": "local", - # "provider_settings.enable": True, - # }, - # }, - "proactive_capability": { - "description": "主动型 Agent", - "hint": "https://docs.astrbot.app/use/proactive-agent.html", - "type": "object", - "items": { - "provider_settings.proactive_capability.add_cron_tools": { - "description": "启用", - "type": "bool", - "hint": "启用后,将会传递给 Agent 相关工具来实现主动型 Agent。你可以告诉 AstrBot 未来某个时间要做的事情,它将被定时触发然后执行任务。", - }, - }, - "condition": { - "agent_runner.runner_type": "local", - "provider_settings.enable": True, - }, - }, - "truncate_and_compress": { - "hint": "", - "description": "上下文管理策略", - "type": "object", - "items": { - "agent_runner.config.compression.max_turns": { - "description": "压缩前最多保留对话轮数", - "type": "int", - "collapsed": True, - "hint": "普通会话历史超过该轮数后,才会按下方策略进行持久化截断或 LLM 压缩;请求发送前也会先按该值约束上下文。-1 表示不按轮数限制。", - "condition": { - "agent_runner.runner_type": "local", - }, - }, - "agent_runner.config.compression.trim_turns": { - "description": "轮次超限时一次丢弃轮数", - "type": "int", - "collapsed": True, - "hint": "当超过“压缩前最多保留对话轮数”且无法使用 LLM 压缩时,一次丢弃多少轮旧对话;请求期截断也会复用该值。", - "condition": { - "agent_runner.runner_type": "local", - }, - }, - "agent_runner.config.compression.overflow_strategy": { - "description": "压缩策略", - "type": "string", - "options": ["truncate_by_turns", "llm_compress"], - "labels": ["按对话轮数截断", "由 LLM 压缩上下文"], - "condition": { - "agent_runner.runner_type": "local", - }, - "hint": "模型上下文超限时的处理策略。", - }, - "agent_runner.config.compression.instruction": { - "description": "上下文压缩提示词", - "type": "text", - "collapsed": True, - "hint": "如果为空则使用默认提示词。", - "condition": { - "agent_runner.config.compression.overflow_strategy": "llm_compress", - "agent_runner.runner_type": "local", - }, - }, - "agent_runner.config.compression.keep_recent_ratio": { - "description": "压缩时保留最近上下文比例", - "type": "float", - "collapsed": True, - "slider": {"min": 0, "max": 0.3, "step": 0.01}, - "hint": "按当前上下文 token 数保留最近内容,范围 0-0.3。0.15 表示保留 15%;比例大于 0 时至少保留最后一轮。", - "condition": { - "agent_runner.config.compression.overflow_strategy": "llm_compress", - "agent_runner.runner_type": "local", - }, - }, - "agent_runner.config.compression.provider_id": { - "description": "压缩模型", - "type": "string", - "_special": "select_provider", - "hint": "用于上下文压缩的模型。默认选择当前的对话模型。", - "condition": { - "agent_runner.config.compression.overflow_strategy": "llm_compress", - "agent_runner.runner_type": "local", - }, - }, - "agent_runner.config.compression.fallback_max_tokens": { - "description": "上下文窗口兜底值", - "type": "int", - "collapsed": True, - "hint": "当 max_context_tokens 为 0 且模型不在内置元数据中时,使用此值作为上下文窗口大小。默认 128000。", - "condition": { - "agent_runner.runner_type": "local", - }, - }, - }, - "condition": { - "agent_runner.runner_type": "local", - "provider_settings.enable": True, - }, - }, - "others": { - "description": "其他配置", - "type": "object", - "items": { - "provider_settings.display_reasoning_text": { - "description": "显示思考内容", - "hint": "显示模型的思维链信息到最终回复中。", - "type": "bool", - "condition": { - "agent_runner.runner_type": "local", - }, - }, - "provider_settings.streaming_response": { - "description": "流式输出", - "hint": "在受支持的聊天平台中以打字机的形式输出响应。", - "type": "bool", - }, - "provider_settings.unsupported_streaming_strategy": { - "description": "不支持流式回复的平台", - "type": "string", - "options": ["realtime_segmenting", "turn_off"], - "hint": "选择在不支持流式回复的平台上的处理方式。实时分段回复会在系统接收流式响应检测到诸如标点符号等分段点时,立即发送当前已接收的内容", - "labels": ["实时分段回复", "关闭流式回复"], - "condition": { - "provider_settings.streaming_response": True, - }, - }, - "provider_settings.identifier": { - "description": "用户识别", - "type": "bool", - "hint": "在用户提示词前带上用户 ID 信息。", - }, - "provider_settings.group_name_display": { - "description": "显示群名称", - "type": "bool", - "hint": "在受支持的消息平台的群聊中的用户提示词前带上群名称信息。", - }, - "provider_settings.datetime_system_prompt": { - "description": "现实世界时间感知", - "type": "bool", - "hint": "在用户提示词中带上当前的时间信息。", - "condition": { - "agent_runner.runner_type": "local", - }, - }, - "provider_settings.show_tool_use_status": { - "description": "输出工具调用信息", - "hint": "有工具调用时,同时发送带有工具调用名字的消息。", - "type": "bool", - "condition": { - "agent_runner.runner_type": "local", - }, - }, - "provider_settings.show_tool_call_result": { - "description": "输出工具调用结果", - "type": "bool", - "hint": "仅在输出工具调用信息启用时生效,展示结果前 70 个字符。", - "condition": { - "agent_runner.runner_type": "local", - "provider_settings.show_tool_use_status": True, - }, - }, - "provider_settings.buffer_intermediate_messages": { - "description": "合并 Agent 中间消息", - "type": "bool", - "hint": "开启后,非流式模式下多步工具调用过程中产生的中间文本将缓冲,待 Agent 完成后合并为一条回复发送。", - "condition": { - "agent_runner.runner_type": "local", - "provider_settings.streaming_response": False, - }, - }, - "agent_runner.config.misc.sanitize_context_by_modalities": { - "description": "按模型能力清理历史上下文", - "type": "bool", - "hint": "开启后,在每次请求 LLM 前会按当前模型提供商中所选择的模型能力删除对话中不支持的图片/工具调用结构(会改变模型看到的历史)", - "condition": { - "agent_runner.runner_type": "local", - }, - }, - "agent_runner.config.misc.max_steps": { - "description": "工具调用轮数上限", - "type": "int", - "condition": { - "agent_runner.runner_type": "local", - }, - }, - "agent_runner.config.misc.tool_call_timeout": { - "description": "工具调用超时时间(秒)", - "type": "int", - "condition": { - "agent_runner.runner_type": "local", - }, - }, - "agent_runner.config.misc.tool_schema_mode": { - "description": "工具调用模式", - "type": "string", - "options": ["skills_like", "full"], - "labels": ["Skills-like(两阶段)", "Full(完整参数)"], - "hint": "skills-like 先下发工具名称与描述,再下发参数;full 一次性下发完整参数。", - "condition": { - "agent_runner.runner_type": "local", - }, - }, - "provider_settings.wake_prefix": { - "description": "额外唤醒前缀", - "type": "string", - "hint": "如果唤醒前缀为 /, 额外聊天唤醒前缀为 chat,则需要 /chat 才会触发 LLM 请求", - }, - "provider_settings.image_compress_options.max_size": { - "description": "输入图片最大边长", - "type": "int", - "hint": "发送给模型的图片最长边(像素),系统会在必要时进一步压缩。", - "slider": {"min": 256, "max": 4096, "step": 64}, - }, - "provider_settings.prompt_prefix": { - "description": "用户提示词", - "type": "string", - "hint": "可使用 {{prompt}} 作为用户输入的占位符。如果不输入占位符则代表添加在用户输入的前面。", - "collapsed": True, - }, - "provider_tts_settings.dual_output": { - "description": "开启 TTS 时同时输出语音和文字内容", - "type": "bool", - "collapsed": True, - }, - "provider_settings.reachability_check": { - "description": "提供商可达性检测", - "type": "bool", - "hint": "/provider 命令列出模型时是否并发检测连通性。开启后会主动调用模型测试连通性,可能产生额外 token 消耗。", - "collapsed": True, - }, - "provider_settings.max_quoted_fallback_images": { - "description": "引用图片回退解析上限", - "type": "int", - "hint": "引用/转发消息回退解析图片时的最大注入数量,超出会截断。", - "condition": { - "agent_runner.runner_type": "local", - }, - "collapsed": True, - }, - "provider_settings.quoted_message_parser.max_component_chain_depth": { - "description": "引用解析组件链深度", - "type": "int", - "hint": "解析 Reply 组件链时允许的最大递归深度。", - "condition": { - "agent_runner.runner_type": "local", - }, - "collapsed": True, - }, - "provider_settings.quoted_message_parser.max_forward_node_depth": { - "description": "引用解析转发节点深度", - "type": "int", - "hint": "解析合并转发节点时允许的最大递归深度。", - "condition": { - "agent_runner.runner_type": "local", - }, - "collapsed": True, - }, - "provider_settings.quoted_message_parser.max_forward_fetch": { - "description": "引用解析转发拉取上限", - "type": "int", - "hint": "递归拉取 get_forward_msg 的最大次数。", - "condition": { - "agent_runner.runner_type": "local", - }, - "collapsed": True, - }, - "provider_settings.quoted_message_parser.warn_on_action_failure": { - "description": "引用解析 action 失败告警", - "type": "bool", - "hint": "开启后,get_msg/get_forward_msg 全部尝试失败时输出 warning 日志。", - "condition": { - "agent_runner.runner_type": "local", - }, - "collapsed": True, - }, - }, - "condition": { - "provider_settings.enable": True, - }, - }, - }, - }, - "platform_group": { - "name": "平台与消息", - "metadata": { - "general": { - "description": "基本", - "type": "object", - "items": { - "platform_settings.unique_session": { - "description": "隔离对话", - "type": "bool", - "hint": "启用后,支持隔离的渠道会为每位群成员使用独立上下文。指令权限请在「管理行为 → 指令」中设置。", - }, - "wake_prefix": { - "description": "唤醒词", - "hint": "唤醒机器人的消息前缀的列表,也可以通过 @ 机器人来唤醒。\n\n内置指令(如 `/help`、`/sid`)也依赖唤醒词:群聊中不带唤醒词直接输入将无法触发;私聊在未启用「私聊消息需要唤醒词」时无需前缀,可直接输入指令触发。", - "type": "list", - "items": {"type": "string"}, - }, - "platform_settings.friend_message_needs_wake_prefix": { - "description": "私聊消息需要唤醒词", - "hint": "私聊消息也必须带上唤醒前缀才能唤醒机器人。", - "type": "bool", - }, - "platform_settings.reply_prefix": { - "description": "回复时的文本前缀", - "hint": "回复中附带的文本前缀。", - "type": "string", - }, - "platform_settings.reply_with_mention": { - "description": "回复时 @ 发送人", - "hint": "回复时提及发送人。", - "type": "bool", - }, - "platform_settings.reply_with_quote": { - "description": "回复时引用发送人消息", - "hint": "回复时引用发送人的对应消息。", - "type": "bool", - }, - "platform_settings.forward_threshold": { - "description": "转发消息的字数阈值", - "hint": "在受支持的平台上,当回复消息过长时,采用 “合并消息转发” 的方式发送消息。", - "type": "int", - }, - "platform_settings.empty_mention_waiting": { - "description": "只 @ 机器人是否触发等待", - "hint": "当发送一条只有提及机器人的消息时,是否在接下来的 1 分钟内保持唤醒状态等待用户的第二条消息。", - "type": "bool", - }, - "disable_builtin_commands": { - "description": "禁用自带指令", - "type": "bool", - "hint": "禁用所有 AstrBot 的自带指令,如 help, sid, new 等。", - }, - }, - }, - "rate_limit": { - "description": "速率限制", - "type": "object", - "items": { - "platform_settings.rate_limit.time": { - "description": "消息速率限制时间(秒)", - "type": "int", - }, - "platform_settings.rate_limit.count": { - "description": "消息速率限制计数", - "type": "int", - }, - "platform_settings.rate_limit.strategy": { - "description": "速率限制策略", - "type": "string", - "options": ["stall", "discard"], - }, - }, - }, - "content_safety": { - "description": "内容安全", - "type": "object", - "items": { - "content_safety.also_use_in_response": { - "description": "同时检查模型的响应内容", - "type": "bool", - }, - "content_safety.baidu_aip.enable": { - "description": "使用百度内容安全审核", - "type": "bool", - "hint": "您需要手动安装 baidu-aip 库。", - }, - "content_safety.baidu_aip.app_id": { - "description": "App ID", - "type": "string", - "condition": { - "content_safety.baidu_aip.enable": True, - }, - }, - "content_safety.baidu_aip.api_key": { - "description": "API Key", - "type": "string", - "secret": True, - "condition": { - "content_safety.baidu_aip.enable": True, - }, - }, - "content_safety.baidu_aip.secret_key": { - "description": "Secret Key", - "type": "string", - "secret": True, - "condition": { - "content_safety.baidu_aip.enable": True, - }, - }, - "content_safety.internal_keywords.enable": { - "description": "关键词检查", - "type": "bool", - }, - "content_safety.internal_keywords.extra_keywords": { - "description": "额外关键词", - "type": "list", - "items": {"type": "string"}, - "hint": "额外的屏蔽关键词列表,支持正则表达式。", - }, - }, - }, - "others": { - "description": "其他配置", - "type": "object", - "items": { - "platform_settings.ignore_bot_self_message": { - "description": "是否忽略机器人自身的消息", - "type": "bool", - }, - "platform_settings.ignore_at_all": { - "description": "是否忽略 @ 全体成员事件", - "type": "bool", - }, - "platform_settings.no_permission_reply": { - "description": "用户权限不足时是否回复", - "type": "bool", - }, - "platform_specific.lark.pre_ack_emoji.enable": { - "description": "[飞书] 启用预回应表情", - "type": "bool", - }, - "platform_specific.lark.pre_ack_emoji.emojis": { - "description": "表情列表(飞书表情枚举名)", - "type": "list", - "items": {"type": "string"}, - "hint": "表情枚举名参考:https://open.feishu.cn/document/server-docs/im-v1/message-reaction/emojis-introduce", - "condition": { - "platform_specific.lark.pre_ack_emoji.enable": True, - }, - }, - "platform_specific.telegram.pre_ack_emoji.enable": { - "description": "[Telegram] 启用预回应表情", - "type": "bool", - }, - "platform_specific.telegram.pre_ack_emoji.emojis": { - "description": "表情列表(Unicode)", - "type": "list", - "items": {"type": "string"}, - "hint": "Telegram 仅支持固定反应集合,参考:https://gist.github.com/Soulter/3f22c8e5f9c7e152e967e8bc28c97fc9", - "condition": { - "platform_specific.telegram.pre_ack_emoji.enable": True, - }, - }, - "platform_specific.discord.pre_ack_emoji.enable": { - "description": "[Discord] 启用预回应表情", - "type": "bool", - }, - "platform_specific.discord.pre_ack_emoji.emojis": { - "description": "表情列表(Unicode 或自定义表情名)", - "type": "list", - "items": {"type": "string"}, - "hint": "填写 Unicode 表情符号,例如:👍、🤔、⏳", - "condition": { - "platform_specific.discord.pre_ack_emoji.enable": True, - }, - }, - }, - }, - }, - }, - "access_group": { - "name": "访问控制", - "metadata": { - "admins": { - "description": "管理员", - "type": "object", - "items": { - "admins_id": { - "description": "管理员 ID", - "type": "list", - "_special": "sender_id", - "items": {"type": "string"}, - "hint": "给机器人发送 /sid 指令以获取 ID。", - }, - }, - }, - "whitelist": { - "description": "白名单", - "type": "object", - "items": { - "platform_settings.enable_id_white_list": { - "description": "启用白名单", - "type": "bool", - "hint": "启用后,只有在白名单内的会话会被响应。", - }, - "platform_settings.id_whitelist": { - "description": "白名单 ID 列表", - "type": "list", - "_special": "umo", - "items": {"type": "string"}, - "hint": "给机器人发送 /sid 指令以获取 ID。为空时代表不启用白名单功能。", - }, - "platform_settings.id_whitelist_log": { - "description": "输出拦截日志", - "type": "bool", - "hint": "输出未通过白名单校验的消息的日志。", - }, - "platform_settings.wl_ignore_admin_on_group": { - "description": "管理员群组消息无视 ID 白名单", - "type": "bool", - }, - "platform_settings.wl_ignore_admin_on_friend": { - "description": "管理员私聊消息无视 ID 白名单", - "type": "bool", - }, - }, - }, - }, - }, - "plugin_group": { - "name": "插件", - "metadata": { - "plugin": { - "description": "插件", - "type": "object", - "items": { - "plugin_set": { - "description": "可用插件", - "type": "bool", - "hint": "默认启用全部未被禁用的插件。若插件在插件页面被禁用,则此处的选择不会生效。", - "_special": "select_plugin_set", - }, - }, - }, - }, - }, - "ext_group": { - "name": "扩展功能", - "metadata": { - "segmented_reply": { - "description": "分段回复", - "type": "object", - "items": { - "platform_settings.segmented_reply.enable": { - "description": "启用分段回复", - "hint": "以分段输出的方式发送回复消息。", - "type": "bool", - }, - "platform_settings.segmented_reply.only_llm_result": { - "description": "仅对 LLM 结果分段", - "type": "bool", - "condition": { - "platform_settings.segmented_reply.enable": True, - }, - }, - "platform_settings.segmented_reply.interval_method": { - "description": "间隔方法。", - "hint": "random 为随机时间,log 为根据消息长度计算,$y=log_(x)$,x为字数,y的单位为秒。", - "type": "string", - "options": ["random", "log"], - "condition": { - "platform_settings.segmented_reply.enable": True, - }, - }, - "platform_settings.segmented_reply.interval": { - "description": "随机间隔时间", - "type": "string", - "hint": "格式:最小值,最大值(如:1.5,3.5)", - "condition": { - "platform_settings.segmented_reply.enable": True, - "platform_settings.segmented_reply.interval_method": "random", - }, - }, - "platform_settings.segmented_reply.log_base": { - "description": "对数底数", - "type": "float", - "hint": "对数间隔的底数,默认为 2.6。取值范围为 1.0-10.0。", - "condition": { - "platform_settings.segmented_reply.enable": True, - "platform_settings.segmented_reply.interval_method": "log", - }, - }, - "platform_settings.segmented_reply.words_count_threshold": { - "description": "分段回复字数阈值", - "hint": "分段回复的字数上限。只有字数小于此值的消息才会被分段,超过此值的长消息将直接发送(不分段)。默认为 150", - "type": "int", - "condition": { - "platform_settings.segmented_reply.enable": True, - }, - }, - "platform_settings.segmented_reply.split_mode": { - "description": "分段模式", - "type": "string", - "options": ["regex", "words"], - "labels": ["正则表达式", "分段词列表"], - "condition": { - "platform_settings.segmented_reply.enable": True, - }, - }, - "platform_settings.segmented_reply.regex": { - "description": "分段正则表达式", - "hint": "用于分隔一段消息。默认情况下会根据句号、问号等标点符号分隔。如填写 `[。?!]` 将移除所有的句号、问号、感叹号。re.findall(r'', text)", - "type": "string", - "condition": { - "platform_settings.segmented_reply.enable": True, - "platform_settings.segmented_reply.split_mode": "regex", - }, - }, - "platform_settings.segmented_reply.split_words": { - "description": "分段词列表", - "type": "list", - "hint": "检测到列表中的任意词时进行分段,如:。、?、!等", - "condition": { - "platform_settings.segmented_reply.enable": True, - "platform_settings.segmented_reply.split_mode": "words", - }, - }, - "platform_settings.segmented_reply.content_cleanup_rule": { - "description": "内容过滤正则表达式", - "type": "string", - "hint": "移除分段后内容中的指定内容。如填写 `[。?!]` 将移除所有的句号、问号、感叹号。", - "condition": { - "platform_settings.segmented_reply.enable": True, - }, - }, - }, - }, - "ltm": { - "description": "群聊上下文感知", - "type": "object", - "items": { - "provider_ltm_settings.group_icl_enable": { - "description": "群聊消息记录注入上下文", - "hint": "是否记录群聊非唤醒机器人的消息,并在唤醒机器人时将消息传给模型。", - "type": "bool", - }, - "provider_ltm_settings.group_message_max_cnt": { - "description": "注入上下文最大消息数量", - "hint": "传给模型的消息的最大数量。", - "type": "int", - "condition": { - "provider_ltm_settings.group_icl_enable": True, - }, - }, - "provider_ltm_settings.image_caption": { - "description": "自动理解图片", - "type": "bool", - "hint": "对非唤醒机器人的图片消息启用图片转述,转换成图片描述文本。对于图片消息频繁的群聊,此功能可能造成较大的开销,请慎用。", - "condition": { - "provider_ltm_settings.group_icl_enable": True, - }, - }, - "provider_ltm_settings.image_caption_provider_id": { - "description": "群聊图片转述模型", - "type": "string", - "_special": "select_provider", - "hint": "用于群聊记录注入上下文的图片理解,与图片转述模型分开配置。", - "condition": { - "provider_ltm_settings.group_icl_enable": True, - "provider_ltm_settings.image_caption": True, - }, - }, - "provider_ltm_settings.group_message_history_enable": { - "description": "持久化群聊消息记录", - "type": "bool", - "hint": "将群内的所有消息都持久化保存,并允许模型通过工具来查询群内消息。", - }, - "provider_ltm_settings.group_message_history_max_cnt": { - "description": "持久化最大消息数量", - "hint": "持久化保存的消息的最大数量,超过后抛弃旧的消息。", - "type": "int", - "condition": { - "provider_ltm_settings.group_message_history_enable": True, - }, - }, - "provider_ltm_settings.active_reply.enable": { - "description": "主动回复", - "hint": "是否在合适的时机主动发消息。", - "type": "bool", - }, - "provider_ltm_settings.active_reply.method": { - "description": "主动回复方法", - "type": "string", - "options": ["possibility_reply"], - "condition": { - "provider_ltm_settings.active_reply.enable": True, - }, - }, - "provider_ltm_settings.active_reply.possibility_reply": { - "description": "回复概率", - "type": "float", - "hint": "0.0-1.0 之间的数值", - "slider": {"min": 0, "max": 1, "step": 0.05}, - "condition": { - "provider_ltm_settings.active_reply.enable": True, - }, - }, - "provider_ltm_settings.active_reply.whitelist": { - "description": "主动回复白名单", - "type": "list", - "items": {"type": "string"}, - "hint": "为空时不启用白名单过滤。使用 /sid 获取 ID。", - "condition": { - "provider_ltm_settings.active_reply.enable": True, - }, - }, - }, - }, - "t2i": { - "description": "文本转图像", - "type": "object", - "items": { - "t2i": { - "description": "文本转图像输出", - "hint": "将模型回复转换成图片后再发送,防止刷屏。", - "type": "bool", - }, - "t2i_word_threshold": { - "description": "文本转图像字数阈值", - "type": "int", - "condition": { - "t2i": True, - }, - }, - "t2i_strategy": { - "description": "文本转图像策略", - "type": "string", - "hint": "文本转图像策略。`remote` 为使用远程基于 HTML 的渲染服务,`local` 为使用 PIL 本地渲染。当使用 local 时,将 ttf 字体命名为 'font.ttf' 放在 data/ 目录下可自定义字体。", - "options": ["remote", "local"], - "condition": { - "t2i": True, - }, - }, - "t2i_endpoint": { - "description": "文本转图像服务 API 地址", - "type": "string", - "hint": "为空时使用 AstrBot API 服务", - "condition": { - "t2i": True, - "t2i_strategy": "remote", - }, - }, - "t2i_template": { - "description": "文本转图像自定义模版", - "type": "bool", - "hint": "启用后可自定义 HTML 模板用于文转图渲染。", - "condition": { - "t2i": True, - "t2i_strategy": "remote", - }, - "_special": "t2i_template", - }, - "t2i_active_template": { - "description": "当前应用的文转图渲染模板", - "type": "string", - "hint": "此处的值由文转图模板管理页面进行维护。", - "invisible": True, - }, - }, - }, - }, - }, -} - -CONFIG_METADATA_3_SYSTEM = { - "system_group": { - "name": "系统配置", - "metadata": { - "system": { - "description": "系统配置", - "type": "object", - "items": { - "log_level": { - "description": "控制台日志级别", - "type": "string", - "hint": "控制台输出日志的级别。", - "options": ["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"], - }, - "dashboard.ssl.enable": { - "description": "启用 WebUI HTTPS", - "type": "bool", - "hint": "启用后,WebUI 将直接使用 HTTPS 提供服务。", - }, - "dashboard.trust_proxy_headers": { - "description": "信任代理请求头获取客户端 IP", - "type": "bool", - "hint": "关闭时忽略 X-Forwarded-For/X-Real-IP,仅使用连接地址。", - }, - "dashboard.auth_rate_limit.enable": { - "description": "启用登录验证速率限制", - "type": "bool", - "hint": "关闭后将不对登录、TOTP 等身份验证接口进行速率限制。", - }, - "dashboard.auth_rate_limit.average_interval": { - "description": "验证端点速率限制平均间隔(秒)", - "type": "float", - "hint": "两次身份验证请求之间的最小平均间隔时间。例如设置为 1.0 表示每秒最多处理 1 个请求。", - "condition": {"dashboard.auth_rate_limit.enable": True}, - }, - "dashboard.auth_rate_limit.max_burst": { - "description": "验证端点速率限制最大突发数", - "type": "int", - "hint": "允许的瞬时最大突发请求数。例如设置为 3 表示在短时间内最多连续处理 3 个请求。", - "condition": {"dashboard.auth_rate_limit.enable": True}, - }, - "dashboard.totp.enable": { - "description": "启用 WebUI TOTP 双因素认证", - "type": "bool", - "hint": "启用后,登录 WebUI 需要额外输入验证码。", - "_special": "dashboard_totp_manager", - }, - "dashboard.ssl.cert_file": { - "description": "SSL 证书文件路径", - "type": "string", - "hint": "证书文件路径(PEM)。支持绝对路径和相对路径(相对于当前工作目录)。", - "condition": {"dashboard.ssl.enable": True}, - }, - "dashboard.ssl.key_file": { - "description": "SSL 私钥文件路径", - "type": "string", - "hint": "私钥文件路径(PEM)。支持绝对路径和相对路径(相对于当前工作目录)。", - "condition": {"dashboard.ssl.enable": True}, - }, - "dashboard.ssl.ca_certs": { - "description": "SSL CA 证书文件路径", - "type": "string", - "hint": "可选。用于指定 CA 证书文件路径。", - "condition": {"dashboard.ssl.enable": True}, - }, - "log_file_enable": { - "description": "启用文件日志", - "type": "bool", - "hint": "开启后会将日志写入指定文件。", - }, - "log_file_path": { - "description": "日志文件路径", - "type": "string", - "hint": "相对路径以 data 目录为基准,例如 logs/astrbot.log;支持绝对路径。", - }, - "log_file_max_mb": { - "description": "日志文件大小上限 (MB)", - "type": "int", - "hint": "超过大小后自动轮转,默认 20MB。", - }, - "temp_dir_max_size": { - "description": "临时目录大小上限 (MB)", - "type": "int", - "hint": "用于限制 data/temp 目录总大小,单位为 MB。系统每 10 分钟检查一次,超限时按文件修改时间从旧到新删除,释放约 30% 当前体积。", - }, - "trace_enable": { - "description": "启用追踪记录", - "type": "bool", - "hint": "追踪用户的每次指令和 AI 调用。", - }, - "trace_db_path": { - "description": "追踪数据库路径", - "type": "string", - "hint": "相对路径以 data 目录为基准,例如 logs/traces.db;支持绝对路径。", - }, - "trace_db_max_mb": { - "description": "追踪数据库容量预算 (MB)", - "type": "int", - "hint": "默认 80 MB,最小 32 MB,低于最小值时按 32 MB 生效。超出后自动清除旧数据。", - }, - "trace_retention_days": { - "description": "追踪保留天数", - "type": "int", - "hint": "默认 7 天,期限或容量先达到者触发清理。", - }, - "pip_install_arg": { - "description": "pip 安装额外参数", - "type": "string", - "hint": "安装插件依赖时,会使用 Python 的 pip 工具。这里可以填写额外的参数,如 `--break-system-package` 等。PyPI 镜像的 TLS 证书默认会校验;若使用自签名/私有 CA 镜像,请通过 `--cert ` 指定信任的证书(推荐),或显式添加 `--trusted-host <主机名>`。", - }, - "pypi_index_url": { - "description": "PyPI 软件仓库地址", - "type": "string", - "hint": "安装 Python 依赖时请求的 PyPI 软件仓库地址。默认为 https://mirrors.aliyun.com/pypi/simple/", - }, - "callback_api_base": { - "description": "对外可达的回调接口地址", - "type": "string", - "hint": "外部服务可能会通过 AstrBot 生成的回调链接(如文件下载链接)访问 AstrBot 后端。由于 AstrBot 无法自动判断部署环境中对外可达的主机地址(host),因此需要通过此配置项显式指定 “外部服务如何访问 AstrBot” 的地址。如 http://localhost:6185,https://example.com 等。", - }, - "timezone": { - "description": "时区", - "type": "string", - "hint": "时区设置。请填写 IANA 时区名称, 如 Asia/Shanghai, 为空时使用系统默认时区。所有时区请查看: https://data.iana.org/time-zones/tzdb-2021a/zone1970.tab", - }, - "http_proxy": { - "description": "代理", - "type": "string", - "hint": "启用后,会以添加环境变量的方式设置代理。支持 http://、https://、socks5:// 格式,例如:http://127.0.0.1:7890 或 socks5://127.0.0.1:7891", - }, - "no_proxy": { - "description": "直连地址列表", - "type": "list", - "items": {"type": "string"}, - }, - }, - }, - }, - }, -} - - -DEFAULT_VALUE_MAP = { - "int": 0, - "float": 0.0, - "bool": False, - "string": "", - "text": "", - "list": [], - "file": [], - "object": {}, - "template_list": [], - "dict": {}, -} +"""如需修改配置,请在 `data/cmd_config.json` 中修改或者在管理面板中可视化修改。""" + +import os + +from astrbot import __version__ +from astrbot.core.computer.booters.cua_defaults import CUA_DEFAULT_CONFIG +from astrbot.core.utils.astrbot_path import get_astrbot_data_path + +from .agent_runner import get_agent_runner_config_default + + +def get_local_permission_defaults(system: str | None = None) -> dict: + """Return fresh Local permission defaults shared by all operating systems. + + Args: + system: Retained for callers supplying an operating system name. + + Returns: + Workspace files without execution for members and unrestricted local + execution for administrators. Neither policy requires process isolation. + """ + return { + "member": { + "allow_execution": False, + "allow_network": False, + "filesystem_scope": "workspace", + }, + "admin": { + "allow_execution": True, + "allow_network": True, + "filesystem_scope": "host", + }, + } + + +VERSION = __version__ + +DB_PATH = os.path.join(get_astrbot_data_path(), "data_v4.db") +PERSONAL_WECHAT_CONFIG_METADATA = { + "weixin_oc_base_url": { + "description": "Base URL", + "type": "string", + "hint": "默认值: https://ilinkai.weixin.qq.com", + }, + "weixin_oc_bot_type": { + "description": "扫码参数 bot_type", + "type": "string", + "hint": "默认值: 3", + "invisible": True, + }, + "weixin_oc_qr_poll_interval": { + "description": "二维码状态轮询间隔(秒)", + "type": "int", + "hint": "每隔多少秒轮询一次二维码状态。", + "invisible": True, + }, + "weixin_oc_long_poll_timeout_ms": { + "description": "getUpdates 长轮询超时时间(毫秒)", + "type": "int", + "hint": "会话消息拉取接口超时参数。", + }, + "weixin_oc_api_timeout_ms": { + "description": "HTTP 请求超时(毫秒)", + "type": "int", + "hint": "通用 API 请求超时参数。", + }, + "weixin_oc_token": { + "description": "登录后 token(可留空)", + "type": "string", + "hint": "扫码登录成功后会自动写入;高级场景可手动填写。", + "secret": True, + "invisible": True, + }, + "weixin_oc_account_id": {"invisible": True}, + "weixin_oc_sync_buf": {"invisible": True}, + "weixin_oc_context_tokens": {"invisible": True}, +} + +WEBHOOK_SUPPORTED_PLATFORMS = [ + "qq_official_webhook", + "weixin_official_account", + "wecom", + "wecom_ai_bot", + "slack", + "lark", + "line", + "mattermost", +] + +# 默认配置 +DEFAULT_CONFIG = { + "config_version": 5, + "platform_settings": { + "unique_session": False, + "rate_limit": { + "time": 60, + "count": 30, + "strategy": "stall", # stall, discard + }, + "reply_prefix": "", + "forward_threshold": 1500, + "enable_id_white_list": True, + "id_whitelist": [], + "id_whitelist_log": True, + "wl_ignore_admin_on_group": True, + "wl_ignore_admin_on_friend": True, + "reply_with_mention": False, + "reply_with_quote": False, + "path_mapping": [], + "segmented_reply": { + "enable": False, + "only_llm_result": True, + "interval_method": "random", + "interval": "1.5,3.5", + "log_base": 2.6, + "words_count_threshold": 150, + "split_mode": "regex", # regex 或 words + "regex": ".*?[。?!~…]+|.+$", + "split_words": [ + "。", + "?", + "!", + "~", + "…", + ], # 当 split_mode 为 words 时使用 + "content_cleanup_rule": "", + }, + "no_permission_reply": True, + "empty_mention_waiting": True, + "empty_mention_waiting_need_reply": True, + "friend_message_needs_wake_prefix": False, + "ignore_bot_self_message": False, + "ignore_at_all": False, + }, + "provider_sources": [], # provider sources + "provider": [], # models from provider_sources + "provider_settings": { + "enable": True, + "default_image_caption_provider_id": "", + "image_caption_prompt": "Please describe the image using Chinese.", + "provider_pool": ["*"], # "*" 表示使用所有可用的提供者 + "wake_prefix": "", + "web_search": False, + "websearch_provider": "tavily", + "websearch_tavily_key": [], + "websearch_bocha_key": [], + "websearch_brave_key": [], + "websearch_baidu_app_builder_key": "", + "websearch_firecrawl_key": [], + "websearch_exa_key": [], + "websearch_anysearch_key": [], + "websearch_deepseek_key": [], + "websearch_serpapi_key": [], + "web_search_link": False, + "display_reasoning_text": False, + "identifier": False, + "group_name_display": False, + "datetime_system_prompt": True, + "persona_pool": ["*"], + "prompt_prefix": "{{prompt}}", + "streaming_response": False, + "show_tool_use_status": False, + "show_tool_call_result": False, + "buffer_intermediate_messages": False, + "max_quoted_fallback_images": 20, + "quoted_message_parser": { + "max_component_chain_depth": 4, + "max_forward_node_depth": 6, + "max_forward_fetch": 32, + "warn_on_action_failure": False, + }, + "unsupported_streaming_strategy": "realtime_segmenting", + "reachability_check": False, + "file_extract": { + "enable": False, + "provider": "moonshotai", + "moonshotai_api_key": "", + }, + "proactive_capability": { + "add_cron_tools": True, + }, + "computer_use_runtime": "none", + "computer_use_local_permissions": get_local_permission_defaults(), + "computer_use_require_admin": True, + "sandbox": { + "booter": "shipyard_neo", + "shipyard_endpoint": "", + "shipyard_access_token": "", + "shipyard_ttl": 3600, + "shipyard_max_sessions": 10, + "shipyard_neo_endpoint": "", + "shipyard_neo_access_token": "", + "shipyard_neo_profile": "python-default", + "shipyard_neo_ttl": 3600, + "cua_image": CUA_DEFAULT_CONFIG["image"], + "cua_os_type": CUA_DEFAULT_CONFIG["os_type"], + "cua_idle_timeout": CUA_DEFAULT_CONFIG["idle_timeout"], + "cua_telemetry_enabled": CUA_DEFAULT_CONFIG["telemetry_enabled"], + "cua_local": CUA_DEFAULT_CONFIG["local"], + "cua_api_key": CUA_DEFAULT_CONFIG["api_key"], + }, + "image_compress_options": { + "max_size": 1280, + }, + }, + "agent_runner": { + "runner_type": "local", + "config": get_agent_runner_config_default("local"), + }, + # SubAgent orchestrator mode: + # - main_enable = False: disabled; main LLM mounts tools normally (persona selection). + # - main_enable = True: enabled; main LLM keeps its own tools and includes handoff + # tools (transfer_to_*). remove_main_duplicate_tools can remove tools that are + # duplicated on subagents from the main LLM toolset. + "subagent_orchestrator": { + "main_enable": False, + "remove_main_duplicate_tools": False, + "router_system_prompt": ( + "You are a task router. Your job is to chat naturally, recognize user intent, " + "and delegate work to the most suitable subagent using transfer_to_* tools. " + "Do not try to use domain tools yourself. If no subagent fits, respond directly." + ), + "agents": [], + }, + "provider_stt_settings": { + "enable": False, + "provider_id": "", + }, + "provider_tts_settings": { + "enable": False, + "provider_id": "", + "dual_output": False, + "use_file_service": False, + "trigger_probability": 1.0, + }, + "provider_ltm_settings": { + "group_icl_enable": False, + "group_message_max_cnt": 1000, + "image_caption": False, + "image_caption_provider_id": "", + "group_message_history_enable": False, + "group_message_history_max_cnt": 700, + "active_reply": { + "enable": False, + "method": "possibility_reply", + "possibility_reply": 0.1, + "whitelist": [], + }, + }, + "content_safety": { + "also_use_in_response": False, + "internal_keywords": {"enable": True, "extra_keywords": []}, + "baidu_aip": {"enable": False, "app_id": "", "api_key": "", "secret_key": ""}, + }, + "admins_id": ["astrbot"], + "t2i": False, + "t2i_word_threshold": 150, + "t2i_strategy": "remote", + "t2i_endpoint": "", + "t2i_use_file_service": False, + "t2i_active_template": "base", + "http_proxy": "", + "no_proxy": ["localhost", "127.0.0.1", "::1", "10.*", "192.168.*"], + "dashboard": { + "enable": True, + "username": "astrbot", + "password": "", + "pbkdf2_password": "", + "password_storage_upgraded": False, + "password_change_required": False, + "jwt_secret": "", + "host": "0.0.0.0", + "port": 6185, + "disable_access_log": True, + "trust_proxy_headers": False, + "auth_rate_limit": { + "enable": True, + "average_interval": 1.0, + "max_burst": 3, + }, + "totp": { + "enable": False, + "secret": "", + "recovery_code_hash": "", + }, + "ssl": { + "enable": False, + "cert_file": "", + "key_file": "", + "ca_certs": "", + }, + }, + "platform": [], + "platform_specific": { + # 平台特异配置:按平台分类,平台下按功能分组 + "lark": { + "pre_ack_emoji": {"enable": False, "emojis": ["Typing"]}, + }, + "telegram": { + "pre_ack_emoji": {"enable": False, "emojis": ["✍️"]}, + }, + "discord": { + "pre_ack_emoji": {"enable": False, "emojis": ["🤔"]}, + }, + }, + "wake_prefix": ["/"], + "log_level": "INFO", + "log_file_enable": False, + "log_file_path": "logs/astrbot.log", + "log_file_max_mb": 20, + "temp_dir_max_size": 1024, + "trace_enable": False, + "trace_db_path": "logs/traces.db", + "trace_db_max_mb": 80, + "trace_retention_days": 7, + "pip_install_arg": "", + "pypi_index_url": "https://mirrors.aliyun.com/pypi/simple/", + "persona": [], # deprecated + "timezone": "Asia/Shanghai", + "callback_api_base": "", + "default_kb_collection": "", # 默认知识库名称, 已经过时 + "plugin_set": ["*"], # "*" 表示使用所有可用的插件, 空列表表示不使用任何插件 + "kb_names": [], # 默认知识库名称列表 + "kb_fusion_top_k": 20, # 知识库检索融合阶段返回结果数量 + "kb_final_top_k": 5, # 知识库检索最终返回结果数量 + "kb_agentic_mode": False, + "disable_builtin_commands": False, + "disable_metrics": False, +} + + +""" +AstrBot v3 时代的配置元数据,目前仅承担以下功能: + +1. 保存配置时,配置项的类型验证 +2. WebUI 展示提供商和平台适配器模版 + +WebUI 的配置文件在 `CONFIG_METADATA_3` 中。 + +未来将会逐步淘汰此配置元数据。 +""" +CONFIG_METADATA_2 = { + "platform_group": { + "metadata": { + "platform": { + "description": "消息平台适配器", + "type": "list", + "config_template": { + "QQ 官方机器人(Websocket, 推荐)": { + "id": "default", + "type": "qq_official", + "enable": True, + "appid": "", + "secret": "", + "enable_group_c2c": True, + "enable_guild_direct_message": True, + "use_markdown": True, + }, + "QQ 官方机器人(Webhook)": { + "id": "default", + "type": "qq_official_webhook", + "enable": True, + "appid": "", + "secret": "", + "use_markdown": True, + "is_sandbox": False, + "unified_webhook_mode": True, + "webhook_uuid": "", + "callback_server_host": "0.0.0.0", + "port": 6196, + }, + "OneBot v11": { + "id": "default", + "type": "aiocqhttp", + "enable": True, + "ws_reverse_host": "0.0.0.0", + "ws_reverse_port": 6199, + "ws_reverse_token": "", + }, + "飞书(Lark)": { + "id": "lark", + "type": "lark", + "enable": True, + "app_id": "", + "app_secret": "", + "domain": "https://open.feishu.cn", + "lark_connection_mode": "socket", # webhook, socket + "webhook_uuid": "", + "lark_encrypt_key": "", + "lark_verification_token": "", + }, + "个人微信": { + "id": "weixin_personal", + "type": "weixin_oc", + "enable": True, + "weixin_oc_base_url": "https://ilinkai.weixin.qq.com", + "weixin_oc_bot_type": "3", + "weixin_oc_qr_poll_interval": 1, + "weixin_oc_long_poll_timeout_ms": 35_000, + "weixin_oc_api_timeout_ms": 120_000, + }, + "企业微信 (智能机器人)": { + "id": "wecom_ai_bot", + "type": "wecom_ai_bot", + "hint": "如果发现字段有异常,请重新创建", + "enable": True, + "wecom_ai_bot_connection_mode": "long_connection", # long_connection, webhook + "wecom_ai_bot_name": "", + "wecomaibot_ws_bot_id": "", + "wecomaibot_ws_secret": "", + "wecomaibot_token": "", + "wecomaibot_encoding_aes_key": "", + "wecomaibot_init_respond_text": "", + "wecomaibot_friend_message_welcome_text": "", + "msg_push_webhook_url": "", + "only_use_webhook_url_to_send": False, + "wecomaibot_ws_url": "wss://openws.work.weixin.qq.com", + "wecomaibot_heartbeat_interval": 30, + "unified_webhook_mode": True, + "webhook_uuid": "", + "callback_server_host": "0.0.0.0", + "port": 6198, + }, + "企业微信应用 & 微信客服": { + "id": "wecom", + "type": "wecom", + "enable": True, + "corpid": "", + "secret": "", + "token": "", + "encoding_aes_key": "", + "kf_name": "", + "api_base_url": "https://qyapi.weixin.qq.com/cgi-bin/", + "unified_webhook_mode": True, + "webhook_uuid": "", + "callback_server_host": "0.0.0.0", + "port": 6195, + }, + "微信公众平台": { + "id": "weixin_official_account", + "type": "weixin_official_account", + "enable": True, + "appid": "", + "secret": "", + "token": "", + "encoding_aes_key": "", + "api_base_url": "https://api.weixin.qq.com/cgi-bin/", + "unified_webhook_mode": True, + "webhook_uuid": "", + "callback_server_host": "0.0.0.0", + "port": 6194, + "active_send_mode": False, + }, + "钉钉(DingTalk)": { + "id": "dingtalk", + "type": "dingtalk", + "enable": True, + "client_id": "", + "client_secret": "", + "card_template_id": "", + }, + "Telegram": { + "id": "telegram", + "type": "telegram", + "enable": True, + "telegram_token": "", + "start_message": "Hello, I'm AstrBot!", + "telegram_api_base_url": "https://api.telegram.org/bot", + "telegram_file_base_url": "https://api.telegram.org/file/bot", + "telegram_command_register": True, + "telegram_command_auto_refresh": True, + "telegram_command_register_interval": 300, + "telegram_polling_restart_delay": 5.0, + }, + "Discord": { + "id": "discord", + "type": "discord", + "enable": True, + "discord_token": "", + "discord_proxy": "", + "discord_command_register": True, + "discord_activity_name": "", + "discord_allow_bot_messages": False, + }, + "Misskey": { + "id": "misskey", + "type": "misskey", + "enable": True, + "misskey_instance_url": "https://misskey.example", + "misskey_token": "", + "misskey_default_visibility": "public", + "misskey_local_only": False, + "misskey_enable_chat": True, + # download / security options + "misskey_allow_insecure_downloads": False, + "misskey_download_timeout": 15, + "misskey_download_chunk_size": 65536, + "misskey_max_download_bytes": None, + "misskey_enable_file_upload": True, + "misskey_upload_concurrency": 3, + "misskey_upload_folder": "", + }, + "Slack": { + "id": "slack", + "type": "slack", + "enable": True, + "bot_token": "", + "app_token": "", + "signing_secret": "", + "slack_connection_mode": "socket", # webhook, socket + "unified_webhook_mode": True, + "webhook_uuid": "", + "slack_webhook_host": "0.0.0.0", + "slack_webhook_port": 6197, + "slack_webhook_path": "/astrbot-slack-webhook/callback", + }, + "Line": { + "id": "line", + "type": "line", + "enable": True, + "channel_access_token": "", + "channel_secret": "", + "unified_webhook_mode": True, + "webhook_uuid": "", + }, + "Satori": { + "id": "satori", + "type": "satori", + "enable": True, + "satori_api_base_url": "http://localhost:5140/satori/v1", + "satori_endpoint": "ws://localhost:5140/satori/v1/events", + "satori_token": "", + "satori_auto_reconnect": True, + "satori_heartbeat_interval": 10, + "satori_reconnect_delay": 5, + }, + "KOOK": { + "id": "kook", + "type": "kook", + "enable": True, + "kook_bot_token": "", + "kook_reconnect_delay": 1, + "kook_max_reconnect_delay": 60, + "kook_max_retry_delay": 60, + "kook_heartbeat_interval": 30, + "kook_heartbeat_timeout": 6, + "kook_max_heartbeat_failures": 3, + "kook_max_consecutive_failures": 5, + }, + "Mattermost": { + "id": "mattermost", + "type": "mattermost", + "enable": True, + "mattermost_url": "https://chat.example.com", + "mattermost_bot_token": "", + "mattermost_reconnect_delay": 5.0, + "unified_webhook_mode": True, + "webhook_uuid": "", + }, + # "WebChat": { + # "id": "webchat", + # "type": "webchat", + # "enable": False, + # "webchat_link_path": "", + # "webchat_present_type": "fullscreen", + # }, + }, + "items": { + # "webchat_link_path": { + # "description": "链接路径", + # "_special": "webchat_link_path", + # "type": "string", + # }, + # "webchat_present_type": { + # "_special": "webchat_present_type", + # "description": "展现形式", + # "type": "string", + # "options": ["fullscreen", "embedded"], + # }, + "app_id": { + "description": "应用 ID", + "type": "string", + "hint": "消息平台开放平台中的应用 ID。", + "show_key": True, + }, + "app_secret": { + "description": "应用密钥", + "type": "string", + "hint": "消息平台开放平台中的应用密钥。请妥善保管,避免泄露。", + "show_key": True, + "secret": True, + }, + "domain": { + "description": "开放平台 API 地址", + "type": "string", + "hint": "开放平台 API 的基础地址。使用默认官方服务时通常无需修改。", + "show_key": True, + }, + "corpid": { + "description": "企业 ID", + "type": "string", + "hint": "企业微信后台中的企业 ID(CorpID)。", + "show_key": True, + }, + "token": { + "description": "回调 Token", + "type": "string", + "hint": "消息平台回调配置中用于验证请求的 Token。", + "show_key": True, + "secret": True, + }, + "encoding_aes_key": { + "description": "消息加密密钥", + "type": "string", + "hint": "消息平台回调配置中的 EncodingAESKey,用于加密和解密消息。", + "show_key": True, + "secret": True, + }, + "api_base_url": { + "description": "API 基础地址", + "type": "string", + "hint": "消息平台 API 的基础地址。使用默认官方服务时通常无需修改。", + "show_key": True, + }, + "client_id": { + "description": "客户端 ID", + "type": "string", + "hint": "消息平台开放平台中的客户端 ID。", + "show_key": True, + }, + "client_secret": { + "description": "客户端密钥", + "type": "string", + "hint": "消息平台开放平台中的客户端密钥。请妥善保管,避免泄露。", + "show_key": True, + "secret": True, + }, + "start_message": { + "description": "Start 命令回复", + "type": "string", + "hint": "用户向 Telegram 机器人发送 /start 命令时回复的内容。", + "show_key": True, + }, + "telegram_api_base_url": { + "description": "API 地址", + "type": "string", + "hint": "Telegram Bot API 的基础地址。使用官方服务时通常无需修改。", + "show_key": True, + }, + "telegram_file_base_url": { + "description": "文件 API 地址", + "type": "string", + "hint": "Telegram Bot API 文件下载接口的基础地址。使用官方服务时通常无需修改。", + "show_key": True, + }, + "bot_token": { + "description": "Slack Bot Token", + "type": "string", + "hint": "Slack 应用的 Bot User OAuth Token,通常以 xoxb- 开头。", + "show_key": True, + "secret": True, + }, + "app_token": { + "description": "Slack App Token", + "type": "string", + "hint": "Slack Socket Mode 使用的 App-Level Token,通常以 xapp- 开头。", + "condition": { + "slack_connection_mode": "socket", + }, + "show_key": True, + "secret": True, + }, + "signing_secret": { + "description": "Slack Signing Secret", + "type": "string", + "hint": "Slack 应用的 Signing Secret,用于验证 Webhook 请求。", + "condition": { + "slack_connection_mode": "webhook", + }, + "show_key": True, + "secret": True, + }, + "channel_access_token": { + "description": "LINE 频道访问令牌", + "type": "string", + "hint": "LINE Messaging API 频道的 Channel Access Token。", + "show_key": True, + "secret": True, + }, + "channel_secret": { + "description": "LINE 频道密钥", + "type": "string", + "hint": "LINE Messaging API 频道的 Channel Secret。", + "show_key": True, + "secret": True, + }, + "lark_connection_mode": { + "description": "订阅方式", + "type": "string", + "options": ["socket", "webhook"], + "labels": ["长连接模式", "推送至服务器模式"], + }, + "lark_encrypt_key": { + "description": "Encrypt Key", + "type": "string", + "hint": "用于解密飞书回调数据的加密密钥", + "secret": True, + "condition": { + "lark_connection_mode": "webhook", + }, + }, + "lark_verification_token": { + "description": "Verification Token", + "type": "string", + "hint": "用于验证飞书回调请求的令牌", + "secret": True, + "condition": { + "lark_connection_mode": "webhook", + }, + }, + "is_sandbox": { + "description": "沙箱模式", + "type": "bool", + }, + "satori_api_base_url": { + "description": "Satori API 终结点", + "type": "string", + "hint": "Satori API 的基础地址。", + }, + "satori_endpoint": { + "description": "Satori WebSocket 终结点", + "type": "string", + "hint": "Satori 事件的 WebSocket 端点。", + }, + "satori_token": { + "description": "Satori 令牌", + "type": "string", + "hint": "用于 Satori API 身份验证的令牌。", + "secret": True, + }, + "satori_auto_reconnect": { + "description": "启用自动重连", + "type": "bool", + "hint": "断开连接时是否自动重新连接 WebSocket。", + }, + "satori_heartbeat_interval": { + "description": "Satori 心跳间隔", + "type": "int", + "hint": "发送心跳消息的间隔(秒)。", + }, + "satori_reconnect_delay": { + "description": "Satori 重连延迟", + "type": "int", + "hint": "尝试重新连接前的延迟时间(秒)。", + }, + "slack_connection_mode": { + "description": "Slack Connection Mode", + "type": "string", + "options": ["webhook", "socket"], + "hint": "The connection mode for Slack. `webhook` uses a webhook server, `socket` uses Slack's Socket Mode.", + }, + "slack_webhook_host": { + "description": "Slack Webhook Host", + "type": "string", + "hint": "Only valid when Slack connection mode is `webhook`.", + "condition": { + "slack_connection_mode": "webhook", + "unified_webhook_mode": False, + }, + }, + "slack_webhook_port": { + "description": "Slack Webhook Port", + "type": "int", + "hint": "Only valid when Slack connection mode is `webhook`.", + "condition": { + "slack_connection_mode": "webhook", + "unified_webhook_mode": False, + }, + }, + "slack_webhook_path": { + "description": "Slack Webhook Path", + "type": "string", + "hint": "Only valid when Slack connection mode is `webhook`.", + "condition": { + "slack_connection_mode": "webhook", + "unified_webhook_mode": False, + }, + }, + "active_send_mode": { + "description": "是否换用主动发送接口", + "type": "bool", + "desc": "只有企业认证的公众号才能主动发送。主动发送接口的限制会少一些。", + }, + "wpp_active_message_poll": { + "description": "是否启用主动消息轮询", + "type": "bool", + "hint": "只有当你发现微信消息没有按时同步到 AstrBot 时,才需要启用这个功能,默认不启用。", + }, + "wpp_active_message_poll_interval": { + "description": "主动消息轮询间隔", + "type": "int", + "hint": "主动消息轮询间隔,单位为秒,默认 3 秒,最大不要超过 60 秒,否则可能被认为是旧消息。", + }, + "kf_name": { + "description": "微信客服账号名", + "type": "string", + "hint": "可选。微信客服账号名(不是 ID)。可在 https://kf.weixin.qq.com/kf/frame#/accounts 获取", + }, + "telegram_token": { + "description": "Bot Token", + "type": "string", + "hint": "如果你的网络环境为中国大陆,请在 `其他配置` 处设置代理或更改 api_base。", + "secret": True, + }, + "mattermost_url": { + "description": "Mattermost URL", + "type": "string", + "hint": "Mattermost 服务地址,例如 https://chat.example.com。", + }, + "mattermost_bot_token": { + "description": "Mattermost Bot Token", + "type": "string", + "hint": "在 Mattermost 中创建 Bot 账户后生成的访问令牌。", + "secret": True, + }, + "mattermost_reconnect_delay": { + "description": "Mattermost 重连延迟", + "type": "float", + "hint": "WebSocket 断开后的重连等待时间,单位为秒。默认 5 秒。", + }, + "misskey_instance_url": { + "description": "Misskey 实例 URL", + "type": "string", + "hint": "例如 https://misskey.example,填写 Bot 账号所在的 Misskey 实例地址", + }, + "misskey_token": { + "description": "Misskey Access Token", + "type": "string", + "hint": "连接服务设置生成的 API 鉴权访问令牌(Access token)", + "secret": True, + }, + "misskey_default_visibility": { + "description": "默认帖子可见性", + "type": "string", + "options": ["public", "home", "followers"], + "hint": "机器人发帖时的默认可见性设置。public:公开,home:主页时间线,followers:仅关注者。", + }, + "misskey_local_only": { + "description": "仅限本站(不参与联合)", + "type": "bool", + "hint": "启用后,机器人发出的帖子将仅在本实例可见,不会联合到其他实例", + }, + "misskey_enable_chat": { + "description": "启用聊天消息响应", + "type": "bool", + "hint": "启用后,机器人将会监听和响应私信聊天消息", + }, + "misskey_enable_file_upload": { + "description": "启用文件上传到 Misskey", + "type": "bool", + "hint": "启用后,适配器会尝试将消息链中的文件上传到 Misskey。URL 文件会先尝试服务器端上传,异步上传失败时会回退到下载后本地上传。", + }, + "misskey_allow_insecure_downloads": { + "description": "允许不安全下载(禁用 SSL 验证)", + "type": "bool", + "hint": "当远端服务器存在证书问题导致无法正常下载时,自动禁用 SSL 验证作为回退方案。适用于某些图床的证书配置问题。启用有安全风险,仅在必要时使用。", + }, + "misskey_download_timeout": { + "description": "远端下载超时时间(秒)", + "type": "int", + "hint": "下载远程文件时的超时时间(秒),用于异步上传回退到本地上传的场景。", + }, + "misskey_download_chunk_size": { + "description": "流式下载分块大小(字节)", + "type": "int", + "hint": "流式下载和计算 MD5 时使用的每次读取字节数,过小会增加开销,过大会占用内存。", + }, + "misskey_max_download_bytes": { + "description": "最大允许下载字节数(超出则中止)", + "type": "int", + "hint": "如果希望限制下载文件的最大大小以防止 OOM,请填写最大字节数;留空或 null 表示不限制。", + }, + "misskey_upload_concurrency": { + "description": "并发上传限制", + "type": "int", + "hint": "同时进行的文件上传任务上限(整数,默认 3)。", + }, + "misskey_upload_folder": { + "description": "上传到网盘的目标文件夹 ID", + "type": "string", + "hint": "可选:填写 Misskey 网盘中目标文件夹的 ID,上传的文件将放置到该文件夹内。留空则使用账号网盘根目录。", + }, + "card_template_id": { + "description": "卡片模板 ID", + "type": "string", + "hint": "可选。钉钉互动卡片模板 ID。启用后将使用互动卡片进行流式回复。", + }, + "telegram_command_register": { + "description": "命令注册", + "type": "bool", + "hint": "启用后,AstrBot 将会自动注册 Telegram 命令。", + "show_key": True, + }, + "telegram_command_auto_refresh": { + "description": "命令自动刷新", + "type": "bool", + "hint": "启用后,AstrBot 将会在运行时自动刷新 Telegram 命令。(单独设置此项无效)", + "show_key": True, + }, + "telegram_command_register_interval": { + "description": "命令自动刷新间隔", + "type": "int", + "hint": "Telegram 命令自动刷新间隔,单位为秒。", + "show_key": True, + }, + "telegram_polling_restart_delay": { + "description": "轮询重启延迟", + "type": "float", + "hint": "当轮询意外结束尝试自动重启时的延迟时间,理论上越短恢复越快,但过短(<0.1s)可能导致死循环针对 API 服务器的请求阻断。单位为秒。默认为 5s。", + "show_key": True, + }, + "id": { + "description": "机器人名称", + "type": "string", + "hint": "机器人名称", + }, + "type": { + "description": "适配器类型", + "type": "string", + "invisible": True, + }, + "enable": { + "description": "启用", + "type": "bool", + "hint": "是否启用该适配器。未启用的适配器对应的消息平台将不会接收到消息。", + }, + "appid": { + "description": "appid", + "type": "string", + "hint": "必填项。当前消息平台的 AppID。如何获取请参考对应平台接入文档。", + }, + "secret": { + "description": "secret", + "type": "string", + "hint": "必填项。", + "secret": True, + }, + "enable_group_c2c": { + "description": "启用消息列表单聊", + "type": "bool", + "hint": "启用后,机器人可以接收到 QQ 消息列表中的私聊消息。你可能需要在 QQ 机器人平台上通过扫描二维码的方式添加机器人为你的好友。详见文档。", + }, + "enable_guild_direct_message": { + "description": "启用频道私聊", + "type": "bool", + "hint": "启用后,机器人可以接收到频道的私聊消息。", + }, + "use_markdown": { + "description": "主动消息使用 Markdown", + "type": "bool", + "hint": "启用后,机器人主动发送消息默认以 Markdown 模式发送;插件显式调用 use_markdown() 指定行为时不受此配置影响。", + }, + "ws_reverse_host": { + "description": "反向 Websocket 主机", + "type": "string", + "hint": "AstrBot 将作为服务器端。", + }, + "ws_reverse_port": { + "description": "反向 Websocket 端口", + "type": "int", + }, + "ws_reverse_token": { + "description": "反向 Websocket Token", + "type": "string", + "hint": "反向 Websocket Token。未设置则不启用 Token 验证。", + "secret": True, + }, + "wecom_ai_bot_name": { + "description": "企业微信智能机器人的名字", + "type": "string", + "hint": "请务必填写正确,否则无法使用一些指令。", + }, + "wecom_ai_bot_connection_mode": { + "description": "企业微信智能机器人连接模式", + "type": "string", + "options": ["webhook", "long_connection"], + "labels": ["Webhook 回调", "长连接"], + "hint": "Webhook 回调模式需要配置 Token/EncodingAESKey。长连接模式需要配置 BotID/Secret。", + }, + "wecomaibot_init_respond_text": { + "description": "企业微信智能机器人初始响应文本", + "type": "string", + "hint": "当机器人收到消息时,首先回复的文本内容。留空则不设置。", + }, + "wecomaibot_friend_message_welcome_text": { + "description": "企业微信智能机器人私聊欢迎语", + "type": "string", + "hint": "当用户当天进入智能机器人单聊会话,回复欢迎语,留空则不回复。", + }, + "wecomaibot_token": { + "description": "企业微信智能机器人 Token", + "type": "string", + "hint": "用于 Webhook 回调模式的身份验证。", + "secret": True, + "condition": { + "wecom_ai_bot_connection_mode": "webhook", + }, + }, + "wecomaibot_encoding_aes_key": { + "description": "企业微信智能机器人 EncodingAESKey", + "type": "string", + "hint": "用于 Webhook 回调模式的消息加密解密。", + "secret": True, + "condition": { + "wecom_ai_bot_connection_mode": "webhook", + }, + }, + "msg_push_webhook_url": { + "description": "企业微信消息推送 Webhook URL", + "type": "string", + "hint": "用于 send_by_session 主动消息推送。格式示例: https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=xxx", + "secret": True, + }, + "only_use_webhook_url_to_send": { + "description": "仅使用 Webhook 发送消息", + "type": "bool", + "hint": "启用后,企业微信智能机器人的所有回复都改为通过消息推送 Webhook 发送。消息推送 Webhook 支持更多的消息类型(如图片、文件等)。", + }, + "wecomaibot_ws_bot_id": { + "description": "长连接 BotID", + "type": "string", + "hint": "企业微信智能机器人长连接模式凭证 BotID。", + "condition": { + "wecom_ai_bot_connection_mode": "long_connection", + }, + }, + "wecomaibot_ws_secret": { + "description": "长连接 Secret", + "type": "string", + "hint": "企业微信智能机器人长连接模式凭证 Secret。", + "secret": True, + "condition": { + "wecom_ai_bot_connection_mode": "long_connection", + }, + }, + "wecomaibot_ws_url": { + "description": "长连接 WebSocket 地址", + "type": "string", + "invisible": True, + "hint": "默认值为 wss://openws.work.weixin.qq.com,一般无需修改。", + "condition": { + "wecom_ai_bot_connection_mode": "long_connection", + }, + }, + "wecomaibot_heartbeat_interval": { + "description": "长连接心跳间隔", + "type": "int", + "invisible": True, + "hint": "长连接模式心跳间隔(秒),建议 30 秒。", + "condition": { + "wecom_ai_bot_connection_mode": "long_connection", + }, + }, + "discord_token": { + "description": "Discord Bot Token", + "type": "string", + "hint": "在此处填入你的Discord Bot Token", + "secret": True, + }, + "discord_proxy": { + "description": "Discord 代理地址", + "type": "string", + "hint": "可选的代理地址:http://ip:port", + }, + "discord_command_register": { + "description": "注册 Discord 指令", + "hint": "启用后,自动将插件指令注册为 Discord 斜杠指令", + "type": "bool", + }, + "discord_activity_name": { + "description": "Discord 活动名称", + "type": "string", + "hint": "可选的 Discord 活动名称。留空则不设置活动。", + }, + "discord_allow_bot_messages": { + "description": "允许接收机器人消息", + "type": "bool", + "hint": "启用后,AstrBot 将接收来自其他 Discord 机器人的消息。适用于机器人间通信场景(如消息转发)。默认关闭。", + }, + "port": { + "description": "回调服务器端口", + "type": "int", + "hint": "回调服务器端口。留空则不启用回调服务器。", + "condition": { + "unified_webhook_mode": False, + }, + }, + "callback_server_host": { + "description": "回调服务器主机", + "type": "string", + "hint": "回调服务器主机。留空则不启用回调服务器。", + "condition": { + "unified_webhook_mode": False, + }, + }, + "unified_webhook_mode": { + "description": "统一 Webhook 模式", + "type": "bool", + "hint": "Webhook 模式下使用 AstrBot 统一 Webhook 入口,无需单独开启端口。回调地址为 /api/platform/webhook/{webhook_uuid}。", + }, + **PERSONAL_WECHAT_CONFIG_METADATA, + "webhook_uuid": { + "invisible": True, + "description": "Webhook UUID", + "type": "string", + "hint": "统一 Webhook 模式下的唯一标识符,创建平台时自动生成。", + }, + "kook_bot_token": { + "description": "机器人 Token", + "type": "string", + "hint": "必填项。从 KOOK 开发者平台获取的机器人 Token。", + "secret": True, + }, + "kook_reconnect_delay": { + "description": "重连延迟", + "type": "int", + "hint": "重连延迟时间(秒),使用指数退避策略。", + }, + "kook_max_reconnect_delay": { + "description": "最大重连延迟", + "type": "int", + "hint": "重连延迟的最大值(秒)。", + }, + "kook_max_retry_delay": { + "description": "最大重试延迟", + "type": "int", + "hint": "重试的最大延迟时间(秒)。", + }, + "kook_heartbeat_interval": { + "description": "心跳间隔", + "type": "int", + "hint": "心跳检测间隔时间(秒)。", + }, + "kook_heartbeat_timeout": { + "description": "心跳超时时间", + "type": "int", + "hint": "心跳检测超时时间(秒)。", + }, + "kook_max_heartbeat_failures": { + "description": "最大心跳失败次数", + "type": "int", + "hint": "允许的最大心跳失败次数,超过后断开连接。", + }, + "kook_max_consecutive_failures": { + "description": "最大连续失败次数", + "type": "int", + "hint": "允许的最大连续失败次数,超过后停止重试。", + }, + }, + }, + "platform_settings": { + "type": "object", + "items": { + "unique_session": { + "type": "bool", + }, + "rate_limit": { + "type": "object", + "items": { + "time": {"type": "int"}, + "count": {"type": "int"}, + "strategy": { + "type": "string", + "options": ["stall", "discard"], + }, + }, + }, + "no_permission_reply": { + "type": "bool", + "hint": "启用后,当用户没有权限执行某个操作时,机器人会回复一条消息。", + }, + "empty_mention_waiting": { + "type": "bool", + "hint": "启用后,当消息内容只有 @ 机器人时,会触发等待,在 60 秒内的该用户的任意一条消息均会唤醒机器人。这在某些平台不支持 @ 和语音/图片等消息同时发送时特别有用。", + }, + "empty_mention_waiting_need_reply": { + "type": "bool", + "hint": "在上面一个配置项中,如果启用了触发等待,启用此项后,机器人会使用 LLM 生成一条回复。否则,将不回复而只是等待。", + }, + "friend_message_needs_wake_prefix": { + "type": "bool", + "hint": "启用后,私聊消息需要唤醒前缀才会被处理,同群聊一样。", + }, + "ignore_bot_self_message": { + "type": "bool", + "hint": "某些平台会将自身账号在其他 APP 端发送的消息也当做消息事件下发导致给自己发消息时唤醒机器人", + }, + "ignore_at_all": { + "type": "bool", + "hint": "启用后,机器人会忽略 @ 全体成员 的消息事件。", + }, + "segmented_reply": { + "type": "object", + "items": { + "enable": { + "type": "bool", + }, + "only_llm_result": { + "type": "bool", + }, + "interval_method": { + "type": "string", + "options": ["random", "log"], + }, + "interval": { + "type": "string", + }, + "log_base": { + "type": "float", + }, + "words_count_threshold": { + "type": "int", + }, + "regex": { + "type": "string", + }, + "content_cleanup_rule": { + "type": "string", + }, + }, + }, + "reply_prefix": { + "type": "string", + "hint": "机器人回复消息时带有的前缀。", + }, + "forward_threshold": { + "type": "int", + "hint": "超过一定字数后,机器人会将消息折叠成 QQ 群聊的 “转发消息”,以防止刷屏。目前仅 QQ 平台适配器适用。", + }, + "enable_id_white_list": { + "type": "bool", + }, + "id_whitelist": { + "type": "list", + "_special": "umo", + "items": {"type": "string"}, + "hint": "只处理填写的 ID 发来的消息事件,为空时不启用。可使用 /sid 指令获取在平台上的会话 ID(类似 abc:GroupMessage:123)。管理员可在 WebUI 的配置文件 -> 访问控制 -> 白名单中管理白名单。", + }, + "id_whitelist_log": { + "type": "bool", + "hint": "启用后,当一条消息没通过白名单时,会输出 INFO 级别的日志。", + }, + "wl_ignore_admin_on_group": { + "type": "bool", + }, + "wl_ignore_admin_on_friend": { + "type": "bool", + }, + "reply_with_mention": { + "type": "bool", + "hint": "启用后,机器人回复消息时会 @ 发送者。实际效果以具体的平台适配器为准。", + }, + "reply_with_quote": { + "type": "bool", + "hint": "启用后,机器人回复消息时会引用原消息。实际效果以具体的平台适配器为准。", + }, + "path_mapping": { + "type": "list", + "items": {"type": "string"}, + "hint": "此功能解决由于文件系统不一致导致路径不存在的问题。格式为 <原路径>:<映射路径>。如 `/app/.config/QQ:/var/lib/docker/volumes/xxxx/_data`。这样,当消息平台下发的事件中图片和语音路径以 `/app/.config/QQ` 开头时,开头被替换为 `/var/lib/docker/volumes/xxxx/_data`。这在 AstrBot 或者平台协议端使用 Docker 部署时特别有用。", + }, + }, + }, + "content_safety": { + "type": "object", + "items": { + "also_use_in_response": { + "type": "bool", + "hint": "启用后,大模型的响应也会通过内容安全审核。", + }, + "baidu_aip": { + "type": "object", + "items": { + "enable": { + "type": "bool", + "hint": "启用此功能前,您需要手动在设备中安装 baidu-aip 库。一般来说,安装指令如下: `pip3 install baidu-aip`", + }, + "app_id": {"description": "APP ID", "type": "string"}, + "api_key": { + "description": "API Key", + "type": "string", + "secret": True, + }, + "secret_key": { + "type": "string", + "secret": True, + }, + }, + }, + "internal_keywords": { + "type": "object", + "items": { + "enable": { + "type": "bool", + }, + "extra_keywords": { + "type": "list", + "items": {"type": "string"}, + "hint": "额外的屏蔽关键词列表,支持正则表达式。", + }, + }, + }, + }, + }, + }, + }, + "provider_group": { + "name": "服务提供商", + "metadata": { + "provider": { + "type": "list", + # provider sources templates + "config_template": { + "OpenAI Compatible": { + "id": "openai", + "provider": "openai", + "type": "openai_chat_completion", + "provider_type": "chat_completion", + "enable": True, + "key": [], + "api_base": "https://api.openai.com/v1", + "timeout": 120, + "proxy": "", + "custom_headers": {}, + }, + "OpenAI Responses": { + "id": "openai-responses", + "provider": "openai", + "type": "openai_responses", + "provider_type": "chat_completion", + "enable": True, + "key": [], + "api_base": "https://api.openai.com/v1", + "timeout": 120, + "proxy": "", + "custom_headers": {}, + }, + "Google Gemini": { + "id": "google_gemini", + "provider": "google", + "type": "googlegenai_chat_completion", + "provider_type": "chat_completion", + "enable": True, + "key": [], + "api_base": "https://generativelanguage.googleapis.com/", + "timeout": 120, + "gm_resp_image_modal": False, + "gm_native_search": False, + "gm_native_coderunner": False, + "gm_url_context": False, + "gm_safety_settings": { + "harassment": "BLOCK_MEDIUM_AND_ABOVE", + "hate_speech": "BLOCK_MEDIUM_AND_ABOVE", + "sexually_explicit": "BLOCK_MEDIUM_AND_ABOVE", + "dangerous_content": "BLOCK_MEDIUM_AND_ABOVE", + }, + "gm_thinking_config": {"budget": 0, "level": "HIGH"}, + "proxy": "", + }, + "Anthropic": { + "id": "anthropic", + "provider": "anthropic", + "type": "anthropic_chat_completion", + "provider_type": "chat_completion", + "enable": True, + "key": [], + "api_base": "https://api.anthropic.com", + "timeout": 120, + "proxy": "", + "custom_headers": {}, + "anth_thinking_config": {"type": "", "budget": 0, "effort": ""}, + }, + "Kimi Coding Plan": { + "id": "kimi-code", + "provider": "kimi-code", + "type": "kimi_code_chat_completion", + "provider_type": "chat_completion", + "enable": True, + "key": [], + "api_base": "https://api.kimi.com/coding", + "timeout": 120, + "proxy": "", + "custom_headers": {}, + "anth_thinking_config": {"type": "", "budget": 0, "effort": ""}, + }, + "Moonshot": { + "id": "moonshot", + "provider": "moonshot", + "type": "openai_chat_completion", + "provider_type": "chat_completion", + "enable": True, + "key": [], + "timeout": 120, + "api_base": "https://api.moonshot.cn/v1", + "proxy": "", + "custom_headers": {}, + }, + "MiniMax": { + "id": "minimax", + "provider": "minimax", + "type": "openai_chat_completion", + "provider_type": "chat_completion", + "enable": True, + "key": [], + "api_base": "https://api.minimaxi.com/v1", + "timeout": 120, + "proxy": "", + "custom_headers": {}, + }, + "MiniMax Token Plan": { + "id": "minimax-token-plan", + "provider": "minimax-token-plan", + "type": "minimax_token_plan", + "provider_type": "chat_completion", + "enable": True, + "key": [], + "api_base": "https://api.minimaxi.com/anthropic", + "timeout": 120, + "proxy": "", + "custom_headers": {}, + "anth_thinking_config": {"type": "", "budget": 0, "effort": ""}, + }, + "Xiaomi": { + "id": "xiaomi", + "provider": "xiaomi", + "type": "xiaomi_chat_completion", + "provider_type": "chat_completion", + "enable": True, + "key": [], + "api_base": "https://api.xiaomimimo.com/v1", + "timeout": 120, + "proxy": "", + "custom_headers": {}, + }, + "Xiaomi Token Plan": { + "id": "xiaomi-token-plan", + "provider": "xiaomi-token-plan", + "type": "xiaomi_token_plan", + "provider_type": "chat_completion", + "enable": True, + "key": [], + "api_base": "https://token-plan-cn.xiaomimimo.com/anthropic", + "timeout": 120, + "proxy": "", + "custom_headers": {}, + "anth_thinking_config": {"type": "", "budget": 0, "effort": ""}, + }, + "xAI": { + "id": "xai", + "provider": "xai", + "type": "openai_responses", + "provider_type": "chat_completion", + "enable": True, + "key": [], + "api_base": "https://api.x.ai/v1", + "timeout": 120, + "proxy": "", + "custom_headers": {}, + }, + "DeepSeek": { + "id": "deepseek", + "provider": "deepseek", + "type": "openai_chat_completion", + "provider_type": "chat_completion", + "enable": True, + "key": [], + "api_base": "https://api.deepseek.com/v1", + "timeout": 120, + "proxy": "", + "custom_headers": {}, + }, + "DeepSeek Responses": { + "id": "deepseek-responses", + "provider": "deepseek", + "type": "openai_responses", + "provider_type": "chat_completion", + "enable": True, + "key": [], + "api_base": "https://api.deepseek.com/v1", + "timeout": 120, + "proxy": "", + "custom_headers": {}, + }, + "Zhipu": { + "id": "zhipu", + "provider": "zhipu", + "type": "zhipu_chat_completion", + "provider_type": "chat_completion", + "enable": True, + "key": [], + "timeout": 120, + "api_base": "https://open.bigmodel.cn/api/paas/v4/", + "proxy": "", + "custom_headers": {}, + }, + "LongCat": { + "id": "longcat", + "provider": "longcat", + "type": "longcat_chat_completion", + "provider_type": "chat_completion", + "enable": True, + "key": [], + "api_base": "https://api.longcat.chat/openai", + "timeout": 120, + "proxy": "", + "custom_headers": {}, + }, + "AIHubMix": { + "id": "aihubmix", + "provider": "aihubmix", + "type": "aihubmix_chat_completion", + "provider_type": "chat_completion", + "enable": True, + "key": [], + "timeout": 120, + "api_base": "https://aihubmix.com/v1", + "proxy": "", + "custom_headers": {}, + }, + "MiraRouter": { + "id": "mirarouter", + "provider": "mirarouter", + "type": "mirarouter_chat_completion", + "provider_type": "chat_completion", + "enable": True, + "key": [], + "timeout": 120, + "api_base": "https://api.mirarouter.com/v1", + "proxy": "", + "custom_headers": {}, + }, + "OpenRouter": { + "id": "openrouter", + "provider": "openrouter", + "type": "openrouter_chat_completion", + "provider_type": "chat_completion", + "enable": True, + "key": [], + "timeout": 120, + "api_base": "https://openrouter.ai/api/v1", + "proxy": "", + "custom_headers": {}, + }, + "SSYCloud(胜算云)": { + "id": "ssycloud", + "provider": "ssycloud", + "type": "ssycloud_chat_completion", + "provider_type": "chat_completion", + "enable": True, + "key": [], + "timeout": 120, + "api_base": "https://router.shengsuanyun.com/api/v1", + "proxy": "", + "custom_headers": {"X-Title": "AstrBot"}, + }, + "NVIDIA": { + "id": "nvidia", + "provider": "nvidia", + "type": "openai_chat_completion", + "provider_type": "chat_completion", + "enable": True, + "key": [], + "api_base": "https://integrate.api.nvidia.com/v1", + "timeout": 120, + "proxy": "", + "custom_headers": {}, + }, + "Azure OpenAI": { + "id": "azure_openai", + "provider": "azure", + "type": "openai_chat_completion", + "provider_type": "chat_completion", + "enable": True, + "api_version": "2024-05-01-preview", + "key": [], + "api_base": "", + "timeout": 120, + "proxy": "", + "custom_headers": {}, + }, + "Ollama": { + "id": "ollama", + "provider": "ollama", + "type": "openai_chat_completion", + "provider_type": "chat_completion", + "enable": True, + "key": ["ollama"], # ollama 的 key 默认是 ollama + "api_base": "http://127.0.0.1:11434/v1", + "proxy": "", + "custom_headers": {}, + "ollama_disable_thinking": False, + }, + "LM Studio": { + "id": "lm_studio", + "provider": "lm_studio", + "type": "openai_chat_completion", + "provider_type": "chat_completion", + "enable": True, + "key": ["lmstudio"], + "api_base": "http://127.0.0.1:1234/v1", + "proxy": "", + "custom_headers": {}, + }, + "Gemini_OpenAI_API": { + "id": "google_gemini_openai", + "provider": "google", + "type": "openai_chat_completion", + "provider_type": "chat_completion", + "enable": True, + "key": [], + "api_base": "https://generativelanguage.googleapis.com/v1beta/openai/", + "timeout": 120, + "proxy": "", + "custom_headers": {}, + }, + "Groq": { + "id": "groq", + "provider": "groq", + "type": "groq_chat_completion", + "provider_type": "chat_completion", + "enable": True, + "key": [], + "api_base": "https://api.groq.com/openai/v1", + "timeout": 120, + "proxy": "", + "custom_headers": {}, + }, + "302.AI": { + "id": "302ai", + "provider": "302ai", + "type": "openai_chat_completion", + "provider_type": "chat_completion", + "enable": True, + "key": [], + "api_base": "https://api.302.ai/v1", + "timeout": 120, + "proxy": "", + "custom_headers": {}, + }, + "SiliconFlow": { + "id": "siliconflow", + "provider": "siliconflow", + "type": "openai_chat_completion", + "provider_type": "chat_completion", + "enable": True, + "key": [], + "timeout": 120, + "api_base": "https://api.siliconflow.cn/v1", + "proxy": "", + "custom_headers": {}, + }, + "PPIO": { + "id": "ppio", + "provider": "ppio", + "type": "openai_chat_completion", + "provider_type": "chat_completion", + "enable": True, + "key": [], + "api_base": "https://api.ppinfra.com/v3/openai", + "timeout": 120, + "proxy": "", + "custom_headers": {}, + }, + "TokenPony": { + "id": "tokenpony", + "provider": "tokenpony", + "type": "openai_chat_completion", + "provider_type": "chat_completion", + "enable": True, + "key": [], + "api_base": "https://api.tokenpony.cn/v1", + "timeout": 120, + "proxy": "", + "custom_headers": {}, + }, + "Compshare": { + "id": "compshare", + "provider": "compshare", + "type": "openai_chat_completion", + "provider_type": "chat_completion", + "enable": True, + "key": [], + "api_base": "https://api.modelverse.cn/v1", + "timeout": 120, + "proxy": "", + "custom_headers": {}, + }, + "ModelScope": { + "id": "modelscope", + "provider": "modelscope", + "type": "openai_chat_completion", + "provider_type": "chat_completion", + "enable": True, + "key": [], + "timeout": 120, + "api_base": "https://api-inference.modelscope.cn/v1", + "proxy": "", + "custom_headers": {}, + }, + "FastGPT": { + "id": "fastgpt", + "provider": "fastgpt", + "type": "openai_chat_completion", + "provider_type": "chat_completion", + "enable": True, + "key": [], + "api_base": "https://api.fastgpt.in/api/v1", + "timeout": 60, + "proxy": "", + "custom_headers": {}, + "custom_extra_body": {}, + }, + "Whisper(API)": { + "id": "whisper", + "provider": "openai", + "type": "openai_whisper_api", + "provider_type": "speech_to_text", + "enable": False, + "api_key": "", + "api_base": "", + "model": "whisper-1", + "proxy": "", + }, + "MiMo STT(API)": { + "id": "mimo_stt", + "provider": "mimo", + "type": "mimo_stt_api", + "provider_type": "speech_to_text", + "enable": False, + "api_key": "", + "api_base": "https://api.xiaomimimo.com/v1", + "model": "mimo-v2.5-asr", + "timeout": "20", + "proxy": "", + }, + "Whisper(Local)": { + "provider": "openai", + "type": "openai_whisper_selfhost", + "provider_type": "speech_to_text", + "enable": False, + "id": "whisper_selfhost", + "model": "tiny", + "whisper_device": "cpu", + }, + "SenseVoice(Local)": { + "type": "sensevoice_stt_selfhost", + "provider": "sensevoice", + "provider_type": "speech_to_text", + "enable": False, + "id": "sensevoice", + "stt_model": "iic/SenseVoiceSmall", + "is_emotion": False, + }, + "OpenAI TTS(API)": { + "id": "openai_tts", + "type": "openai_tts_api", + "provider": "openai", + "provider_type": "text_to_speech", + "enable": False, + "api_key": "", + "api_base": "", + "model": "tts-1", + "openai-tts-voice": "alloy", + "timeout": "20", + "proxy": "", + }, + "MiMo TTS(API)": { + "id": "mimo_tts", + "type": "mimo_tts_api", + "provider": "mimo", + "provider_type": "text_to_speech", + "enable": False, + "api_key": "", + "api_base": "https://api.xiaomimimo.com/v1", + "model": "mimo-v2.5-tts", + "mimo-tts-voice": "mimo_default", + "mimo-tts-format": "wav", + "mimo-tts-style-prompt": "", + "mimo-tts-dialect": "", + "mimo-tts-seed-text": "Hello, MiMo, have you had lunch?", + "timeout": "20", + "proxy": "", + }, + "Genie TTS": { + "id": "genie_tts", + "provider": "genie_tts", + "type": "genie_tts", + "provider_type": "text_to_speech", + "enable": False, + "genie_character_name": "mika", + "genie_onnx_model_dir": "CharacterModels/v2ProPlus/mika/tts_models", + "genie_language": "Japanese", + "genie_refer_audio_path": "", + "genie_refer_text": "", + "timeout": 20, + }, + "Edge TTS": { + "id": "edge_tts", + "provider": "microsoft", + "type": "edge_tts", + "provider_type": "text_to_speech", + "enable": False, + "edge-tts-voice": "zh-CN-XiaoxiaoNeural", + "rate": "+0%", + "volume": "+0%", + "pitch": "+0Hz", + "timeout": 20, + }, + "GSV TTS(Local)": { + "id": "gsv_tts", + "enable": False, + "provider": "gpt_sovits", + "type": "gsv_tts_selfhost", + "provider_type": "text_to_speech", + "api_base": "http://127.0.0.1:9880", + "gpt_weights_path": "", + "sovits_weights_path": "", + "timeout": 60, + "gsv_default_parms": { + "gsv_ref_audio_path": "", + "gsv_prompt_text": "", + "gsv_prompt_lang": "zh", + "gsv_aux_ref_audio_paths": "", + "gsv_text_lang": "zh", + "gsv_top_k": 5, + "gsv_top_p": 1.0, + "gsv_temperature": 1.0, + "gsv_text_split_method": "cut3", + "gsv_batch_size": 1, + "gsv_batch_threshold": 0.75, + "gsv_split_bucket": True, + "gsv_speed_factor": 1, + "gsv_fragment_interval": 0.3, + "gsv_streaming_mode": False, + "gsv_seed": -1, + "gsv_parallel_infer": True, + "gsv_repetition_penalty": 1.35, + "gsv_media_type": "wav", + }, + }, + "GSVI TTS(API)": { + "id": "gsvi_tts", + "type": "gsvi_tts_api", + "provider": "gpt_sovits_inference", + "provider_type": "text_to_speech", + "enable": False, + "api_key": "", + "api_base": "http://127.0.0.1:8000", + "version": "v4", + "character": "", + "prompt_text_lang": "中文", + "emotion": "默认", + "text_lang": "中文", + "timeout": 20, + }, + "FishAudio TTS(API)": { + "id": "fishaudio_tts", + "provider": "fishaudio", + "type": "fishaudio_tts_api", + "provider_type": "text_to_speech", + "enable": False, + "api_key": "", + "api_base": "https://api.fish.audio/v1", + "model": "s2-pro", + "fishaudio-tts-character": "可莉", + "fishaudio-tts-reference-id": "", + "timeout": "20", + "proxy": "", + }, + "阿里云百炼 TTS(API)": { + "hint": "API Key 从 https://bailian.console.aliyun.com/?tab=model#/api-key 获取。模型和音色的选择文档请参考: 阿里云百炼语音合成音色名称。具体可参考 https://help.aliyun.com/zh/model-studio/speech-synthesis-and-speech-recognition", + "id": "dashscope_tts", + "provider": "dashscope", + "type": "dashscope_tts", + "provider_type": "text_to_speech", + "enable": False, + "api_key": "", + "model": "cosyvoice-v1", + "dashscope_tts_voice": "loongstella", + "timeout": "20", + }, + "Azure TTS": { + "id": "azure_tts", + "type": "azure_tts", + "provider": "azure", + "provider_type": "text_to_speech", + "enable": True, + "azure_tts_voice": "zh-CN-YunxiaNeural", + "azure_tts_style": "cheerful", + "azure_tts_role": "Boy", + "azure_tts_rate": "1", + "azure_tts_volume": "100", + "azure_tts_subscription_key": "", + "azure_tts_region": "eastus", + "proxy": "", + }, + "MiniMax TTS(API)": { + "id": "minimax_tts", + "type": "minimax_tts_api", + "provider": "minimax", + "provider_type": "text_to_speech", + "enable": False, + "api_key": "", + "api_base": "https://api.minimax.chat/v1/t2a_v2", + "minimax-group-id": "", + "model": "speech-02-turbo", + "minimax-langboost": "auto", + "minimax-voice-speed": 1.0, + "minimax-voice-vol": 1.0, + "minimax-voice-pitch": 0, + "minimax-is-timber-weight": False, + "minimax-voice-id": "female-shaonv", + "minimax-timber-weight": '[\n {\n "voice_id": "Chinese (Mandarin)_Warm_Girl",\n "weight": 25\n },\n {\n "voice_id": "Chinese (Mandarin)_BashfulGirl",\n "weight": 50\n }\n]', + "minimax-voice-emotion": "auto", + "minimax-voice-latex": False, + "minimax-voice-english-normalization": False, + "timeout": 20, + "proxy": "", + }, + "火山引擎_TTS(API)": { + "id": "volcengine_tts", + "type": "volcengine_tts", + "provider": "volcengine", + "provider_type": "text_to_speech", + "enable": False, + "api_key": "", + "appid": "", + "volcengine_cluster": "volcano_tts", + "volcengine_voice_type": "", + "volcengine_speed_ratio": 1.0, + "api_base": "https://openspeech.bytedance.com/api/v1/tts", + "timeout": 20, + "proxy": "", + }, + "Gemini TTS": { + "id": "gemini_tts", + "type": "gemini_tts", + "provider": "google", + "provider_type": "text_to_speech", + "enable": False, + "gemini_tts_api_key": "", + "gemini_tts_api_base": "", + "gemini_tts_timeout": 20, + "gemini_tts_model": "gemini-3.8-flash-tts", + "gemini_tts_prefix": "", + "gemini_tts_voice_name": "Leda", + "proxy": "", + }, + "ElevenLabs TTS(API)": { + "hint": "API Key 从 https://elevenlabs.io/app/settings/api-keys 获取。Voice ID 可在 https://elevenlabs.io/app/voice-library 浏览选择。", + "id": "elevenlabs_tts", + "type": "elevenlabs_tts_api", + "provider": "elevenlabs", + "provider_type": "text_to_speech", + "enable": False, + "api_key": "", + "api_base": "https://api.elevenlabs.io/v1", + "model": "eleven_multilingual_v2", + "elevenlabs-tts-voice-id": "JBFqnCBsd6RMkjVDRZzb", + "elevenlabs-tts-output-format": "mp3_44100_128", + "elevenlabs-tts-stability": "", + "elevenlabs-tts-similarity-boost": "", + "elevenlabs-tts-style": "", + "elevenlabs-tts-use-speaker-boost": True, + "timeout": "20", + "proxy": "", + }, + "OpenAI Embedding": { + "id": "openai_embedding", + "type": "openai_embedding", + "provider": "openai", + "provider_type": "embedding", + "hint": "provider_group.provider.openai_embedding.hint", + "enable": True, + "embedding_api_key": "", + "embedding_api_base": "", + "embedding_model": "", + "embedding_dimensions": 1024, + "embedding_dimensions_mode": "auto", + "timeout": 20, + "proxy": "", + }, + "Gemini Embedding": { + "id": "gemini_embedding", + "type": "gemini_embedding", + "provider": "google", + "provider_type": "embedding", + "hint": "provider_group.provider.gemini_embedding.hint", + "enable": True, + "embedding_api_key": "", + "embedding_api_base": "", + "embedding_model": "gemini-embedding-001", + "embedding_dimensions": 768, + "embedding_task_type_mode": "auto", + "embedding_query_task_type": "RETRIEVAL_QUERY", + "embedding_document_task_type": "RETRIEVAL_DOCUMENT", + "embedding_query_task_name": "search result", + "embedding_document_title": "", + "timeout": 20, + "proxy": "", + }, + "NVIDIA Embedding": { + "id": "nvidia_embedding", + "type": "nvidia_embedding", + "provider": "nvidia", + "provider_type": "embedding", + "hint": "provider_group.provider.nvidia_embedding.hint", + "enable": True, + "embedding_api_key": "", + "embedding_api_base": "https://integrate.api.nvidia.com/v1", + "embedding_model": "nvidia/nemotron-3-embed-1b", + "input_type": "passage", + "embedding_dimensions": 2048, + "timeout": 20, + "proxy": "", + }, + "Ollama Embedding": { + "id": "ollama_embedding", + "type": "ollama_embedding", + "provider": "ollama", + "provider_type": "embedding", + "hint": "provider_group.provider.ollama_embedding.hint", + "enable": True, + "embedding_api_base": "http://localhost:11434", + "embedding_model": "nomic-embed-text", + "embedding_dimensions": 768, + "timeout": 60, + "proxy": "", + }, + "DashScope Embedding": { + "id": "dashscope_embedding", + "type": "dashscope_embedding", + "provider": "dashscope", + "provider_type": "embedding", + "hint": "provider_group.provider.dashscope_embedding.hint", + "enable": True, + "embedding_api_key": "", + "embedding_api_base": "https://dashscope.aliyuncs.com/api/v1", + "embedding_model": "text-embedding-v4", + "embedding_dimensions": 1024, + "timeout": 60, + "proxy": "", + }, + "vLLM Rerank": { + "id": "vllm_rerank", + "type": "vllm_rerank", + "provider": "vllm", + "provider_type": "rerank", + "enable": True, + "rerank_api_key": "", + "rerank_api_base": "http://127.0.0.1:8000", + "rerank_api_suffix": "/v1/rerank", + "rerank_model": "BAAI/bge-reranker-base", + "timeout": 20, + }, + "Xinference Rerank": { + "id": "xinference_rerank", + "type": "xinference_rerank", + "provider": "xinference", + "provider_type": "rerank", + "enable": True, + "rerank_api_key": "", + "rerank_api_base": "http://127.0.0.1:9997", + "rerank_model": "BAAI/bge-reranker-base", + "timeout": 20, + "launch_model_if_not_running": False, + }, + "阿里云百炼重排序": { + "id": "bailian_rerank", + "type": "bailian_rerank", + "provider": "bailian", + "provider_type": "rerank", + "enable": True, + "rerank_api_key": "", + "rerank_api_base": "https://dashscope.aliyuncs.com/api/v1/services/rerank/text-rerank/text-rerank", + "rerank_model": "qwen3-rerank", + "timeout": 30, + "return_documents": False, + "instruct": "", + }, + "NVIDIA Rerank": { + "id": "nvidia_rerank", + "type": "nvidia_rerank", + "provider": "nvidia", + "provider_type": "rerank", + "enable": True, + "nvidia_rerank_api_key": "", + "nvidia_rerank_api_base": "https://ai.api.nvidia.com/v1/retrieval", + "nvidia_rerank_model": "nvidia/llama-nemotron-rerank-vl-1b-v2", + "nvidia_rerank_model_endpoint": "/reranking", + "timeout": 20, + "nvidia_rerank_truncate": "", + }, + "TEI Rerank": { + "id": "tei_rerank", + "type": "tei_rerank", + "provider": "huggingface", + "provider_type": "rerank", + "enable": True, + "rerank_api_key": "", + "rerank_api_base": "http://127.0.0.1:8080", + "timeout": 20, + "tei_rerank_truncate": False, + "tei_rerank_truncation_direction": "Right", + "tei_rerank_raw_scores": False, + "tei_rerank_return_text": False, + }, + "TypeSafe System One": { + "id": "typesafe_decision", + "type": "system_one_decision", + "provider": "typesafe", + "provider_type": "decision", + "enable": True, + "key": "", + "api_base": "https://api.typesafe.ai/v1/systemone", + "model": "jev-latest", + "timeout": 2, + "total_timeout": 5, + "max_concurrency": 4, + "proxy": "", + "custom_headers": {}, + }, + "OpenRouter System One": { + "id": "openrouter_decision", + "type": "system_one_decision", + "provider": "openrouter", + "provider_type": "decision", + "enable": True, + "key": "", + "api_base": "https://openrouter.ai/api/v1/systemone", + "model": "jev-latest", + "timeout": 2, + "total_timeout": 5, + "max_concurrency": 4, + "proxy": "", + "custom_headers": {}, + }, + "Vercel System One": { + "id": "vercel_decision", + "type": "system_one_decision", + "provider": "vercel", + "provider_type": "decision", + "enable": True, + "key": "", + "api_base": "https://ai-gateway.vercel.sh/typesafe/v1/systemone", + "model": "typesafe-ai/jev", + "timeout": 2, + "total_timeout": 5, + "max_concurrency": 4, + "proxy": "", + "custom_headers": {}, + }, + "Custom System One": { + "id": "custom_decision", + "type": "system_one_decision", + "provider": "custom", + "provider_type": "decision", + "enable": True, + "key": "", + "api_base": "", + "model": "", + "timeout": 2, + "total_timeout": 5, + "max_concurrency": 4, + "proxy": "", + "custom_headers": {}, + }, + "Xinference STT": { + "id": "xinference_stt", + "type": "xinference_stt", + "provider": "xinference", + "provider_type": "speech_to_text", + "enable": False, + "api_key": "", + "api_base": "http://127.0.0.1:9997", + "model": "whisper-large-v3", + "timeout": 180, + "launch_model_if_not_running": False, + }, + }, + "items": { + "genie_onnx_model_dir": { + "description": "ONNX Model Directory", + "type": "string", + "hint": "The directory path containing the ONNX model files", + }, + "genie_language": { + "description": "Language", + "type": "string", + "options": ["Japanese", "English", "Chinese"], + }, + "provider_source_id": { + "invisible": True, + "type": "string", + }, + "api_key": { + "description": "API Key", + "type": "string", + "secret": True, + }, + "dashscope_api_key": { + "description": "DashScope API Key", + "type": "string", + "secret": True, + }, + "gemini_tts_api_key": { + "description": "Gemini API Key", + "type": "string", + "secret": True, + }, + "xai_native_search": { + "description": "启用原生搜索功能", + "type": "bool", + "hint": "启用后,将通过 xAI 的 Chat Completions 原生 Live Search 进行联网检索(按需计费)。仅对 xAI 提供商生效。", + "condition": { + "provider": "xai", + "type": "xai_chat_completion", + }, + }, + "rerank_api_base": { + "description": "重排序模型 API Base URL", + "type": "string", + "hint": "最终请求路径由 Base URL 和路径后缀拼接而成(默认为 /v1/rerank)。", + }, + "rerank_api_suffix": { + "description": "API URL 路径后缀", + "type": "string", + "hint": "追加到 base_url 后的路径,如 /v1/rerank。留空则不追加。", + }, + "rerank_api_key": { + "description": "API Key", + "type": "string", + "hint": "如果不需要 API Key, 请留空。", + "secret": True, + }, + "rerank_model": { + "description": "重排序模型名称", + "type": "string", + }, + "return_documents": { + "description": "是否在排序结果中返回文档原文", + "type": "bool", + "hint": "默认值false,以减少网络传输开销。", + }, + "instruct": { + "description": "自定义排序任务类型说明", + "type": "string", + "hint": "仅在使用 qwen3-rerank 模型时生效。建议使用英文撰写。", + }, + "launch_model_if_not_running": { + "description": "模型未运行时自动启动", + "type": "bool", + "hint": "如果模型当前未在 Xinference 服务中运行,是否尝试自动启动它。在生产环境中建议关闭。", + }, + "nvidia_rerank_api_base": { + "description": "API Base URL", + "type": "string", + }, + "nvidia_rerank_api_key": { + "description": "API Key", + "type": "string", + "secret": True, + }, + "nvidia_rerank_model": { + "description": "重排序模型名称", + "type": "string", + "hint": "请参照NVIDIA Docs中模型名称填写。", + }, + "nvidia_rerank_model_endpoint": { + "description": "自定义模型端点", + "type": "string", + "hint": "自定义URL末尾端点,默认为 /reranking", + }, + "nvidia_rerank_truncate": { + "description": "文本截断策略", + "type": "string", + "hint": "当输入文本过长时,是否截断输入以适应模型的最大上下文长度。", + "options": [ + "", + "NONE", + "END", + ], + }, + "tei_rerank_truncate": { + "description": "截断超长文本", + "type": "bool", + "hint": "当输入超过模型最大上下文长度时,是否自动截断。启用后需配合 截断方向 使用。", + }, + "tei_rerank_truncation_direction": { + "description": "截断方向", + "type": "string", + "options": ["left", "right"], + "hint": "选择从文本的左侧(left)还是右侧(right)开始截断。仅在 截断超长文本 为 True 时生效。", + }, + "tei_rerank_raw_scores": { + "description": "返回原始分数", + "type": "bool", + "hint": "如果为 True,返回模型原始 logit 分数(可能为负值),不经过 sigmoid 归一化。默认 False。", + }, + "tei_rerank_return_text": { + "description": "返回排序结果中的文档原文", + "type": "bool", + "hint": "如果为 True,每个排序结果将附带原始文本。默认 False 以减少网络传输。", + }, + "modalities": { + "description": "模型能力", + "type": "list", + "items": {"type": "string"}, + "options": ["text", "image", "audio", "tool_use"], + "labels": ["文本", "图像", "音频", "工具使用"], + "render_type": "checkbox", + "hint": "模型支持的模态及能力。", + }, + "custom_headers": { + "description": "自定义请求头", + "type": "dict", + "items": {}, + "hint": "此处添加的键值对将作为自定义 HTTP 请求头,附加到 AstrBot 发往模型服务商的请求中。值必须为字符串。", + }, + "ollama_disable_thinking": { + "description": "关闭思考模式", + "type": "bool", + "hint": "关闭 Ollama 思考模式。", + }, + "custom_extra_body": { + "description": "自定义请求体参数", + "type": "dict", + "items": {}, + "hint": "用于在请求时添加额外的参数,如 temperature, top_p, max_tokens, reasoning_effort 等。", + "template_schema": { + "temperature": { + "name": "Temperature", + "description": "温度参数", + "hint": "控制输出的随机性,范围通常为 0-2。值越高越随机。", + "type": "float", + "default": 0.6, + "slider": {"min": 0, "max": 2, "step": 0.1}, + }, + "top_p": { + "name": "Top-p", + "description": "Top-p 采样", + "hint": "核采样参数,范围通常为 0-1。控制模型考虑的概率质量。", + "type": "float", + "default": 1.0, + "slider": {"min": 0, "max": 1, "step": 0.01}, + }, + "max_tokens": { + "name": "Max Tokens", + "description": "最大词元(Tokens)数", + "hint": "生成的最大词元(Tokens)数。", + "type": "int", + "default": 8192, + }, + "reasoning_effort": { + "name": "Reasoning Effort", + "description": "推理强度", + "hint": "控制推理模型的推理强度,支持的值取决于具体模型。", + "type": "string", + "default": "high", + }, + }, + }, + "provider": { + "type": "string", + "invisible": True, + }, + "gpt_weights_path": { + "description": "GPT模型文件路径", + "type": "string", + "hint": "即“.ckpt”后缀的文件,请使用绝对路径,路径两端不要带双引号,不填则默认用GPT_SoVITS内置的SoVITS模型(建议直接在GPT_SoVITS中改默认模型)", + }, + "sovits_weights_path": { + "description": "SoVITS模型文件路径", + "type": "string", + "hint": "即“.pth”后缀的文件,请使用绝对路径,路径两端不要带双引号,不填则默认用GPT_SoVITS内置的SoVITS模型(建议直接在GPT_SoVITS中改默认模型)", + }, + "gsv_default_parms": { + "description": "GPT_SoVITS默认参数", + "hint": "参考音频文件路径、参考音频文本必填,其他参数根据个人爱好自行填写", + "type": "object", + "items": { + "gsv_ref_audio_path": { + "description": "参考音频文件路径", + "type": "string", + "hint": "必填!请使用绝对路径!路径两端不要带双引号!", + }, + "gsv_prompt_text": { + "description": "参考音频文本", + "type": "string", + "hint": "必填!请填写参考音频讲述的文本", + }, + "gsv_prompt_lang": { + "description": "参考音频文本语言", + "type": "string", + "hint": "请填写参考音频讲述的文本的语言,默认为中文", + }, + "gsv_aux_ref_audio_paths": { + "description": "辅助参考音频文件路径", + "type": "string", + "hint": "辅助参考音频文件,可不填", + }, + "gsv_text_lang": { + "description": "文本语言", + "type": "string", + "hint": "默认为中文", + }, + "gsv_top_k": { + "description": "生成语音的多样性", + "type": "int", + "hint": "", + }, + "gsv_top_p": { + "description": "核采样的阈值", + "type": "float", + "hint": "", + }, + "gsv_temperature": { + "description": "生成语音的随机性", + "type": "float", + "hint": "", + }, + "gsv_text_split_method": { + "description": "切分文本的方法", + "type": "string", + "hint": "可选值: `cut0`:不切分 `cut1`:四句一切 `cut2`:50字一切 `cut3`:按中文句号切 `cut4`:按英文句号切 `cut5`:按标点符号切", + "options": [ + "cut0", + "cut1", + "cut2", + "cut3", + "cut4", + "cut5", + ], + }, + "gsv_batch_size": { + "description": "批处理大小", + "type": "int", + "hint": "", + }, + "gsv_batch_threshold": { + "description": "批处理阈值", + "type": "float", + "hint": "", + }, + "gsv_split_bucket": { + "description": "将文本分割成桶以便并行处理", + "type": "bool", + "hint": "", + }, + "gsv_speed_factor": { + "description": "语音播放速度", + "type": "float", + "hint": "1为原始语速", + }, + "gsv_fragment_interval": { + "description": "语音片段之间的间隔时间", + "type": "float", + "hint": "", + }, + "gsv_streaming_mode": { + "description": "启用流模式", + "type": "bool", + "hint": "", + }, + "gsv_seed": { + "description": "随机种子", + "type": "int", + "hint": "用于结果的可重复性", + }, + "gsv_parallel_infer": { + "description": "并行执行推理", + "type": "bool", + "hint": "", + }, + "gsv_repetition_penalty": { + "description": "重复惩罚因子", + "type": "float", + "hint": "", + }, + "gsv_media_type": { + "description": "输出媒体的类型", + "type": "string", + "hint": "建议用wav", + }, + }, + }, + "embedding_dimensions": { + "description": "嵌入维度", + "type": "int", + "hint": "嵌入向量的维度。根据模型不同,可能需要调整,请参考具体模型的文档。此配置项请务必填写正确,否则将导致向量数据库无法正常工作。", + "_special": "get_embedding_dim", + }, + "embedding_dimensions_mode": { + "description": "嵌入维度参数发送模式", + "type": "string", + "options": ["auto", "always", "never"], + "hint": "控制是否在 OpenAI 兼容 Embedding 请求中发送 dimensions 参数。auto 会仅对官方 OpenAI embedding-3 模型自动发送;第三方兼容 API 如需该参数可改为 always,报错时改为 never。", + }, + "embedding_model": { + "description": "嵌入模型", + "type": "string", + "hint": "嵌入模型名称。", + }, + "embedding_api_key": { + "description": "API Key", + "type": "string", + "secret": True, + }, + "embedding_api_base": { + "description": "API Base URL", + "type": "string", + }, + "volcengine_cluster": { + "type": "string", + "description": "火山引擎集群", + "hint": "若使用语音复刻大模型,可选volcano_icl或volcano_icl_concurr,默认使用volcano_tts", + }, + "volcengine_voice_type": { + "type": "string", + "description": "火山引擎音色", + "hint": "输入声音id(Voice_type)", + }, + "volcengine_speed_ratio": { + "type": "float", + "description": "语速设置", + "hint": "语速设置,范围为 0.2 到 3.0,默认值为 1.0", + }, + "volcengine_volume_ratio": { + "type": "float", + "description": "音量设置", + "hint": "音量设置,范围为 0.0 到 2.0,默认值为 1.0", + }, + "azure_tts_voice": { + "type": "string", + "description": "音色设置", + "hint": "API 音色", + }, + "azure_tts_style": { + "type": "string", + "description": "风格设置", + "hint": "声音特定的讲话风格。 可以表达快乐、同情和平静等情绪。", + }, + "azure_tts_role": { + "type": "string", + "description": "模仿设置(可选)", + "hint": "讲话角色扮演。 声音可以模仿不同的年龄和性别,但声音名称不会更改。 例如,男性语音可以提高音调和改变语调来模拟女性语音,但语音名称不会更改。 如果角色缺失或不受声音的支持,则会忽略此属性。", + "options": [ + "Boy", + "Girl", + "YoungAdultFemale", + "YoungAdultMale", + "OlderAdultFemale", + "OlderAdultMale", + "SeniorFemale", + "SeniorMale", + "禁用", + ], + }, + "azure_tts_rate": { + "type": "string", + "description": "语速设置", + "hint": "指示文本的讲出速率。可在字词或句子层面应用语速。 速率变化应为原始音频的 0.5 到 2 倍。", + }, + "azure_tts_volume": { + "type": "string", + "description": "语音音量设置", + "hint": "指示语音的音量级别。 可在句子层面应用音量的变化。以从 0.0 到 100.0(从最安静到最大声,例如 75)的数字表示。 默认值为 100.0。", + }, + "azure_tts_region": { + "type": "string", + "description": "API 地区", + "hint": "Azure_TTS 处理数据所在区域,具体参考 https://learn.microsoft.com/zh-cn/azure/ai-services/speech-service/regions", + "options": [ + "southafricanorth", + "eastasia", + "southeastasia", + "australiaeast", + "centralindia", + "japaneast", + "japanwest", + "koreacentral", + "canadacentral", + "northeurope", + "westeurope", + "francecentral", + "germanywestcentral", + "norwayeast", + "swedencentral", + "switzerlandnorth", + "switzerlandwest", + "uksouth", + "uaenorth", + "brazilsouth", + "qatarcentral", + "centralus", + "eastus", + "eastus2", + "northcentralus", + "southcentralus", + "westcentralus", + "westus", + "westus2", + "westus3", + ], + }, + "azure_tts_subscription_key": { + "type": "string", + "description": "服务订阅密钥", + "hint": "Azure_TTS 服务的订阅密钥(注意不是令牌)", + "secret": True, + }, + "dashscope_tts_voice": {"description": "音色", "type": "string"}, + "gm_resp_image_modal": { + "description": "启用图片模态", + "type": "bool", + "hint": "启用后,将支持返回图片内容。需要模型支持,否则会报错。具体支持模型请查看 Google Gemini 官方网站。温馨提示,如果您需要生成图片,请关闭 `启用群员识别` 配置获得更好的效果。", + }, + "gm_native_search": { + "description": "启用原生搜索功能", + "type": "bool", + "hint": "仅 Gemini 3 及以上模型支持与函数工具同时使用;Gemini 3 及以上模型的原生搜索仅限付费层级,计费规则请查阅官方文档", + }, + "gm_native_coderunner": { + "description": "启用原生代码执行器", + "type": "bool", + "hint": "仅 Gemini 3 及以上模型支持与函数工具同时使用", + }, + "gm_url_context": { + "description": "启用URL上下文功能", + "type": "bool", + "hint": "仅 Gemini 3 及以上模型支持与函数工具同时使用", + }, + "gm_safety_settings": { + "description": "安全过滤器", + "type": "object", + "hint": "设置模型输入的内容安全过滤级别。过滤级别分类为NONE(不屏蔽)、HIGH(高风险时屏蔽)、MEDIUM_AND_ABOVE(中等风险及以上屏蔽)、LOW_AND_ABOVE(低风险及以上时屏蔽),具体参见Gemini API文档。", + "items": { + "harassment": { + "description": "骚扰内容", + "type": "string", + "hint": "负面或有害评论", + "options": [ + "BLOCK_NONE", + "BLOCK_ONLY_HIGH", + "BLOCK_MEDIUM_AND_ABOVE", + "BLOCK_LOW_AND_ABOVE", + ], + }, + "hate_speech": { + "description": "仇恨言论", + "type": "string", + "hint": "粗鲁、无礼或亵渎性质内容", + "options": [ + "BLOCK_NONE", + "BLOCK_ONLY_HIGH", + "BLOCK_MEDIUM_AND_ABOVE", + "BLOCK_LOW_AND_ABOVE", + ], + }, + "sexually_explicit": { + "description": "露骨色情内容", + "type": "string", + "hint": "包含性行为或其他淫秽内容的引用", + "options": [ + "BLOCK_NONE", + "BLOCK_ONLY_HIGH", + "BLOCK_MEDIUM_AND_ABOVE", + "BLOCK_LOW_AND_ABOVE", + ], + }, + "dangerous_content": { + "description": "危险内容", + "type": "string", + "hint": "宣扬、助长或鼓励有害行为的信息", + "options": [ + "BLOCK_NONE", + "BLOCK_ONLY_HIGH", + "BLOCK_MEDIUM_AND_ABOVE", + "BLOCK_LOW_AND_ABOVE", + ], + }, + }, + }, + "gm_thinking_config": { + "description": "Thinking Config", + "type": "object", + "items": { + "budget": { + "description": "Thinking Budget", + "type": "int", + "hint": "Guides the model on the specific number of thinking tokens to use for reasoning. See: https://ai.google.dev/gemini-api/docs/thinking#set-budget", + }, + "level": { + "description": "Thinking Level", + "type": "string", + "hint": "Recommended for Gemini 3 models and onwards, lets you control reasoning behavior.See: https://ai.google.dev/gemini-api/docs/thinking#thinking-levels", + "options": [ + "MINIMAL", + "LOW", + "MEDIUM", + "HIGH", + ], + }, + }, + }, + "anth_thinking_config": { + "description": "思考配置", + "type": "object", + "items": { + "type": { + "description": "思考类型", + "type": "string", + "options": ["", "adaptive"], + "hint": "Opus 4.6+ / Sonnet 4.6+ 推荐设为 'adaptive'。留空则使用手动 budget 模式。参见: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking", + }, + "budget": { + "description": "思考预算", + "type": "int", + "hint": "手动 budget_tokens,需 >= 1024。仅在 type 为空时生效。Opus 4.6 / Sonnet 4.6 上已弃用。参见: https://platform.claude.com/docs/en/build-with-claude/extended-thinking", + }, + "effort": { + "description": "思考深度", + "type": "string", + "options": ["", "low", "medium", "high", "max"], + "hint": "type 为 'adaptive' 时控制思考深度。默认 'high'。'max' 仅限 Opus 4.6。参见: https://platform.claude.com/docs/en/build-with-claude/effort", + }, + }, + }, + "minimax-group-id": { + "type": "string", + "description": "用户组", + "hint": "于账户管理->基本信息中可见", + }, + "minimax-langboost": { + "type": "string", + "description": "指定语言/方言", + "hint": "增强对指定的小语种和方言的识别能力,设置后可以提升在指定小语种/方言场景下的语音表现", + "options": [ + "Chinese", + "Chinese,Yue", + "English", + "Arabic", + "Russian", + "Spanish", + "French", + "Portuguese", + "German", + "Turkish", + "Dutch", + "Ukrainian", + "Vietnamese", + "Indonesian", + "Japanese", + "Italian", + "Korean", + "Thai", + "Polish", + "Romanian", + "Greek", + "Czech", + "Finnish", + "Hindi", + "auto", + ], + }, + "minimax-voice-speed": { + "type": "float", + "description": "语速", + "hint": "生成声音的语速, 取值[0.5, 2], 默认为1.0, 取值越大,语速越快", + }, + "minimax-voice-vol": { + "type": "float", + "description": "音量", + "hint": "生成声音的音量, 取值(0, 10], 默认为1.0, 取值越大,音量越高", + }, + "minimax-voice-pitch": { + "type": "int", + "description": "语调", + "hint": "生成声音的语调, 取值[-12, 12], 默认为0", + }, + "minimax-is-timber-weight": { + "type": "bool", + "description": "启用混合音色", + "hint": "启用混合音色, 支持以自定义权重混合最多四种音色, 启用后自动忽略单一音色设置", + }, + "minimax-timber-weight": { + "type": "string", + "description": "混合音色", + "editor_mode": True, + "hint": "混合音色及其权重, 最多支持四种音色, 权重为整数, 取值[1, 100]. 可在官网API语音调试台预览代码获得预设以及编写模板, 需要严格按照json字符串格式编写, 可以查看控制台判断是否解析成功. 具体结构可参照默认值以及官网代码预览.", + }, + "minimax-voice-id": { + "type": "string", + "description": "单一音色", + "hint": "单一音色编号, 详见官网文档", + }, + "minimax-voice-emotion": { + "type": "string", + "description": "情绪", + "hint": "控制合成语音的情绪。当为 auto 时,将根据文本内容自动选择情绪。", + "options": [ + "auto", + "happy", + "sad", + "angry", + "fearful", + "disgusted", + "surprised", + "calm", + "fluent", + "whisper", + ], + }, + "minimax-voice-latex": { + "type": "bool", + "description": "支持朗读latex公式", + "hint": "朗读latex公式, 但是需要确保输入文本按官网要求格式化", + }, + "minimax-voice-english-normalization": { + "type": "bool", + "description": "支持英语文本规范化", + "hint": "可提升数字阅读场景的性能,但会略微增加延迟", + }, + "rag_options": { + "description": "RAG 选项", + "type": "object", + "hint": "检索知识库设置, 非必填。仅 Agent 应用类型支持(智能体应用, 包括 RAG 应用)。阿里云百炼应用开启此功能后将无法多轮对话。", + "items": { + "pipeline_ids": { + "description": "知识库 ID 列表", + "type": "list", + "items": {"type": "string"}, + "hint": "对指定知识库内所有文档进行检索, 前往 https://bailian.console.aliyun.com/ 数据应用->知识索引创建和获取 ID。", + }, + "file_ids": { + "description": "非结构化文档 ID, 传入该参数将对指定非结构化文档进行检索。", + "type": "list", + "items": {"type": "string"}, + "hint": "对指定非结构化文档进行检索。前往 https://bailian.console.aliyun.com/ 数据管理创建和获取 ID。", + }, + "output_reference": { + "description": "是否输出知识库/文档的引用", + "type": "bool", + "hint": "在每次回答尾部加上引用源。默认为 False。", + }, + }, + }, + "sensevoice_hint": { + "description": "部署SenseVoice", + "type": "string", + "hint": "启用前请 pip 安装 funasr、funasr_onnx、torchaudio、torch、modelscope、jieba 库(默认使用CPU,大约下载 1 GB),并且安装 ffmpeg。否则将无法正常转文字。", + }, + "is_emotion": { + "description": "情绪识别", + "type": "bool", + "hint": "是否开启情绪识别。happy|sad|angry|neutral|fearful|disgusted|surprised|unknown", + }, + "stt_model": { + "description": "模型名称", + "type": "string", + "hint": "modelscope 上的模型名称。默认:iic/SenseVoiceSmall。", + }, + "variables": { + "description": "工作流固定输入变量", + "type": "object", + "items": {}, + "hint": "可选。工作流固定输入变量,将会作为工作流的输入。也可以在对话时使用 /set 指令动态设置变量。如果变量名冲突,优先使用动态设置的变量。", + "invisible": True, + }, + "dashscope_app_type": { + "description": "应用类型", + "type": "string", + "hint": "百炼应用的应用类型。", + "options": [ + "agent", + "agent-arrange", + "dialog-workflow", + "task-workflow", + ], + }, + "timeout": { + "description": "超时时间", + "type": "int", + "hint": "超时时间,单位为秒。", + }, + "total_timeout": { + "description": "总超时时间", + "type": "float", + "hint": "单次决策请求的总超时时间(秒),包含等待并发名额、重试与退避;默认 5 秒。", + "condition": {"type": "system_one_decision"}, + }, + "max_concurrency": { + "description": "最大并发数", + "type": "int", + "hint": "该提供商同时进行的决策请求上限;默认 4。", + "condition": {"type": "system_one_decision"}, + }, + "openai-tts-voice": { + "description": "voice", + "type": "string", + "hint": "OpenAI TTS 的声音。OpenAI 默认支持:'alloy', 'echo', 'fable', 'onyx', 'nova', 'shimmer'", + }, + "mimo-tts-voice": { + "description": "音色", + "type": "string", + "hint": "MiMo TTS 的音色名称。可选值包括 'mimo_default'、'default_en'、'default_zh'。", + }, + "mimo-tts-format": { + "description": "输出格式", + "type": "string", + "hint": "MiMo TTS 生成音频的格式。支持 'wav'、'mp3'、'pcm'。", + }, + "mimo-tts-style-prompt": { + "description": "风格提示词", + "type": "string", + "hint": "会以 标签形式添加到待合成文本开头,用于控制语速、情绪、角色或风格,例如 开心、变快、孙悟空、悄悄话。可留空。", + }, + "mimo-tts-dialect": { + "description": "方言", + "type": "string", + "hint": "会与风格提示词一起写入开头的 标签中,例如 东北话、四川话、河南话、粤语。可留空。", + }, + "mimo-tts-seed-text": { + "description": "种子文本", + "type": "string", + "hint": "作为可选的 user 消息发送,用于辅助调节语气和风格,不会拼接到待合成文本中。", + }, + "fishaudio-tts-character": { + "description": "character", + "type": "string", + "hint": "fishaudio TTS 的角色。默认为可莉。更多角色请访问:https://fish.audio/zh-CN/discovery", + }, + "fishaudio-tts-reference-id": { + "description": "reference_id", + "type": "string", + "hint": "fishaudio TTS 的参考模型ID(可选)。如果填入此字段,将直接使用模型ID而不通过角色名称查询。例如:626bb6d3f3364c9cbc3aa6a67300a664。更多模型请访问:https://fish.audio/zh-CN/discovery,进入模型详情界面后可复制模型ID", + }, + "whisper_hint": { + "description": "本地部署 Whisper 模型须知", + "type": "string", + "hint": "启用前请 pip 安装 openai-whisper 库(N卡用户大约下载 2GB,主要是 torch 和 cuda,CPU 用户大约下载 1 GB),并且安装 ffmpeg。否则将无法正常转文字。", + }, + "whisper_device": { + "description": "推理设备", + "type": "string", + "hint": "Whisper 推理设备。Apple Silicon 可选 mps;其他环境建议使用 cpu。若指定 mps 但当前环境不可用,将自动回退到 cpu。", + "options": ["cpu", "mps"], + }, + "id": { + "description": "ID", + "type": "string", + }, + "type": { + "description": "模型提供商种类", + "type": "string", + "invisible": True, + }, + "provider_type": { + "description": "模型提供商能力种类", + "type": "string", + "invisible": True, + }, + "enable": { + "description": "启用", + "type": "bool", + }, + "key": { + "description": "API Key", + "type": "list", + "items": {"type": "string"}, + "secret": True, + }, + "api_base": { + "description": "API Base URL", + "type": "string", + }, + "proxy": { + "description": "provider_group.provider.proxy.description", + "type": "string", + "hint": "provider_group.provider.proxy.hint", + }, + "model": { + "description": "模型 ID", + "type": "string", + "hint": "模型名称,如 gpt-4o-mini, deepseek-chat。", + }, + "max_context_tokens": { + "description": "模型上下文窗口大小", + "type": "int", + "hint": "模型最大上下文 Token 大小。如果为 0,则会自动从模型元数据填充(如有)", + }, + "dify_api_key": { + "description": "API Key", + "type": "string", + "hint": "Dify API Key。此项必填。", + "secret": True, + }, + "dify_api_base": { + "description": "API Base URL", + "type": "string", + "hint": "Dify API Base URL。默认为 https://api.dify.ai/v1", + }, + "dify_api_type": { + "description": "Dify 应用类型", + "type": "string", + "hint": "Dify API 类型。根据 Dify 官网,目前支持 chat, chatflow, agent, workflow 三种应用类型。", + "options": ["chat", "chatflow", "agent", "workflow"], + }, + "dify_workflow_output_key": { + "description": "Dify Workflow 输出变量名", + "type": "string", + "hint": "Dify Workflow 输出变量名。当应用类型为 workflow 时才使用。默认为 astrbot_wf_output。", + }, + "dify_query_input_key": { + "description": "Prompt 输入变量名", + "type": "string", + "hint": "发送的消息文本内容对应的输入变量名。默认为 astrbot_text_query。", + "obvious": True, + }, + "coze_api_key": { + "description": "Coze API Key", + "type": "string", + "hint": "Coze API 密钥,用于访问 Coze 服务。", + "secret": True, + }, + "bot_id": { + "description": "Bot ID", + "type": "string", + "hint": "Coze 机器人的 ID,在 Coze 平台上创建机器人后获得。", + }, + "coze_api_base": { + "description": "API Base URL", + "type": "string", + "hint": "Coze API 的基础 URL 地址,默认为 https://api.coze.cn", + }, + "deerflow_api_base": { + "description": "API Base URL", + "type": "string", + "hint": "DeerFlow API 网关地址,默认为 http://127.0.0.1:2026", + }, + "deerflow_api_key": { + "description": "DeerFlow API Key", + "type": "string", + "hint": "可选。若 DeerFlow 网关配置了 Bearer 鉴权,则在此填写。", + "secret": True, + }, + "deerflow_auth_header": { + "description": "Authorization Header", + "type": "string", + "hint": "可选。自定义 Authorization 请求头,优先级高于 DeerFlow API Key。", + "secret": True, + }, + "deerflow_assistant_id": { + "description": "Assistant ID", + "type": "string", + "hint": "DeerFlow 2.0 LangGraph assistant_id,默认为 lead_agent。", + }, + "deerflow_model_name": { + "description": "模型名称覆盖", + "type": "string", + "hint": "可选。覆盖 DeerFlow 默认模型(对应运行时 configurable 的 model_name)。", + }, + "deerflow_thinking_enabled": { + "description": "启用思考模式", + "type": "bool", + }, + "deerflow_plan_mode": { + "description": "启用计划模式", + "type": "bool", + "hint": "对应 DeerFlow 2.0 运行时 configurable 的 is_plan_mode。", + }, + "deerflow_subagent_enabled": { + "description": "启用子智能体", + "type": "bool", + "hint": "对应 DeerFlow 2.0 运行时 configurable 的 subagent_enabled。", + }, + "deerflow_max_concurrent_subagents": { + "description": "子智能体最大并发数", + "type": "int", + "hint": "对应 DeerFlow 2.0 运行时 configurable 的 max_concurrent_subagents。仅在启用子智能体时生效,默认 3。", + }, + "deerflow_recursion_limit": { + "description": "递归深度上限", + "type": "int", + "hint": "对应 LangGraph recursion_limit。", + }, + "auto_save_history": { + "description": "由 Coze 管理对话记录", + "type": "bool", + "hint": "启用后,将由 Coze 进行对话历史记录管理, 此时 AstrBot 本地保存的上下文不会生效(仅供浏览), 对 AstrBot 的上下文进行的操作也不会生效。如果为禁用, 则使用 AstrBot 管理上下文。", + }, + }, + }, + "provider_settings": { + "type": "object", + "items": { + "enable": { + "type": "bool", + }, + "wake_prefix": { + "type": "string", + }, + "web_search": { + "type": "bool", + }, + "web_search_link": { + "type": "bool", + }, + "display_reasoning_text": { + "type": "bool", + }, + "identifier": { + "type": "bool", + }, + "group_name_display": { + "type": "bool", + }, + "datetime_system_prompt": { + "type": "bool", + }, + "prompt_prefix": { + "type": "string", + }, + "streaming_response": { + "type": "bool", + }, + "show_tool_use_status": { + "type": "bool", + }, + "show_tool_call_result": { + "type": "bool", + }, + "buffer_intermediate_messages": { + "type": "bool", + }, + "unsupported_streaming_strategy": { + "type": "string", + }, + "file_extract": { + "type": "object", + "items": { + "enable": { + "type": "bool", + }, + "provider": { + "type": "string", + }, + "moonshotai_api_key": { + "type": "string", + "secret": True, + }, + }, + }, + "proactive_capability": { + "type": "object", + "items": { + "add_cron_tools": { + "type": "bool", + }, + }, + }, + }, + }, + "agent_runner": { + "type": "object", + "items": { + "runner_type": {"type": "string"}, + "config": {"type": "dict"}, + }, + }, + "provider_stt_settings": { + "type": "object", + "items": { + "enable": { + "type": "bool", + }, + "provider_id": { + "type": "string", + }, + }, + }, + "provider_tts_settings": { + "type": "object", + "items": { + "enable": { + "type": "bool", + }, + "provider_id": { + "type": "string", + }, + "dual_output": { + "type": "bool", + }, + "use_file_service": { + "type": "bool", + }, + "trigger_probability": { + "type": "float", + }, + }, + }, + "provider_ltm_settings": { + "type": "object", + "items": { + "group_icl_enable": { + "type": "bool", + }, + "group_message_max_cnt": { + "type": "int", + }, + "image_caption": { + "type": "bool", + }, + "image_caption_provider_id": { + "type": "string", + }, + "image_caption_prompt": { + "type": "string", + }, + "group_message_history_enable": { + "type": "bool", + }, + "group_message_history_max_cnt": { + "type": "int", + }, + "active_reply": { + "type": "object", + "items": { + "enable": { + "type": "bool", + }, + "whitelist": { + "type": "list", + "items": {"type": "string"}, + }, + "method": { + "type": "string", + "options": ["possibility_reply"], + }, + "possibility_reply": { + "type": "float", + }, + }, + }, + }, + }, + }, + }, + "misc_config_group": { + "metadata": { + "wake_prefix": { + "type": "list", + "items": {"type": "string"}, + }, + "t2i": { + "type": "bool", + }, + "t2i_word_threshold": { + "type": "int", + }, + "admins_id": { + "type": "list", + "_special": "sender_id", + "items": {"type": "string"}, + }, + "http_proxy": { + "type": "string", + }, + "no_proxy": { + "description": "直连地址列表", + "type": "list", + "items": {"type": "string"}, + "hint": "在此处添加不希望通过代理访问的地址,例如内部服务地址。回车添加,可添加多个,如未设置代理请忽略此配置", + }, + "timezone": { + "type": "string", + }, + "callback_api_base": { + "type": "string", + }, + "disable_metrics": { + "description": "禁用匿名使用统计", + "type": "bool", + "hint": "禁用后,AstrBot 将不再上传匿名使用统计数据。", + }, + "log_level": { + "type": "string", + "options": ["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"], + }, + "dashboard.ssl.enable": {"type": "bool"}, + "dashboard.trust_proxy_headers": {"type": "bool"}, + "dashboard.auth_rate_limit.enable": {"type": "bool"}, + "dashboard.auth_rate_limit.average_interval": {"type": "float"}, + "dashboard.auth_rate_limit.max_burst": {"type": "int"}, + "dashboard.ssl.cert_file": { + "type": "string", + "condition": {"dashboard.ssl.enable": True}, + }, + "dashboard.ssl.key_file": { + "type": "string", + "condition": {"dashboard.ssl.enable": True}, + }, + "dashboard.ssl.ca_certs": { + "type": "string", + "condition": {"dashboard.ssl.enable": True}, + }, + "log_file_enable": {"type": "bool"}, + "log_file_path": {"type": "string", "condition": {"log_file_enable": True}}, + "log_file_max_mb": {"type": "int", "condition": {"log_file_enable": True}}, + "temp_dir_max_size": {"type": "int"}, + "trace_enable": {"type": "bool"}, + "trace_db_path": {"type": "string"}, + "trace_db_max_mb": {"type": "int"}, + "trace_retention_days": {"type": "int"}, + "t2i_strategy": { + "type": "string", + "options": ["remote", "local"], + }, + "t2i_endpoint": { + "type": "string", + }, + "t2i_use_file_service": { + "type": "bool", + }, + "pip_install_arg": { + "type": "string", + }, + "pypi_index_url": { + "type": "string", + }, + "default_kb_collection": { + "type": "string", + }, + "kb_names": {"type": "list", "items": {"type": "string"}}, + "kb_fusion_top_k": {"type": "int", "default": 20}, + "kb_final_top_k": {"type": "int", "default": 5}, + "kb_agentic_mode": {"type": "bool"}, + }, + }, +} + + +""" +Since v4.7.0, fields such as name, description, and hint support i18n. +Their resources are stored in: + +- dashboard/src/i18n/locales//features/config-metadata.json + +When adding configuration fields here, update this file for every supported +Dashboard locale. +""" +CONFIG_METADATA_3 = { + "ai_group": { + "name": "AI", + "metadata": { + "agent_runner": { + "description": "Agent 执行方式", + "hint": "选择 AI 对话的执行器。切换执行器会使用新类型的默认配置,不保留上一类型的参数。", + "type": "object", + "items": { + "provider_settings.enable": { + "description": "启用", + "type": "bool", + "hint": "AI 对话总开关", + }, + "agent_runner.runner_type": { + "description": "执行器", + "type": "string", + "options": ["local", "dify", "coze", "dashscope", "deerflow"], + "labels": [ + "内置 Agent", + "Dify", + "Coze", + "阿里云百炼应用", + "DeerFlow", + ], + "_special": "agent_runner_type", + "runner_defaults": { + runner_type: get_agent_runner_config_default(runner_type) + for runner_type in ( + "local", + "dify", + "coze", + "dashscope", + "deerflow", + ) + }, + "condition": { + "provider_settings.enable": True, + }, + }, + }, + }, + "dify_runner": { + "description": "Dify 配置", + "type": "object", + "condition": { + "provider_settings.enable": True, + "agent_runner.runner_type": "dify", + }, + "items": { + "agent_runner.config.dify_api_type": { + "description": "应用类型", + "type": "string", + "options": ["chat", "chatflow", "agent", "workflow"], + }, + "agent_runner.config.dify_api_key": { + "description": "API Key", + "type": "string", + "secret": True, + }, + "agent_runner.config.dify_api_base": { + "description": "API Base URL", + "type": "string", + }, + "agent_runner.config.dify_workflow_output_key": { + "description": "Workflow 输出变量名", + "type": "string", + }, + "agent_runner.config.dify_query_input_key": { + "description": "Prompt 输入变量名", + "type": "string", + }, + "agent_runner.config.variables": { + "description": "变量", + "type": "dict", + }, + "agent_runner.config.timeout": { + "description": "超时时间(秒)", + "type": "int", + }, + "agent_runner.config.proxy": { + "description": "代理地址", + "type": "string", + }, + }, + }, + "coze_runner": { + "description": "Coze 配置", + "type": "object", + "condition": { + "provider_settings.enable": True, + "agent_runner.runner_type": "coze", + }, + "items": { + "agent_runner.config.coze_api_key": { + "description": "API Key", + "type": "string", + "secret": True, + }, + "agent_runner.config.bot_id": { + "description": "Bot ID", + "type": "string", + }, + "agent_runner.config.coze_api_base": { + "description": "API Base URL", + "type": "string", + }, + "agent_runner.config.auto_save_history": { + "description": "由 Coze 管理对话记录", + "type": "bool", + }, + "agent_runner.config.timeout": { + "description": "超时时间(秒)", + "type": "int", + }, + "agent_runner.config.proxy": { + "description": "代理地址", + "type": "string", + }, + }, + }, + "dashscope_runner": { + "description": "阿里云百炼应用配置", + "type": "object", + "condition": { + "provider_settings.enable": True, + "agent_runner.runner_type": "dashscope", + }, + "items": { + "agent_runner.config.dashscope_app_type": { + "description": "应用类型", + "type": "string", + "options": ["agent", "workflow"], + }, + "agent_runner.config.dashscope_api_key": { + "description": "API Key", + "type": "string", + "secret": True, + }, + "agent_runner.config.dashscope_app_id": { + "description": "应用 ID", + "type": "string", + }, + "agent_runner.config.rag_options.pipeline_ids": { + "description": "知识库 Pipeline ID", + "type": "list", + "items": {"type": "string"}, + }, + "agent_runner.config.rag_options.file_ids": { + "description": "文件 ID", + "type": "list", + "items": {"type": "string"}, + }, + "agent_runner.config.rag_options.output_reference": { + "description": "输出引用", + "type": "bool", + }, + "agent_runner.config.variables": { + "description": "变量", + "type": "dict", + }, + "agent_runner.config.timeout": { + "description": "超时时间(秒)", + "type": "int", + }, + "agent_runner.config.proxy": { + "description": "代理地址", + "type": "string", + }, + }, + }, + "deerflow_runner": { + "description": "DeerFlow 配置", + "type": "object", + "condition": { + "provider_settings.enable": True, + "agent_runner.runner_type": "deerflow", + }, + "items": { + "agent_runner.config.deerflow_api_base": { + "description": "API Base URL", + "type": "string", + }, + "agent_runner.config.deerflow_api_key": { + "description": "API Key", + "type": "string", + "secret": True, + }, + "agent_runner.config.deerflow_auth_header": { + "description": "Authorization Header", + "type": "string", + "secret": True, + }, + "agent_runner.config.deerflow_assistant_id": { + "description": "Assistant ID", + "type": "string", + }, + "agent_runner.config.deerflow_model_name": { + "description": "模型名称覆盖", + "type": "string", + }, + "agent_runner.config.deerflow_thinking_enabled": { + "description": "启用思考模式", + "type": "bool", + }, + "agent_runner.config.deerflow_plan_mode": { + "description": "启用计划模式", + "type": "bool", + }, + "agent_runner.config.deerflow_subagent_enabled": { + "description": "启用子智能体", + "type": "bool", + }, + "agent_runner.config.deerflow_max_concurrent_subagents": { + "description": "子智能体最大并发数", + "type": "int", + }, + "agent_runner.config.deerflow_recursion_limit": { + "description": "递归深度上限", + "type": "int", + }, + "agent_runner.config.timeout": { + "description": "超时时间(秒)", + "type": "int", + }, + "agent_runner.config.proxy": { + "description": "代理地址", + "type": "string", + }, + }, + }, + "ai": { + "description": "模型", + "hint": "配置内置 Agent 使用的对话模型,以及通用的图片转述、语音模型。", + "type": "object", + "items": { + "agent_runner.config.model.provider_id": { + "description": "对话模型", + "type": "string", + "_special": "select_provider", + "hint": "留空时使用第一个模型", + "condition": { + "agent_runner.runner_type": "local", + }, + }, + "agent_runner.config.model.fallback_provider_ids": { + "description": "回退对话模型", + "type": "list", + "items": {"type": "string"}, + "_special": "select_providers", + "hint": "主聊天模型请求失败时,按顺序切换到这些模型。", + "condition": { + "agent_runner.runner_type": "local", + }, + }, + "agent_runner.config.model.request_max_retries": { + "description": "异常重试次数", + "type": "int", + "hint": "单次模型请求遇到可重试错误时的最大尝试次数。", + "condition": { + "agent_runner.runner_type": "local", + }, + }, + "provider_settings.default_image_caption_provider_id": { + "description": "图片转述模型", + "type": "string", + "_special": "select_provider", + "hint": "当对话模型不支持图片输入时,调用图片转述模型来获得图片描述。留空代表不使用。", + }, + "provider_stt_settings.enable": { + "description": "语音识别", + "type": "bool", + "hint": "使用语音转文字模型将用户语音转述为文本,方便模型理解。", + }, + "provider_stt_settings.provider_id": { + "description": "默认语音转文本模型", + "type": "string", + "hint": "也可使用 /provider 指令单独选择会话的模型。", + "_special": "select_provider_stt", + "condition": { + "provider_stt_settings.enable": True, + }, + }, + "provider_tts_settings.enable": { + "description": "语音回复", + "type": "bool", + "hint": "使用文字转语音模型将文字转为语音回复。", + }, + "provider_tts_settings.provider_id": { + "description": "默认文本转语音模型", + "hint": "也可使用 /provider 指令单独选择会话的模型。", + "type": "string", + "_special": "select_provider_tts", + "condition": { + "provider_tts_settings.enable": True, + }, + }, + "provider_tts_settings.trigger_probability": { + "description": "TTS 触发概率", + "hint": "采用随机概率触发语音回复。", + "type": "float", + "slider": {"min": 0, "max": 1, "step": 0.05}, + "condition": { + "provider_tts_settings.enable": True, + }, + }, + "provider_settings.image_caption_prompt": { + "description": "图片转述提示词", + "hint": "用于图片转述模型的提示词。", + "type": "text", + "collapsed": True, + }, + }, + "condition": { + "provider_settings.enable": True, + }, + }, + "persona": { + "description": "人格", + "hint": "", + "type": "object", + "items": { + "agent_runner.config.persona.persona_id": { + "description": "默认采用的人格", + "type": "string", + "_special": "select_persona", + }, + "agent_runner.config.persona.safety_mode": { + "description": "健康模式", + "type": "bool", + "hint": "引导模型输出健康、安全的内容,避免有害或敏感话题。", + }, + "agent_runner.config.persona.safety_mode_strategy": { + "description": "健康模式策略", + "type": "string", + "invisible": True, + "options": ["system_prompt"], + "hint": "选择健康模式的实现策略。", + "condition": { + "agent_runner.config.persona.safety_mode": True, + }, + }, + }, + "condition": { + "agent_runner.runner_type": "local", + "provider_settings.enable": True, + }, + }, + "knowledgebase": { + "description": "知识库", + "hint": "", + "type": "object", + "items": { + "kb_names": { + "description": "知识库列表", + "type": "list", + "items": {"type": "string"}, + "_special": "select_knowledgebase", + "hint": "支持多选", + }, + "kb_fusion_top_k": { + "description": "融合检索结果数", + "type": "int", + "hint": "多个知识库检索结果融合后的返回结果数量", + }, + "kb_final_top_k": { + "description": "最终返回结果数", + "type": "int", + "hint": "从知识库中检索到的结果数量,越大可能获得越多相关信息,但也可能引入噪音。建议根据实际需求调整", + }, + "kb_agentic_mode": { + "description": "Agentic 知识库检索", + "type": "bool", + "hint": "启用后,知识库检索将作为 LLM Tool,由模型自主决定何时调用知识库进行查询。需要模型支持函数调用能力。", + }, + }, + "condition": { + "agent_runner.runner_type": "local", + "provider_settings.enable": True, + }, + }, + "websearch": { + "description": "网页搜索", + "hint": "", + "type": "object", + "items": { + "provider_settings.web_search": { + "description": "启用网页搜索", + "type": "bool", + }, + "provider_settings.websearch_provider": { + "description": "网页搜索提供商", + "type": "string", + "options": [ + "serpapi", + "deepseek", + "tavily", + "baidu_ai_search", + "bocha", + "brave", + "firecrawl", + "exa", + "anysearch", + ], + "labels": [ + "SerpApi", + "DeepSeek Search API", + "Tavily", + "Baidu AI Search", + "Bocha", + "Brave", + "Firecrawl", + "Exa", + "AnySearch", + ], + "subtitles": [ + "Google 网页、新闻、图片、学术和财经搜索", + "DeepSeek 官方搜索接口", + "", + "", + "", + "", + "", + "", + "", + ], + "condition": { + "provider_settings.web_search": True, + }, + }, + "provider_settings.websearch_tavily_key": { + "description": "Tavily API Key", + "type": "list", + "items": {"type": "string"}, + "hint": "可添加多个 Key 进行轮询。", + "secret": True, + "condition": { + "provider_settings.websearch_provider": "tavily", + "provider_settings.web_search": True, + }, + }, + "provider_settings.websearch_bocha_key": { + "description": "BoCha API Key", + "type": "list", + "items": {"type": "string"}, + "hint": "可添加多个 Key 进行轮询。", + "secret": True, + "condition": { + "provider_settings.websearch_provider": "bocha", + "provider_settings.web_search": True, + }, + }, + "provider_settings.websearch_brave_key": { + "description": "Brave Search API Key", + "type": "list", + "items": {"type": "string"}, + "hint": "可添加多个 Key 进行轮询。", + "secret": True, + "condition": { + "provider_settings.websearch_provider": "brave", + "provider_settings.web_search": True, + }, + }, + "provider_settings.websearch_firecrawl_key": { + "description": "Firecrawl API Key", + "type": "list", + "items": {"type": "string"}, + "hint": "可添加多个 Key 进行轮询。", + "secret": True, + "condition": { + "provider_settings.websearch_provider": "firecrawl", + "provider_settings.web_search": True, + }, + }, + "provider_settings.websearch_baidu_app_builder_key": { + "description": "百度千帆智能云 APP Builder API Key", + "type": "string", + "hint": "参考:https://console.bce.baidu.com/iam/#/iam/apikey/list", + "secret": True, + "condition": { + "provider_settings.websearch_provider": "baidu_ai_search", + "provider_settings.web_search": True, + }, + }, + "provider_settings.websearch_exa_key": { + "description": "Exa API Key", + "type": "list", + "items": {"type": "string"}, + "hint": "可添加多个 Key 进行轮询。Get a key at https://dashboard.exa.ai", + "secret": True, + "condition": { + "provider_settings.websearch_provider": "exa", + "provider_settings.web_search": True, + }, + }, + "provider_settings.websearch_anysearch_key": { + "description": "AnySearch API Key", + "type": "list", + "items": {"type": "string"}, + "hint": "可添加多个 Key 进行轮询。留空则使用匿名模式(每日免费额度)。申请地址:https://anysearch.com/console/api-keys", + "condition": { + "provider_settings.websearch_provider": "anysearch", + "provider_settings.web_search": True, + }, + }, + "provider_settings.websearch_deepseek_key": { + "description": "DeepSeek API Key", + "type": "list", + "items": {"type": "string"}, + "hint": "Configure a DeepSeek API key for search and page extraction. Multiple keys rotate. Get a key: [https://platform.deepseek.com/api_keys](https://platform.deepseek.com/api_keys)", + "secret": True, + "condition": { + "provider_settings.websearch_provider": "deepseek", + "provider_settings.web_search": True, + }, + }, + "provider_settings.websearch_serpapi_key": { + "description": "SerpApi API Key", + "type": "list", + "items": {"type": "string"}, + "hint": "支持 Google 网页、新闻、图片、学术和财经搜索。可添加多个 Key 轮询。获取 Key:[https://serpapi.com/manage-api-key](https://serpapi.com/manage-api-key)", + "secret": True, + "condition": { + "provider_settings.websearch_provider": "serpapi", + "provider_settings.web_search": True, + }, + }, + "provider_settings.web_search_link": { + "description": "显示来源引用", + "type": "bool", + "condition": { + "provider_settings.web_search": True, + }, + }, + }, + "condition": { + "agent_runner.runner_type": "local", + "provider_settings.enable": True, + }, + }, + "agent_computer_use": { + "description": "Agent Computer Use", + "hint": "", + "type": "object", + "items": { + "provider_settings.computer_use_runtime": { + "description": "Computer Use Runtime", + "type": "string", + "options": ["none", "local", "sandbox"], + "labels": [ + "不允许任何环境", + "本机环境", + "第三方沙箱环境", + ], + "hint": "选择 Computer Use 运行环境。", + }, + "provider_settings.computer_use_local_permissions": { + "description": "本地权限策略", + "type": "object", + "_special": "local_permission_matrix", + "full_width": True, + "items": { + "member": { + "type": "object", + "items": { + "allow_execution": {"type": "bool"}, + "allow_network": {"type": "bool"}, + "filesystem_scope": { + "type": "string", + "options": ["none", "workspace", "host"], + }, + }, + }, + "admin": { + "type": "object", + "items": { + "allow_execution": {"type": "bool"}, + "allow_network": {"type": "bool"}, + "filesystem_scope": { + "type": "string", + "options": ["none", "workspace", "host"], + }, + }, + }, + }, + "condition": { + "provider_settings.computer_use_runtime": "local", + }, + }, + "provider_settings.computer_use_require_admin": { + "description": "沙箱能力需要 AstrBot 管理员权限", + "type": "bool", + "hint": "开启后,需要 AstrBot 管理员权限才能调用远程沙箱能力。在配置文件 -> 访问控制 -> 管理员 -> 管理员 ID 中可添加管理员。给机器人发送 /sid 指令以获取 ID。", + "condition": { + "provider_settings.computer_use_runtime": "sandbox", + }, + }, + "provider_settings.sandbox.booter": { + "description": "沙箱环境驱动器", + "type": "string", + "options": ["shipyard_neo", "shipyard", "cua"], + "labels": ["Shipyard Neo", "Shipyard", "CUA"], + "condition": { + "provider_settings.computer_use_runtime": "sandbox", + }, + }, + "provider_settings.sandbox.shipyard_neo_endpoint": { + "description": "Shipyard Neo API Endpoint", + "type": "string", + "hint": "Shipyard Neo(Bay) 服务的 API 地址,默认 http://127.0.0.1:8114。", + "condition": { + "provider_settings.computer_use_runtime": "sandbox", + "provider_settings.sandbox.booter": "shipyard_neo", + }, + }, + "provider_settings.sandbox.shipyard_neo_access_token": { + "description": "Shipyard Neo Access Token", + "type": "string", + "hint": "Bay 的 API Key(sk-bay-...)。留空时自动从 credentials.json 发现。", + "secret": True, + "condition": { + "provider_settings.computer_use_runtime": "sandbox", + "provider_settings.sandbox.booter": "shipyard_neo", + }, + }, + "provider_settings.sandbox.shipyard_neo_profile": { + "description": "Shipyard Neo Profile", + "type": "string", + "hint": "Shipyard Neo 沙箱 profile,如 python-default。留空时自动选择能力更完整的 profile。", + "condition": { + "provider_settings.computer_use_runtime": "sandbox", + "provider_settings.sandbox.booter": "shipyard_neo", + }, + }, + "provider_settings.sandbox.shipyard_neo_ttl": { + "description": "Shipyard Neo Sandbox TTL", + "type": "int", + "hint": "Shipyard Neo 沙箱生存时间(秒)。", + "condition": { + "provider_settings.computer_use_runtime": "sandbox", + "provider_settings.sandbox.booter": "shipyard_neo", + }, + }, + "provider_settings.sandbox.cua_image": { + "description": "CUA Image", + "type": "string", + "hint": "CUA 沙箱镜像/系统类型,默认 linux。可填写 linux、macos、windows、android,具体取决于 CUA SDK 支持。", + "condition": { + "provider_settings.computer_use_runtime": "sandbox", + "provider_settings.sandbox.booter": "cua", + }, + }, + "provider_settings.sandbox.cua_os_type": { + "description": "CUA OS Type", + "type": "string", + "options": ["linux", "macos", "windows", "android"], + "labels": ["Linux", "macOS", "Windows", "Android"], + "hint": "CUA 沙箱操作系统类型,默认 linux。", + "condition": { + "provider_settings.computer_use_runtime": "sandbox", + "provider_settings.sandbox.booter": "cua", + }, + }, + "provider_settings.sandbox.cua_idle_timeout": { + "description": "CUA Idle Timeout", + "type": "int", + "hint": "Idle timeout for CUA sandbox sessions in seconds. When greater than 0, AstrBot proactively shuts down an idle CUA sandbox after that amount of inactivity; 0 disables it.", + "condition": { + "provider_settings.computer_use_runtime": "sandbox", + "provider_settings.sandbox.booter": "cua", + }, + }, + "provider_settings.sandbox.cua_telemetry_enabled": { + "description": "CUA Telemetry", + "type": "bool", + "hint": "是否允许 CUA SDK 发送遥测数据。默认关闭。", + "condition": { + "provider_settings.computer_use_runtime": "sandbox", + "provider_settings.sandbox.booter": "cua", + }, + }, + "provider_settings.sandbox.cua_local": { + "description": "CUA Local Sandbox", + "type": "bool", + "hint": "是否优先使用 CUA 本地沙箱。默认开启,避免云端沙箱要求 CUA_API_KEY。关闭后可使用 CUA 云端沙箱。", + "condition": { + "provider_settings.computer_use_runtime": "sandbox", + "provider_settings.sandbox.booter": "cua", + }, + }, + "provider_settings.sandbox.cua_api_key": { + "description": "CUA API Key", + "type": "string", + "hint": "CUA 云端沙箱 API Key。仅在关闭本地沙箱时需要。也可以通过 CUA_API_KEY 环境变量提供。", + "obvious_hint": True, + "secret": True, + "condition": { + "provider_settings.computer_use_runtime": "sandbox", + "provider_settings.sandbox.booter": "cua", + "provider_settings.sandbox.cua_local": False, + }, + }, + "provider_settings.sandbox.shipyard_endpoint": { + "description": "Shipyard API Endpoint", + "type": "string", + "hint": "Shipyard 服务的 API 访问地址。", + "condition": { + "provider_settings.computer_use_runtime": "sandbox", + "provider_settings.sandbox.booter": "shipyard", + }, + "_special": "check_shipyard_connection", + }, + "provider_settings.sandbox.shipyard_access_token": { + "description": "Shipyard Access Token", + "type": "string", + "hint": "用于访问 Shipyard 服务的访问令牌。", + "secret": True, + "condition": { + "provider_settings.computer_use_runtime": "sandbox", + "provider_settings.sandbox.booter": "shipyard", + }, + }, + "provider_settings.sandbox.shipyard_ttl": { + "description": "Shipyard Session TTL", + "type": "int", + "hint": "Shipyard 会话的生存时间(秒)。", + "condition": { + "provider_settings.computer_use_runtime": "sandbox", + "provider_settings.sandbox.booter": "shipyard", + }, + }, + "provider_settings.sandbox.shipyard_max_sessions": { + "description": "Shipyard Max Sessions", + "type": "int", + "hint": "Shipyard 最大会话数量。", + "condition": { + "provider_settings.computer_use_runtime": "sandbox", + "provider_settings.sandbox.booter": "shipyard", + }, + }, + }, + "condition": { + "agent_runner.runner_type": "local", + "provider_settings.enable": True, + }, + }, + # "file_extract": { + # "description": "文档解析能力 [beta]", + # "type": "object", + # "items": { + # "provider_settings.file_extract.enable": { + # "description": "启用文档解析能力", + # "type": "bool", + # }, + # "provider_settings.file_extract.provider": { + # "description": "文档解析提供商", + # "type": "string", + # "options": ["moonshotai"], + # "condition": { + # "provider_settings.file_extract.enable": True, + # }, + # }, + # "provider_settings.file_extract.moonshotai_api_key": { + # "description": "Moonshot AI API Key", + # "type": "string", + # "condition": { + # "provider_settings.file_extract.provider": "moonshotai", + # "provider_settings.file_extract.enable": True, + # }, + # }, + # }, + # "condition": { + # "agent_runner.runner_type": "local", + # "provider_settings.enable": True, + # }, + # }, + "proactive_capability": { + "description": "主动型 Agent", + "hint": "https://docs.astrbot.app/use/proactive-agent.html", + "type": "object", + "items": { + "provider_settings.proactive_capability.add_cron_tools": { + "description": "启用", + "type": "bool", + "hint": "启用后,将会传递给 Agent 相关工具来实现主动型 Agent。你可以告诉 AstrBot 未来某个时间要做的事情,它将被定时触发然后执行任务。", + }, + }, + "condition": { + "agent_runner.runner_type": "local", + "provider_settings.enable": True, + }, + }, + "truncate_and_compress": { + "hint": "", + "description": "上下文管理策略", + "type": "object", + "items": { + "agent_runner.config.compression.max_turns": { + "description": "压缩前最多保留对话轮数", + "type": "int", + "collapsed": True, + "hint": "普通会话历史超过该轮数后,才会按下方策略进行持久化截断或 LLM 压缩;请求发送前也会先按该值约束上下文。-1 表示不按轮数限制。", + "condition": { + "agent_runner.runner_type": "local", + }, + }, + "agent_runner.config.compression.trim_turns": { + "description": "轮次超限时一次丢弃轮数", + "type": "int", + "collapsed": True, + "hint": "当超过“压缩前最多保留对话轮数”且无法使用 LLM 压缩时,一次丢弃多少轮旧对话;请求期截断也会复用该值。", + "condition": { + "agent_runner.runner_type": "local", + }, + }, + "agent_runner.config.compression.overflow_strategy": { + "description": "压缩策略", + "type": "string", + "options": ["truncate_by_turns", "llm_compress"], + "labels": ["按对话轮数截断", "由 LLM 压缩上下文"], + "condition": { + "agent_runner.runner_type": "local", + }, + "hint": "模型上下文超限时的处理策略。", + }, + "agent_runner.config.compression.instruction": { + "description": "上下文压缩提示词", + "type": "text", + "collapsed": True, + "hint": "如果为空则使用默认提示词。", + "condition": { + "agent_runner.config.compression.overflow_strategy": "llm_compress", + "agent_runner.runner_type": "local", + }, + }, + "agent_runner.config.compression.keep_recent_ratio": { + "description": "压缩时保留最近上下文比例", + "type": "float", + "collapsed": True, + "slider": {"min": 0, "max": 0.3, "step": 0.01}, + "hint": "按当前上下文 token 数保留最近内容,范围 0-0.3。0.15 表示保留 15%;比例大于 0 时至少保留最后一轮。", + "condition": { + "agent_runner.config.compression.overflow_strategy": "llm_compress", + "agent_runner.runner_type": "local", + }, + }, + "agent_runner.config.compression.provider_id": { + "description": "压缩模型", + "type": "string", + "_special": "select_provider", + "hint": "用于上下文压缩的模型。默认选择当前的对话模型。", + "condition": { + "agent_runner.config.compression.overflow_strategy": "llm_compress", + "agent_runner.runner_type": "local", + }, + }, + "agent_runner.config.compression.fallback_max_tokens": { + "description": "上下文窗口兜底值", + "type": "int", + "collapsed": True, + "hint": "当 max_context_tokens 为 0 且模型不在内置元数据中时,使用此值作为上下文窗口大小。默认 128000。", + "condition": { + "agent_runner.runner_type": "local", + }, + }, + }, + "condition": { + "agent_runner.runner_type": "local", + "provider_settings.enable": True, + }, + }, + "others": { + "description": "其他配置", + "type": "object", + "items": { + "provider_settings.display_reasoning_text": { + "description": "显示思考内容", + "hint": "显示模型的思维链信息到最终回复中。", + "type": "bool", + "condition": { + "agent_runner.runner_type": "local", + }, + }, + "provider_settings.streaming_response": { + "description": "流式输出", + "hint": "在受支持的聊天平台中以打字机的形式输出响应。", + "type": "bool", + }, + "provider_settings.unsupported_streaming_strategy": { + "description": "不支持流式回复的平台", + "type": "string", + "options": ["realtime_segmenting", "turn_off"], + "hint": "选择在不支持流式回复的平台上的处理方式。实时分段回复会在系统接收流式响应检测到诸如标点符号等分段点时,立即发送当前已接收的内容", + "labels": ["实时分段回复", "关闭流式回复"], + "condition": { + "provider_settings.streaming_response": True, + }, + }, + "provider_settings.identifier": { + "description": "用户识别", + "type": "bool", + "hint": "在用户提示词前带上用户 ID 信息。", + }, + "provider_settings.group_name_display": { + "description": "显示群名称", + "type": "bool", + "hint": "在受支持的消息平台的群聊中的用户提示词前带上群名称信息。", + }, + "provider_settings.datetime_system_prompt": { + "description": "现实世界时间感知", + "type": "bool", + "hint": "在用户提示词中带上当前的时间信息。", + "condition": { + "agent_runner.runner_type": "local", + }, + }, + "provider_settings.show_tool_use_status": { + "description": "输出工具调用信息", + "hint": "有工具调用时,同时发送带有工具调用名字的消息。", + "type": "bool", + "condition": { + "agent_runner.runner_type": "local", + }, + }, + "provider_settings.show_tool_call_result": { + "description": "输出工具调用结果", + "type": "bool", + "hint": "仅在输出工具调用信息启用时生效,展示结果前 70 个字符。", + "condition": { + "agent_runner.runner_type": "local", + "provider_settings.show_tool_use_status": True, + }, + }, + "provider_settings.buffer_intermediate_messages": { + "description": "合并 Agent 中间消息", + "type": "bool", + "hint": "开启后,非流式模式下多步工具调用过程中产生的中间文本将缓冲,待 Agent 完成后合并为一条回复发送。", + "condition": { + "agent_runner.runner_type": "local", + "provider_settings.streaming_response": False, + }, + }, + "agent_runner.config.misc.sanitize_context_by_modalities": { + "description": "按模型能力清理历史上下文", + "type": "bool", + "hint": "开启后,在每次请求 LLM 前会按当前模型提供商中所选择的模型能力删除对话中不支持的图片/工具调用结构(会改变模型看到的历史)", + "condition": { + "agent_runner.runner_type": "local", + }, + }, + "agent_runner.config.misc.max_steps": { + "description": "工具调用轮数上限", + "type": "int", + "condition": { + "agent_runner.runner_type": "local", + }, + }, + "agent_runner.config.misc.tool_call_timeout": { + "description": "工具调用超时时间(秒)", + "type": "int", + "condition": { + "agent_runner.runner_type": "local", + }, + }, + "agent_runner.config.misc.tool_schema_mode": { + "description": "工具调用模式", + "type": "string", + "options": ["skills_like", "full"], + "labels": ["Skills-like(两阶段)", "Full(完整参数)"], + "hint": "skills-like 先下发工具名称与描述,再下发参数;full 一次性下发完整参数。", + "condition": { + "agent_runner.runner_type": "local", + }, + }, + "provider_settings.wake_prefix": { + "description": "额外唤醒前缀", + "type": "string", + "hint": "如果唤醒前缀为 /, 额外聊天唤醒前缀为 chat,则需要 /chat 才会触发 LLM 请求", + }, + "provider_settings.image_compress_options.max_size": { + "description": "输入图片最大边长", + "type": "int", + "hint": "发送给模型的图片最长边(像素),系统会在必要时进一步压缩。", + "slider": {"min": 256, "max": 4096, "step": 64}, + }, + "provider_settings.prompt_prefix": { + "description": "用户提示词", + "type": "string", + "hint": "可使用 {{prompt}} 作为用户输入的占位符。如果不输入占位符则代表添加在用户输入的前面。", + "collapsed": True, + }, + "provider_tts_settings.dual_output": { + "description": "开启 TTS 时同时输出语音和文字内容", + "type": "bool", + "collapsed": True, + }, + "provider_settings.reachability_check": { + "description": "提供商可达性检测", + "type": "bool", + "hint": "/provider 命令列出模型时是否并发检测连通性。开启后会主动调用模型测试连通性,可能产生额外 token 消耗。", + "collapsed": True, + }, + "provider_settings.max_quoted_fallback_images": { + "description": "引用图片回退解析上限", + "type": "int", + "hint": "引用/转发消息回退解析图片时的最大注入数量,超出会截断。", + "condition": { + "agent_runner.runner_type": "local", + }, + "collapsed": True, + }, + "provider_settings.quoted_message_parser.max_component_chain_depth": { + "description": "引用解析组件链深度", + "type": "int", + "hint": "解析 Reply 组件链时允许的最大递归深度。", + "condition": { + "agent_runner.runner_type": "local", + }, + "collapsed": True, + }, + "provider_settings.quoted_message_parser.max_forward_node_depth": { + "description": "引用解析转发节点深度", + "type": "int", + "hint": "解析合并转发节点时允许的最大递归深度。", + "condition": { + "agent_runner.runner_type": "local", + }, + "collapsed": True, + }, + "provider_settings.quoted_message_parser.max_forward_fetch": { + "description": "引用解析转发拉取上限", + "type": "int", + "hint": "递归拉取 get_forward_msg 的最大次数。", + "condition": { + "agent_runner.runner_type": "local", + }, + "collapsed": True, + }, + "provider_settings.quoted_message_parser.warn_on_action_failure": { + "description": "引用解析 action 失败告警", + "type": "bool", + "hint": "开启后,get_msg/get_forward_msg 全部尝试失败时输出 warning 日志。", + "condition": { + "agent_runner.runner_type": "local", + }, + "collapsed": True, + }, + }, + "condition": { + "provider_settings.enable": True, + }, + }, + }, + }, + "platform_group": { + "name": "平台与消息", + "metadata": { + "general": { + "description": "基本", + "type": "object", + "items": { + "platform_settings.unique_session": { + "description": "隔离对话", + "type": "bool", + "hint": "启用后,支持隔离的渠道会为每位群成员使用独立上下文。指令权限请在「管理行为 → 指令」中设置。", + }, + "wake_prefix": { + "description": "唤醒词", + "hint": "唤醒机器人的消息前缀的列表,也可以通过 @ 机器人来唤醒。\n\n内置指令(如 `/help`、`/sid`)也依赖唤醒词:群聊中不带唤醒词直接输入将无法触发;私聊在未启用「私聊消息需要唤醒词」时无需前缀,可直接输入指令触发。", + "type": "list", + "items": {"type": "string"}, + }, + "platform_settings.friend_message_needs_wake_prefix": { + "description": "私聊消息需要唤醒词", + "hint": "私聊消息也必须带上唤醒前缀才能唤醒机器人。", + "type": "bool", + }, + "platform_settings.reply_prefix": { + "description": "回复时的文本前缀", + "hint": "回复中附带的文本前缀。", + "type": "string", + }, + "platform_settings.reply_with_mention": { + "description": "回复时 @ 发送人", + "hint": "回复时提及发送人。", + "type": "bool", + }, + "platform_settings.reply_with_quote": { + "description": "回复时引用发送人消息", + "hint": "回复时引用发送人的对应消息。", + "type": "bool", + }, + "platform_settings.forward_threshold": { + "description": "转发消息的字数阈值", + "hint": "在受支持的平台上,当回复消息过长时,采用 “合并消息转发” 的方式发送消息。", + "type": "int", + }, + "platform_settings.empty_mention_waiting": { + "description": "只 @ 机器人是否触发等待", + "hint": "当发送一条只有提及机器人的消息时,是否在接下来的 1 分钟内保持唤醒状态等待用户的第二条消息。", + "type": "bool", + }, + "disable_builtin_commands": { + "description": "禁用自带指令", + "type": "bool", + "hint": "禁用所有 AstrBot 的自带指令,如 help, sid, new 等。", + }, + }, + }, + "rate_limit": { + "description": "速率限制", + "type": "object", + "items": { + "platform_settings.rate_limit.time": { + "description": "消息速率限制时间(秒)", + "type": "int", + }, + "platform_settings.rate_limit.count": { + "description": "消息速率限制计数", + "type": "int", + }, + "platform_settings.rate_limit.strategy": { + "description": "速率限制策略", + "type": "string", + "options": ["stall", "discard"], + }, + }, + }, + "content_safety": { + "description": "内容安全", + "type": "object", + "items": { + "content_safety.also_use_in_response": { + "description": "同时检查模型的响应内容", + "type": "bool", + }, + "content_safety.baidu_aip.enable": { + "description": "使用百度内容安全审核", + "type": "bool", + "hint": "您需要手动安装 baidu-aip 库。", + }, + "content_safety.baidu_aip.app_id": { + "description": "App ID", + "type": "string", + "condition": { + "content_safety.baidu_aip.enable": True, + }, + }, + "content_safety.baidu_aip.api_key": { + "description": "API Key", + "type": "string", + "secret": True, + "condition": { + "content_safety.baidu_aip.enable": True, + }, + }, + "content_safety.baidu_aip.secret_key": { + "description": "Secret Key", + "type": "string", + "secret": True, + "condition": { + "content_safety.baidu_aip.enable": True, + }, + }, + "content_safety.internal_keywords.enable": { + "description": "关键词检查", + "type": "bool", + }, + "content_safety.internal_keywords.extra_keywords": { + "description": "额外关键词", + "type": "list", + "items": {"type": "string"}, + "hint": "额外的屏蔽关键词列表,支持正则表达式。", + }, + }, + }, + "others": { + "description": "其他配置", + "type": "object", + "items": { + "platform_settings.ignore_bot_self_message": { + "description": "是否忽略机器人自身的消息", + "type": "bool", + }, + "platform_settings.ignore_at_all": { + "description": "是否忽略 @ 全体成员事件", + "type": "bool", + }, + "platform_settings.no_permission_reply": { + "description": "用户权限不足时是否回复", + "type": "bool", + }, + "platform_specific.lark.pre_ack_emoji.enable": { + "description": "[飞书] 启用预回应表情", + "type": "bool", + }, + "platform_specific.lark.pre_ack_emoji.emojis": { + "description": "表情列表(飞书表情枚举名)", + "type": "list", + "items": {"type": "string"}, + "hint": "表情枚举名参考:https://open.feishu.cn/document/server-docs/im-v1/message-reaction/emojis-introduce", + "condition": { + "platform_specific.lark.pre_ack_emoji.enable": True, + }, + }, + "platform_specific.telegram.pre_ack_emoji.enable": { + "description": "[Telegram] 启用预回应表情", + "type": "bool", + }, + "platform_specific.telegram.pre_ack_emoji.emojis": { + "description": "表情列表(Unicode)", + "type": "list", + "items": {"type": "string"}, + "hint": "Telegram 仅支持固定反应集合,参考:https://gist.github.com/Soulter/3f22c8e5f9c7e152e967e8bc28c97fc9", + "condition": { + "platform_specific.telegram.pre_ack_emoji.enable": True, + }, + }, + "platform_specific.discord.pre_ack_emoji.enable": { + "description": "[Discord] 启用预回应表情", + "type": "bool", + }, + "platform_specific.discord.pre_ack_emoji.emojis": { + "description": "表情列表(Unicode 或自定义表情名)", + "type": "list", + "items": {"type": "string"}, + "hint": "填写 Unicode 表情符号,例如:👍、🤔、⏳", + "condition": { + "platform_specific.discord.pre_ack_emoji.enable": True, + }, + }, + }, + }, + }, + }, + "access_group": { + "name": "访问控制", + "metadata": { + "admins": { + "description": "管理员", + "type": "object", + "items": { + "admins_id": { + "description": "管理员 ID", + "type": "list", + "_special": "sender_id", + "items": {"type": "string"}, + "hint": "给机器人发送 /sid 指令以获取 ID。", + }, + }, + }, + "whitelist": { + "description": "白名单", + "type": "object", + "items": { + "platform_settings.enable_id_white_list": { + "description": "启用白名单", + "type": "bool", + "hint": "启用后,只有在白名单内的会话会被响应。", + }, + "platform_settings.id_whitelist": { + "description": "白名单 ID 列表", + "type": "list", + "_special": "umo", + "items": {"type": "string"}, + "hint": "给机器人发送 /sid 指令以获取 ID。为空时代表不启用白名单功能。", + }, + "platform_settings.id_whitelist_log": { + "description": "输出拦截日志", + "type": "bool", + "hint": "输出未通过白名单校验的消息的日志。", + }, + "platform_settings.wl_ignore_admin_on_group": { + "description": "管理员群组消息无视 ID 白名单", + "type": "bool", + }, + "platform_settings.wl_ignore_admin_on_friend": { + "description": "管理员私聊消息无视 ID 白名单", + "type": "bool", + }, + }, + }, + }, + }, + "plugin_group": { + "name": "插件", + "metadata": { + "plugin": { + "description": "插件", + "type": "object", + "items": { + "plugin_set": { + "description": "可用插件", + "type": "bool", + "hint": "默认启用全部未被禁用的插件。若插件在插件页面被禁用,则此处的选择不会生效。", + "_special": "select_plugin_set", + }, + }, + }, + }, + }, + "ext_group": { + "name": "扩展功能", + "metadata": { + "segmented_reply": { + "description": "分段回复", + "type": "object", + "items": { + "platform_settings.segmented_reply.enable": { + "description": "启用分段回复", + "hint": "以分段输出的方式发送回复消息。", + "type": "bool", + }, + "platform_settings.segmented_reply.only_llm_result": { + "description": "仅对 LLM 结果分段", + "type": "bool", + "condition": { + "platform_settings.segmented_reply.enable": True, + }, + }, + "platform_settings.segmented_reply.interval_method": { + "description": "间隔方法。", + "hint": "random 为随机时间,log 为根据消息长度计算,$y=log_(x)$,x为字数,y的单位为秒。", + "type": "string", + "options": ["random", "log"], + "condition": { + "platform_settings.segmented_reply.enable": True, + }, + }, + "platform_settings.segmented_reply.interval": { + "description": "随机间隔时间", + "type": "string", + "hint": "格式:最小值,最大值(如:1.5,3.5)", + "condition": { + "platform_settings.segmented_reply.enable": True, + "platform_settings.segmented_reply.interval_method": "random", + }, + }, + "platform_settings.segmented_reply.log_base": { + "description": "对数底数", + "type": "float", + "hint": "对数间隔的底数,默认为 2.6。取值范围为 1.0-10.0。", + "condition": { + "platform_settings.segmented_reply.enable": True, + "platform_settings.segmented_reply.interval_method": "log", + }, + }, + "platform_settings.segmented_reply.words_count_threshold": { + "description": "分段回复字数阈值", + "hint": "分段回复的字数上限。只有字数小于此值的消息才会被分段,超过此值的长消息将直接发送(不分段)。默认为 150", + "type": "int", + "condition": { + "platform_settings.segmented_reply.enable": True, + }, + }, + "platform_settings.segmented_reply.split_mode": { + "description": "分段模式", + "type": "string", + "options": ["regex", "words"], + "labels": ["正则表达式", "分段词列表"], + "condition": { + "platform_settings.segmented_reply.enable": True, + }, + }, + "platform_settings.segmented_reply.regex": { + "description": "分段正则表达式", + "hint": "用于分隔一段消息。默认情况下会根据句号、问号等标点符号分隔。如填写 `[。?!]` 将移除所有的句号、问号、感叹号。re.findall(r'', text)", + "type": "string", + "condition": { + "platform_settings.segmented_reply.enable": True, + "platform_settings.segmented_reply.split_mode": "regex", + }, + }, + "platform_settings.segmented_reply.split_words": { + "description": "分段词列表", + "type": "list", + "hint": "检测到列表中的任意词时进行分段,如:。、?、!等", + "condition": { + "platform_settings.segmented_reply.enable": True, + "platform_settings.segmented_reply.split_mode": "words", + }, + }, + "platform_settings.segmented_reply.content_cleanup_rule": { + "description": "内容过滤正则表达式", + "type": "string", + "hint": "移除分段后内容中的指定内容。如填写 `[。?!]` 将移除所有的句号、问号、感叹号。", + "condition": { + "platform_settings.segmented_reply.enable": True, + }, + }, + }, + }, + "ltm": { + "description": "群聊上下文感知", + "type": "object", + "items": { + "provider_ltm_settings.group_icl_enable": { + "description": "群聊消息记录注入上下文", + "hint": "是否记录群聊非唤醒机器人的消息,并在唤醒机器人时将消息传给模型。", + "type": "bool", + }, + "provider_ltm_settings.group_message_max_cnt": { + "description": "注入上下文最大消息数量", + "hint": "传给模型的消息的最大数量。", + "type": "int", + "condition": { + "provider_ltm_settings.group_icl_enable": True, + }, + }, + "provider_ltm_settings.image_caption": { + "description": "自动理解图片", + "type": "bool", + "hint": "对非唤醒机器人的图片消息启用图片转述,转换成图片描述文本。对于图片消息频繁的群聊,此功能可能造成较大的开销,请慎用。", + "condition": { + "provider_ltm_settings.group_icl_enable": True, + }, + }, + "provider_ltm_settings.image_caption_provider_id": { + "description": "群聊图片转述模型", + "type": "string", + "_special": "select_provider", + "hint": "用于群聊记录注入上下文的图片理解,与图片转述模型分开配置。", + "condition": { + "provider_ltm_settings.group_icl_enable": True, + "provider_ltm_settings.image_caption": True, + }, + }, + "provider_ltm_settings.group_message_history_enable": { + "description": "持久化群聊消息记录", + "type": "bool", + "hint": "将群内的所有消息都持久化保存,并允许模型通过工具来查询群内消息。", + }, + "provider_ltm_settings.group_message_history_max_cnt": { + "description": "持久化最大消息数量", + "hint": "持久化保存的消息的最大数量,超过后抛弃旧的消息。", + "type": "int", + "condition": { + "provider_ltm_settings.group_message_history_enable": True, + }, + }, + "provider_ltm_settings.active_reply.enable": { + "description": "主动回复", + "hint": "是否在合适的时机主动发消息。", + "type": "bool", + }, + "provider_ltm_settings.active_reply.method": { + "description": "主动回复方法", + "type": "string", + "options": ["possibility_reply"], + "condition": { + "provider_ltm_settings.active_reply.enable": True, + }, + }, + "provider_ltm_settings.active_reply.possibility_reply": { + "description": "回复概率", + "type": "float", + "hint": "0.0-1.0 之间的数值", + "slider": {"min": 0, "max": 1, "step": 0.05}, + "condition": { + "provider_ltm_settings.active_reply.enable": True, + }, + }, + "provider_ltm_settings.active_reply.whitelist": { + "description": "主动回复白名单", + "type": "list", + "items": {"type": "string"}, + "hint": "为空时不启用白名单过滤。使用 /sid 获取 ID。", + "condition": { + "provider_ltm_settings.active_reply.enable": True, + }, + }, + }, + }, + "t2i": { + "description": "文本转图像", + "type": "object", + "items": { + "t2i": { + "description": "文本转图像输出", + "hint": "将模型回复转换成图片后再发送,防止刷屏。", + "type": "bool", + }, + "t2i_word_threshold": { + "description": "文本转图像字数阈值", + "type": "int", + "condition": { + "t2i": True, + }, + }, + "t2i_strategy": { + "description": "文本转图像策略", + "type": "string", + "hint": "文本转图像策略。`remote` 为使用远程基于 HTML 的渲染服务,`local` 为使用 PIL 本地渲染。当使用 local 时,将 ttf 字体命名为 'font.ttf' 放在 data/ 目录下可自定义字体。", + "options": ["remote", "local"], + "condition": { + "t2i": True, + }, + }, + "t2i_endpoint": { + "description": "文本转图像服务 API 地址", + "type": "string", + "hint": "为空时使用 AstrBot API 服务", + "condition": { + "t2i": True, + "t2i_strategy": "remote", + }, + }, + "t2i_template": { + "description": "文本转图像自定义模版", + "type": "bool", + "hint": "启用后可自定义 HTML 模板用于文转图渲染。", + "condition": { + "t2i": True, + "t2i_strategy": "remote", + }, + "_special": "t2i_template", + }, + "t2i_active_template": { + "description": "当前应用的文转图渲染模板", + "type": "string", + "hint": "此处的值由文转图模板管理页面进行维护。", + "invisible": True, + }, + }, + }, + }, + }, +} + +CONFIG_METADATA_3_SYSTEM = { + "system_group": { + "name": "系统配置", + "metadata": { + "system": { + "description": "系统配置", + "type": "object", + "items": { + "log_level": { + "description": "控制台日志级别", + "type": "string", + "hint": "控制台输出日志的级别。", + "options": ["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"], + }, + "dashboard.ssl.enable": { + "description": "启用 WebUI HTTPS", + "type": "bool", + "hint": "启用后,WebUI 将直接使用 HTTPS 提供服务。", + }, + "dashboard.trust_proxy_headers": { + "description": "信任代理请求头获取客户端 IP", + "type": "bool", + "hint": "关闭时忽略 X-Forwarded-For/X-Real-IP,仅使用连接地址。", + }, + "dashboard.auth_rate_limit.enable": { + "description": "启用登录验证速率限制", + "type": "bool", + "hint": "关闭后将不对登录、TOTP 等身份验证接口进行速率限制。", + }, + "dashboard.auth_rate_limit.average_interval": { + "description": "验证端点速率限制平均间隔(秒)", + "type": "float", + "hint": "两次身份验证请求之间的最小平均间隔时间。例如设置为 1.0 表示每秒最多处理 1 个请求。", + "condition": {"dashboard.auth_rate_limit.enable": True}, + }, + "dashboard.auth_rate_limit.max_burst": { + "description": "验证端点速率限制最大突发数", + "type": "int", + "hint": "允许的瞬时最大突发请求数。例如设置为 3 表示在短时间内最多连续处理 3 个请求。", + "condition": {"dashboard.auth_rate_limit.enable": True}, + }, + "dashboard.totp.enable": { + "description": "启用 WebUI TOTP 双因素认证", + "type": "bool", + "hint": "启用后,登录 WebUI 需要额外输入验证码。", + "_special": "dashboard_totp_manager", + }, + "dashboard.ssl.cert_file": { + "description": "SSL 证书文件路径", + "type": "string", + "hint": "证书文件路径(PEM)。支持绝对路径和相对路径(相对于当前工作目录)。", + "condition": {"dashboard.ssl.enable": True}, + }, + "dashboard.ssl.key_file": { + "description": "SSL 私钥文件路径", + "type": "string", + "hint": "私钥文件路径(PEM)。支持绝对路径和相对路径(相对于当前工作目录)。", + "condition": {"dashboard.ssl.enable": True}, + }, + "dashboard.ssl.ca_certs": { + "description": "SSL CA 证书文件路径", + "type": "string", + "hint": "可选。用于指定 CA 证书文件路径。", + "condition": {"dashboard.ssl.enable": True}, + }, + "log_file_enable": { + "description": "启用文件日志", + "type": "bool", + "hint": "开启后会将日志写入指定文件。", + }, + "log_file_path": { + "description": "日志文件路径", + "type": "string", + "hint": "相对路径以 data 目录为基准,例如 logs/astrbot.log;支持绝对路径。", + }, + "log_file_max_mb": { + "description": "日志文件大小上限 (MB)", + "type": "int", + "hint": "超过大小后自动轮转,默认 20MB。", + }, + "temp_dir_max_size": { + "description": "临时目录大小上限 (MB)", + "type": "int", + "hint": "用于限制 data/temp 目录总大小,单位为 MB。系统每 10 分钟检查一次,超限时按文件修改时间从旧到新删除,释放约 30% 当前体积。", + }, + "trace_enable": { + "description": "启用追踪记录", + "type": "bool", + "hint": "追踪用户的每次指令和 AI 调用。", + }, + "trace_db_path": { + "description": "追踪数据库路径", + "type": "string", + "hint": "相对路径以 data 目录为基准,例如 logs/traces.db;支持绝对路径。", + }, + "trace_db_max_mb": { + "description": "追踪数据库容量预算 (MB)", + "type": "int", + "hint": "默认 80 MB,最小 32 MB,低于最小值时按 32 MB 生效。超出后自动清除旧数据。", + }, + "trace_retention_days": { + "description": "追踪保留天数", + "type": "int", + "hint": "默认 7 天,期限或容量先达到者触发清理。", + }, + "pip_install_arg": { + "description": "pip 安装额外参数", + "type": "string", + "hint": "安装插件依赖时,会使用 Python 的 pip 工具。这里可以填写额外的参数,如 `--break-system-package` 等。PyPI 镜像的 TLS 证书默认会校验;若使用自签名/私有 CA 镜像,请通过 `--cert ` 指定信任的证书(推荐),或显式添加 `--trusted-host <主机名>`。", + }, + "pypi_index_url": { + "description": "PyPI 软件仓库地址", + "type": "string", + "hint": "安装 Python 依赖时请求的 PyPI 软件仓库地址。默认为 https://mirrors.aliyun.com/pypi/simple/", + }, + "callback_api_base": { + "description": "对外可达的回调接口地址", + "type": "string", + "hint": "外部服务可能会通过 AstrBot 生成的回调链接(如文件下载链接)访问 AstrBot 后端。由于 AstrBot 无法自动判断部署环境中对外可达的主机地址(host),因此需要通过此配置项显式指定 “外部服务如何访问 AstrBot” 的地址。如 http://localhost:6185,https://example.com 等。", + }, + "timezone": { + "description": "时区", + "type": "string", + "hint": "时区设置。请填写 IANA 时区名称, 如 Asia/Shanghai, 为空时使用系统默认时区。所有时区请查看: https://data.iana.org/time-zones/tzdb-2021a/zone1970.tab", + }, + "http_proxy": { + "description": "代理", + "type": "string", + "hint": "启用后,会以添加环境变量的方式设置代理。支持 http://、https://、socks5:// 格式,例如:http://127.0.0.1:7890 或 socks5://127.0.0.1:7891", + }, + "no_proxy": { + "description": "直连地址列表", + "type": "list", + "items": {"type": "string"}, + }, + }, + }, + }, + }, +} + + +DEFAULT_VALUE_MAP = { + "int": 0, + "float": 0.0, + "bool": False, + "string": "", + "text": "", + "list": [], + "file": [], + "object": {}, + "template_list": [], + "dict": {}, +} diff --git a/astrbot/core/db/vec_db/faiss_impl/embedding_storage.py b/astrbot/core/db/vec_db/faiss_impl/embedding_storage.py index c7684506d74..b92621a8727 100644 --- a/astrbot/core/db/vec_db/faiss_impl/embedding_storage.py +++ b/astrbot/core/db/vec_db/faiss_impl/embedding_storage.py @@ -1,186 +1,295 @@ -from __future__ import annotations - -import os -import shutil -import tempfile -from typing import TYPE_CHECKING - -import numpy as np - -if TYPE_CHECKING: - import faiss - -# ── Faiss C++ fopen() 在 Windows 上使用 ANSI codepage ── -# Python 传给 Faiss 的路径是 UTF-8 字节,但 Windows fopen 期望 ANSI 编码, -# 导致含非 ASCII 字符的路径(如 C:\Users\中文用户名\...)被解读为乱码而失败。 -# 本模块通过"纯 ASCII 临时文件桥接"规避此问题。 - - -def _needs_bridge(path: str) -> bool: - """判断是否需要 ASCII 临时文件桥接。""" - return os.name == "nt" and not path.isascii() - - -def _safe_temp_dir() -> str: - """返回保证纯 ASCII 且可写的临时目录,用于 Faiss I/O 桥接。 - - 优先级: - 1. %SystemRoot%\\Temp(Windows 系统临时目录) - 2. tempfile.gettempdir()(当其为纯 ASCII 时) - 3. 非 Windows 平台使用 tempfile.gettempdir() - """ - if os.name == "nt": - root = os.environ.get("SystemRoot", r"C:\Windows") - temp_dir = os.path.join(root, "Temp") - if ( - temp_dir.isascii() - and os.path.isdir(temp_dir) - and os.access(temp_dir, os.W_OK) - ): - return temp_dir - - tmp = tempfile.gettempdir() - if tmp.isascii(): - return tmp - - raise OSError( - "_safe_temp_dir: 无法找到可写的纯 ASCII 临时目录。" - f" 检查过 SystemRoot\\Temp={temp_dir}, gettempdir={tmp}" - ) - - return tempfile.gettempdir() - - -def _make_temp_file(prefix: str) -> str: - """创建用于 Faiss 桥接的临时文件,返回路径。""" - safe_dir = _safe_temp_dir() - fd, path = tempfile.mkstemp(prefix=f"{prefix}_", suffix=".faiss", dir=safe_dir) - os.close(fd) - return path - - -class EmbeddingStorage: - def __init__(self, dimension: int, path: str | None = None) -> None: - try: - import faiss - except ImportError: - raise ImportError( - "faiss 未安装。请使用 'pip install faiss-cpu' 或 'pip install faiss-gpu' 安装。", - ) - self.dimension = dimension - self.path = path - self.index = None - if path and os.path.exists(path): - self.index = self._read_index(path) - else: - if dimension <= 0: - raise ValueError( - f"无效的嵌入向量维度: {dimension}。请检查该知识库使用的 Embedding " - "Provider 是否正确配置了 embedding_dimensions。", - ) - base_index = faiss.IndexFlatL2(dimension) - self.index = faiss.IndexIDMap(base_index) - - @staticmethod - def _read_index(path: str) -> faiss.Index: - """读取 Faiss 索引,兼容含非 ASCII 字符的 Windows 路径。""" - import faiss - - try: - return faiss.read_index(path) - except RuntimeError: - if not _needs_bridge(path): - raise - - tmp = _make_temp_file("_faiss_read") - try: - shutil.copy2(path, tmp) - return faiss.read_index(tmp) - finally: - if os.path.exists(tmp): - try: - os.remove(tmp) - except OSError: - pass - - @staticmethod - def _write_index(index: faiss.Index, path: str) -> None: - """保存 Faiss 索引,兼容含非 ASCII 字符的 Windows 路径。""" - import faiss - - dirname = os.path.dirname(path) - if dirname: - os.makedirs(dirname, exist_ok=True) - - if not _needs_bridge(path): - faiss.write_index(index, path) - return - - tmp = _make_temp_file("_faiss_write") - try: - faiss.write_index(index, tmp) - shutil.move(tmp, path) - finally: - if os.path.exists(tmp): - try: - os.remove(tmp) - except OSError: - pass - - async def insert(self, vector: np.ndarray, id: int) -> None: - """插入向量""" - assert self.index is not None, "FAISS index is not initialized." - if vector.shape[0] != self.dimension: - raise ValueError( - f"向量维度不匹配, 期望: {self.dimension}, 实际: {vector.shape[0]}", - ) - self.index.add_with_ids(vector.reshape(1, -1), np.array([id], dtype=np.int64)) - await self.save_index() - - async def insert_batch(self, vectors: np.ndarray, ids: list[int]) -> None: - """批量插入向量""" - assert self.index is not None, "FAISS index is not initialized." - if len(vectors.shape) != 2: - raise ValueError( - f"向量必须是二维数组, 当前维度: {len(vectors.shape)}", - ) - if vectors.shape[1] != self.dimension: - raise ValueError( - f"向量维度不匹配, 期望: {self.dimension}, 实际: {vectors.shape[1]}", - ) - self.index.add_with_ids(vectors, np.array(ids, dtype=np.int64)) - await self.save_index() - - async def search(self, vector: np.ndarray, k: int) -> tuple: - """搜索向量 - - 接受 1D (d,) 或 2D (1, d) 向量,自动展平为 Faiss 期望的 (1, d)。 - """ - assert self.index is not None, "FAISS index is not initialized." - vector = np.asarray(vector, dtype=np.float32).ravel() - if vector.shape[0] != self.dimension: - raise ValueError( - f"向量维度不匹配, 期望: {self.dimension}, 实际: {vector.shape[0]}", - ) - distances, indices = self.index.search(vector.reshape(1, -1), k) - return distances, indices - - async def delete(self, ids: list[int]) -> None: - """删除向量 - - 删除不存在的 ID 时 Faiss 会抛 RuntimeError。 - 由于 remove_ids 为幂等操作,此处忽略该错误。 - """ - assert self.index is not None, "FAISS index is not initialized." - try: - self.index.remove_ids(np.array(ids, dtype=np.int64)) - except RuntimeError: - # 幂等:删除已不存在的 ID,安全忽略 - pass - await self.save_index() - - async def save_index(self) -> None: - """保存索引(兼容含非 ASCII 字符的 Windows 路径)""" - if self.index is None or not self.path: - return - self._write_index(self.index, self.path) +from __future__ import annotations + +import os +import shutil +import tempfile +from typing import TYPE_CHECKING + +import numpy as np + +from astrbot import logger + +if TYPE_CHECKING: + import faiss + +# ── Faiss C++ fopen() 在 Windows 上使用 ANSI codepage ── +# Python 传给 Faiss 的路径是 UTF-8 字节,但 Windows fopen 期望 ANSI 编码, +# 导致含非 ASCII 字符的路径(如 C:\Users\中文用户名\...)被解读为乱码而失败。 +# 本模块通过"纯 ASCII 临时文件桥接"规避此问题。 + + +#: 模长低于该阈值的行视为零向量,不做缩放,避免放大浮点噪声。 +_MIN_NORM = 1e-12 + + +def _l2_normalize(vectors: np.ndarray) -> np.ndarray: + """把每行缩放到单位长度,让 L2 距离等价于按余弦相似度排序。 + + ``IndexFlatL2`` 返回欧氏距离的平方,配合 ``score = 1 - distance / 2`` + 只有在向量是单位向量时才等于余弦相似度。部分提供商返回的向量未归一化 + (如 Gemini 在低于 3072 维时),且模长会随文本长度漂移,此时分数由模长 + 而非语义主导,检索排序会失效。 + + 用 float64 计算范数再转回 float32:float32 下对接近上限的值求平方会 + 溢出成 ``inf``,导致整行归一化后变成全零。 + + Args: + vectors: 一维或二维数组,最后一维是向量维度。 + + Returns: + 与输入形状相同的 float32 单位向量数组;零向量行保持为零。 + """ + array = np.asarray(vectors, dtype=np.float32) + if array.size == 0: + return array + + wide = array.astype(np.float64) + norms = np.linalg.norm(wide, axis=-1, keepdims=True) + # 零向量与极小模长不参与缩放,否则会产出 inf/NaN。 + norms = np.where(norms < _MIN_NORM, 1.0, norms) + return (wide / norms).astype(np.float32) + + +def _needs_bridge(path: str) -> bool: + """判断是否需要 ASCII 临时文件桥接。""" + return os.name == "nt" and not path.isascii() + + +def _safe_temp_dir() -> str: + """返回保证纯 ASCII 且可写的临时目录,用于 Faiss I/O 桥接。 + + 优先级: + 1. %SystemRoot%\\Temp(Windows 系统临时目录) + 2. tempfile.gettempdir()(当其为纯 ASCII 时) + 3. 非 Windows 平台使用 tempfile.gettempdir() + """ + if os.name == "nt": + root = os.environ.get("SystemRoot", r"C:\Windows") + temp_dir = os.path.join(root, "Temp") + if ( + temp_dir.isascii() + and os.path.isdir(temp_dir) + and os.access(temp_dir, os.W_OK) + ): + return temp_dir + + tmp = tempfile.gettempdir() + if tmp.isascii(): + return tmp + + raise OSError( + "_safe_temp_dir: 无法找到可写的纯 ASCII 临时目录。" + f" 检查过 SystemRoot\\Temp={temp_dir}, gettempdir={tmp}" + ) + + return tempfile.gettempdir() + + +def _make_temp_file(prefix: str) -> str: + """创建用于 Faiss 桥接的临时文件,返回路径。""" + safe_dir = _safe_temp_dir() + fd, path = tempfile.mkstemp(prefix=f"{prefix}_", suffix=".faiss", dir=safe_dir) + os.close(fd) + return path + + +class EmbeddingStorage: + def __init__(self, dimension: int, path: str | None = None) -> None: + try: + import faiss + except ImportError: + raise ImportError( + "faiss 未安装。请使用 'pip install faiss-cpu' 或 'pip install faiss-gpu' 安装。", + ) + self.dimension = dimension + self.path = path + self.index = None + self._pending_save = False + if path and os.path.exists(path): + self.index = self._read_index(path) + self._normalize_loaded_index() + else: + if dimension <= 0: + raise ValueError( + f"无效的嵌入向量维度: {dimension}。请检查该知识库使用的 Embedding " + "Provider 是否正确配置了 embedding_dimensions。", + ) + base_index = faiss.IndexFlatL2(dimension) + self.index = faiss.IndexIDMap(base_index) + + def _normalize_loaded_index(self) -> None: + """把旧索引里未归一化的向量就地归一化。 + + 旧版本入库时未做归一化,而检索侧现在会归一化查询向量。两侧标准不 + 一致会让相似度整体失真(分数偏移,排序也可能错),因此加载旧索引时 + 统一重建为归一化后的向量。 + + 仅处理 ``IndexIDMap(IndexFlatL2)``;其他索引类型(如已训练的 IVF) + 无法安全地重建向量,直接跳过以保证兼容。 + """ + import faiss + + if self.index is None: + return + + # AstrBot 只会用 IndexIDMap(IndexFlatL2);其他布局(如已训练的 IVF) + # 无法安全重建向量,直接跳过以保证兼容。 + if not isinstance(self.index, faiss.IndexIDMap): + return + + inner = faiss.downcast_index(self.index.index) + if not isinstance(inner, faiss.IndexFlat) or inner.ntotal == 0: + return + + try: + # IndexFlat 支持按位置取回原始向量。 + vectors = inner.reconstruct_n(0, inner.ntotal) + except RuntimeError: + logger.debug("[EmbeddingStorage] 索引不支持 reconstruct,跳过归一化。") + return + + # 已经全部是单位向量时不重建,避免每次加载都重写索引文件。 + # 零向量的模长是 0 而非 1,必须排除在外,否则会误判成"未归一化", + # 导致每次启动都重建一遍索引。 + norms = np.linalg.norm(vectors.astype(np.float64), axis=1) + nonzero = norms[norms >= _MIN_NORM] + if nonzero.size == 0 or np.allclose(nonzero, 1.0, atol=1e-5): + return + + normalized = _l2_normalize(vectors) + ids = faiss.vector_to_array(self.index.id_map) + rebuilt = faiss.IndexIDMap(faiss.IndexFlatL2(inner.d)) + rebuilt.add_with_ids(normalized, ids) + self.index = rebuilt + self._pending_save = True + + logger.info( + f"[EmbeddingStorage] 已把 {len(normalized)} 条旧向量归一化为单位向量。", + ) + + async def flush(self) -> None: + """若加载旧索引时做过归一化重建,则把结果落盘。 + + 归一化是检索质量优化,不是正确性前提——内存里的索引已经可用。写盘 + 失败(磁盘满、只读挂载等)不应该让知识库整个打不开,因此这里只记日志 + 不抛异常。 + """ + if not self._pending_save: + return + try: + await self.save_index() + except Exception as e: + # 只记异常类型:OSError 等异常文本里常带完整路径,会把本机用户名 + # 等本地信息写进日志。 + logger.warning( + f"[EmbeddingStorage] 归一化后的索引写盘失败,本次运行使用内存中" + f"已归一化的索引,稍后会重试: {type(e).__name__}", + ) + return + self._pending_save = False + + @staticmethod + def _read_index(path: str) -> faiss.Index: + """读取 Faiss 索引,兼容含非 ASCII 字符的 Windows 路径。""" + import faiss + + try: + return faiss.read_index(path) + except RuntimeError: + if not _needs_bridge(path): + raise + + tmp = _make_temp_file("_faiss_read") + try: + shutil.copy2(path, tmp) + return faiss.read_index(tmp) + finally: + if os.path.exists(tmp): + try: + os.remove(tmp) + except OSError: + pass + + @staticmethod + def _write_index(index: faiss.Index, path: str) -> None: + """保存 Faiss 索引,兼容含非 ASCII 字符的 Windows 路径。""" + import faiss + + dirname = os.path.dirname(path) + if dirname: + os.makedirs(dirname, exist_ok=True) + + if not _needs_bridge(path): + faiss.write_index(index, path) + return + + tmp = _make_temp_file("_faiss_write") + try: + faiss.write_index(index, tmp) + shutil.move(tmp, path) + finally: + if os.path.exists(tmp): + try: + os.remove(tmp) + except OSError: + pass + + async def insert(self, vector: np.ndarray, id: int) -> None: + """插入向量""" + assert self.index is not None, "FAISS index is not initialized." + if vector.shape[0] != self.dimension: + raise ValueError( + f"向量维度不匹配, 期望: {self.dimension}, 实际: {vector.shape[0]}", + ) + self.index.add_with_ids( + _l2_normalize(vector.reshape(1, -1)), np.array([id], dtype=np.int64) + ) + await self.save_index() + + async def insert_batch(self, vectors: np.ndarray, ids: list[int]) -> None: + """批量插入向量""" + assert self.index is not None, "FAISS index is not initialized." + if len(vectors.shape) != 2: + raise ValueError( + f"向量必须是二维数组, 当前维度: {len(vectors.shape)}", + ) + if vectors.shape[1] != self.dimension: + raise ValueError( + f"向量维度不匹配, 期望: {self.dimension}, 实际: {vectors.shape[1]}", + ) + self.index.add_with_ids(_l2_normalize(vectors), np.array(ids, dtype=np.int64)) + await self.save_index() + + async def search(self, vector: np.ndarray, k: int) -> tuple: + """搜索向量 + + 接受 1D (d,) 或 2D (1, d) 向量,自动展平为 Faiss 期望的 (1, d)。 + """ + assert self.index is not None, "FAISS index is not initialized." + vector = np.asarray(vector, dtype=np.float32).ravel() + if vector.shape[0] != self.dimension: + raise ValueError( + f"向量维度不匹配, 期望: {self.dimension}, 实际: {vector.shape[0]}", + ) + distances, indices = self.index.search(_l2_normalize(vector.reshape(1, -1)), k) + return distances, indices + + async def delete(self, ids: list[int]) -> None: + """删除向量 + + 删除不存在的 ID 时 Faiss 会抛 RuntimeError。 + 由于 remove_ids 为幂等操作,此处忽略该错误。 + """ + assert self.index is not None, "FAISS index is not initialized." + try: + self.index.remove_ids(np.array(ids, dtype=np.int64)) + except RuntimeError: + # 幂等:删除已不存在的 ID,安全忽略 + pass + await self.save_index() + + async def save_index(self) -> None: + """保存索引(兼容含非 ASCII 字符的 Windows 路径)""" + if self.index is None or not self.path: + return + self._write_index(self.index, self.path) diff --git a/astrbot/core/db/vec_db/faiss_impl/vec_db.py b/astrbot/core/db/vec_db/faiss_impl/vec_db.py index 13fde6c0ef2..076fa4bb3f8 100644 --- a/astrbot/core/db/vec_db/faiss_impl/vec_db.py +++ b/astrbot/core/db/vec_db/faiss_impl/vec_db.py @@ -1,349 +1,356 @@ -import time -import uuid - -import numpy as np - -from astrbot import logger -from astrbot.core.exceptions import KnowledgeBaseUploadError -from astrbot.core.provider.provider import EmbeddingProvider, RerankProvider - -from ..base import BaseVecDB, Result -from .document_storage import DocumentStorage -from .embedding_storage import EmbeddingStorage - - -class FaissVecDB(BaseVecDB): - """A class to represent a vector database.""" - - def __init__( - self, - doc_store_path: str, - index_store_path: str, - embedding_provider: EmbeddingProvider, - rerank_provider: RerankProvider | None = None, - ) -> None: - self.doc_store_path = doc_store_path - self.index_store_path = index_store_path - self.embedding_provider = embedding_provider - self.document_storage = DocumentStorage(doc_store_path) - self.embedding_storage = EmbeddingStorage( - embedding_provider.get_dim(), - index_store_path, - ) - self.embedding_provider = embedding_provider - self.rerank_provider = rerank_provider - - async def initialize(self) -> None: - await self.document_storage.initialize() - - async def insert( - self, - content: str, - metadata: dict | None = None, - id: str | None = None, - ) -> int: - """插入一条文本和其对应向量,自动生成 ID 并保持一致性。""" - metadata = metadata or {} - str_id = id or str(uuid.uuid4()) # 使用 UUID 作为原始 ID - - vector = await self.embedding_provider.get_embedding(content) - vector = np.array(vector, dtype=np.float32) - - # 使用 DocumentStorage 的方法插入文档 - int_id = await self.document_storage.insert_document(str_id, content, metadata) - - # 插入向量到 FAISS - await self.embedding_storage.insert(vector, int_id) - return int_id - - async def insert_batch( - self, - contents: list[str], - metadatas: list[dict] | None = None, - ids: list[str] | None = None, - batch_size: int = 32, - tasks_limit: int = 3, - max_retries: int = 3, - progress_callback=None, - embedding_contents: list[str] | None = None, - ) -> list[int]: - """批量插入文本和其对应向量,自动生成 ID 并保持一致性。 - - Args: - progress_callback: 进度回调函数,接收参数 (current, total) - embedding_contents: Optional enriched texts used only for embeddings. - - """ - metadatas = metadatas or [{} for _ in contents] - ids = ids or [str(uuid.uuid4()) for _ in contents] - if embedding_contents is None: - embedding_contents = contents - - if not contents: - logger.debug( - "No contents provided for batch insert; skipping embedding generation." - ) - return [] - - content_count = len(contents) - if len(metadatas) != content_count: - raise KnowledgeBaseUploadError( - stage="storage", - user_message=( - f"存储失败:文本分块数量与元数据数量不一致(期望 {content_count}," - f"实际 {len(metadatas)})。" - ), - details={ - "expected_contents": content_count, - "actual_metadatas": len(metadatas), - }, - ) - if len(ids) != content_count: - raise KnowledgeBaseUploadError( - stage="storage", - user_message=( - f"存储失败:文本分块数量与文档 ID 数量不一致(期望 {content_count}," - f"实际 {len(ids)})。" - ), - details={ - "expected_contents": content_count, - "actual_ids": len(ids), - }, - ) - if len(embedding_contents) != content_count: - raise KnowledgeBaseUploadError( - stage="storage", - user_message=( - f"存储失败:文本分块数量与向量化文本数量不一致(期望 {content_count}," - f"实际 {len(embedding_contents)})。" - ), - details={ - "expected_contents": content_count, - "actual_embedding_contents": len(embedding_contents), - }, - ) - - start = time.time() - logger.debug(f"Generating embeddings for {len(contents)} contents...") - vectors = await self.embedding_provider.get_embeddings_batch( - embedding_contents, - batch_size=batch_size, - tasks_limit=tasks_limit, - max_retries=max_retries, - progress_callback=progress_callback, - ) - end = time.time() - logger.debug( - f"Generated embeddings for {len(contents)} contents in {end - start:.2f} seconds.", - ) - if len(vectors) != content_count: - raise KnowledgeBaseUploadError( - stage="embedding", - user_message=( - "向量化失败:嵌入模型返回的向量数量与文本分块数量不一致" - f"(期望 {content_count},实际 {len(vectors)})。" - "这通常说明当前 Embedding 接口未完整返回批量结果," - "或该服务不兼容当前批量请求格式。" - ), - details={ - "expected_contents": content_count, - "actual_vectors": len(vectors), - }, - ) - - # Validate vector format/dimension before any local write so validation - # failures never leave a half-written document store. - try: - vectors_array = np.asarray(vectors, dtype=np.float32) - except (TypeError, ValueError) as exc: - raise KnowledgeBaseUploadError( - stage="embedding", - user_message=( - "向量化失败:嵌入模型返回的向量格式不正确," - "无法转换为统一的浮点向量矩阵。" - ), - details={"vector_count": len(vectors)}, - ) from exc - if vectors_array.ndim != 2: - raise KnowledgeBaseUploadError( - stage="embedding", - user_message=( - "向量化失败:嵌入模型返回的向量格式不正确,无法构造成二维向量矩阵。" - ), - details={"actual_ndim": int(vectors_array.ndim)}, - ) - if vectors_array.shape[1] != self.embedding_storage.dimension: - raise KnowledgeBaseUploadError( - stage="embedding", - user_message=( - "向量化失败:返回向量维度与当前知识库索引维度不一致" - f"(期望 {self.embedding_storage.dimension}," - f"实际 {vectors_array.shape[1]})。" - ), - details={ - "expected_dimension": self.embedding_storage.dimension, - "actual_dimension": int(vectors_array.shape[1]), - }, - ) - - # DocumentStorage and FAISS cannot share a transaction. If FAISS - # write fails after documents are committed, compensate by deleting. - int_ids = await self.document_storage.insert_documents_batch( - ids, - contents, - metadatas, - ) - try: - if len(int_ids) != content_count: - raise KnowledgeBaseUploadError( - stage="storage", - user_message=( - f"存储失败:写入文档索引后返回的内部 ID 数量与文本分块数量不一致" - f"(期望 {content_count},实际 {len(int_ids)})。" - ), - details={ - "expected_contents": content_count, - "actual_int_ids": len(int_ids), - }, - ) - await self.embedding_storage.insert_batch(vectors_array, int_ids) - except Exception: - await self._rollback_partial_insert(ids=ids, int_ids=int_ids) - raise - return int_ids - - async def retrieve( - self, - query: str, - k: int = 5, - fetch_k: int = 20, - rerank: bool = False, - metadata_filters: dict | None = None, - ) -> list[Result]: - """搜索最相似的文档。 - - Args: - query (str): 查询文本 - k (int): 返回的最相似文档的数量 - fetch_k (int): 在根据 metadata 过滤前从 FAISS 中获取的数量 - rerank (bool): 是否使用重排序。这需要在实例化时提供 rerank_provider, 如果未提供并且 rerank 为 True, 不会抛出异常。 - metadata_filters (dict): 元数据过滤器 - - Returns: - List[Result]: 查询结果 - - """ - embedding = await self.embedding_provider.get_embedding(query) - scores, indices = await self.embedding_storage.search( - vector=np.array(embedding).astype("float32"), - k=fetch_k if metadata_filters else k, - ) - if len(indices[0]) == 0 or indices[0][0] == -1: - return [] - # normalize scores - scores[0] = 1.0 - (scores[0] / 2.0) - # NOTE: maybe the size is less than k. - fetched_docs = await self.document_storage.get_documents( - metadata_filters=metadata_filters or {}, - ids=indices[0], - ) - if not fetched_docs: - return [] - result_docs: list[Result] = [] - - idx_pos = {fetch_doc["id"]: idx for idx, fetch_doc in enumerate(fetched_docs)} - for i, indice_idx in enumerate(indices[0]): - pos = idx_pos.get(indice_idx) - if pos is None: - continue - fetch_doc = fetched_docs[pos] - score = scores[0][i] - result_docs.append(Result(similarity=float(score), data=fetch_doc)) - - top_k_results = result_docs[:k] - - if rerank and self.rerank_provider: - documents = [doc.data["text"] for doc in top_k_results] - reranked_results = await self.rerank_provider.rerank(query, documents) - reranked_results = sorted( - reranked_results, - key=lambda x: x.relevance_score, - reverse=True, - ) - top_k_results = [ - top_k_results[reranked_result.index] - for reranked_result in reranked_results - ] - - return top_k_results - - async def _rollback_partial_insert( - self, - ids: list[str], - int_ids: list[int], - ) -> None: - """Best-effort cleanup after a partial ``insert_batch`` write. - - DocumentStorage commits independently from FAISS. When FAISS insertion - fails after documents are written — or after vectors were added in - memory but not flushed — remove those rows/ids so the two stores do - not diverge. - - Args: - ids: Chunk UUID strings written to DocumentStorage. - int_ids: Internal integer ids returned by DocumentStorage, also - used as FAISS ids when any vectors may have been added. - """ - if int_ids: - try: - await self.embedding_storage.delete(int_ids) - except Exception as exc: - logger.warning( - f"Failed to roll back FAISS vectors for partial insert: {exc}", - ) - - for doc_id in ids: - try: - await self.document_storage.delete_document_by_doc_id(doc_id) - except Exception as exc: - logger.warning( - f"Failed to roll back document storage entry {doc_id}: {exc}", - ) - - async def delete(self, doc_id: str) -> None: - """删除一条文档块(chunk)""" - # 获得对应的 int id - result = await self.document_storage.get_document_by_doc_id(doc_id) - int_id = result["id"] if result else None - if int_id is None: - return - - # 使用 DocumentStorage 的删除方法 - await self.document_storage.delete_document_by_doc_id(doc_id) - await self.embedding_storage.delete([int_id]) - - async def close(self) -> None: - await self.document_storage.close() - - async def count_documents(self, metadata_filter: dict | None = None) -> int: - """计算文档数量 - - Args: - metadata_filter (dict | None): 元数据过滤器 - - """ - count = await self.document_storage.count_documents( - metadata_filters=metadata_filter or {}, - ) - return count - - async def delete_documents(self, metadata_filters: dict) -> None: - """根据元数据过滤器删除文档""" - docs = await self.document_storage.get_documents( - metadata_filters=metadata_filters, - offset=None, - limit=None, - ) - doc_ids: list[int] = [doc["id"] for doc in docs] - await self.embedding_storage.delete(doc_ids) - await self.document_storage.delete_documents(metadata_filters=metadata_filters) +import time +import uuid + +import numpy as np + +from astrbot import logger +from astrbot.core.exceptions import KnowledgeBaseUploadError +from astrbot.core.provider.provider import EmbeddingProvider, RerankProvider + +from ..base import BaseVecDB, Result +from .document_storage import DocumentStorage +from .embedding_storage import EmbeddingStorage + + +class FaissVecDB(BaseVecDB): + """A class to represent a vector database.""" + + def __init__( + self, + doc_store_path: str, + index_store_path: str, + embedding_provider: EmbeddingProvider, + rerank_provider: RerankProvider | None = None, + ) -> None: + self.doc_store_path = doc_store_path + self.index_store_path = index_store_path + self.embedding_provider = embedding_provider + self.document_storage = DocumentStorage(doc_store_path) + self.embedding_storage = EmbeddingStorage( + embedding_provider.get_dim(), + index_store_path, + ) + self.embedding_provider = embedding_provider + self.rerank_provider = rerank_provider + + async def initialize(self) -> None: + await self.document_storage.initialize() + # 加载旧索引时可能做过向量归一化重建,这里统一落盘一次。 + await self.embedding_storage.flush() + + async def insert( + self, + content: str, + metadata: dict | None = None, + id: str | None = None, + ) -> int: + """插入一条文本和其对应向量,自动生成 ID 并保持一致性。""" + metadata = metadata or {} + str_id = id or str(uuid.uuid4()) # 使用 UUID 作为原始 ID + + vector = await self.embedding_provider.get_embedding(content) + vector = np.array(vector, dtype=np.float32) + + # 使用 DocumentStorage 的方法插入文档 + int_id = await self.document_storage.insert_document(str_id, content, metadata) + + # 插入向量到 FAISS + await self.embedding_storage.insert(vector, int_id) + return int_id + + async def insert_batch( + self, + contents: list[str], + metadatas: list[dict] | None = None, + ids: list[str] | None = None, + batch_size: int = 32, + tasks_limit: int = 3, + max_retries: int = 3, + progress_callback=None, + embedding_contents: list[str] | None = None, + ) -> list[int]: + """批量插入文本和其对应向量,自动生成 ID 并保持一致性。 + + Args: + progress_callback: 进度回调函数,接收参数 (current, total) + embedding_contents: Optional enriched texts used only for embeddings. + + """ + metadatas = metadatas or [{} for _ in contents] + ids = ids or [str(uuid.uuid4()) for _ in contents] + if embedding_contents is None: + embedding_contents = contents + + if not contents: + logger.debug( + "No contents provided for batch insert; skipping embedding generation." + ) + return [] + + content_count = len(contents) + if len(metadatas) != content_count: + raise KnowledgeBaseUploadError( + stage="storage", + user_message=( + f"存储失败:文本分块数量与元数据数量不一致(期望 {content_count}," + f"实际 {len(metadatas)})。" + ), + details={ + "expected_contents": content_count, + "actual_metadatas": len(metadatas), + }, + ) + if len(ids) != content_count: + raise KnowledgeBaseUploadError( + stage="storage", + user_message=( + f"存储失败:文本分块数量与文档 ID 数量不一致(期望 {content_count}," + f"实际 {len(ids)})。" + ), + details={ + "expected_contents": content_count, + "actual_ids": len(ids), + }, + ) + if len(embedding_contents) != content_count: + raise KnowledgeBaseUploadError( + stage="storage", + user_message=( + f"存储失败:文本分块数量与向量化文本数量不一致(期望 {content_count}," + f"实际 {len(embedding_contents)})。" + ), + details={ + "expected_contents": content_count, + "actual_embedding_contents": len(embedding_contents), + }, + ) + + start = time.time() + logger.debug(f"Generating embeddings for {len(contents)} contents...") + vectors = await self.embedding_provider.get_embeddings_batch( + embedding_contents, + batch_size=batch_size, + tasks_limit=tasks_limit, + max_retries=max_retries, + progress_callback=progress_callback, + ) + end = time.time() + logger.debug( + f"Generated embeddings for {len(contents)} contents in {end - start:.2f} seconds.", + ) + if len(vectors) != content_count: + raise KnowledgeBaseUploadError( + stage="embedding", + user_message=( + "向量化失败:嵌入模型返回的向量数量与文本分块数量不一致" + f"(期望 {content_count},实际 {len(vectors)})。" + "这通常说明当前 Embedding 接口未完整返回批量结果," + "或该服务不兼容当前批量请求格式。" + ), + details={ + "expected_contents": content_count, + "actual_vectors": len(vectors), + }, + ) + + # Validate vector format/dimension before any local write so validation + # failures never leave a half-written document store. + try: + vectors_array = np.asarray(vectors, dtype=np.float32) + except (TypeError, ValueError) as exc: + raise KnowledgeBaseUploadError( + stage="embedding", + user_message=( + "向量化失败:嵌入模型返回的向量格式不正确," + "无法转换为统一的浮点向量矩阵。" + ), + details={"vector_count": len(vectors)}, + ) from exc + if vectors_array.ndim != 2: + raise KnowledgeBaseUploadError( + stage="embedding", + user_message=( + "向量化失败:嵌入模型返回的向量格式不正确,无法构造成二维向量矩阵。" + ), + details={"actual_ndim": int(vectors_array.ndim)}, + ) + if vectors_array.shape[1] != self.embedding_storage.dimension: + raise KnowledgeBaseUploadError( + stage="embedding", + user_message=( + "向量化失败:返回向量维度与当前知识库索引维度不一致" + f"(期望 {self.embedding_storage.dimension}," + f"实际 {vectors_array.shape[1]})。" + ), + details={ + "expected_dimension": self.embedding_storage.dimension, + "actual_dimension": int(vectors_array.shape[1]), + }, + ) + + # DocumentStorage and FAISS cannot share a transaction. If FAISS + # write fails after documents are committed, compensate by deleting. + int_ids = await self.document_storage.insert_documents_batch( + ids, + contents, + metadatas, + ) + try: + if len(int_ids) != content_count: + raise KnowledgeBaseUploadError( + stage="storage", + user_message=( + f"存储失败:写入文档索引后返回的内部 ID 数量与文本分块数量不一致" + f"(期望 {content_count},实际 {len(int_ids)})。" + ), + details={ + "expected_contents": content_count, + "actual_int_ids": len(int_ids), + }, + ) + await self.embedding_storage.insert_batch(vectors_array, int_ids) + except Exception: + await self._rollback_partial_insert(ids=ids, int_ids=int_ids) + raise + return int_ids + + async def retrieve( + self, + query: str, + k: int = 5, + fetch_k: int = 20, + rerank: bool = False, + metadata_filters: dict | None = None, + ) -> list[Result]: + """搜索最相似的文档。 + + Args: + query (str): 查询文本 + k (int): 返回的最相似文档的数量 + fetch_k (int): 在根据 metadata 过滤前从 FAISS 中获取的数量 + rerank (bool): 是否使用重排序。这需要在实例化时提供 rerank_provider, 如果未提供并且 rerank 为 True, 不会抛出异常。 + metadata_filters (dict): 元数据过滤器 + + Returns: + List[Result]: 查询结果 + + """ + embedding = await self.embedding_provider.get_query_embedding(query) + scores, indices = await self.embedding_storage.search( + vector=np.array(embedding).astype("float32"), + k=fetch_k if metadata_filters else k, + ) + if len(indices[0]) == 0 or indices[0][0] == -1: + return [] + # FAISS IndexFlatL2 返回的是欧氏距离的平方;对单位向量有 + # ``L2^2 = 2 - 2 * cos``,因此 ``1 - L2^2 / 2`` 就是余弦相似度。 + # 这里只在入库与查询两侧保证向量已归一化(见 EmbeddingStorage), + # 公式本身保持不变。 + scores[0] = 1.0 - (scores[0] / 2.0) + # NOTE: maybe the size is less than k. + fetched_docs = await self.document_storage.get_documents( + metadata_filters=metadata_filters or {}, + ids=indices[0], + ) + if not fetched_docs: + return [] + result_docs: list[Result] = [] + + idx_pos = {fetch_doc["id"]: idx for idx, fetch_doc in enumerate(fetched_docs)} + for i, indice_idx in enumerate(indices[0]): + pos = idx_pos.get(indice_idx) + if pos is None: + continue + fetch_doc = fetched_docs[pos] + score = scores[0][i] + result_docs.append(Result(similarity=float(score), data=fetch_doc)) + + top_k_results = result_docs[:k] + + if rerank and self.rerank_provider: + documents = [doc.data["text"] for doc in top_k_results] + reranked_results = await self.rerank_provider.rerank(query, documents) + reranked_results = sorted( + reranked_results, + key=lambda x: x.relevance_score, + reverse=True, + ) + top_k_results = [ + top_k_results[reranked_result.index] + for reranked_result in reranked_results + ] + + return top_k_results + + async def _rollback_partial_insert( + self, + ids: list[str], + int_ids: list[int], + ) -> None: + """Best-effort cleanup after a partial ``insert_batch`` write. + + DocumentStorage commits independently from FAISS. When FAISS insertion + fails after documents are written — or after vectors were added in + memory but not flushed — remove those rows/ids so the two stores do + not diverge. + + Args: + ids: Chunk UUID strings written to DocumentStorage. + int_ids: Internal integer ids returned by DocumentStorage, also + used as FAISS ids when any vectors may have been added. + """ + if int_ids: + try: + await self.embedding_storage.delete(int_ids) + except Exception as exc: + logger.warning( + f"Failed to roll back FAISS vectors for partial insert: {exc}", + ) + + for doc_id in ids: + try: + await self.document_storage.delete_document_by_doc_id(doc_id) + except Exception as exc: + logger.warning( + f"Failed to roll back document storage entry {doc_id}: {exc}", + ) + + async def delete(self, doc_id: str) -> None: + """删除一条文档块(chunk)""" + # 获得对应的 int id + result = await self.document_storage.get_document_by_doc_id(doc_id) + int_id = result["id"] if result else None + if int_id is None: + return + + # 使用 DocumentStorage 的删除方法 + await self.document_storage.delete_document_by_doc_id(doc_id) + await self.embedding_storage.delete([int_id]) + + async def close(self) -> None: + # 归一化重建可能因为写盘失败而留在内存里,关闭时再试一次。 + await self.embedding_storage.flush() + await self.document_storage.close() + + async def count_documents(self, metadata_filter: dict | None = None) -> int: + """计算文档数量 + + Args: + metadata_filter (dict | None): 元数据过滤器 + + """ + count = await self.document_storage.count_documents( + metadata_filters=metadata_filter or {}, + ) + return count + + async def delete_documents(self, metadata_filters: dict) -> None: + """根据元数据过滤器删除文档""" + docs = await self.document_storage.get_documents( + metadata_filters=metadata_filters, + offset=None, + limit=None, + ) + doc_ids: list[int] = [doc["id"] for doc in docs] + await self.embedding_storage.delete(doc_ids) + await self.document_storage.delete_documents(metadata_filters=metadata_filters) diff --git a/astrbot/core/provider/provider.py b/astrbot/core/provider/provider.py index 0319d57c828..a9c90f7fcd3 100644 --- a/astrbot/core/provider/provider.py +++ b/astrbot/core/provider/provider.py @@ -1,484 +1,493 @@ -import abc -import asyncio -import os -from collections.abc import AsyncGenerator, Mapping -from typing import Literal, TypeAlias, Union - -from astrbot.core.agent.message import ContentPart, Message, is_checkpoint_message -from astrbot.core.agent.tool import ToolSet -from astrbot.core.provider.entities import ( - DecisionAnswer, - DecisionBooleanQuestion, - DecisionQuestion, - DecisionState, - LLMResponse, - ProviderMeta, - RerankResult, - ToolCallsResult, -) -from astrbot.core.provider.headers import build_provider_headers -from astrbot.core.provider.register import provider_cls_map -from astrbot.core.utils.astrbot_path import get_astrbot_path - -Providers: TypeAlias = Union[ - "Provider", - "STTProvider", - "TTSProvider", - "EmbeddingProvider", - "RerankProvider", - "DecisionProvider", -] - - -class AbstractProvider(abc.ABC): - """Provider Abstract Class""" - - def __init__(self, provider_config: dict) -> None: - super().__init__() - self.model_name = "" - self.provider_config = provider_config - self.request_headers = build_provider_headers( - provider_config.get("custom_headers") - ) - - def set_model(self, model_name: str) -> None: - """Set the current model name""" - self.model_name = model_name - - def get_model(self) -> str: - """Get the current model name""" - return self.model_name - - def meta(self) -> ProviderMeta: - """Get the provider metadata""" - provider_type_name = self.provider_config["type"] - meta_data = provider_cls_map.get(provider_type_name) - if not meta_data: - raise ValueError(f"Provider type {provider_type_name} not registered") - meta = ProviderMeta( - id=self.provider_config.get("id", "default"), - model=self.get_model(), - type=provider_type_name, - provider_type=meta_data.provider_type, - ) - return meta - - async def test(self) -> None: - """test the provider is a - - raises: - Exception: if the provider is not available - """ - ... - - -class Provider(AbstractProvider): - """Chat Provider""" - - def __init__( - self, - provider_config: dict, - provider_settings: dict, - ) -> None: - super().__init__(provider_config) - self.provider_settings = provider_settings - - @abc.abstractmethod - def get_current_key(self) -> str: - raise NotImplementedError - - def get_keys(self) -> list[str]: - """获得提供商 Key""" - keys = self.provider_config.get("key", [""]) - return keys or [""] - - @abc.abstractmethod - def set_key(self, key: str) -> None: - raise NotImplementedError - - @abc.abstractmethod - async def get_models(self) -> list[str]: - """获得支持的模型列表""" - raise NotImplementedError - - @abc.abstractmethod - async def text_chat( - self, - prompt: str | None = None, - session_id: str | None = None, - image_urls: list[str] | None = None, - audio_urls: list[str] | None = None, - func_tool: ToolSet | None = None, - contexts: list[Message] | list[dict] | None = None, - system_prompt: str | None = None, - tool_calls_result: ToolCallsResult | list[ToolCallsResult] | None = None, - model: str | None = None, - extra_user_content_parts: list[ContentPart] | None = None, - tool_choice: Literal["auto", "required"] = "auto", - request_max_retries: int | None = None, - **kwargs, - ) -> LLMResponse: - """获得 LLM 的文本对话结果。会使用当前的模型进行对话。 - - Args: - prompt: 提示词,和 contexts 二选一使用,如果都指定,则会将 prompt(以及可能的 image_urls) 作为最新的一条记录添加到 contexts 中 - session_id: 会话 ID(此属性已经被废弃) - image_urls: 图片 URL 列表 - audio_urls: 音频 URL 列表,也支持本地路径 - tools: tool set - tool_choice: 工具调用策略,`auto` 表示由模型自行决定,`required` 表示要求模型必须调用工具 - contexts: 上下文,和 prompt 二选一使用 - tool_calls_result: 回传给 LLM 的工具调用结果。参考: https://platform.openai.com/docs/guides/function-calling - extra_user_content_parts: 额外的内容块列表,用于在用户消息后添加额外的文本块(如系统提醒、指令等) - request_max_retries: 可重试请求错误的最大尝试次数,包含首次请求。 - kwargs: 其他参数 - - Notes: - - 如果传入了 image_urls,将会在对话时附上图片。如果模型不支持图片输入,将会抛出错误。 - - 如果传入了 audio_urls,将会在对话时附上音频。如果模型不支持音频输入,将会抛出错误或降级处理。 - - 如果传入了 tools,将会使用 tools 进行 Function-calling。如果模型不支持 Function-calling,将会抛出错误。 - - """ - ... - - async def text_chat_stream( - self, - prompt: str | None = None, - session_id: str | None = None, - image_urls: list[str] | None = None, - audio_urls: list[str] | None = None, - func_tool: ToolSet | None = None, - contexts: list[Message] | list[dict] | None = None, - system_prompt: str | None = None, - tool_calls_result: ToolCallsResult | list[ToolCallsResult] | None = None, - model: str | None = None, - tool_choice: Literal["auto", "required"] = "auto", - request_max_retries: int | None = None, - **kwargs, - ) -> AsyncGenerator[LLMResponse, None]: - """获得 LLM 的流式文本对话结果。会使用当前的模型进行对话。在生成的最后会返回一次完整的结果。 - - Args: - prompt: 提示词,和 contexts 二选一使用,如果都指定,则会将 prompt(以及可能的 image_urls) 作为最新的一条记录添加到 contexts 中 - session_id: 会话 ID(此属性已经被废弃) - image_urls: 图片 URL 列表 - audio_urls: 音频 URL 列表,也支持本地路径 - tools: tool set - tool_choice: 工具调用策略,`auto` 表示由模型自行决定,`required` 表示要求模型必须调用工具 - contexts: 上下文,和 prompt 二选一使用 - tool_calls_result: 回传给 LLM 的工具调用结果。参考: https://platform.openai.com/docs/guides/function-calling - request_max_retries: 可重试请求错误的最大尝试次数,包含首次请求。 - kwargs: 其他参数 - - Notes: - - 如果传入了 image_urls,将会在对话时附上图片。如果模型不支持图片输入,将会抛出错误。 - - 如果传入了 audio_urls,将会在对话时附上音频。如果模型不支持音频输入,将会抛出错误或降级处理。 - - 如果传入了 tools,将会使用 tools 进行 Function-calling。如果模型不支持 Function-calling,将会抛出错误。 - - """ - if False: # pragma: no cover - make this an async generator for typing - yield None # type: ignore - raise NotImplementedError() - - async def pop_record(self, context: list) -> None: - """弹出 context 第一条非系统提示词对话记录""" - poped = 0 - indexs_to_pop = [] - for idx, record in enumerate(context): - if record["role"] == "system": - continue - indexs_to_pop.append(idx) - poped += 1 - if poped == 2: - break - - for idx in reversed(indexs_to_pop): - context.pop(idx) - - def _ensure_message_to_dicts( - self, - messages: list[dict] | list[Message] | None, - ) -> list[dict]: - """Convert a list of Message objects to a list of dictionaries.""" - if not messages: - return [] - dicts: list[dict] = [] - for message in messages: - if is_checkpoint_message(message): - continue - if isinstance(message, Message): - dicts.append(message.model_dump()) - else: - dicts.append(message) - - return dicts - - async def test(self, timeout: float = 45.0) -> None: - await asyncio.wait_for( - self.text_chat(prompt="REPLY `PONG` ONLY"), - timeout=timeout, - ) - - -class STTProvider(AbstractProvider): - def __init__(self, provider_config: dict, provider_settings: dict) -> None: - super().__init__(provider_config) - self.provider_config = provider_config - self.provider_settings = provider_settings - - @abc.abstractmethod - async def get_text(self, audio_url: str) -> str: - """获取音频的文本""" - raise NotImplementedError - - async def test(self) -> None: - sample_audio_path = os.path.join( - get_astrbot_path(), - "samples", - "stt_health_check.wav", - ) - await self.get_text(sample_audio_path) - - -class TTSProvider(AbstractProvider): - def __init__(self, provider_config: dict, provider_settings: dict) -> None: - super().__init__(provider_config) - self.provider_config = provider_config - self.provider_settings = provider_settings - - def support_stream(self) -> bool: - """是否支持流式 TTS - - Returns: - bool: True 表示支持流式处理,False 表示不支持(默认) - - Notes: - 子类可以重写此方法返回 True 来启用流式 TTS 支持 - """ - return False - - @abc.abstractmethod - async def get_audio(self, text: str) -> str: - """获取文本的音频,返回音频文件路径""" - raise NotImplementedError - - async def get_audio_stream( - self, - text_queue: asyncio.Queue[str | None], - audio_queue: "asyncio.Queue[bytes | tuple[str, bytes] | None]", - ) -> None: - """流式 TTS 处理方法。 - - 从 text_queue 中读取文本片段,将生成的音频数据(WAV 格式的 in-memory bytes)放入 audio_queue。 - 当 text_queue 收到 None 时,表示文本输入结束,此时应该处理完所有剩余文本并向 audio_queue 发送 None 表示结束。 - - Args: - text_queue: 输入文本队列,None 表示输入结束 - audio_queue: 输出音频队列(bytes 或 (text, bytes)),None 表示输出结束 - - Notes: - - 默认实现会将文本累积后一次性调用 get_audio 生成完整音频 - - 子类可以重写此方法实现真正的流式 TTS - - 音频数据应该是 WAV 格式的 bytes - """ - accumulated_text = "" - - while True: - text_part = await text_queue.get() - - if text_part is None: - # 输入结束,处理累积的文本 - if accumulated_text: - try: - # 调用原有的 get_audio 方法获取音频文件路径 - audio_path = await self.get_audio(accumulated_text) - # 读取音频文件内容 - with open(audio_path, "rb") as f: - audio_data = f.read() - await audio_queue.put((accumulated_text, audio_data)) - except Exception: - # 出错时也要发送 None 结束标记 - pass - # 发送结束标记 - await audio_queue.put(None) - break - - accumulated_text += text_part - - async def test(self) -> None: - audio_path = await self.get_audio("hi") - - # 检查生成的音频文件是否有效 - if not os.path.exists(audio_path): - raise Exception("TTS test failed: audio file was not created") - - file_size = os.path.getsize(audio_path) - if file_size == 0: - raise Exception( - "TTS test failed: generated audio file is empty (0 bytes). " - "Please check your TTS provider configuration, especially required parameters like group_id for MiniMax." - ) - - # 清理测试文件 - try: - os.remove(audio_path) - except Exception: - pass - - -class EmbeddingProvider(AbstractProvider): - def __init__(self, provider_config: dict, provider_settings: dict) -> None: - super().__init__(provider_config) - self.provider_config = provider_config - self.provider_settings = provider_settings - - @abc.abstractmethod - async def get_embedding(self, text: str) -> list[float]: - """获取文本的向量""" - ... - - @abc.abstractmethod - async def get_embeddings(self, text: list[str]) -> list[list[float]]: - """批量获取文本的向量""" - ... - - @abc.abstractmethod - def get_dim(self) -> int: - """获取向量的维度""" - ... - - async def test(self) -> None: - await self.get_embedding("astrbot") - - async def get_embeddings_batch( - self, - texts: list[str], - batch_size: int = 16, - tasks_limit: int = 3, - max_retries: int = 3, - progress_callback=None, - ) -> list[list[float]]: - """批量获取文本的向量,分批处理以节省内存 - - Args: - texts: 文本列表 - batch_size: 每批处理的文本数量 - tasks_limit: 并发任务数量限制 - max_retries: 失败时的最大重试次数 - progress_callback: 进度回调函数,接收参数 (current, total) - - Returns: - 向量列表 - - """ - semaphore = asyncio.Semaphore(tasks_limit) - batch_results: dict[int, list[list[float]]] = {} - failed_batches: list[tuple[int, list[str]]] = [] - completed_count = 0 - total_count = len(texts) - - async def process_batch(batch_idx: int, batch_texts: list[str]) -> None: - nonlocal completed_count - async with semaphore: - for attempt in range(max_retries): - try: - batch_embeddings = await self.get_embeddings(batch_texts) - batch_results[batch_idx] = batch_embeddings - completed_count += len(batch_texts) - if progress_callback: - await progress_callback(completed_count, total_count) - return - except Exception as e: - if attempt == max_retries - 1: - # 最后一次重试失败,记录失败的批次 - failed_batches.append((batch_idx, batch_texts)) - raise Exception( - f"批次 {batch_idx} 处理失败,已重试 {max_retries} 次: {e!s}", - ) - # 等待一段时间后重试,使用指数退避 - await asyncio.sleep(2**attempt) - - tasks = [] - for i in range(0, len(texts), batch_size): - batch_texts = texts[i : i + batch_size] - batch_idx = i // batch_size - tasks.append(process_batch(batch_idx, batch_texts)) - - # 收集所有任务的结果,包括失败的任务 - results = await asyncio.gather(*tasks, return_exceptions=True) - - # 检查是否有失败的任务 - errors = [r for r in results if isinstance(r, Exception)] - if errors: - error_msg = ( - f"有 {len(errors)} 个批次处理失败: {'; '.join(str(e) for e in errors)}" - ) - raise Exception(error_msg) - - all_embeddings: list[list[float]] = [] - for batch_idx in range(len(tasks)): - all_embeddings.extend(batch_results[batch_idx]) - return all_embeddings - - -class RerankProvider(AbstractProvider): - def __init__(self, provider_config: dict, provider_settings: dict) -> None: - super().__init__(provider_config) - self.provider_config = provider_config - self.provider_settings = provider_settings - - @abc.abstractmethod - async def rerank( - self, - query: str, - documents: list[str], - top_n: int | None = None, - ) -> list[RerankResult]: - """获取查询和文档的重排序分数""" - ... - - async def test(self) -> None: - result = await self.rerank("Apple", documents=["apple", "banana"]) - if not result: - raise Exception("Rerank provider test failed, no results returned") - - -class DecisionProvider(AbstractProvider): - """Provider for low-latency, structured decisions.""" - - def __init__(self, provider_config: dict, provider_settings: dict) -> None: - super().__init__(provider_config) - self.provider_config = provider_config - self.provider_settings = provider_settings - - @abc.abstractmethod - async def ask( - self, - questions: Mapping[str, DecisionQuestion], - state: DecisionState | None = None, - *, - request_max_retries: int = 0, - ) -> Mapping[str, DecisionAnswer]: - """Answer multiple decision questions in one provider request. - - Args: - questions: Question heads keyed by caller-defined identifiers. - state: Context evaluated by the model. Providers forward it as-is. - request_max_retries: Number of retries after the initial request. - - Returns: - Answers keyed by the same identifiers as ``questions``. - - Raises: - ValueError: The question or criteria are unusable. - DecisionError: The provider is unavailable, the request fails, or - the response violates the decision contract. - """ - ... - - async def test(self) -> None: - await self.ask( - {"test": DecisionBooleanQuestion("Is this provider available?")}, - {}, - request_max_retries=0, - ) +import abc +import asyncio +import os +from collections.abc import AsyncGenerator, Mapping +from typing import Literal, TypeAlias, Union + +from astrbot.core.agent.message import ContentPart, Message, is_checkpoint_message +from astrbot.core.agent.tool import ToolSet +from astrbot.core.provider.entities import ( + DecisionAnswer, + DecisionBooleanQuestion, + DecisionQuestion, + DecisionState, + LLMResponse, + ProviderMeta, + RerankResult, + ToolCallsResult, +) +from astrbot.core.provider.headers import build_provider_headers +from astrbot.core.provider.register import provider_cls_map +from astrbot.core.utils.astrbot_path import get_astrbot_path + +Providers: TypeAlias = Union[ + "Provider", + "STTProvider", + "TTSProvider", + "EmbeddingProvider", + "RerankProvider", + "DecisionProvider", +] + + +class AbstractProvider(abc.ABC): + """Provider Abstract Class""" + + def __init__(self, provider_config: dict) -> None: + super().__init__() + self.model_name = "" + self.provider_config = provider_config + self.request_headers = build_provider_headers( + provider_config.get("custom_headers") + ) + + def set_model(self, model_name: str) -> None: + """Set the current model name""" + self.model_name = model_name + + def get_model(self) -> str: + """Get the current model name""" + return self.model_name + + def meta(self) -> ProviderMeta: + """Get the provider metadata""" + provider_type_name = self.provider_config["type"] + meta_data = provider_cls_map.get(provider_type_name) + if not meta_data: + raise ValueError(f"Provider type {provider_type_name} not registered") + meta = ProviderMeta( + id=self.provider_config.get("id", "default"), + model=self.get_model(), + type=provider_type_name, + provider_type=meta_data.provider_type, + ) + return meta + + async def test(self) -> None: + """test the provider is a + + raises: + Exception: if the provider is not available + """ + ... + + +class Provider(AbstractProvider): + """Chat Provider""" + + def __init__( + self, + provider_config: dict, + provider_settings: dict, + ) -> None: + super().__init__(provider_config) + self.provider_settings = provider_settings + + @abc.abstractmethod + def get_current_key(self) -> str: + raise NotImplementedError + + def get_keys(self) -> list[str]: + """获得提供商 Key""" + keys = self.provider_config.get("key", [""]) + return keys or [""] + + @abc.abstractmethod + def set_key(self, key: str) -> None: + raise NotImplementedError + + @abc.abstractmethod + async def get_models(self) -> list[str]: + """获得支持的模型列表""" + raise NotImplementedError + + @abc.abstractmethod + async def text_chat( + self, + prompt: str | None = None, + session_id: str | None = None, + image_urls: list[str] | None = None, + audio_urls: list[str] | None = None, + func_tool: ToolSet | None = None, + contexts: list[Message] | list[dict] | None = None, + system_prompt: str | None = None, + tool_calls_result: ToolCallsResult | list[ToolCallsResult] | None = None, + model: str | None = None, + extra_user_content_parts: list[ContentPart] | None = None, + tool_choice: Literal["auto", "required"] = "auto", + request_max_retries: int | None = None, + **kwargs, + ) -> LLMResponse: + """获得 LLM 的文本对话结果。会使用当前的模型进行对话。 + + Args: + prompt: 提示词,和 contexts 二选一使用,如果都指定,则会将 prompt(以及可能的 image_urls) 作为最新的一条记录添加到 contexts 中 + session_id: 会话 ID(此属性已经被废弃) + image_urls: 图片 URL 列表 + audio_urls: 音频 URL 列表,也支持本地路径 + tools: tool set + tool_choice: 工具调用策略,`auto` 表示由模型自行决定,`required` 表示要求模型必须调用工具 + contexts: 上下文,和 prompt 二选一使用 + tool_calls_result: 回传给 LLM 的工具调用结果。参考: https://platform.openai.com/docs/guides/function-calling + extra_user_content_parts: 额外的内容块列表,用于在用户消息后添加额外的文本块(如系统提醒、指令等) + request_max_retries: 可重试请求错误的最大尝试次数,包含首次请求。 + kwargs: 其他参数 + + Notes: + - 如果传入了 image_urls,将会在对话时附上图片。如果模型不支持图片输入,将会抛出错误。 + - 如果传入了 audio_urls,将会在对话时附上音频。如果模型不支持音频输入,将会抛出错误或降级处理。 + - 如果传入了 tools,将会使用 tools 进行 Function-calling。如果模型不支持 Function-calling,将会抛出错误。 + + """ + ... + + async def text_chat_stream( + self, + prompt: str | None = None, + session_id: str | None = None, + image_urls: list[str] | None = None, + audio_urls: list[str] | None = None, + func_tool: ToolSet | None = None, + contexts: list[Message] | list[dict] | None = None, + system_prompt: str | None = None, + tool_calls_result: ToolCallsResult | list[ToolCallsResult] | None = None, + model: str | None = None, + tool_choice: Literal["auto", "required"] = "auto", + request_max_retries: int | None = None, + **kwargs, + ) -> AsyncGenerator[LLMResponse, None]: + """获得 LLM 的流式文本对话结果。会使用当前的模型进行对话。在生成的最后会返回一次完整的结果。 + + Args: + prompt: 提示词,和 contexts 二选一使用,如果都指定,则会将 prompt(以及可能的 image_urls) 作为最新的一条记录添加到 contexts 中 + session_id: 会话 ID(此属性已经被废弃) + image_urls: 图片 URL 列表 + audio_urls: 音频 URL 列表,也支持本地路径 + tools: tool set + tool_choice: 工具调用策略,`auto` 表示由模型自行决定,`required` 表示要求模型必须调用工具 + contexts: 上下文,和 prompt 二选一使用 + tool_calls_result: 回传给 LLM 的工具调用结果。参考: https://platform.openai.com/docs/guides/function-calling + request_max_retries: 可重试请求错误的最大尝试次数,包含首次请求。 + kwargs: 其他参数 + + Notes: + - 如果传入了 image_urls,将会在对话时附上图片。如果模型不支持图片输入,将会抛出错误。 + - 如果传入了 audio_urls,将会在对话时附上音频。如果模型不支持音频输入,将会抛出错误或降级处理。 + - 如果传入了 tools,将会使用 tools 进行 Function-calling。如果模型不支持 Function-calling,将会抛出错误。 + + """ + if False: # pragma: no cover - make this an async generator for typing + yield None # type: ignore + raise NotImplementedError() + + async def pop_record(self, context: list) -> None: + """弹出 context 第一条非系统提示词对话记录""" + poped = 0 + indexs_to_pop = [] + for idx, record in enumerate(context): + if record["role"] == "system": + continue + indexs_to_pop.append(idx) + poped += 1 + if poped == 2: + break + + for idx in reversed(indexs_to_pop): + context.pop(idx) + + def _ensure_message_to_dicts( + self, + messages: list[dict] | list[Message] | None, + ) -> list[dict]: + """Convert a list of Message objects to a list of dictionaries.""" + if not messages: + return [] + dicts: list[dict] = [] + for message in messages: + if is_checkpoint_message(message): + continue + if isinstance(message, Message): + dicts.append(message.model_dump()) + else: + dicts.append(message) + + return dicts + + async def test(self, timeout: float = 45.0) -> None: + await asyncio.wait_for( + self.text_chat(prompt="REPLY `PONG` ONLY"), + timeout=timeout, + ) + + +class STTProvider(AbstractProvider): + def __init__(self, provider_config: dict, provider_settings: dict) -> None: + super().__init__(provider_config) + self.provider_config = provider_config + self.provider_settings = provider_settings + + @abc.abstractmethod + async def get_text(self, audio_url: str) -> str: + """获取音频的文本""" + raise NotImplementedError + + async def test(self) -> None: + sample_audio_path = os.path.join( + get_astrbot_path(), + "samples", + "stt_health_check.wav", + ) + await self.get_text(sample_audio_path) + + +class TTSProvider(AbstractProvider): + def __init__(self, provider_config: dict, provider_settings: dict) -> None: + super().__init__(provider_config) + self.provider_config = provider_config + self.provider_settings = provider_settings + + def support_stream(self) -> bool: + """是否支持流式 TTS + + Returns: + bool: True 表示支持流式处理,False 表示不支持(默认) + + Notes: + 子类可以重写此方法返回 True 来启用流式 TTS 支持 + """ + return False + + @abc.abstractmethod + async def get_audio(self, text: str) -> str: + """获取文本的音频,返回音频文件路径""" + raise NotImplementedError + + async def get_audio_stream( + self, + text_queue: asyncio.Queue[str | None], + audio_queue: "asyncio.Queue[bytes | tuple[str, bytes] | None]", + ) -> None: + """流式 TTS 处理方法。 + + 从 text_queue 中读取文本片段,将生成的音频数据(WAV 格式的 in-memory bytes)放入 audio_queue。 + 当 text_queue 收到 None 时,表示文本输入结束,此时应该处理完所有剩余文本并向 audio_queue 发送 None 表示结束。 + + Args: + text_queue: 输入文本队列,None 表示输入结束 + audio_queue: 输出音频队列(bytes 或 (text, bytes)),None 表示输出结束 + + Notes: + - 默认实现会将文本累积后一次性调用 get_audio 生成完整音频 + - 子类可以重写此方法实现真正的流式 TTS + - 音频数据应该是 WAV 格式的 bytes + """ + accumulated_text = "" + + while True: + text_part = await text_queue.get() + + if text_part is None: + # 输入结束,处理累积的文本 + if accumulated_text: + try: + # 调用原有的 get_audio 方法获取音频文件路径 + audio_path = await self.get_audio(accumulated_text) + # 读取音频文件内容 + with open(audio_path, "rb") as f: + audio_data = f.read() + await audio_queue.put((accumulated_text, audio_data)) + except Exception: + # 出错时也要发送 None 结束标记 + pass + # 发送结束标记 + await audio_queue.put(None) + break + + accumulated_text += text_part + + async def test(self) -> None: + audio_path = await self.get_audio("hi") + + # 检查生成的音频文件是否有效 + if not os.path.exists(audio_path): + raise Exception("TTS test failed: audio file was not created") + + file_size = os.path.getsize(audio_path) + if file_size == 0: + raise Exception( + "TTS test failed: generated audio file is empty (0 bytes). " + "Please check your TTS provider configuration, especially required parameters like group_id for MiniMax." + ) + + # 清理测试文件 + try: + os.remove(audio_path) + except Exception: + pass + + +class EmbeddingProvider(AbstractProvider): + def __init__(self, provider_config: dict, provider_settings: dict) -> None: + super().__init__(provider_config) + self.provider_config = provider_config + self.provider_settings = provider_settings + + @abc.abstractmethod + async def get_embedding(self, text: str) -> list[float]: + """获取文本的向量""" + ... + + @abc.abstractmethod + async def get_embeddings(self, text: list[str]) -> list[list[float]]: + """批量获取文本的向量""" + ... + + async def get_query_embedding(self, text: str) -> list[float]: + """获取检索查询的向量。 + + 默认回退到 :meth:`get_embedding`。对支持非对称检索条件化的提供 + 商(如 Gemini Embedding),应覆盖此方法让查询与文档使用不同的任务 + 类型或文本前缀,否则编码空间对不上,相似度区分度会明显下降。 + """ + return await self.get_embedding(text) + + @abc.abstractmethod + def get_dim(self) -> int: + """获取向量的维度""" + ... + + async def test(self) -> None: + await self.get_embedding("astrbot") + + async def get_embeddings_batch( + self, + texts: list[str], + batch_size: int = 16, + tasks_limit: int = 3, + max_retries: int = 3, + progress_callback=None, + ) -> list[list[float]]: + """批量获取文本的向量,分批处理以节省内存 + + Args: + texts: 文本列表 + batch_size: 每批处理的文本数量 + tasks_limit: 并发任务数量限制 + max_retries: 失败时的最大重试次数 + progress_callback: 进度回调函数,接收参数 (current, total) + + Returns: + 向量列表 + + """ + semaphore = asyncio.Semaphore(tasks_limit) + batch_results: dict[int, list[list[float]]] = {} + failed_batches: list[tuple[int, list[str]]] = [] + completed_count = 0 + total_count = len(texts) + + async def process_batch(batch_idx: int, batch_texts: list[str]) -> None: + nonlocal completed_count + async with semaphore: + for attempt in range(max_retries): + try: + batch_embeddings = await self.get_embeddings(batch_texts) + batch_results[batch_idx] = batch_embeddings + completed_count += len(batch_texts) + if progress_callback: + await progress_callback(completed_count, total_count) + return + except Exception as e: + if attempt == max_retries - 1: + # 最后一次重试失败,记录失败的批次 + failed_batches.append((batch_idx, batch_texts)) + raise Exception( + f"批次 {batch_idx} 处理失败,已重试 {max_retries} 次: {e!s}", + ) + # 等待一段时间后重试,使用指数退避 + await asyncio.sleep(2**attempt) + + tasks = [] + for i in range(0, len(texts), batch_size): + batch_texts = texts[i : i + batch_size] + batch_idx = i // batch_size + tasks.append(process_batch(batch_idx, batch_texts)) + + # 收集所有任务的结果,包括失败的任务 + results = await asyncio.gather(*tasks, return_exceptions=True) + + # 检查是否有失败的任务 + errors = [r for r in results if isinstance(r, Exception)] + if errors: + error_msg = ( + f"有 {len(errors)} 个批次处理失败: {'; '.join(str(e) for e in errors)}" + ) + raise Exception(error_msg) + + all_embeddings: list[list[float]] = [] + for batch_idx in range(len(tasks)): + all_embeddings.extend(batch_results[batch_idx]) + return all_embeddings + + +class RerankProvider(AbstractProvider): + def __init__(self, provider_config: dict, provider_settings: dict) -> None: + super().__init__(provider_config) + self.provider_config = provider_config + self.provider_settings = provider_settings + + @abc.abstractmethod + async def rerank( + self, + query: str, + documents: list[str], + top_n: int | None = None, + ) -> list[RerankResult]: + """获取查询和文档的重排序分数""" + ... + + async def test(self) -> None: + result = await self.rerank("Apple", documents=["apple", "banana"]) + if not result: + raise Exception("Rerank provider test failed, no results returned") + + +class DecisionProvider(AbstractProvider): + """Provider for low-latency, structured decisions.""" + + def __init__(self, provider_config: dict, provider_settings: dict) -> None: + super().__init__(provider_config) + self.provider_config = provider_config + self.provider_settings = provider_settings + + @abc.abstractmethod + async def ask( + self, + questions: Mapping[str, DecisionQuestion], + state: DecisionState | None = None, + *, + request_max_retries: int = 0, + ) -> Mapping[str, DecisionAnswer]: + """Answer multiple decision questions in one provider request. + + Args: + questions: Question heads keyed by caller-defined identifiers. + state: Context evaluated by the model. Providers forward it as-is. + request_max_retries: Number of retries after the initial request. + + Returns: + Answers keyed by the same identifiers as ``questions``. + + Raises: + ValueError: The question or criteria are unusable. + DecisionError: The provider is unavailable, the request fails, or + the response violates the decision contract. + """ + ... + + async def test(self) -> None: + await self.ask( + {"test": DecisionBooleanQuestion("Is this provider available?")}, + {}, + request_max_retries=0, + ) diff --git a/astrbot/core/provider/sources/gemini_embedding_source.py b/astrbot/core/provider/sources/gemini_embedding_source.py index 7c14d06ab1c..f2fd40919fb 100644 --- a/astrbot/core/provider/sources/gemini_embedding_source.py +++ b/astrbot/core/provider/sources/gemini_embedding_source.py @@ -1,92 +1,294 @@ -from google import genai -from google.genai import types -from google.genai.errors import APIError - -from astrbot import logger - -from ..entities import ProviderType -from ..provider import EmbeddingProvider -from ..register import register_provider_adapter - - -@register_provider_adapter( - "gemini_embedding", - "Google Gemini Embedding 提供商适配器", - provider_type=ProviderType.EMBEDDING, -) -class GeminiEmbeddingProvider(EmbeddingProvider): - def __init__(self, provider_config: dict, provider_settings: dict) -> None: - super().__init__(provider_config, provider_settings) - self.provider_config = provider_config - self.provider_settings = provider_settings - - api_key: str = provider_config["embedding_api_key"] - api_base: str = provider_config["embedding_api_base"] - timeout: int = int(provider_config.get("timeout", 20)) - - http_options = types.HttpOptions( - timeout=timeout * 1000, headers=self.request_headers - ) - if api_base: - api_base = api_base.removesuffix("/") - http_options.base_url = api_base - proxy = provider_config.get("proxy", "") - if proxy: - http_options.async_client_args = {"proxy": proxy} - logger.info(f"[Gemini Embedding] 使用代理: {proxy}") - - self.client = genai.Client(api_key=api_key, http_options=http_options).aio - # The SDK adds its own lower-case UA alongside our explicit header. - self.client._api_client._http_options.headers.pop("user-agent", None) - - self.model = provider_config.get( - "embedding_model", - "gemini-embedding-001", - ) - - async def get_embedding(self, text: str) -> list[float]: - """获取文本的嵌入""" - try: - result = await self.client.models.embed_content( - model=self.model, - contents=text, - config=types.EmbedContentConfig( - output_dimensionality=self.get_dim(), - ), - ) - assert result.embeddings is not None - assert result.embeddings[0].values is not None - return result.embeddings[0].values - except APIError as e: - raise Exception(f"Gemini Embedding API请求失败: {e.message}") - - async def get_embeddings(self, text: list[str]) -> list[list[float]]: - """批量获取文本的嵌入""" - try: - contents = [ - types.Content(parts=[types.Part.from_text(text=s)]) for s in text - ] - result = await self.client.models.embed_content( - model=self.model, - contents=contents, - config=types.EmbedContentConfig( - output_dimensionality=self.get_dim(), - ), - ) - assert result.embeddings is not None - - embeddings: list[list[float]] = [] - for embedding in result.embeddings: - assert embedding.values is not None - embeddings.append(embedding.values) - return embeddings - except APIError as e: - raise Exception(f"Gemini Embedding API批量请求失败: {e.message}") - - def get_dim(self) -> int: - """获取向量的维度""" - return int(self.provider_config.get("embedding_dimensions", 768)) - - async def terminate(self): - if self.client: - await self.client.aclose() +"""Google Gemini Embedding 提供商适配器。 + +两条任务条件化路径,取决于模型代际: + +- ``gemini-embedding-001``(及更早模型):使用 API 的 ``task_type`` 参数, + 查询用 ``RETRIEVAL_QUERY``,文档用 ``RETRIEVAL_DOCUMENT``(可带 ``title``)。 +- ``gemini-embedding-2``:官方不再支持 ``task_type``,改为把任务前缀写进文本。 + 非对称检索的格式为: + + - 查询:``task: search result | query: {content}`` + - 文档:``title: {title} | text: {content}``(无标题时 ``title: none``) + +参考:https://ai.google.dev/gemini-api/docs/embeddings +""" + +from google import genai +from google.genai import types +from google.genai.errors import APIError + +from astrbot import logger + +from ..entities import ProviderType +from ..provider import EmbeddingProvider +from ..register import register_provider_adapter + +#: 走文本前缀路径的模型前缀(gemini-embedding-2 / -2-preview 等)。 +_TASK_PREFIX_MODEL_MARKERS = ("gemini-embedding-2",) + +#: 走 ``task_type`` 参数路径的默认查询/文档任务类型。 +_DEFAULT_QUERY_TASK = "RETRIEVAL_QUERY" +_DEFAULT_DOCUMENT_TASK = "RETRIEVAL_DOCUMENT" + +#: ``gemini-embedding-2`` 支持的非对称任务名。 +_PREFIX_ASYMMETRIC_TASKS = { + "search result", + "question answering", + "fact checking", + "code retrieval", +} + + +def uses_task_prefix(model: str) -> bool: + """判断该模型是否应使用文本任务前缀(而非 ``task_type`` 参数)。""" + model_name = str(model or "").strip().lower() + # 允许 ``models/gemini-embedding-2`` 这类带前缀的写法。 + model_name = model_name.rsplit("/", 1)[-1] + return model_name.startswith(_TASK_PREFIX_MODEL_MARKERS) + + +def _normalize_task_name(task: str) -> str: + """把用户配置的任务名归一化(大小写、下划线/空格互换)。""" + return " ".join(str(task or "").strip().lower().replace("_", " ").split()) + + +def resolve_query_task(task: str | None) -> str: + """把配置值解析成合法的查询任务名,非法值回退到 ``search result``。 + + 单独抽出来的原因是:配置笔误(多一个连字符、大写、写错单词)不应该让 + 整个检索链路在调用时才崩掉,而构造期就应该收敛到一个可用值。 + """ + normalized = _normalize_task_name(task or "") + return normalized if normalized in _PREFIX_ASYMMETRIC_TASKS else "search result" + + +def build_query_prefix(task: str = "search result") -> str: + """构造 ``gemini-embedding-2`` 的查询前缀。 + + 任务名不可识别时回退到 ``search result``,保证检索链路不会因为一个配置 + 笔误整体崩掉。 + + Args: + task: 任务名,见 ``_PREFIX_ASYMMETRIC_TASKS``,默认 ``search result``。 + + Returns: + 形如 ``task: search result | query: `` 的前缀字符串。 + """ + normalized = _normalize_task_name(task) + if normalized not in _PREFIX_ASYMMETRIC_TASKS: + normalized = resolve_query_task(task) + return f"task: {normalized} | query: " + + +def build_document_prefix(title: str | None = None) -> str: + """构造 ``gemini-embedding-2`` 的文档前缀。 + + Args: + title: 文档标题;为空时使用 ``none``。 + + Returns: + 形如 ``title: none | text: `` 的前缀字符串。 + """ + safe_title = " ".join(str(title or "").split()) or "none" + return f"title: {safe_title} | text: " + + +@register_provider_adapter( + "gemini_embedding", + "Google Gemini Embedding 提供商适配器", + provider_type=ProviderType.EMBEDDING, +) +class GeminiEmbeddingProvider(EmbeddingProvider): + def __init__(self, provider_config: dict, provider_settings: dict) -> None: + super().__init__(provider_config, provider_settings) + self.provider_config = provider_config + self.provider_settings = provider_settings + + api_key: str = provider_config["embedding_api_key"] + api_base: str = provider_config["embedding_api_base"] + timeout: int = int(provider_config.get("timeout", 20)) + + http_options = types.HttpOptions( + timeout=timeout * 1000, headers=self.request_headers + ) + if api_base: + api_base = api_base.removesuffix("/") + http_options.base_url = api_base + proxy = provider_config.get("proxy", "") + if proxy: + http_options.async_client_args = {"proxy": proxy} + logger.info(f"[Gemini Embedding] 使用代理: {proxy}") + + self.client = genai.Client(api_key=api_key, http_options=http_options).aio + # The SDK adds its own lower-case UA alongside our explicit header. + self.client._api_client._http_options.headers.pop("user-agent", None) + + self.model = provider_config.get( + "embedding_model", + "gemini-embedding-001", + ) + + # 任务条件化配置。默认按检索场景(查询/文档非对称)处理。 + self.task_config_mode = ( + str(provider_config.get("embedding_task_type_mode", "auto")).strip().lower() + ) + if self.task_config_mode not in {"auto", "never", "always"}: + logger.warning( + f"[Gemini Embedding] 未知的 embedding_task_type_mode: " + f"{self.task_config_mode!r},回退为 'auto'。", + ) + self.task_config_mode = "auto" + self.query_task = ( + provider_config.get("embedding_query_task_type") or _DEFAULT_QUERY_TASK + ) + self.document_task = ( + provider_config.get("embedding_document_task_type") + or _DEFAULT_DOCUMENT_TASK + ) + self.query_prefix_task = resolve_query_task( + provider_config.get("embedding_query_task_name") + ) + configured_task = provider_config.get("embedding_query_task_name") + if configured_task and resolve_query_task( + configured_task + ) != _normalize_task_name(configured_task): + logger.warning( + f"[Gemini Embedding] 未知的 embedding_query_task_name: " + f"{configured_task!r},回退为 'search result'。" + f"可选: {', '.join(sorted(_PREFIX_ASYMMETRIC_TASKS))}", + ) + # 默认留空:AstrBot 入库时已经把文档标题拼进了 embedding_contents + # (见 kb_helper.py 的 ``{document_title}\n\n{chunk_text}``),这里再填 + # 一次会让标题重复两遍。只有直接调用本适配器、正文不含标题时才建议设置。 + self.document_title = provider_config.get("embedding_document_title") or "" + + if self._uses_task_prefix(): + logger.debug( + f"[Gemini Embedding] 模型 {self.model} 使用文本任务前缀," + "不发送 task_type。", + ) + + self.set_model(self.model) + + # ── 任务条件化 ────────────────────────────────────────────── + + def _uses_task_prefix(self) -> bool: + if self.task_config_mode == "never": + return False + if self.task_config_mode == "always": + return True + return uses_task_prefix(self.model) + + def _build_config( + self, + *, + task_type: str | None, + title: str | None = None, + ) -> types.EmbedContentConfig: + """构造 ``EmbedContentConfig``;前缀模式不设置 ``task_type``。""" + kwargs: dict = {"output_dimensionality": self.get_dim()} + if task_type and not self._uses_task_prefix(): + kwargs["task_type"] = task_type + # ``title`` 只在 RETRIEVAL_DOCUMENT 下有意义。 + if title and task_type == _DEFAULT_DOCUMENT_TASK: + kwargs["title"] = title + return types.EmbedContentConfig(**kwargs) + + def _prepare_query(self, text: str) -> str: + if not self._uses_task_prefix(): + return text + return build_query_prefix(self.query_prefix_task) + text + + def _prepare_document(self, text: str) -> str: + if not self._uses_task_prefix(): + return text + return build_document_prefix(self.document_title) + text + + # ── EmbeddingProvider 接口 ────────────────────────────────── + + async def get_embedding(self, text: str) -> list[float]: + """获取文本的嵌入。 + + 为兼容既有调用方(知识库入库、提供商连通性测试等),该方法按 + **文档**侧语义嵌入。检索查询请使用 :meth:`get_query_embedding`。 + """ + return await self._embed_single( + self._prepare_document(text), + config=self._build_config( + task_type=self.document_task, + title=self.document_title or None, + ), + ) + + async def get_query_embedding(self, text: str) -> list[float]: + """获取检索查询的嵌入(带查询侧任务条件化)。""" + return await self._embed_single( + self._prepare_query(text), + config=self._build_config(task_type=self.query_task), + ) + + async def get_embeddings(self, text: list[str]) -> list[list[float]]: + """批量获取**文档**侧文本的嵌入。 + + 批量入库不需要查询侧语义,因此统一走文档路径。 + """ + return await self._embed_many( + [self._prepare_document(s) for s in text], + config=self._build_config( + task_type=self.document_task, + title=self.document_title or None, + ), + ) + + async def _embed_single( + self, + text: str, + *, + config: types.EmbedContentConfig, + ) -> list[float]: + try: + result = await self.client.models.embed_content( + model=self.model, + contents=text, + config=config, + ) + if not result.embeddings or result.embeddings[0].values is None: + raise Exception("Gemini Embedding API 返回了空向量") + return result.embeddings[0].values + except APIError as e: + raise Exception(f"Gemini Embedding API请求失败: {e.message}") + + async def _embed_many( + self, + text: list[str], + *, + config: types.EmbedContentConfig, + ) -> list[list[float]]: + try: + contents = [ + types.Content(parts=[types.Part.from_text(text=s)]) for s in text + ] + result = await self.client.models.embed_content( + model=self.model, + contents=contents, + config=config, + ) + if result.embeddings is None: + raise Exception("Gemini Embedding API 返回了空结果") + + embeddings: list[list[float]] = [] + for embedding in result.embeddings: + if embedding.values is None: + raise Exception("Gemini Embedding API 返回的向量为空") + embeddings.append(embedding.values) + return embeddings + except APIError as e: + raise Exception(f"Gemini Embedding API批量请求失败: {e.message}") + + def get_dim(self) -> int: + """获取向量的维度""" + return int(self.provider_config.get("embedding_dimensions", 768)) + + async def terminate(self): + if self.client: + await self.client.aclose() diff --git a/astrbot/dashboard/utils.py b/astrbot/dashboard/utils.py index 2f0189cd9f8..58ddd613033 100644 --- a/astrbot/dashboard/utils.py +++ b/astrbot/dashboard/utils.py @@ -1,167 +1,167 @@ -import base64 -import traceback -from io import BytesIO -from typing import TYPE_CHECKING - -from astrbot.api import logger -from astrbot.core.knowledge_base.kb_helper import KBHelper -from astrbot.core.knowledge_base.kb_mgr import KnowledgeBaseManager - -if TYPE_CHECKING: - from astrbot.core.db.vec_db.faiss_impl import FaissVecDB - - -async def generate_tsne_visualization( - query: str, - kb_names: list[str], - kb_manager: KnowledgeBaseManager, -) -> str | None: - """生成 t-SNE 可视化图片 - - Args: - query: 查询文本 - kb_names: 知识库名称列表 - kb_manager: 知识库管理器 - - Returns: - 图片路径或 None - - """ - try: - import faiss - import matplotlib # type: ignore[reportMissingImports] - import numpy as np - - matplotlib.use("Agg") # 使用非交互式后端 - import matplotlib.pyplot as plt # type: ignore[reportMissingImports] - from sklearn.manifold import TSNE # type: ignore[reportMissingImports] - except ImportError as e: - raise Exception( - "缺少必要的库以生成 t-SNE 可视化。请安装 matplotlib 和 scikit-learn: {e}", - ) from e - - try: - # 获取第一个知识库的向量数据 - kb_helper: KBHelper | None = None - for kb_name in kb_names: - kb_helper = await kb_manager.get_kb_by_name(kb_name) - if kb_helper: - break - - if not kb_helper: - logger.warning("未找到知识库") - return None - - kb = kb_helper.kb - index_path = kb_helper.kb_dir / "index.faiss" - - # 读取 FAISS 索引 - if not index_path.exists(): - logger.warning(f"FAISS 索引不存在: {index_path!s}") - return None - - index = faiss.read_index(str(index_path)) - - if index.ntotal == 0: - logger.warning("索引为空") - return None - - # 提取所有向量 - logger.info(f"提取 {index.ntotal} 个向量用于可视化...") - if isinstance(index, faiss.IndexIDMap): - base_index = faiss.downcast_index(index.index) - if hasattr(base_index, "reconstruct_n"): - vectors = base_index.reconstruct_n(0, index.ntotal) - else: - vectors = np.zeros((index.ntotal, index.d), dtype=np.float32) - for i in range(index.ntotal): - base_index.reconstruct(i, vectors[i]) - elif hasattr(index, "reconstruct_n"): - vectors = index.reconstruct_n(0, index.ntotal) - else: - vectors = np.zeros((index.ntotal, index.d), dtype=np.float32) - for i in range(index.ntotal): - index.reconstruct(i, vectors[i]) - - # 获取查询向量 - vec_db: FaissVecDB = kb_helper.vec_db # type: ignore - embedding_provider = vec_db.embedding_provider - query_embedding = await embedding_provider.get_embedding(query) - query_vector = np.array([query_embedding], dtype=np.float32) - - # 合并所有向量和查询向量 - all_vectors = np.vstack([vectors, query_vector]) - - # t-SNE 降维 - logger.info("开始 t-SNE 降维...") - perplexity = min(30, all_vectors.shape[0] - 1) - tsne = TSNE(n_components=2, random_state=42, perplexity=perplexity) - vectors_2d = tsne.fit_transform(all_vectors) - - # 分离知识库向量和查询向量 - kb_vectors_2d = vectors_2d[:-1] - query_vector_2d = vectors_2d[-1] - - # 可视化 - logger.info("生成可视化图表...") - plt.figure(figsize=(14, 10)) - - # 绘制知识库向量 - scatter = plt.scatter( - kb_vectors_2d[:, 0], - kb_vectors_2d[:, 1], - alpha=0.5, - s=40, - c=range(len(kb_vectors_2d)), - cmap="viridis", - label="Knowledge Base Vectors", - ) - - # 绘制查询向量(红色 X) - plt.scatter( - query_vector_2d[0], - query_vector_2d[1], - c="red", - s=300, - marker="X", - edgecolors="black", - linewidths=2, - label="Query", - zorder=5, - ) - - # 添加查询文本标注 - plt.annotate( - "Query", - (query_vector_2d[0], query_vector_2d[1]), - xytext=(10, 10), - textcoords="offset points", - fontsize=10, - bbox={"boxstyle": "round,pad=0.5", "fc": "yellow", "alpha": 0.7}, - arrowprops={"arrowstyle": "->", "connectionstyle": "arc3,rad=0"}, - ) - - plt.colorbar(scatter, label="Vector Index") - plt.title( - f"t-SNE Visualization: Query in Knowledge Base\n" - f"({index.ntotal} vectors, {index.d} dimensions, KB: {kb.kb_name})", - fontsize=14, - pad=20, - ) - plt.xlabel("t-SNE Dimension 1", fontsize=12) - plt.ylabel("t-SNE Dimension 2", fontsize=12) - plt.grid(True, alpha=0.3) - plt.legend(fontsize=10, loc="upper right") - - # base64 编码图片返回 - buffer = BytesIO() - plt.savefig(buffer, format="png", dpi=150, bbox_inches="tight") - plt.close() - buffer.seek(0) - img_base64 = base64.b64encode(buffer.read()).decode("utf-8") - return img_base64 - - except Exception as e: - logger.error(f"生成 t-SNE 可视化时出错: {e}") - logger.error(traceback.format_exc()) - return None +import base64 +import traceback +from io import BytesIO +from typing import TYPE_CHECKING + +from astrbot.api import logger +from astrbot.core.knowledge_base.kb_helper import KBHelper +from astrbot.core.knowledge_base.kb_mgr import KnowledgeBaseManager + +if TYPE_CHECKING: + from astrbot.core.db.vec_db.faiss_impl import FaissVecDB + + +async def generate_tsne_visualization( + query: str, + kb_names: list[str], + kb_manager: KnowledgeBaseManager, +) -> str | None: + """生成 t-SNE 可视化图片 + + Args: + query: 查询文本 + kb_names: 知识库名称列表 + kb_manager: 知识库管理器 + + Returns: + 图片路径或 None + + """ + try: + import faiss + import matplotlib # type: ignore[reportMissingImports] + import numpy as np + + matplotlib.use("Agg") # 使用非交互式后端 + import matplotlib.pyplot as plt # type: ignore[reportMissingImports] + from sklearn.manifold import TSNE # type: ignore[reportMissingImports] + except ImportError as e: + raise Exception( + "缺少必要的库以生成 t-SNE 可视化。请安装 matplotlib 和 scikit-learn: {e}", + ) from e + + try: + # 获取第一个知识库的向量数据 + kb_helper: KBHelper | None = None + for kb_name in kb_names: + kb_helper = await kb_manager.get_kb_by_name(kb_name) + if kb_helper: + break + + if not kb_helper: + logger.warning("未找到知识库") + return None + + kb = kb_helper.kb + index_path = kb_helper.kb_dir / "index.faiss" + + # 读取 FAISS 索引 + if not index_path.exists(): + logger.warning(f"FAISS 索引不存在: {index_path!s}") + return None + + index = faiss.read_index(str(index_path)) + + if index.ntotal == 0: + logger.warning("索引为空") + return None + + # 提取所有向量 + logger.info(f"提取 {index.ntotal} 个向量用于可视化...") + if isinstance(index, faiss.IndexIDMap): + base_index = faiss.downcast_index(index.index) + if hasattr(base_index, "reconstruct_n"): + vectors = base_index.reconstruct_n(0, index.ntotal) + else: + vectors = np.zeros((index.ntotal, index.d), dtype=np.float32) + for i in range(index.ntotal): + base_index.reconstruct(i, vectors[i]) + elif hasattr(index, "reconstruct_n"): + vectors = index.reconstruct_n(0, index.ntotal) + else: + vectors = np.zeros((index.ntotal, index.d), dtype=np.float32) + for i in range(index.ntotal): + index.reconstruct(i, vectors[i]) + + # 获取查询向量 + vec_db: FaissVecDB = kb_helper.vec_db # type: ignore + embedding_provider = vec_db.embedding_provider + query_embedding = await embedding_provider.get_query_embedding(query) + query_vector = np.array([query_embedding], dtype=np.float32) + + # 合并所有向量和查询向量 + all_vectors = np.vstack([vectors, query_vector]) + + # t-SNE 降维 + logger.info("开始 t-SNE 降维...") + perplexity = min(30, all_vectors.shape[0] - 1) + tsne = TSNE(n_components=2, random_state=42, perplexity=perplexity) + vectors_2d = tsne.fit_transform(all_vectors) + + # 分离知识库向量和查询向量 + kb_vectors_2d = vectors_2d[:-1] + query_vector_2d = vectors_2d[-1] + + # 可视化 + logger.info("生成可视化图表...") + plt.figure(figsize=(14, 10)) + + # 绘制知识库向量 + scatter = plt.scatter( + kb_vectors_2d[:, 0], + kb_vectors_2d[:, 1], + alpha=0.5, + s=40, + c=range(len(kb_vectors_2d)), + cmap="viridis", + label="Knowledge Base Vectors", + ) + + # 绘制查询向量(红色 X) + plt.scatter( + query_vector_2d[0], + query_vector_2d[1], + c="red", + s=300, + marker="X", + edgecolors="black", + linewidths=2, + label="Query", + zorder=5, + ) + + # 添加查询文本标注 + plt.annotate( + "Query", + (query_vector_2d[0], query_vector_2d[1]), + xytext=(10, 10), + textcoords="offset points", + fontsize=10, + bbox={"boxstyle": "round,pad=0.5", "fc": "yellow", "alpha": 0.7}, + arrowprops={"arrowstyle": "->", "connectionstyle": "arc3,rad=0"}, + ) + + plt.colorbar(scatter, label="Vector Index") + plt.title( + f"t-SNE Visualization: Query in Knowledge Base\n" + f"({index.ntotal} vectors, {index.d} dimensions, KB: {kb.kb_name})", + fontsize=14, + pad=20, + ) + plt.xlabel("t-SNE Dimension 1", fontsize=12) + plt.ylabel("t-SNE Dimension 2", fontsize=12) + plt.grid(True, alpha=0.3) + plt.legend(fontsize=10, loc="upper right") + + # base64 编码图片返回 + buffer = BytesIO() + plt.savefig(buffer, format="png", dpi=150, bbox_inches="tight") + plt.close() + buffer.seek(0) + img_base64 = base64.b64encode(buffer.read()).decode("utf-8") + return img_base64 + + except Exception as e: + logger.error(f"生成 t-SNE 可视化时出错: {e}") + logger.error(traceback.format_exc()) + return None diff --git a/changelogs/unreleased.md b/changelogs/unreleased.md index b06e68235cc..4ed0dc48b08 100644 --- a/changelogs/unreleased.md +++ b/changelogs/unreleased.md @@ -1,3 +1,4 @@ -# Unreleased - -- QQ Official: a failed image upload no longer dumps the base64 payload into the log (a single multi-MB line could freeze log writing and the web dashboard), and image upload retries drop from 5 to 3 with a single summary warning instead of one per attempt. +# Unreleased + +- QQ Official: a failed image upload no longer dumps the base64 payload into the log (a single multi-MB line could freeze log writing and the web dashboard), and image upload retries drop from 5 to 3 with a single summary warning instead of one per attempt. +- Gemini Embedding now conditions query and document embeddings separately (`task_type` for `gemini-embedding-001`, text prefixes for `gemini-embedding-2`), and FAISS vectors are L2-normalized on write and search so `1 - distance / 2` is a real cosine score. Previously both sides used the same encoding and unnormalized vectors made similarity scores drift with text length, so no fixed threshold could separate relevant from irrelevant memories. Existing indexes are re-normalized once on load. diff --git a/dashboard/src/i18n/locales/en-US/features/config-metadata.json b/dashboard/src/i18n/locales/en-US/features/config-metadata.json index f21350bc4b5..66405d7c380 100644 --- a/dashboard/src/i18n/locales/en-US/features/config-metadata.json +++ b/dashboard/src/i18n/locales/en-US/features/config-metadata.json @@ -1,2074 +1,2094 @@ -{ - "ai_group": { - "name": "AI", - "agent_runner": { - "description": "Agent Runner", - "hint": "Select the runner for AI conversations. Switching runners resets the configuration to the new type's defaults.", - "provider_settings": { - "enable": { - "description": "Enable", - "hint": "Master switch for AI conversations" - } - }, - "agent_runner": { - "runner_type": { - "description": "Runner", - "labels": [ - "Built-in Agent", - "Dify", - "Coze", - "Alibaba Cloud Bailian Application", - "DeerFlow" - ] - } - } - }, - "dify_runner": { - "description": "Dify Configuration", - "agent_runner": { "config": { - "dify_api_type": { "description": "Application Type" }, - "dify_api_key": { "description": "API Key" }, - "dify_api_base": { "description": "API Base URL" }, - "dify_workflow_output_key": { "description": "Workflow Output Variable" }, - "dify_query_input_key": { "description": "Prompt Input Variable" }, - "variables": { "description": "Variables" }, - "timeout": { "description": "Timeout (seconds)" }, - "proxy": { "description": "Proxy URL" } - } } - }, - "coze_runner": { - "description": "Coze Configuration", - "agent_runner": { "config": { - "coze_api_key": { "description": "API Key" }, - "bot_id": { "description": "Bot ID" }, - "coze_api_base": { "description": "API Base URL" }, - "auto_save_history": { "description": "Let Coze Manage Conversation History" }, - "timeout": { "description": "Timeout (seconds)" }, - "proxy": { "description": "Proxy URL" } - } } - }, - "dashscope_runner": { - "description": "Alibaba Cloud Bailian Application Configuration", - "agent_runner": { "config": { - "dashscope_app_type": { "description": "Application Type" }, - "dashscope_api_key": { "description": "API Key" }, - "dashscope_app_id": { "description": "Application ID" }, - "rag_options": { - "pipeline_ids": { "description": "Knowledge Base Pipeline IDs" }, - "file_ids": { "description": "File IDs" }, - "output_reference": { "description": "Include References" } - }, - "variables": { "description": "Variables" }, - "timeout": { "description": "Timeout (seconds)" }, - "proxy": { "description": "Proxy URL" } - } } - }, - "deerflow_runner": { - "description": "DeerFlow Configuration", - "agent_runner": { "config": { - "deerflow_api_base": { "description": "API Base URL" }, - "deerflow_api_key": { "description": "API Key" }, - "deerflow_auth_header": { "description": "Authorization Header" }, - "deerflow_assistant_id": { "description": "Assistant ID" }, - "deerflow_model_name": { "description": "Model Name Override" }, - "deerflow_thinking_enabled": { "description": "Enable Thinking Mode" }, - "deerflow_plan_mode": { "description": "Enable Plan Mode" }, - "deerflow_subagent_enabled": { "description": "Enable Subagents" }, - "deerflow_max_concurrent_subagents": { "description": "Maximum Concurrent Subagents" }, - "deerflow_recursion_limit": { "description": "Recursion Limit" }, - "timeout": { "description": "Timeout (seconds)" }, - "proxy": { "description": "Proxy URL" } - } } - }, - "ai": { - "description": "Model", - "hint": "Configure the built-in Agent's chat models and shared image caption and speech models.", - "agent_runner": { "config": { "model": { - "provider_id": { - "description": "Chat Model", - "hint": "Uses the first model when left empty" - }, - "fallback_provider_ids": { - "description": "Fallback Chat Models", - "hint": "Try these chat models in order when the primary model request fails." - }, - "request_max_retries": { - "description": "Retries on Error", - "hint": "Maximum attempts for a single model request when retryable errors occur." - } - } } }, - "provider_settings": { - "default_image_caption_provider_id": { - "description": "Image Caption Model", - "hint": "When the chat model does not support image input, use the image captioning model to describe images. Leave blank to disable." - }, - "image_caption_prompt": { - "description": "Image Caption Prompt", - "hint": "The prompt used by the image captioning model." - } - }, - "provider_stt_settings": { - "enable": { - "description": "Speech Recognition", - "hint": "Use a speech-to-text model to transcribe user voice messages into text for the model to understand." - }, - "provider_id": { - "description": "Default Speech-to-Text Model", - "hint": "You can also use /provider to select a model for an individual conversation." - } - }, - "provider_tts_settings": { - "enable": { - "description": "Voice Replies", - "hint": "Use a text-to-speech model to turn text into voice replies." - }, - "provider_id": { - "description": "Default Text-to-Speech Model", - "hint": "You can also use /provider to select a model for an individual conversation." - }, - "trigger_probability": { - "description": "TTS Trigger Probability", - "hint": "Trigger voice replies based on a random probability." - } - } - }, - "persona": { - "description": "Persona", - "hint": "Set the default persona for AI conversations. Personas can be managed in the Persona tab.", - "agent_runner": { "config": { "persona": { - "persona_id": { "description": "Default Persona" }, - "safety_mode": { - "description": "Safety Mode", - "hint": "Guide the model toward safe content and away from harmful or sensitive topics." - }, - "safety_mode_strategy": { - "description": "Safety Mode Strategy", - "hint": "Select how safety mode is applied." - } - } } } - }, - "knowledgebase": { - "description": "Knowledge Base", - "hint": "AstrBot's \"external brain\".", - "kb_names": { - "description": "Knowledge Base List", - "hint": "Supports multiple selections" - }, - "kb_fusion_top_k": { - "description": "Fusion Search Results Count", - "hint": "Number of results returned after fusing search results from multiple knowledge bases" - }, - "kb_final_top_k": { - "description": "Final Results Count", - "hint": "Number of results retrieved from the knowledge base. Higher values may provide more relevant information but could also introduce noise. Adjust based on actual needs" - }, - "kb_agentic_mode": { - "description": "Agentic Knowledge Base Retrieval", - "hint": "When enabled, knowledge base retrieval becomes an LLM Tool, allowing the model to autonomously decide when to query the knowledge base. Requires the model to support function calling." - } - }, - "websearch": { - "description": "Web Search", - "hint": "Enables AstrBot to access the internet and stay up to date.", - "provider_settings": { - "web_search": { - "description": "Enable Web Search" - }, - "websearch_provider": { - "description": "Web Search Provider", - "labels": [ - "SerpApi", - "DeepSeek Search API", - "Tavily", - "Baidu AI Search", - "Bocha", - "Brave", - "Firecrawl", - "Exa", - "AnySearch" - ], - "subtitles": [ - "Google web, news, image, scholar, and finance search", - "Official DeepSeek search API", - "", - "", - "", - "", - "", - "", - "" - ] - }, - "websearch_tavily_key": { - "description": "Tavily API Key", - "hint": "Multiple keys can be added for rotation." - }, - "websearch_bocha_key": { - "description": "BoCha API Key", - "hint": "Multiple keys can be added for rotation." - }, - "websearch_brave_key": { - "description": "Brave Search API Key", - "hint": "Multiple keys can be added for rotation." - }, - "websearch_firecrawl_key": { - "description": "Firecrawl API Key", - "hint": "Multiple keys can be added for rotation." - }, - "websearch_baidu_app_builder_key": { - "description": "Baidu Qianfan Smart Cloud APP Builder API Key", - "hint": "Reference: [https://console.bce.baidu.com/iam/#/iam/apikey/list](https://console.bce.baidu.com/iam/#/iam/apikey/list)" - }, - "web_search_link": { - "description": "Display Source Citations" - }, - "websearch_exa_key": { - "description": "Exa API Key", - "hint": "Multiple keys can be added for rotation. Get a key at https://dashboard.exa.ai" - }, - "websearch_anysearch_key": { - "description": "AnySearch API Key", - "hint": "Multiple keys can be added for rotation. Leave empty to use anonymous mode with a daily free quota." - }, - "websearch_serpapi_key": { - "description": "SerpApi API Key", - "hint": "Supports Google web, news, image, scholar, and finance search. Multiple keys can be added for rotation. Get a key: [https://serpapi.com/manage-api-key](https://serpapi.com/manage-api-key)" - }, - "websearch_deepseek_key": { - "description": "DeepSeek API Key", - "hint": "Enter your DeepSeek API key. Can use the same key as the chat model (must be entered separately). Supports multiple keys for rotation. Get a key: [https://platform.deepseek.com/api_keys](https://platform.deepseek.com/api_keys)" - } - } - }, - "file_extract": { - "description": "File Extract", - "provider_settings": { - "file_extract": { - "enable": { - "description": "Enable File Extract" - }, - "provider": { - "description": "File Extract Provider" - }, - "moonshotai_api_key": { - "description": "Moonshot AI API Key" - } - } - } - }, - "agent_computer_use": { - "description": "Agent Computer Use", - "hint": "Allows the AstrBot to access and use your computer or an sandbox environment to perform more complex tasks. See: [Agent Sandbox Environment](https://docs.astrbot.app/en/use/astrbot-agent-sandbox.html).", - "provider_settings": { - "computer_use_runtime": { - "description": "Computer Use Runtime", - "hint": "Environment the Agent is allowed to access.", - "labels": ["No environment", "Local machine", "Third-party sandbox"] - }, - "computer_use_local_permissions": { - "description": "Local Permission Policies" - }, - "computer_use_require_admin": { - "description": "Require Admin Permission for Sandbox", - "hint": "When enabled, AstrBot admin permission is required to use remote sandbox capabilities. Add admins under Config -> Access Control -> Administrators -> Administrator IDs. Send /sid to the bot to get the ID." - }, - "sandbox": { - "booter": { - "description": "Sandbox Environment Driver" - }, - "shipyard_neo_endpoint": { - "description": "Shipyard Neo API Endpoint", - "hint": "Bay API address, default http://127.0.0.1:8114." - }, - "shipyard_neo_access_token": { - "description": "Shipyard Neo Access Token", - "hint": "Bay API Key (sk-bay-...). Leave empty for auto-discovery from credentials.json." - }, - "shipyard_neo_profile": { - "description": "Shipyard Neo Profile", - "hint": "Sandbox profile for Shipyard Neo, e.g. python-default. Leave empty to auto-select the most capable profile." - }, - "shipyard_neo_ttl": { - "description": "Shipyard Neo Sandbox TTL", - "hint": "Sandbox time-to-live in seconds." - }, - "cua_image": { - "description": "CUA Image", - "hint": "CUA sandbox image or OS type. Defaults to linux. Supported values depend on the installed CUA SDK." - }, - "cua_os_type": { - "description": "CUA OS Type", - "hint": "CUA sandbox operating system type. Defaults to linux." - }, - "cua_idle_timeout": { - "description": "CUA Idle Timeout", - "hint": "Idle timeout for CUA sandbox sessions in seconds. When greater than 0, AstrBot proactively shuts down an idle CUA sandbox after that amount of inactivity; 0 disables it." - }, - "cua_telemetry_enabled": { - "description": "CUA Telemetry", - "hint": "Allow the CUA SDK to send telemetry data. Disabled by default." - }, - "cua_local": { - "description": "CUA Local Sandbox", - "hint": "Prefer a local CUA sandbox. Enabled by default to avoid requiring CUA_API_KEY for cloud sandboxes. Disable this to use CUA cloud sandboxes." - }, - "cua_api_key": { - "description": "CUA API Key", - "hint": "CUA cloud sandbox API key. Required only when local sandbox is disabled. You can also provide it via the CUA_API_KEY environment variable." - }, - "shipyard_endpoint": { - "description": "Shipyard API Endpoint", - "hint": "API access address for Shipyard service." - }, - "shipyard_access_token": { - "description": "Shipyard Access Token", - "hint": "Access token for accessing Shipyard service." - }, - "shipyard_ttl": { - "description": "Shipyard Session TTL", - "hint": "Session time-to-live in seconds." - }, - "shipyard_max_sessions": { - "description": "Shipyard Max Sessions", - "hint": "Maximum number of Shipyard sessions an instance can handle." - } - } - }, - "local_permissions": { - "role": "Role", - "execution": "Allow code execution", - "network": "Allow execution network access", - "filesystem": "File access scope", - "scopes": { - "workspace": "Workspace", - "host": "Entire environment" - }, - "scopeHints": { - "none": "No file access allowed", - "workspace": "Restricted workspace, temporary directories, and skill files.", - "workspaceUnsupported": "Restricted workspace file access is unavailable on this platform.", - "host": "All files in the environment where AstrBot runs." - }, - "scopeDetails": { - "account": "1. Access is limited to files permitted by the account running AstrBot.", - "docker": "2. If deployed through Docker, only files inside the container and mounted files are accessible, not all files on the Docker host." - }, - "roles": { - "member": "Member", - "admin": "Administrator" - }, - "modes": { - "none": "Disabled" - }, - "networkAlwaysOn": "Always on", - "windowsHostNetworkHint": "Windows cannot disable networking while executing code with entire-environment access. Switch to workspace access to disable networking.", - "runtimeUnknown": "Runtime information is unavailable.", - "memberWarning": "Members have network access or file access across the entire environment.", - "executionInactive": "Inactive", - "executionInactiveHelp": "Why execution is inactive", - "executionBlocked": "Code execution is enabled for {role}, but the configured isolation requirements cannot currently be met. {reason}", - "runtime": { - "os": "OS", - "arch": "Architecture", - "sandbox": "Local isolation", - "windowsUnavailable": "{backend} · Not ready", - "windowsSetupHint": "Save the configuration and restart AstrBot. If prompted for administrator approval, allow it to initialize the sandbox.", - "errorDetails": "View diagnostic details", - "unavailableHint": "Sandbox startup failed, affecting restricted Shell/Python execution and workspace file search. Use the error below to check system security policies (such as Linux AppArmor and user namespace restrictions) or container restrictions, then restart AstrBot to check again.", - "dialog": { - "intro": "Using Seatbelt on macOS or bubblewrap (bwrap) on Linux, AstrBot provides security isolation for Agent execution, restricting file access scope and network permissions for different users of AstrBot Agent to improve security.", - "startupError": "View startup error", - "documentation": "View detailed setup documentation" - }, - "close": "Close", - "setupHint": { - "missing": "Install {dependency} to enable all local isolation features.", - "unavailable": "Configure {backend} to enable all local isolation features.", - "unsupported": "Learn about local isolation support." - }, - "isolationFailure": { - "missing": "Missing {dependency}.", - "unavailable": "{backend} failed its startup probe.", - "unsupported": "Local process isolation is not supported on this platform." - }, - "executionUnavailable": { - "missing": "Missing {dependency}; code execution cannot be enabled when File access scope is set to Workspace.", - "unavailable": "{backend} cannot start; code execution cannot be enabled when File access scope is set to Workspace.", - "unsupported": "Local isolation is unsupported on this platform; code execution cannot be enabled when File access scope is set to Workspace." - }, - "status": { - "detected": "{backend}", - "missing": "Missing {dependency}", - "unavailable": "{backend} · Installed but cannot start", - "unsupported": "Unsupported" - } - } - } - }, - "proactive_capability": { - "description": "Proactive Agent", - "hint": "AstrBot will wake up, run your tasks, and deliver the results to you. See [Proactive Agent](https://docs.astrbot.app/en/use/proactive-agent.html)", - "provider_settings": { - "proactive_capability": { - "add_cron_tools": { - "description": "Enable", - "hint": "When enabled, related tools will be passed to the Agent to implement proactive Agent capabilities. You can tell AstrBot what to do at a future time, and it will be triggered on schedule to execute the task, and report the result back to you." - } - } - } - }, - "truncate_and_compress": { - "hint": "[Context Management](https://docs.astrbot.app/en/use/context-compress.html)", - "description": "Context Management Strategy", - "agent_runner": { "config": { "compression": { - "max_turns": { - "description": "Max Turns Before Compression", - "hint": "Persistent conversation history is truncated or LLM-compressed by the strategy below only after it exceeds this many turns. Request-time contexts are also constrained by this value before sending. -1 means no turn-based limit." - }, - "trim_turns": { - "description": "Turns to Discard When Limit Exceeded", - "hint": "When history exceeds 'Max Turns Before Compression' and LLM compression is unavailable, discard this many oldest turns at once. Request-time truncation also reuses this value." - }, - "overflow_strategy": { - "description": "Compression Strategy", - "labels": [ - "Truncate by Turns", - "Compress by LLM" - ], - "hint": "Strategy for handling model context limits." - }, - "instruction": { - "description": "Context Compression Instruction", - "hint": "If empty, the default prompt will be used." - }, - "keep_recent_ratio": { - "description": "Recent Context Token Ratio to Keep", - "hint": "Keep recent exact context by current context token ratio, from 0-0.3. 0.15 means keeping 15%; values above 0 keep at least the latest round." - }, - "provider_id": { - "description": "Compression Model", - "hint": "The model used for context compression. Defaults to the current chat model." - }, - "fallback_max_tokens": { - "description": "Fallback context window size", - "hint": "When max_context_tokens is 0 and the model is not in built-in metadata, use this value as the context window size. Default: 128000." - } - } } } - }, - "others": { - "description": "Other Settings", - "agent_runner": { "config": { "misc": { - "max_steps": { "description": "Maximum Tool Call Rounds" }, - "tool_schema_mode": { - "description": "Tool Schema Mode", - "hint": "Skills-like sends name/description first and re-queries for parameters; Full sends the complete schema in one step.", - "labels": ["Skills-like (two-stage)", "Full schema"] - }, - "tool_call_timeout": { - "description": "Tool Call Timeout (seconds)" - }, - "sanitize_context_by_modalities": { - "description": "Sanitize History by Modalities", - "hint": "When enabled, sanitizes contexts before each LLM request by removing image blocks and tool-call structures that the current provider's modalities do not support (this changes what the model sees)." - } - } } }, - "provider_settings": { - "display_reasoning_text": { - "description": "Display Reasoning Content", - "hint": "Include the model's chain-of-thought information in the final reply." - }, - "identifier": { - "description": "User Identification", - "hint": "Prepend the user ID to the user prompt." - }, - "group_name_display": { - "description": "Display Group Name", - "hint": "Prepend the group name to user prompts in group chats on supported messaging platforms." - }, - "datetime_system_prompt": { - "description": "Real-world Time Awareness", - "hint": "Include the current time in the user prompt." - }, - "show_tool_use_status": { - "description": "Show Tool Call Information", - "hint": "When a tool is called, also send a message containing the tool name." - }, - "show_tool_call_result": { - "description": "Output Tool Call Results", - "hint": "Only takes effect when \"Show Tool Call Information\" is enabled, and shows at most 70 characters." - }, - "buffer_intermediate_messages": { - "description": "Merge Agent Intermediate Messages", - "hint": "When enabled, intermediate text generated during multi-step tool calls in non-streaming mode will be buffered and sent as a single merged reply after the Agent finishes." - }, - "max_quoted_fallback_images": { - "description": "Forwarded Image Fetch Limit", - "hint": "Maximum number of images injected from forwarded-message parsing; extra images are truncated." - }, - "quoted_message_parser": { - "max_component_chain_depth": { - "description": "Forwarded Rich-Text Parse Depth", - "hint": "Maximum recursive depth when parsing rich-text component chains inside forwarded messages." - }, - "max_forward_node_depth": { - "description": "Forward Nesting Parse Depth", - "hint": "Maximum recursive depth when parsing nested forwarded nodes." - }, - "max_forward_fetch": { - "description": "Forward Recursive Fetch Limit", - "hint": "Maximum number of recursive get_forward_msg fetch operations." - }, - "warn_on_action_failure": { - "description": "Warn on Forward Parse Failure", - "hint": "When enabled, log warnings when all get_msg/get_forward_msg attempts fail." - } - }, - "streaming_response": { - "description": "Streaming Output", - "hint": "Display responses with a typewriter effect on supported chat platforms." - }, - "unsupported_streaming_strategy": { - "description": "Platforms Without Streaming Support", - "hint": "Select the handling method for platforms that don't support streaming responses. Real-time segmented reply sends content immediately when the system detects segment points like punctuation during streaming reception", - "labels": [ - "Real-time Segmented Reply", - "Disable Streaming Response" - ] - }, - "wake_prefix": { - "description": "Additional Wake Prefix", - "hint": "If the wake prefix is / and the additional chat wake prefix is chat, then /chat is required to trigger LLM requests" - }, - "prompt_prefix": { - "description": "User Prompt", - "hint": "You can use {{prompt}} as a placeholder for user input. If no placeholder is provided, it will be added before the user input." - }, - "image_compress_options": { - "description": "Model input image settings", - "hint": "Images are always prepared as JPEG/PNG below 512 KiB. Original attachments are preserved.", - "max_size": { - "description": "Input image maximum edge length", - "hint": "Longest edge sent to the model, in pixels. Images may be reduced further to stay below 512 KiB; original attachment paths are unchanged." - } - }, - "reachability_check": { - "description": "Provider Reachability Check", - "hint": "When running the /provider command, test provider connectivity in parallel. This actively pings models and may consume extra tokens." - } - }, - "provider_tts_settings": { - "dual_output": { - "description": "Output Both Voice and Text When TTS is Enabled" - } - } - } - }, - "platform_group": { - "name": "Platforms & Messages", - "platform": { - "description": "Message Platform Adapters", - "app_id": { - "description": "Application ID", - "hint": "The application ID from the messaging platform's developer console." - }, - "app_secret": { - "description": "Application secret", - "hint": "The application secret from the messaging platform's developer console. Keep it secure." - }, - "domain": { - "description": "Open platform API URL", - "hint": "The base URL of the open platform API. The default normally does not need to be changed." - }, - "corpid": { - "description": "Enterprise ID", - "hint": "The enterprise ID (CorpID) from the WeCom administration console." - }, - "token": { - "description": "Callback token", - "hint": "The token used to verify requests in the messaging platform's callback settings." - }, - "encoding_aes_key": { - "description": "Message encryption key", - "hint": "The EncodingAESKey from the callback settings, used to encrypt and decrypt messages." - }, - "api_base_url": { - "description": "API base URL", - "hint": "The messaging platform API base URL. The default normally does not need to be changed." - }, - "client_id": { - "description": "Client ID", - "hint": "The client ID from the messaging platform's developer console." - }, - "client_secret": { - "description": "Client secret", - "hint": "The client secret from the messaging platform's developer console. Keep it secure." - }, - "start_message": { - "description": "Start command reply", - "hint": "The message sent when a user sends the /start command to the Telegram bot." - }, - "telegram_api_base_url": { - "description": "API URL", - "hint": "The Telegram Bot API base URL. The official default normally does not need to be changed." - }, - "telegram_file_base_url": { - "description": "File API URL", - "hint": "The base URL used to download files from the Telegram Bot API. The official default normally does not need to be changed." - }, - "bot_token": { - "description": "Slack Bot Token", - "hint": "The Slack application's Bot User OAuth Token, usually beginning with xoxb-." - }, - "app_token": { - "description": "Slack App Token", - "hint": "The App-Level Token used by Slack Socket Mode, usually beginning with xapp-." - }, - "signing_secret": { - "description": "Slack Signing Secret", - "hint": "The Slack application's Signing Secret, used to verify webhook requests." - }, - "channel_access_token": { - "description": "LINE Channel Access Token", - "hint": "The Channel Access Token for the LINE Messaging API channel." - }, - "channel_secret": { - "description": "LINE Channel Secret", - "hint": "The Channel Secret for the LINE Messaging API channel." - }, - "active_send_mode": { - "description": "Use Proactive Send API" - }, - "appid": { - "description": "App ID", - "hint": "Required. App ID for the current messaging platform. See the platform integration docs for how to obtain it." - }, - "callback_server_host": { - "description": "Callback Server Host", - "hint": "Callback server host. Leave empty to disable the callback server." - }, - "card_template_id": { - "description": "Card Template ID", - "hint": "Optional. DingTalk interactive card template ID. When enabled, streaming replies will use interactive cards." - }, - "discord_activity_name": { - "description": "Discord Activity Name", - "hint": "Optional Discord activity name. Leave empty to disable." - }, - "discord_allow_bot_messages": { - "description": "Allow Bot Messages", - "hint": "When enabled, AstrBot will receive messages from other Discord bots. Useful for bot-to-bot communication scenarios (e.g., message forwarding). Disabled by default." - }, - "discord_command_register": { - "description": "Register Discord slash commands", - "hint": "When enabled, AstrBot will automatically register plugin commands as Discord slash commands" - }, - "discord_proxy": { - "description": "Discord Proxy URL", - "hint": "Optional proxy URL: http://ip:port" - }, - "discord_token": { - "description": "Discord Bot Token", - "hint": "Enter your Discord Bot Token here." - }, - "enable": { - "description": "Enable", - "hint": "Whether to enable this adapter. Disabled adapters will not receive messages." - }, - "enable_group_c2c": { - "description": "Enable Message List Private Chat", - "hint": "When enabled, the bot can receive private chats from QQ message list. You may need to add the bot as a friend by scanning a QR code in the QQ bot platform. See docs." - }, - "enable_guild_direct_message": { - "description": "Enable Guild Direct Messages", - "hint": "When enabled, the bot can receive guild direct messages." - }, - "id": { - "description": "Bot Name", - "hint": "Bot name" - }, - "is_sandbox": { - "description": "Sandbox Mode" - }, - "kf_name": { - "description": "WeChat Customer Service Account Name", - "hint": "Optional. Customer service account name (not ID). Get it at https://kf.weixin.qq.com/kf/frame#/accounts" - }, - "lark_connection_mode": { - "description": "Subscription Mode", - "labels": [ - "Long Connection Mode", - "Webhook Server Mode" - ] - }, - "lark_encrypt_key": { - "description": "Encrypt Key", - "hint": "Encryption key for decrypting Lark callback data." - }, - "lark_verification_token": { - "description": "Verification Token", - "hint": "Token for verifying Lark callback requests." - }, - "misskey_allow_insecure_downloads": { - "description": "Allow Insecure Downloads (Disable SSL Verification)", - "hint": "If remote servers have certificate issues, SSL verification will be disabled as a fallback. Use only when necessary due to security risks." - }, - "misskey_default_visibility": { - "description": "Default Post Visibility", - "hint": "Default visibility for bot posts. public: public, home: home timeline, followers: followers only." - }, - "misskey_download_chunk_size": { - "description": "Stream Download Chunk Size (bytes)", - "hint": "Bytes read per chunk during streaming download and MD5 calculation. Too small increases overhead; too large uses more memory." - }, - "misskey_download_timeout": { - "description": "Remote Download Timeout (seconds)", - "hint": "Timeout for downloading remote files (seconds), used when falling back to local upload." - }, - "misskey_enable_chat": { - "description": "Enable Chat Message Responses", - "hint": "When enabled, the bot listens and responds to private chat messages." - }, - "misskey_enable_file_upload": { - "description": "Enable File Upload to Misskey", - "hint": "When enabled, the adapter uploads files in message chains to Misskey. URL files try server-side upload first; if async upload fails, it falls back to local download and upload." - }, - "misskey_instance_url": { - "description": "Misskey Instance URL", - "hint": "e.g. https://misskey.example. The Misskey instance where the bot account lives." - }, - "misskey_local_only": { - "description": "Local Only (No Federation)", - "hint": "When enabled, bot posts are visible only on this instance and are not federated." - }, - "misskey_max_download_bytes": { - "description": "Max Download Size (bytes)", - "hint": "To limit download size to prevent OOM, set the maximum bytes; empty or null means no limit." - }, - "misskey_token": { - "description": "Misskey Access Token", - "hint": "API access token generated in the connection service settings." - }, - "misskey_upload_concurrency": { - "description": "Upload Concurrency Limit", - "hint": "Max number of concurrent upload tasks (integer, default 3)." - }, - "misskey_upload_folder": { - "description": "Target Drive Folder ID", - "hint": "Optional: ID of the target folder in Misskey drive. Leave empty to use the root folder." - }, - "port": { - "description": "Callback Server Port", - "hint": "Callback server port. Leave empty to disable the callback server." - }, - "satori_api_base_url": { - "description": "Satori API Endpoint", - "hint": "Base URL for the Satori API." - }, - "satori_auto_reconnect": { - "description": "Enable Auto Reconnect", - "hint": "Automatically reconnect the WebSocket when disconnected." - }, - "satori_endpoint": { - "description": "Satori WebSocket Endpoint", - "hint": "WebSocket endpoint for Satori events." - }, - "satori_heartbeat_interval": { - "description": "Satori Heartbeat Interval", - "hint": "Interval in seconds between heartbeat messages." - }, - "satori_reconnect_delay": { - "description": "Satori Reconnect Delay", - "hint": "Delay before attempting to reconnect (seconds)." - }, - "satori_token": { - "description": "Satori Token", - "hint": "Token for Satori API authentication." - }, - "secret": { - "description": "Secret", - "hint": "Required." - }, - "slack_connection_mode": { - "description": "Slack Connection Mode", - "hint": "The connection mode for Slack. `webhook` uses a webhook server, `socket` uses Slack's Socket Mode." - }, - "slack_webhook_host": { - "description": "Slack Webhook Host", - "hint": "Only valid when Slack connection mode is `webhook`." - }, - "slack_webhook_path": { - "description": "Slack Webhook Path", - "hint": "Only valid when Slack connection mode is `webhook`." - }, - "slack_webhook_port": { - "description": "Slack Webhook Port", - "hint": "Only valid when Slack connection mode is `webhook`." - }, - "telegram_command_auto_refresh": { - "description": "Command Auto Refresh", - "hint": "When enabled, AstrBot automatically refreshes Telegram commands at runtime. (Setting this alone has no effect)" - }, - "telegram_command_register": { - "description": "Command Registration", - "hint": "When enabled, AstrBot automatically registers Telegram commands." - }, - "telegram_command_register_interval": { - "description": "Command Auto Refresh Interval", - "hint": "Telegram command auto-refresh interval in seconds." - }, - "telegram_polling_restart_delay": { - "description": "Polling Restart Delay", - "hint": "Waiting time in seconds when the polling loop needs to restart after unexpected exits. Defaults to 5s." - }, - "telegram_token": { - "description": "Bot Token", - "hint": "If you are in mainland China, set a proxy or change api_base in Other Settings." - }, - "mattermost_url": { - "description": "Mattermost URL", - "hint": "Mattermost service URL, for example https://chat.example.com." - }, - "mattermost_bot_token": { - "description": "Mattermost Bot Token", - "hint": "The access token generated after creating a bot account in Mattermost." - }, - "mattermost_reconnect_delay": { - "description": "Mattermost Reconnect Delay", - "hint": "Delay in seconds before reconnecting after the WebSocket disconnects. Defaults to 5 seconds." - }, - "type": { - "description": "Adapter Type" - }, - "unified_webhook_mode": { - "description": "Unified Webhook Mode", - "hint": "When enabled, use AstrBot unified webhook entry without opening a separate port. Callback URL is /api/v1/webhooks/platforms/{webhook_uuid}." - }, - "use_markdown": { - "description": "Use Markdown for Proactive Messages", - "hint": "When enabled, proactive messages are sent in Markdown mode by default; an explicit use_markdown() call from a plugin takes precedence over this option." - }, - "webhook_uuid": { - "description": "Webhook UUID", - "hint": "Unique identifier for unified webhook mode; generated when creating the platform." - }, - "wecom_ai_bot_name": { - "description": "WeCom AI Bot Name", - "hint": "Must be correct; otherwise some commands won't work." - }, - "wecom_ai_bot_connection_mode": { - "description": "WeCom AI Bot Connection Mode", - "hint": "Webhook mode requires Token/EncodingAESKey; long_connection mode requires BotID/Secret." - }, - "wecomaibot_friend_message_welcome_text": { - "description": "WeCom AI Bot DM Welcome Message", - "hint": "When a user enters a DM session on that day, reply with a welcome message. Leave empty to disable." - }, - "wecomaibot_init_respond_text": { - "description": "WeCom AI Bot Initial Response Text", - "hint": "First reply when the bot receives a message. Leave empty to disable." - }, - "wecomaibot_token": { - "description": "WeCom AI Bot Token", - "hint": "Used for authentication in webhook callback mode." - }, - "wecomaibot_encoding_aes_key": { - "description": "WeCom AI Bot EncodingAESKey", - "hint": "Used for message encryption/decryption in webhook callback mode." - }, - "wecomaibot_ws_bot_id": { - "description": "Long Connection BotID", - "hint": "BotID credential for WeCom AI Bot long connection mode." - }, - "wecomaibot_ws_secret": { - "description": "Long Connection Secret", - "hint": "Secret credential for WeCom AI Bot long connection mode." - }, - "wecomaibot_ws_url": { - "description": "Long Connection WebSocket URL", - "hint": "Default is wss://openws.work.weixin.qq.com and usually does not need changes." - }, - "wecomaibot_heartbeat_interval": { - "description": "Long Connection Heartbeat Interval", - "hint": "Heartbeat interval (seconds) in long connection mode. 30 seconds is recommended." - }, - "wpp_active_message_poll": { - "description": "Enable Proactive Message Polling", - "hint": "Only enable if WeChat messages are not syncing to AstrBot on time. Disabled by default." - }, - "wpp_active_message_poll_interval": { - "description": "Proactive Message Poll Interval", - "hint": "Interval in seconds, default 3, should not exceed 60 or it may be considered old messages." - }, - "ws_reverse_host": { - "description": "Reverse WebSocket Host", - "hint": "AstrBot acts as the server." - }, - "ws_reverse_port": { - "description": "Reverse WebSocket Port" - }, - "ws_reverse_token": { - "description": "Reverse WebSocket Token", - "hint": "Reverse WebSocket token. If not set, token verification is disabled." - }, - "msg_push_webhook_url": { - "description": "WeCom Message Push Webhook URL", - "hint": "Used for proactive message push. It is strongly recommended to set this for a better message sending experience." - }, - "only_use_webhook_url_to_send": { - "description": "Send Replies via Webhook Only", - "hint": "When enabled, all WeCom AI Bot replies are sent through msg_push_webhook_url. The message push webhook supports more message types (such as images, files, etc.). If you do not need the typing effect, it is strongly recommended to use this option. " - }, - "weixin_oc_base_url": { - "description": "API Base URL", - "hint": "Default: https://ilinkai.weixin.qq.com" - }, - "weixin_oc_bot_type": { - "description": "bot_type (QR login parameter)", - "hint": "Default: 3" - }, - "weixin_oc_qr_poll_interval": { - "description": "QR status poll interval (seconds)", - "hint": "Polling interval in seconds for QR code status." - }, - "weixin_oc_long_poll_timeout_ms": { - "description": "getUpdates long-poll timeout (ms)", - "hint": "Timeout parameter for polling messages." - }, - "weixin_oc_api_timeout_ms": { - "description": "HTTP timeout (ms)", - "hint": "Generic API request timeout." - }, - "weixin_oc_token": { - "description": "Token after login (optional)", - "hint": "Automatically written after QR login; can be filled manually for advanced scenarios." - }, - "kook_bot_token": { - "description": "Bot Token", - "type": "string", - "hint": "Required. The Bot Token obtained from the KOOK Developer Platform." - }, - "kook_reconnect_delay": { - "description": "Reconnect Delay", - "type": "int", - "hint": "Delay time for reconnection (seconds), using an exponential backoff strategy." - }, - "kook_max_reconnect_delay": { - "description": "Max Reconnect Delay", - "type": "int", - "hint": "The maximum value for reconnection delay (seconds)." - }, - "kook_max_retry_delay": { - "description": "Max Retry Delay", - "type": "int", - "hint": "The maximum delay time for retries (seconds)." - }, - "kook_heartbeat_interval": { - "description": "Heartbeat Interval", - "type": "int", - "hint": "The interval time for heartbeat detection (seconds)." - }, - "kook_heartbeat_timeout": { - "description": "Heartbeat Timeout", - "type": "int", - "hint": "The timeout duration for heartbeat detection (seconds)." - }, - "kook_max_heartbeat_failures": { - "description": "Max Heartbeat Failures", - "type": "int", - "hint": "Maximum allowed heartbeat failures; the connection will be dropped if exceeded." - }, - "kook_max_consecutive_failures": { - "description": "Max Consecutive Failures", - "type": "int", - "hint": "Maximum allowed consecutive failures; retries will stop if exceeded." - } - }, - "general": { - "description": "General", - "platform_settings": { - "unique_session": { - "description": "Isolate Conversation", - "hint": "On supported platforms, each group member has a separate conversation context when enabled. Manage command permissions under Handlers → Command." - }, - "friend_message_needs_wake_prefix": { - "description": "Private Messages Require Wake Word", - "hint": "Private messages must also include a wake prefix to activate the bot." - }, - "reply_prefix": { - "description": "Reply Text Prefix", - "hint": "The text prefix added to replies." - }, - "reply_with_mention": { - "description": "Mention Sender in Reply", - "hint": "Mention the sender when replying." - }, - "reply_with_quote": { - "description": "Quote Sender's Message in Reply", - "hint": "Quote the sender's corresponding message when replying." - }, - "forward_threshold": { - "description": "Forward Message Word Count Threshold", - "hint": "On supported platforms, send overly long replies as merged forwarded messages." - }, - "empty_mention_waiting": { - "description": "Trigger Waiting on Mention-only Messages", - "hint": "After a message that only mentions the bot, stay awake for one minute to wait for the user's next message." - } - }, - "wake_prefix": { - "description": "Wake Word", - "hint": "A list of message prefixes that wake the bot. You can also wake it by mentioning it.\n\nBuilt-in commands such as `/help` and `/sid` also depend on the wake word: in group chats they do not trigger unless the message starts with a wake word; in private chats they trigger without a prefix unless \"Private Messages Require Wake Word\" is enabled." - }, - "disable_builtin_commands": { - "description": "Disable Built-in Commands", - "hint": "Disable all built-in AstrBot commands such as help, sid, new, etc." - } - }, - "rate_limit": { - "description": "Rate Limiting", - "platform_settings": { - "rate_limit": { - "time": { - "description": "Message Rate Limit Time (seconds)" - }, - "count": { - "description": "Message Rate Limit Count" - }, - "strategy": { - "description": "Rate Limit Strategy" - } - } - } - }, - "content_safety": { - "description": "Content Safety", - "content_safety": { - "also_use_in_response": { - "description": "Also Check Model Response Content" - }, - "baidu_aip": { - "enable": { - "description": "Use Baidu Content Safety Moderation", - "hint": "You need to manually install the baidu-aip library." - }, - "app_id": { - "description": "App ID" - }, - "api_key": { - "description": "API Key" - }, - "secret_key": { - "description": "Secret Key" - } - }, - "internal_keywords": { - "enable": { - "description": "Keyword Check" - }, - "extra_keywords": { - "description": "Additional Keywords", - "hint": "Additional keyword blocklist, supports regular expressions." - } - } - } - }, - "others": { - "description": "Other Settings", - "platform_settings": { - "ignore_bot_self_message": { - "description": "Ignore Bot's Own Messages" - }, - "ignore_at_all": { - "description": "Ignore @All Events" - }, - "no_permission_reply": { - "description": "Reply When User Has Insufficient Permissions" - } - }, - "platform_specific": { - "lark": { - "pre_ack_emoji": { - "enable": { - "description": "[Lark] Enable Pre-acknowledgment Emoji" - }, - "emojis": { - "description": "Emoji List (Lark Emoji Enum Names)", - "hint": "Emoji enum names reference: [https://open.feishu.cn/document/server-docs/im-v1/message-reaction/emojis-introduce](https://open.feishu.cn/document/server-docs/im-v1/message-reaction/emojis-introduce)" - } - } - }, - "telegram": { - "pre_ack_emoji": { - "enable": { - "description": "[Telegram] Enable Pre-acknowledgment Emoji" - }, - "emojis": { - "description": "Emoji List (Unicode)", - "hint": "Telegram only supports a fixed reaction set, reference: [https://gist.github.com/Soulter/3f22c8e5f9c7e152e967e8bc28c97fc9](https://gist.github.com/Soulter/3f22c8e5f9c7e152e967e8bc28c97fc9)" - } - } - }, - "discord": { - "pre_ack_emoji": { - "enable": { - "description": "[Discord] Enable Pre-acknowledgment Emoji" - }, - "emojis": { - "description": "Emoji List (Unicode or Custom Emoji Name)", - "hint": "Enter Unicode emoji symbols, e.g., 👍, 🤔, ⏳" - } - } - } - } - } - }, - "access_group": { - "name": "Access Control", - "admins": { - "description": "Administrators", - "admins_id": { - "description": "Administrator IDs", - "hint": "Send the /sid command to the bot to get the ID." - } - }, - "whitelist": { - "description": "Whitelist", - "platform_settings": { - "enable_id_white_list": { - "description": "Enable Whitelist", - "hint": "When enabled, only sessions in the whitelist will be responded to." - }, - "id_whitelist": { - "description": "Whitelist ID List", - "hint": "Send the /sid command to the bot to get the ID. An empty list disables the whitelist." - }, - "id_whitelist_log": { - "description": "Log Blocked Messages", - "hint": "Log messages that fail whitelist checks." - }, - "wl_ignore_admin_on_group": { - "description": "Administrator Group Messages Bypass ID Whitelist" - }, - "wl_ignore_admin_on_friend": { - "description": "Administrator Private Messages Bypass ID Whitelist" - } - } - } - }, - "plugin_group": { - "name": "Plugin", - "plugin": { - "description": "Plugins", - "plugin_set": { - "description": "Available Plugins", - "hint": "All non-disabled plugins are enabled by default. If a plugin is disabled on the plugins page, selections here will not take effect." - } - } - }, - "ext_group": { - "name": "Ext.", - "segmented_reply": { - "description": "Segmented Reply", - "platform_settings": { - "segmented_reply": { - "enable": { - "description": "Enable Segmented Reply", - "hint": "Send replies in multiple segments." - }, - "only_llm_result": { - "description": "Segment Only LLM Results" - }, - "interval_method": { - "description": "Interval Method", - "hint": "random uses a random delay. log calculates delay by message length: $y=log_{log\\_base}(x)$, where x is word count and y is in seconds." - }, - "interval": { - "description": "Random Interval Time", - "hint": "Format: minimum,maximum (e.g., 1.5,3.5)" - }, - "log_base": { - "description": "Logarithm Base", - "hint": "Base for logarithmic intervals, defaults to 2.6. Value range: 1.0-10.0." - }, - "words_count_threshold": { - "description": "Segmented Reply Word Count Threshold", - "hint": "Segmented reply word count threshold. Only messages with less than this number of words will be segmented, and messages with more than this number of words will be sent directly (not segmented)." - }, - "split_mode": { - "description": "Split Mode", - "hint": "Used to segment a message. By default, it will be separated by punctuation marks like period, question mark, etc. For example, filling `[。?!]` will remove all periods, question marks, and exclamation marks. re.findall(r'', text)", - "labels": [ - "Regex", - "Words List" - ] - }, - "regex": { - "description": "Segmentation Regular Expression", - "hint": "Used to identify split points with a regular expression. Prefer patterns that match separators." - }, - "split_words": { - "description": "Split Word List", - "hint": "Split when any word in the list is detected" - }, - "content_cleanup_rule": { - "description": "Content Filtering Regular Expression", - "hint": "Remove specified content from segmented content. For example, `[。?!]` will remove all periods, question marks, and exclamation marks." - } - } - } - }, - "ltm": { - "description": "Group Chat Context Awareness", - "provider_ltm_settings": { - "group_icl_enable": { - "description": "Inject Group Chat Records into Context", - "hint": "Record group messages that do not wake the bot and pass them to the model when the bot is activated." - }, - "group_message_max_cnt": { - "description": "Maximum Messages Injected into Context", - "hint": "The maximum number of messages passed to the model." - }, - "image_caption": { - "description": "Auto-understand Images", - "hint": "Convert image messages that do not wake the bot into text descriptions. Use with care in image-heavy group chats, as this can incur substantial costs." - }, - "image_caption_provider_id": { - "description": "Group Chat Image Caption Model", - "hint": "Used to understand images injected from group chat records, configured separately from the default image caption model." - }, - "group_message_history_enable": { - "description": "Persist Group Chat Messages", - "hint": "Persist all group messages and allow the model to query them using tools." - }, - "group_message_history_max_cnt": { - "description": "Maximum Persisted Messages", - "hint": "The maximum number of persisted messages. Older messages are discarded when the limit is exceeded." - }, - "active_reply": { - "enable": { - "description": "Active Reply", - "hint": "Send messages proactively at suitable times." - }, - "method": { - "description": "Active Reply Method" - }, - "possibility_reply": { - "description": "Reply Probability", - "hint": "Value between 0.0-1.0" - }, - "whitelist": { - "description": "Active Reply Whitelist", - "hint": "Whitelist filtering is disabled when empty. Use /sid to get IDs." - } - } - } - }, - "t2i": { - "description": "Text-to-Image", - "t2i": { - "description": "Text-to-Image Output", - "hint": "Convert model replies to images before sending to avoid flooding the chat." - }, - "t2i_word_threshold": { - "description": "Text-to-Image Word Count Threshold" - }, - "t2i_strategy": { - "description": "Text-to-Image Strategy", - "hint": "Text-to-image strategy. `remote` uses a remote HTML-based rendering service, `local` uses PIL for local rendering. When using local, place a TTF font named 'font.ttf' in the data/ directory to customize the font." - }, - "t2i_endpoint": { - "description": "Text-to-Image Service API Endpoint", - "hint": "Uses AstrBot API service when empty" - }, - "t2i_template": { - "description": "Text-to-Image Custom Template", - "hint": "When enabled, you can customize HTML templates for text-to-image rendering." - }, - "t2i_active_template": { - "description": "Currently Active Text-to-Image Rendering Template", - "hint": "This value is maintained by the text-to-image template management page." - } - } - }, - "system_group": { - "name": "System", - "system": { - "description": "System Settings", - "log_level": { - "description": "Console Log Level", - "hint": "Log level for console output." - }, - "log_file_enable": { - "description": "Enable File Logging", - "hint": "Write logs to a file in addition to the console." - }, - "log_file_path": { - "description": "Log File Path", - "hint": "Relative paths are resolved under the data directory, e.g. logs/astrbot.log; absolute paths are supported." - }, - "log_file_max_mb": { - "description": "Log File Max Size (MB)", - "hint": "Rotate when exceeding this size; default 20MB." - }, - "temp_dir_max_size": { - "description": "Temp Directory Size Limit (MB)", - "hint": "Limits total size of data/temp in MB. The system checks every 10 minutes, and when exceeded, deletes oldest files first to release about 30% of current size." - }, - "trace_enable": { - "description": "Enable Trace Recording", - "hint": "Trace each user command and AI call." - }, - "trace_db_path": { - "description": "Trace Database Path", - "hint": "Relative paths start from the data directory, for example logs/traces.db. Absolute paths are also supported." - }, - "trace_db_max_mb": { - "description": "Trace Database Capacity Budget (MB)", - "hint": "Default: 80 MB. Values below 32 MB use 32 MB. Old data is automatically cleared when this size is exceeded." - }, - "trace_retention_days": { - "description": "Trace Retention Days", - "hint": "Default: 7 days. Old data is cleared when either the retention period or capacity is reached." - }, - "pip_install_arg": { - "description": "Additional pip Installation Arguments", - "hint": "When installing plugin dependencies, Python's pip tool will be used. Additional arguments can be provided here, such as `--break-system-package`. TLS certificates of the PyPI index are verified by default; for self-signed/private-CA mirrors, pass `--cert ` (recommended) or explicitly add `--trusted-host `." - }, - "pypi_index_url": { - "description": "PyPI Repository URL", - "hint": "PyPI repository URL for installing Python dependencies. Defaults to [https://mirrors.aliyun.com/pypi/simple/](https://mirrors.aliyun.com/pypi/simple/)" - }, - "callback_api_base": { - "description": "Externally Accessible Callback API Address", - "hint": "External services may access AstrBot's backend through callback links generated by AstrBot (such as file download links). Since AstrBot cannot automatically determine the externally accessible host address in the deployment environment, this configuration item is needed to explicitly specify how external services should access AstrBot's address. Examples: [http://localhost:6185](http://localhost:6185), [https://example.com](https://example.com), etc." - }, - "disable_metrics": { - "description": "Disable Anonymous Usage Statistics", - "hint": "When disabled, AstrBot will not upload anonymous usage statistics." - }, - "dashboard": { - "trust_proxy_headers": { - "description": "Trust Proxy Headers for Client IP", - "hint": "When disabled, ignore X-Forwarded-For/X-Real-IP and use the connection address only." - }, - "auth_rate_limit": { - "enable": { - "description": "Enable Login Rate Limiting", - "hint": "When disabled, authentication endpoints (login, TOTP, etc.) will not be rate-limited." - }, - "average_interval": { - "description": "Endpoint Rate Limit Average Interval (seconds)", - "hint": "Minimum average interval between authentication requests. For example, 1.0 means at most 1 request per second." - }, - "max_burst": { - "description": "Endpoint Rate Limit Max Burst", - "hint": "Maximum number of consecutive burst requests allowed. For example, 3 allows up to 3 requests in a short burst." - } - }, - "ssl": { - "enable": { - "description": "Enable WebUI HTTPS", - "hint": "When enabled, WebUI serves directly over HTTPS." - }, - "cert_file": { - "description": "SSL Certificate File Path", - "hint": "Certificate file path (PEM). Supports absolute and relative paths (relative to current working directory)." - }, - "key_file": { - "description": "SSL Private Key File Path", - "hint": "Private key file path (PEM). Supports absolute and relative paths (relative to current working directory)." - }, - "ca_certs": { - "description": "SSL CA Certificate File Path", - "hint": "Optional. Path to CA certificate file." - } - }, - "totp": { - "enable": { - "description": "Enable WebUI TOTP", - "hint": "When enabled, a TOTP code is required during dashboard login." - }, - "manage": "Manage", - "configuration": "TOTP", - "statusPending": "Setup required", - "statusEnabled": "Enabled", - "setupRequiredHint": "TOTP is enabled but not yet configured. Click Manage to complete setup.", - "setupTitle": "Set up TOTP", - "setupSubtitle": "Scan this QR code in your authenticator app, then enter a verification code.", - "setupConfirm": "Verify and continue", - "activeSubtitle": "Use this QR code or secret to add another authenticator device.", - "rotateTitle": "Rotate TOTP Secret", - "rotateSubtitle": "Generate a new secret, then enter a code from your authenticator to confirm the replacement.", - "rotate": "Rotate", - "rotateRecovery": "Rotate Recovery Code", - "rotateConfirm": "Confirm Rotation", - "rotateCancel": "Cancel", - "rotateCode": "Verification Code", - "rotateCodeHint": "Enter the code from your authenticator app to confirm the new key.", - "rotateError": "Invalid code, please try again.", - "recoveryTitle": "Recovery Codes", - "recoverySubtitle": "This recovery code is shown once. Save it before continuing.", - "recoveryWarning": "If lost, account access cannot be restored through normal means.", - "recoveryAcknowledge": "I have saved my recovery codes", - "recoveryClose": "Done", - "disableTitle": "Disable TOTP", - "disableSubtitle": "Enter a verification code to disable two-factor authentication.", - "disableRecoverySubtitle": "Enter a recovery code to disable two-factor authentication.", - "disableCode": "Verification Code", - "disableRecoveryCode": "Recovery Code", - "disableConfirm": "Disable", - "disableCancel": "Cancel", - "disableError": "Verification failed. Please try again.", - "disableUseRecovery": "Can't use TOTP?", - "disableUseCode": "Use verification code", - "configSaveTitle": "Two-Factor Verification", - "configSaveSubtitle": "Enter a verification code to change protected configuration.", - "configSaveRotationHint": "When rotating TOTP keys, both the old and new verification codes are accepted (allowed once per rotation operation).", - "configSaveCode": "Verification Code", - "configSaveConfirm": "Continue", - "configSaveCancel": "Cancel", - "configSaveError": "Verification failed. Please try again." - } - }, - "timezone": { - "description": "Timezone", - "hint": "Timezone setting. Please enter an IANA timezone name, such as Asia/Shanghai. Uses system default timezone when empty. For all timezones, see: [https://data.iana.org/time-zones/tzdb-2021a/zone1970.tab](https://data.iana.org/time-zones/tzdb-2021a/zone1970.tab)" - }, - "http_proxy": { - "description": "HTTP Proxy", - "hint": "When enabled, proxy will be set by adding environment variables. Format: `http://ip:port`" - }, - "no_proxy": { - "description": "Direct Connection Address List" - } - } - }, - "provider_group": { - "provider": { - "api_key": { - "description": "API Key" - }, - "dashscope_api_key": { - "description": "DashScope API Key" - }, - "gemini_tts_api_key": { - "description": "Gemini API Key" - }, - "genie_onnx_model_dir": { - "description": "ONNX Model Directory", - "hint": "The directory path containing the ONNX model files" - }, - "genie_language": { - "description": "Language" - }, - "xai_native_search": { - "description": "Enable native search", - "hint": "When enabled, uses xAI Chat Completions native Live Search for web queries (billed on demand). Only applies to xAI providers." - }, - "rerank_api_base": { - "description": "Rerank Model API Base URL", - "hint": "The full request URL is formed by combining the Base URL and a path suffix (defaults to /v1/rerank)." - }, - "rerank_api_suffix": { - "description": "API URL path suffix", - "hint": "Path appended to base_url, e.g. /v1/rerank. Leave empty to disable auto-append." - }, - "rerank_api_key": { - "description": "API Key", - "hint": "Leave empty if no API key is required." - }, - "rerank_model": { - "description": "Rerank model name" - }, - "return_documents": { - "description": "Return source documents in rerank results", - "hint": "Default is false to reduce network overhead." - }, - "instruct": { - "description": "Custom rerank task description", - "hint": "Only effective for qwen3-rerank models. Recommended to write in English." - }, - "nvidia_rerank_api_base": { - "description": "API Base URL" - }, - "nvidia_rerank_api_key": { - "description": "API Key" - }, - "nvidia_rerank_model": { - "description": "Rerank Model Name", - "hint": "Please refer to the NVIDIA Docs for the model name." - }, - "nvidia_rerank_model_endpoint": { - "description": "Custom Model Endpoint", - "hint": "Custom URL suffix endpoint, defaults to /reranking." - }, - "nvidia_rerank_truncate": { - "description": "Text Truncation Strategy", - "hint": "Whether to truncate the input to fit the model's maximum context length when the input text is too long." - }, - "tei_rerank_truncate": { - "description": "Truncate Long Text", - "hint": "Whether to automatically truncate input when it exceeds the model's maximum context length. Requires Truncation Direction when enabled." - }, - "tei_rerank_truncation_direction": { - "description": "Truncation Direction", - "hint": "Choose to truncate from the left or right side of the text. Only takes effect when Truncate Long Text is True." - }, - "tei_rerank_raw_scores": { - "description": "Return Raw Scores", - "hint": "If True, returns raw model logit scores (which may be negative) without sigmoid normalization. Default is False." - }, - "tei_rerank_return_text": { - "description": "Return Document Text in Results", - "hint": "If True, each result will include the original document text. Default is False to reduce network overhead." - }, - "launch_model_if_not_running": { - "description": "Auto-start model if not running", - "hint": "If the model is not running in Xinference, attempt to start it automatically. Recommended to disable in production." - }, - "modalities": { - "description": "Model capabilities", - "hint": "Modalities supported by the model. If the model does not support images, uncheck image.", - "labels": [ - "Text", - "Image", - "Audio", - "Tool use" - ] - }, - - "custom_headers": { - "description": "Custom request headers", - "hint": "Key/value pairs added here are sent by AstrBot as custom HTTP headers to the provider. Values must be strings." - }, - "ollama_disable_thinking": { - "description": "Disable thinking mode", - "hint": "Close Ollama thinking mode." - }, - "custom_extra_body": { - "description": "Custom request body parameters", - "hint": "Add extra parameters to requests, such as temperature, top_p, max_tokens, etc.", - "template_schema": { - "temperature": { - "description": "Temperature", - "hint": "Controls randomness, typically 0-2. Higher is more random.", - "name": "Temperature" - }, - "top_p": { - "description": "Top-p sampling", - "hint": "Nucleus sampling parameter, usually 0-1. Controls probability mass considered.", - "name": "Top-p" - }, - "max_tokens": { - "description": "Max tokens", - "hint": "Maximum number of generated tokens.", - "name": "Max Tokens" - }, - "max_output_tokens": { - "description": "Max output tokens", - "hint": "Maximum number of generated tokens.", - "name": "Max Output Tokens" - }, - "reasoning_effort": { - "description": "Reasoning effort", - "hint": "Controls the effort used by reasoning models. Supported values depend on the model.", - "name": "Reasoning Effort" - } - } - }, - "gpt_weights_path": { - "description": "GPT model file path", - "hint": "The .ckpt file. Use an absolute path without quotes. Leave empty to use the GPT_SoVITS built-in SoVITS model (recommended to change defaults in GPT_SoVITS)." - }, - "sovits_weights_path": { - "description": "SoVITS model file path", - "hint": "The .pth file. Use an absolute path without quotes. Leave empty to use the GPT_SoVITS built-in SoVITS model (recommended to change defaults in GPT_SoVITS)." - }, - "gsv_default_parms": { - "description": "GPT_SoVITS default parameters", - "hint": "Reference audio file path and text are required; other parameters are optional.", - "gsv_ref_audio_path": { - "description": "Reference audio file path", - "hint": "Required! Use an absolute path without quotes." - }, - "gsv_prompt_text": { - "description": "Reference audio text", - "hint": "Required! Provide the transcript of the reference audio." - }, - "gsv_prompt_lang": { - "description": "Reference audio text language", - "hint": "Language of the reference audio text; default is Chinese." - }, - "gsv_aux_ref_audio_paths": { - "description": "Auxiliary reference audio file paths", - "hint": "Auxiliary reference audio files; optional." - }, - "gsv_text_lang": { - "description": "Text language", - "hint": "Default is Chinese." - }, - "gsv_top_k": { - "description": "Speech diversity", - "hint": "" - }, - "gsv_top_p": { - "description": "Nucleus sampling threshold", - "hint": "" - }, - "gsv_temperature": { - "description": "Speech randomness", - "hint": "" - }, - "gsv_text_split_method": { - "description": "Text splitting method", - "hint": "Options: `cut0` no split, `cut1` split every 4 sentences, `cut2` split every 50 chars, `cut3` split by Chinese period, `cut4` split by English period, `cut5` split by punctuation." - }, - "gsv_batch_size": { - "description": "Batch size", - "hint": "" - }, - "gsv_batch_threshold": { - "description": "Batch threshold", - "hint": "" - }, - "gsv_split_bucket": { - "description": "Split text into buckets for parallel processing", - "hint": "" - }, - "gsv_speed_factor": { - "description": "Speech playback speed", - "hint": "1 is the original speed." - }, - "gsv_fragment_interval": { - "description": "Interval between speech segments", - "hint": "" - }, - "gsv_streaming_mode": { - "description": "Enable streaming mode", - "hint": "" - }, - "gsv_seed": { - "description": "Random seed", - "hint": "For reproducible results." - }, - "gsv_parallel_infer": { - "description": "Run inference in parallel", - "hint": "" - }, - "gsv_repetition_penalty": { - "description": "Repetition penalty", - "hint": "" - }, - "gsv_media_type": { - "description": "Output media type", - "hint": "Recommended: wav" - } - }, - "embedding_dimensions": { - "description": "Embedding dimensions", - "hint": "Embedding vector dimensions. May need adjustment per model; see model documentation. This must be correct or the vector database will not work." - }, - "embedding_dimensions_mode": { - "description": "Embedding dimensions mode", - "hint": "Controls whether to send the dimensions parameter in OpenAI-compatible embedding requests. auto sends it only for official OpenAI embedding-3 models; use always when a compatible API supports it, or never when it rejects the parameter." - }, - "embedding_model": { - "description": "Embedding model", - "hint": "Embedding model name." - }, - "embedding_api_key": { - "description": "API Key" - }, - "embedding_api_base": { - "description": "API Base URL" - }, - "openai_embedding": { - "hint": "If testing fails, try adding /v1 at the end for some OpenAI API versions." - }, - "gemini_embedding": { - "hint": "Gemini Embedding does not require manually adding /v1beta." - }, - "dashscope_embedding": { - "hint": "Aliyun DashScope Embedding. Default base URL: https://dashscope.aliyuncs.com/api/v1." - }, - "volcengine_cluster": { - "description": "Volcengine cluster", - "hint": "For voice cloning models, choose volcano_icl or volcano_icl_concurr; default is volcano_tts." - }, - "volcengine_voice_type": { - "description": "Volcengine voice", - "hint": "Enter voice id (Voice_type)." - }, - "volcengine_speed_ratio": { - "description": "Speech rate", - "hint": "Speech rate, range 0.2 to 3.0, default 1.0." - }, - "volcengine_volume_ratio": { - "description": "Volume", - "hint": "Volume, range 0.0 to 2.0, default 1.0." - }, - "azure_tts_voice": { - "description": "Voice style", - "hint": "API voice name" - }, - "azure_tts_style": { - "description": "Style", - "hint": "A voice-specific speaking style. Can express emotions like happy, sympathetic, and calm." - }, - "azure_tts_role": { - "description": "Role (optional)", - "hint": "Speaking role-play. The voice can emulate different ages and genders without changing the voice name. For example, a male voice can raise pitch to simulate a female voice, but the voice name does not change. If the role is missing or unsupported, this attribute is ignored." - }, - "azure_tts_rate": { - "description": "Speech rate", - "hint": "Controls speaking rate. You can apply the rate at word or sentence level. Rate should be 0.5x to 2x of original audio." - }, - "azure_tts_volume": { - "description": "Speech volume", - "hint": "Controls volume level. You can apply changes at sentence level. Use 0.0 to 100.0 (quiet to loud, e.g., 75). Default is 100.0." - }, - "azure_tts_region": { - "description": "API region", - "hint": "Region where Azure TTS processes data. See https://learn.microsoft.com/zh-cn/azure/ai-services/speech-service/regions" - }, - "azure_tts_subscription_key": { - "description": "Service subscription key", - "hint": "Azure TTS subscription key (not a token)." - }, - "dashscope_tts_voice": { - "description": "Voice" - }, - "gm_resp_image_modal": { - "description": "Enable image modality", - "hint": "When enabled, responses can include images. Requires model support or it will error. See the Google Gemini website for supported models. Tip: if you need image generation, disable the `Enable member recognition` setting for better results." - }, - "gm_native_search": { - "description": "Enable native search", - "hint": "Only Gemini 3 and later models support using this together with function tools. For Gemini 3 and later, native search is only available on the paid tier; see the official docs for pricing." - }, - "gm_native_coderunner": { - "description": "Enable native code runner", - "hint": "Only Gemini 3 and later models support using this together with function tools." - }, - "gm_url_context": { - "description": "Enable URL context", - "hint": "Only Gemini 3 and later models support using this together with function tools." - }, - "gm_safety_settings": { - "description": "Safety filters", - "hint": "Set the safety filtering level for model input. Levels: NONE (no blocking), HIGH (block high risk), MEDIUM_AND_ABOVE (block medium risk and above), LOW_AND_ABOVE (block low risk and above). See Gemini API docs.", - "harassment": { - "description": "Harassment", - "hint": "Negative or harmful comments" - }, - "hate_speech": { - "description": "Hate speech", - "hint": "Rude, disrespectful, or profane content" - }, - "sexually_explicit": { - "description": "Sexually explicit content", - "hint": "References to sexual acts or other obscene content" - }, - "dangerous_content": { - "description": "Dangerous content", - "hint": "Content that promotes, encourages, or assists harmful behavior" - } - }, - "gm_thinking_config": { - "description": "Thinking Config", - "budget": { - "description": "Thinking Budget", - "hint": "Guides the model on the specific number of thinking tokens to use for reasoning. See: https://ai.google.dev/gemini-api/docs/thinking#set-budget" - }, - "level": { - "description": "Thinking Level", - "hint": "Recommended for Gemini 3 models and onwards, lets you control reasoning behavior.See: https://ai.google.dev/gemini-api/docs/thinking#thinking-levels" - } - }, - "anth_thinking_config": { - "description": "Thinking Config", - "type": { - "description": "Thinking Type", - "hint": "Set 'adaptive' for Opus 4.6+ / Sonnet 4.6+ (recommended). Leave empty to use manual budget mode. See: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking" - }, - "budget": { - "description": "Thinking Budget", - "hint": "Anthropic thinking.budget_tokens param. Must >= 1024. Only used when type is empty. Deprecated on Opus 4.6 / Sonnet 4.6. See: https://platform.claude.com/docs/en/build-with-claude/extended-thinking" - }, - "effort": { - "description": "Effort Level", - "hint": "Controls thinking depth when type is 'adaptive'. 'high' is the default. 'max' is Opus 4.6 only. See: https://platform.claude.com/docs/en/build-with-claude/effort" - } - }, - "minimax-group-id": { - "description": "User group", - "hint": "Visible in Account Management -> Basic Info." - }, - "minimax-langboost": { - "description": "Target language/dialect", - "hint": "Enhances recognition for specified languages/dialects and improves speech performance in those scenarios." - }, - "minimax-voice-speed": { - "description": "Speech rate", - "hint": "Speech speed for synthesis, range [0.5, 2], default 1.0. Higher is faster." - }, - "minimax-voice-vol": { - "description": "Volume", - "hint": "Volume for synthesis, range (0, 10], default 1.0. Higher is louder." - }, - "minimax-voice-pitch": { - "description": "Pitch", - "hint": "Pitch for synthesis, range [-12, 12], default 0." - }, - "minimax-is-timber-weight": { - "description": "Enable mixed voices", - "hint": "Enable mixing up to four voices with custom weights. When enabled, single voice settings are ignored." - }, - "minimax-timber-weight": { - "description": "Mixed voices", - "hint": "Mixed voices and their weights. Up to four voices, integer weights in [1, 100]. Get presets and templates from the official API TTS debug console. Must be a JSON string; check the console to confirm parsing. See defaults and the official code preview for structure." - }, - "minimax-voice-id": { - "description": "Single voice", - "hint": "Single voice ID; see the official documentation." - }, - "minimax-voice-emotion": { - "description": "Emotion", - "hint": "Controls emotion of synthesized speech. When set to auto, it selects emotion based on text." - }, - "minimax-voice-latex": { - "description": "Read LaTeX formulas", - "hint": "Read LaTeX formulas, but ensure input text is formatted per the official requirements." - }, - "minimax-voice-english-normalization": { - "description": "English text normalization", - "hint": "Improves number-reading performance but slightly increases latency." - }, - "rag_options": { - "description": "RAG options", - "hint": "Knowledge base retrieval settings, optional. Only supported for Agent app types (agent apps, including RAG apps). For Bailian apps, enabling this disables multi-turn conversations.", - "pipeline_ids": { - "description": "Knowledge base ID list", - "hint": "Retrieve all documents in the specified knowledge bases. Go to https://bailian.console.aliyun.com/ Data Apps -> Knowledge Index to create and get IDs." - }, - "file_ids": { - "description": "Unstructured document IDs", - "hint": "Retrieve specified unstructured documents. Go to https://bailian.console.aliyun.com/ Data Management to create and get IDs." - }, - "output_reference": { - "description": "Output knowledge base/document references", - "hint": "Append reference sources to the end of each answer. Default is False." - } - }, - "sensevoice_hint": { - "description": "Deploy SenseVoice", - "hint": "Before enabling, install funasr, funasr_onnx, torchaudio, torch, modelscope, and jieba (CPU by default, about 1 GB download), and install ffmpeg. Otherwise STT will not work." - }, - "is_emotion": { - "description": "Emotion recognition", - "hint": "Enable emotion recognition. happy?sad?angry?neutral?fearful?disgusted?surprised?unknown" - }, - "stt_model": { - "description": "Model name", - "hint": "Model name on modelscope. Default: iic/SenseVoiceSmall." - }, - "variables": { - "description": "Workflow fixed input variables", - "hint": "Optional. Fixed workflow input variables are used as workflow inputs. You can also set variables dynamically with /set during a chat. If names conflict, dynamic settings take precedence." - }, - "dashscope_app_type": { - "description": "App type", - "hint": "Bailian app type." - }, - "timeout": { - "description": "Timeout", - "hint": "Timeout in seconds." - }, - "openai-tts-voice": { - "description": "voice", - "hint": "OpenAI TTS voice. OpenAI defaults: 'alloy', 'echo', 'fable', 'onyx', 'nova', 'shimmer'." - }, - "elevenlabs-tts-voice-id": { - "description": "Voice ID", - "hint": "ElevenLabs voice ID. Browse and copy voice IDs at https://elevenlabs.io/app/voice-library. Default 'JBFqnCBsd6RMkjVDRZzb' (George)." - }, - "elevenlabs-tts-output-format": { - "description": "Output format", - "hint": "Audio output format, e.g. 'mp3_44100_128', 'mp3_22050_32', 'wav_44100', or 'opus_48000_128'. Raw PCM/u-law/a-law formats are not supported. Default 'mp3_44100_128'." - }, - "elevenlabs-tts-stability": { - "description": "Stability", - "hint": "Voice stability, range [0, 1]. Higher is more consistent, lower is more expressive. Leave empty to use the server default." - }, - "elevenlabs-tts-similarity-boost": { - "description": "Similarity boost", - "hint": "How closely the output matches the original voice, range [0, 1]. Leave empty to use the server default." - }, - "elevenlabs-tts-style": { - "description": "Style exaggeration", - "hint": "Style exaggeration of the voice, range [0, 1]. Higher values increase latency. Leave empty to use the server default." - }, - "elevenlabs-tts-use-speaker-boost": { - "description": "Speaker boost", - "hint": "Boost similarity to the original speaker. May slightly increase latency." - }, - "mimo-tts-voice": { - "description": "Voice", - "hint": "MiMo TTS voice name. Supported values include 'mimo_default', 'default_en', and 'default_zh'." - }, - "mimo-tts-format": { - "description": "Output format", - "hint": "Audio format generated by MiMo TTS. Supported values: 'wav', 'mp3', and 'pcm'." - }, - "mimo-tts-style-prompt": { - "description": "Style prompt", - "hint": "Prepended to the synthesis target text as a tag to control speed, emotion, character, or style, such as happy, faster, Sun Wukong, or whispering. Optional." - }, - "mimo-tts-dialect": { - "description": "Dialect", - "hint": "Combined with the style prompt inside the leading tag, for example Northeastern Mandarin, Sichuan dialect, Henan dialect, or Cantonese. Optional." - }, - "mimo-tts-seed-text": { - "description": "Seed text", - "hint": "Sent as an optional user message to help guide tone and speaking style. It is not appended to the synthesis target text." - }, - "fishaudio-tts-character": { - "description": "character", - "hint": "Fishaudio TTS character. Default is Klee. More roles: https://fish.audio/zh-CN/discovery" - }, - "fishaudio-tts-reference-id": { - "description": "reference_id", - "hint": "Fishaudio TTS reference model ID (optional). If set, the model ID is used directly instead of looking up by role name. Example: 626bb6d3f3364c9cbc3aa6a67300a664. More models: https://fish.audio/zh-CN/discovery; open a model detail page to copy the model ID." - }, - "whisper_hint": { - "description": "Notes for local Whisper deployment", - "hint": "Before enabling, install the openai-whisper library (NVIDIA users download ~2GB mainly for torch and cuda; CPU users download ~1GB), and install ffmpeg. Otherwise STT will not work." - }, - "whisper_device": { - "description": "Inference device", - "hint": "Whisper inference device. Apple Silicon can use mps; other environments should use cpu. If mps is selected but unavailable, AstrBot will fall back to cpu." - }, - "id": { - "description": "ID" - }, - "type": { - "description": "Provider category" - }, - "provider_type": { - "description": "Provider capability type" - }, - "enable": { - "description": "Enable" - }, - "key": { - "description": "API Key" - }, - "api_base": { - "description": "API Base URL" - }, - "total_timeout": { - "description": "Total timeout", - "hint": "Total timeout in seconds for one decision request, including concurrency-slot wait, retries, and backoff; default 5 seconds." - }, - "max_concurrency": { - "description": "Maximum concurrency", - "hint": "Maximum number of simultaneous decision requests for this provider; default 4." - }, - "proxy": { - "description": "Proxy address", - "hint": "HTTP/HTTPS proxy URL, e.g. http://127.0.0.1:7890. Applies only to this provider's API requests and does not affect Docker internal networking." - }, - "model": { - "description": "Model ID", - "hint": "Model name, e.g., gpt-4o-mini, deepseek-chat." - }, - "max_context_tokens": { - "description": "Model context window size", - "hint": "Maximum context tokens. If 0, it auto-fills from model metadata (if available); you can also edit manually." - }, - "dify_api_key": { - "description": "API Key", - "hint": "Dify API Key. This field is required." - }, - "dify_api_base": { - "description": "API Base URL", - "hint": "Dify API Base URL. Default: https://api.dify.ai/v1" - }, - "dify_api_type": { - "description": "Dify app type", - "hint": "Dify API type. According to Dify docs, supported types are chat, chatflow, agent, workflow." - }, - "dify_workflow_output_key": { - "description": "Dify workflow output variable name", - "hint": "Dify workflow output variable name. Only used when app type is workflow. Default: astrbot_wf_output." - }, - "dify_query_input_key": { - "description": "Prompt input variable name", - "hint": "Input variable name for the message text. Default: astrbot_text_query." - }, - "coze_api_key": { - "description": "Coze API Key", - "hint": "Coze API key for accessing Coze services." - }, - "bot_id": { - "description": "Bot ID", - "hint": "Coze bot ID, obtained after creating a bot on the Coze platform." - }, - "coze_api_base": { - "description": "API Base URL", - "hint": "Base URL for the Coze API. Default: https://api.coze.cn" - }, - "deerflow_api_base": { - "description": "API Base URL", - "hint": "DeerFlow API gateway URL. Default: http://127.0.0.1:2026" - }, - "deerflow_api_key": { - "description": "DeerFlow API Key", - "hint": "Optional. Fill this if your DeerFlow gateway is protected by Bearer auth." - }, - "deerflow_auth_header": { - "description": "Authorization Header", - "hint": "Optional. Custom Authorization header value; takes precedence over DeerFlow API Key." - }, - "deerflow_assistant_id": { - "description": "Assistant ID", - "hint": "LangGraph assistant_id, default is lead_agent." - }, - "deerflow_model_name": { - "description": "Model name override", - "hint": "Optional. Overrides DeerFlow default model (maps to runtime context model_name)." - }, - "deerflow_thinking_enabled": { - "description": "Enable thinking mode" - }, - "deerflow_plan_mode": { - "description": "Enable plan mode", - "hint": "Maps to DeerFlow is_plan_mode." - }, - "deerflow_subagent_enabled": { - "description": "Enable subagent", - "hint": "Maps to DeerFlow subagent_enabled." - }, - "deerflow_max_concurrent_subagents": { - "description": "Max concurrent subagents", - "hint": "Maps to DeerFlow max_concurrent_subagents. Effective only when subagent is enabled. Default: 3." - }, - "deerflow_recursion_limit": { - "description": "Recursion limit", - "hint": "Maps to LangGraph recursion_limit." - }, - "auto_save_history": { - "description": "Conversation history managed by Coze", - "hint": "When enabled, Coze manages conversation history. AstrBot's locally saved context will not take effect (read-only), and operations on AstrBot context will not apply. If disabled, AstrBot manages the context." - } - } - }, - "help": { - "documentation": "Official Documentation", - "support": "Join Support Group", - "helpText": "Don't understand the configuration? See {documentation} or {support}.", - "helpPrefix": "Don't understand the configuration? See", - "helpMiddle": "or", - "helpSuffix": "." - } -} +{ + "ai_group": { + "name": "AI", + "agent_runner": { + "description": "Agent Runner", + "hint": "Select the runner for AI conversations. Switching runners resets the configuration to the new type's defaults.", + "provider_settings": { + "enable": { + "description": "Enable", + "hint": "Master switch for AI conversations" + } + }, + "agent_runner": { + "runner_type": { + "description": "Runner", + "labels": [ + "Built-in Agent", + "Dify", + "Coze", + "Alibaba Cloud Bailian Application", + "DeerFlow" + ] + } + } + }, + "dify_runner": { + "description": "Dify Configuration", + "agent_runner": { "config": { + "dify_api_type": { "description": "Application Type" }, + "dify_api_key": { "description": "API Key" }, + "dify_api_base": { "description": "API Base URL" }, + "dify_workflow_output_key": { "description": "Workflow Output Variable" }, + "dify_query_input_key": { "description": "Prompt Input Variable" }, + "variables": { "description": "Variables" }, + "timeout": { "description": "Timeout (seconds)" }, + "proxy": { "description": "Proxy URL" } + } } + }, + "coze_runner": { + "description": "Coze Configuration", + "agent_runner": { "config": { + "coze_api_key": { "description": "API Key" }, + "bot_id": { "description": "Bot ID" }, + "coze_api_base": { "description": "API Base URL" }, + "auto_save_history": { "description": "Let Coze Manage Conversation History" }, + "timeout": { "description": "Timeout (seconds)" }, + "proxy": { "description": "Proxy URL" } + } } + }, + "dashscope_runner": { + "description": "Alibaba Cloud Bailian Application Configuration", + "agent_runner": { "config": { + "dashscope_app_type": { "description": "Application Type" }, + "dashscope_api_key": { "description": "API Key" }, + "dashscope_app_id": { "description": "Application ID" }, + "rag_options": { + "pipeline_ids": { "description": "Knowledge Base Pipeline IDs" }, + "file_ids": { "description": "File IDs" }, + "output_reference": { "description": "Include References" } + }, + "variables": { "description": "Variables" }, + "timeout": { "description": "Timeout (seconds)" }, + "proxy": { "description": "Proxy URL" } + } } + }, + "deerflow_runner": { + "description": "DeerFlow Configuration", + "agent_runner": { "config": { + "deerflow_api_base": { "description": "API Base URL" }, + "deerflow_api_key": { "description": "API Key" }, + "deerflow_auth_header": { "description": "Authorization Header" }, + "deerflow_assistant_id": { "description": "Assistant ID" }, + "deerflow_model_name": { "description": "Model Name Override" }, + "deerflow_thinking_enabled": { "description": "Enable Thinking Mode" }, + "deerflow_plan_mode": { "description": "Enable Plan Mode" }, + "deerflow_subagent_enabled": { "description": "Enable Subagents" }, + "deerflow_max_concurrent_subagents": { "description": "Maximum Concurrent Subagents" }, + "deerflow_recursion_limit": { "description": "Recursion Limit" }, + "timeout": { "description": "Timeout (seconds)" }, + "proxy": { "description": "Proxy URL" } + } } + }, + "ai": { + "description": "Model", + "hint": "Configure the built-in Agent's chat models and shared image caption and speech models.", + "agent_runner": { "config": { "model": { + "provider_id": { + "description": "Chat Model", + "hint": "Uses the first model when left empty" + }, + "fallback_provider_ids": { + "description": "Fallback Chat Models", + "hint": "Try these chat models in order when the primary model request fails." + }, + "request_max_retries": { + "description": "Retries on Error", + "hint": "Maximum attempts for a single model request when retryable errors occur." + } + } } }, + "provider_settings": { + "default_image_caption_provider_id": { + "description": "Image Caption Model", + "hint": "When the chat model does not support image input, use the image captioning model to describe images. Leave blank to disable." + }, + "image_caption_prompt": { + "description": "Image Caption Prompt", + "hint": "The prompt used by the image captioning model." + } + }, + "provider_stt_settings": { + "enable": { + "description": "Speech Recognition", + "hint": "Use a speech-to-text model to transcribe user voice messages into text for the model to understand." + }, + "provider_id": { + "description": "Default Speech-to-Text Model", + "hint": "You can also use /provider to select a model for an individual conversation." + } + }, + "provider_tts_settings": { + "enable": { + "description": "Voice Replies", + "hint": "Use a text-to-speech model to turn text into voice replies." + }, + "provider_id": { + "description": "Default Text-to-Speech Model", + "hint": "You can also use /provider to select a model for an individual conversation." + }, + "trigger_probability": { + "description": "TTS Trigger Probability", + "hint": "Trigger voice replies based on a random probability." + } + } + }, + "persona": { + "description": "Persona", + "hint": "Set the default persona for AI conversations. Personas can be managed in the Persona tab.", + "agent_runner": { "config": { "persona": { + "persona_id": { "description": "Default Persona" }, + "safety_mode": { + "description": "Safety Mode", + "hint": "Guide the model toward safe content and away from harmful or sensitive topics." + }, + "safety_mode_strategy": { + "description": "Safety Mode Strategy", + "hint": "Select how safety mode is applied." + } + } } } + }, + "knowledgebase": { + "description": "Knowledge Base", + "hint": "AstrBot's \"external brain\".", + "kb_names": { + "description": "Knowledge Base List", + "hint": "Supports multiple selections" + }, + "kb_fusion_top_k": { + "description": "Fusion Search Results Count", + "hint": "Number of results returned after fusing search results from multiple knowledge bases" + }, + "kb_final_top_k": { + "description": "Final Results Count", + "hint": "Number of results retrieved from the knowledge base. Higher values may provide more relevant information but could also introduce noise. Adjust based on actual needs" + }, + "kb_agentic_mode": { + "description": "Agentic Knowledge Base Retrieval", + "hint": "When enabled, knowledge base retrieval becomes an LLM Tool, allowing the model to autonomously decide when to query the knowledge base. Requires the model to support function calling." + } + }, + "websearch": { + "description": "Web Search", + "hint": "Enables AstrBot to access the internet and stay up to date.", + "provider_settings": { + "web_search": { + "description": "Enable Web Search" + }, + "websearch_provider": { + "description": "Web Search Provider", + "labels": [ + "SerpApi", + "DeepSeek Search API", + "Tavily", + "Baidu AI Search", + "Bocha", + "Brave", + "Firecrawl", + "Exa", + "AnySearch" + ], + "subtitles": [ + "Google web, news, image, scholar, and finance search", + "Official DeepSeek search API", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "websearch_tavily_key": { + "description": "Tavily API Key", + "hint": "Multiple keys can be added for rotation." + }, + "websearch_bocha_key": { + "description": "BoCha API Key", + "hint": "Multiple keys can be added for rotation." + }, + "websearch_brave_key": { + "description": "Brave Search API Key", + "hint": "Multiple keys can be added for rotation." + }, + "websearch_firecrawl_key": { + "description": "Firecrawl API Key", + "hint": "Multiple keys can be added for rotation." + }, + "websearch_baidu_app_builder_key": { + "description": "Baidu Qianfan Smart Cloud APP Builder API Key", + "hint": "Reference: [https://console.bce.baidu.com/iam/#/iam/apikey/list](https://console.bce.baidu.com/iam/#/iam/apikey/list)" + }, + "web_search_link": { + "description": "Display Source Citations" + }, + "websearch_exa_key": { + "description": "Exa API Key", + "hint": "Multiple keys can be added for rotation. Get a key at https://dashboard.exa.ai" + }, + "websearch_anysearch_key": { + "description": "AnySearch API Key", + "hint": "Multiple keys can be added for rotation. Leave empty to use anonymous mode with a daily free quota." + }, + "websearch_serpapi_key": { + "description": "SerpApi API Key", + "hint": "Supports Google web, news, image, scholar, and finance search. Multiple keys can be added for rotation. Get a key: [https://serpapi.com/manage-api-key](https://serpapi.com/manage-api-key)" + }, + "websearch_deepseek_key": { + "description": "DeepSeek API Key", + "hint": "Enter your DeepSeek API key. Can use the same key as the chat model (must be entered separately). Supports multiple keys for rotation. Get a key: [https://platform.deepseek.com/api_keys](https://platform.deepseek.com/api_keys)" + } + } + }, + "file_extract": { + "description": "File Extract", + "provider_settings": { + "file_extract": { + "enable": { + "description": "Enable File Extract" + }, + "provider": { + "description": "File Extract Provider" + }, + "moonshotai_api_key": { + "description": "Moonshot AI API Key" + } + } + } + }, + "agent_computer_use": { + "description": "Agent Computer Use", + "hint": "Allows the AstrBot to access and use your computer or an sandbox environment to perform more complex tasks. See: [Agent Sandbox Environment](https://docs.astrbot.app/en/use/astrbot-agent-sandbox.html).", + "provider_settings": { + "computer_use_runtime": { + "description": "Computer Use Runtime", + "hint": "Environment the Agent is allowed to access.", + "labels": ["No environment", "Local machine", "Third-party sandbox"] + }, + "computer_use_local_permissions": { + "description": "Local Permission Policies" + }, + "computer_use_require_admin": { + "description": "Require Admin Permission for Sandbox", + "hint": "When enabled, AstrBot admin permission is required to use remote sandbox capabilities. Add admins under Config -> Access Control -> Administrators -> Administrator IDs. Send /sid to the bot to get the ID." + }, + "sandbox": { + "booter": { + "description": "Sandbox Environment Driver" + }, + "shipyard_neo_endpoint": { + "description": "Shipyard Neo API Endpoint", + "hint": "Bay API address, default http://127.0.0.1:8114." + }, + "shipyard_neo_access_token": { + "description": "Shipyard Neo Access Token", + "hint": "Bay API Key (sk-bay-...). Leave empty for auto-discovery from credentials.json." + }, + "shipyard_neo_profile": { + "description": "Shipyard Neo Profile", + "hint": "Sandbox profile for Shipyard Neo, e.g. python-default. Leave empty to auto-select the most capable profile." + }, + "shipyard_neo_ttl": { + "description": "Shipyard Neo Sandbox TTL", + "hint": "Sandbox time-to-live in seconds." + }, + "cua_image": { + "description": "CUA Image", + "hint": "CUA sandbox image or OS type. Defaults to linux. Supported values depend on the installed CUA SDK." + }, + "cua_os_type": { + "description": "CUA OS Type", + "hint": "CUA sandbox operating system type. Defaults to linux." + }, + "cua_idle_timeout": { + "description": "CUA Idle Timeout", + "hint": "Idle timeout for CUA sandbox sessions in seconds. When greater than 0, AstrBot proactively shuts down an idle CUA sandbox after that amount of inactivity; 0 disables it." + }, + "cua_telemetry_enabled": { + "description": "CUA Telemetry", + "hint": "Allow the CUA SDK to send telemetry data. Disabled by default." + }, + "cua_local": { + "description": "CUA Local Sandbox", + "hint": "Prefer a local CUA sandbox. Enabled by default to avoid requiring CUA_API_KEY for cloud sandboxes. Disable this to use CUA cloud sandboxes." + }, + "cua_api_key": { + "description": "CUA API Key", + "hint": "CUA cloud sandbox API key. Required only when local sandbox is disabled. You can also provide it via the CUA_API_KEY environment variable." + }, + "shipyard_endpoint": { + "description": "Shipyard API Endpoint", + "hint": "API access address for Shipyard service." + }, + "shipyard_access_token": { + "description": "Shipyard Access Token", + "hint": "Access token for accessing Shipyard service." + }, + "shipyard_ttl": { + "description": "Shipyard Session TTL", + "hint": "Session time-to-live in seconds." + }, + "shipyard_max_sessions": { + "description": "Shipyard Max Sessions", + "hint": "Maximum number of Shipyard sessions an instance can handle." + } + } + }, + "local_permissions": { + "role": "Role", + "execution": "Allow code execution", + "network": "Allow execution network access", + "filesystem": "File access scope", + "scopes": { + "workspace": "Workspace", + "host": "Entire environment" + }, + "scopeHints": { + "none": "No file access allowed", + "workspace": "Restricted workspace, temporary directories, and skill files.", + "workspaceUnsupported": "Restricted workspace file access is unavailable on this platform.", + "host": "All files in the environment where AstrBot runs." + }, + "scopeDetails": { + "account": "1. Access is limited to files permitted by the account running AstrBot.", + "docker": "2. If deployed through Docker, only files inside the container and mounted files are accessible, not all files on the Docker host." + }, + "roles": { + "member": "Member", + "admin": "Administrator" + }, + "modes": { + "none": "Disabled" + }, + "networkAlwaysOn": "Always on", + "windowsHostNetworkHint": "Windows cannot disable networking while executing code with entire-environment access. Switch to workspace access to disable networking.", + "runtimeUnknown": "Runtime information is unavailable.", + "memberWarning": "Members have network access or file access across the entire environment.", + "executionInactive": "Inactive", + "executionInactiveHelp": "Why execution is inactive", + "executionBlocked": "Code execution is enabled for {role}, but the configured isolation requirements cannot currently be met. {reason}", + "runtime": { + "os": "OS", + "arch": "Architecture", + "sandbox": "Local isolation", + "windowsUnavailable": "{backend} · Not ready", + "windowsSetupHint": "Save the configuration and restart AstrBot. If prompted for administrator approval, allow it to initialize the sandbox.", + "errorDetails": "View diagnostic details", + "unavailableHint": "Sandbox startup failed, affecting restricted Shell/Python execution and workspace file search. Use the error below to check system security policies (such as Linux AppArmor and user namespace restrictions) or container restrictions, then restart AstrBot to check again.", + "dialog": { + "intro": "Using Seatbelt on macOS or bubblewrap (bwrap) on Linux, AstrBot provides security isolation for Agent execution, restricting file access scope and network permissions for different users of AstrBot Agent to improve security.", + "startupError": "View startup error", + "documentation": "View detailed setup documentation" + }, + "close": "Close", + "setupHint": { + "missing": "Install {dependency} to enable all local isolation features.", + "unavailable": "Configure {backend} to enable all local isolation features.", + "unsupported": "Learn about local isolation support." + }, + "isolationFailure": { + "missing": "Missing {dependency}.", + "unavailable": "{backend} failed its startup probe.", + "unsupported": "Local process isolation is not supported on this platform." + }, + "executionUnavailable": { + "missing": "Missing {dependency}; code execution cannot be enabled when File access scope is set to Workspace.", + "unavailable": "{backend} cannot start; code execution cannot be enabled when File access scope is set to Workspace.", + "unsupported": "Local isolation is unsupported on this platform; code execution cannot be enabled when File access scope is set to Workspace." + }, + "status": { + "detected": "{backend}", + "missing": "Missing {dependency}", + "unavailable": "{backend} · Installed but cannot start", + "unsupported": "Unsupported" + } + } + } + }, + "proactive_capability": { + "description": "Proactive Agent", + "hint": "AstrBot will wake up, run your tasks, and deliver the results to you. See [Proactive Agent](https://docs.astrbot.app/en/use/proactive-agent.html)", + "provider_settings": { + "proactive_capability": { + "add_cron_tools": { + "description": "Enable", + "hint": "When enabled, related tools will be passed to the Agent to implement proactive Agent capabilities. You can tell AstrBot what to do at a future time, and it will be triggered on schedule to execute the task, and report the result back to you." + } + } + } + }, + "truncate_and_compress": { + "hint": "[Context Management](https://docs.astrbot.app/en/use/context-compress.html)", + "description": "Context Management Strategy", + "agent_runner": { "config": { "compression": { + "max_turns": { + "description": "Max Turns Before Compression", + "hint": "Persistent conversation history is truncated or LLM-compressed by the strategy below only after it exceeds this many turns. Request-time contexts are also constrained by this value before sending. -1 means no turn-based limit." + }, + "trim_turns": { + "description": "Turns to Discard When Limit Exceeded", + "hint": "When history exceeds 'Max Turns Before Compression' and LLM compression is unavailable, discard this many oldest turns at once. Request-time truncation also reuses this value." + }, + "overflow_strategy": { + "description": "Compression Strategy", + "labels": [ + "Truncate by Turns", + "Compress by LLM" + ], + "hint": "Strategy for handling model context limits." + }, + "instruction": { + "description": "Context Compression Instruction", + "hint": "If empty, the default prompt will be used." + }, + "keep_recent_ratio": { + "description": "Recent Context Token Ratio to Keep", + "hint": "Keep recent exact context by current context token ratio, from 0-0.3. 0.15 means keeping 15%; values above 0 keep at least the latest round." + }, + "provider_id": { + "description": "Compression Model", + "hint": "The model used for context compression. Defaults to the current chat model." + }, + "fallback_max_tokens": { + "description": "Fallback context window size", + "hint": "When max_context_tokens is 0 and the model is not in built-in metadata, use this value as the context window size. Default: 128000." + } + } } } + }, + "others": { + "description": "Other Settings", + "agent_runner": { "config": { "misc": { + "max_steps": { "description": "Maximum Tool Call Rounds" }, + "tool_schema_mode": { + "description": "Tool Schema Mode", + "hint": "Skills-like sends name/description first and re-queries for parameters; Full sends the complete schema in one step.", + "labels": ["Skills-like (two-stage)", "Full schema"] + }, + "tool_call_timeout": { + "description": "Tool Call Timeout (seconds)" + }, + "sanitize_context_by_modalities": { + "description": "Sanitize History by Modalities", + "hint": "When enabled, sanitizes contexts before each LLM request by removing image blocks and tool-call structures that the current provider's modalities do not support (this changes what the model sees)." + } + } } }, + "provider_settings": { + "display_reasoning_text": { + "description": "Display Reasoning Content", + "hint": "Include the model's chain-of-thought information in the final reply." + }, + "identifier": { + "description": "User Identification", + "hint": "Prepend the user ID to the user prompt." + }, + "group_name_display": { + "description": "Display Group Name", + "hint": "Prepend the group name to user prompts in group chats on supported messaging platforms." + }, + "datetime_system_prompt": { + "description": "Real-world Time Awareness", + "hint": "Include the current time in the user prompt." + }, + "show_tool_use_status": { + "description": "Show Tool Call Information", + "hint": "When a tool is called, also send a message containing the tool name." + }, + "show_tool_call_result": { + "description": "Output Tool Call Results", + "hint": "Only takes effect when \"Show Tool Call Information\" is enabled, and shows at most 70 characters." + }, + "buffer_intermediate_messages": { + "description": "Merge Agent Intermediate Messages", + "hint": "When enabled, intermediate text generated during multi-step tool calls in non-streaming mode will be buffered and sent as a single merged reply after the Agent finishes." + }, + "max_quoted_fallback_images": { + "description": "Forwarded Image Fetch Limit", + "hint": "Maximum number of images injected from forwarded-message parsing; extra images are truncated." + }, + "quoted_message_parser": { + "max_component_chain_depth": { + "description": "Forwarded Rich-Text Parse Depth", + "hint": "Maximum recursive depth when parsing rich-text component chains inside forwarded messages." + }, + "max_forward_node_depth": { + "description": "Forward Nesting Parse Depth", + "hint": "Maximum recursive depth when parsing nested forwarded nodes." + }, + "max_forward_fetch": { + "description": "Forward Recursive Fetch Limit", + "hint": "Maximum number of recursive get_forward_msg fetch operations." + }, + "warn_on_action_failure": { + "description": "Warn on Forward Parse Failure", + "hint": "When enabled, log warnings when all get_msg/get_forward_msg attempts fail." + } + }, + "streaming_response": { + "description": "Streaming Output", + "hint": "Display responses with a typewriter effect on supported chat platforms." + }, + "unsupported_streaming_strategy": { + "description": "Platforms Without Streaming Support", + "hint": "Select the handling method for platforms that don't support streaming responses. Real-time segmented reply sends content immediately when the system detects segment points like punctuation during streaming reception", + "labels": [ + "Real-time Segmented Reply", + "Disable Streaming Response" + ] + }, + "wake_prefix": { + "description": "Additional Wake Prefix", + "hint": "If the wake prefix is / and the additional chat wake prefix is chat, then /chat is required to trigger LLM requests" + }, + "prompt_prefix": { + "description": "User Prompt", + "hint": "You can use {{prompt}} as a placeholder for user input. If no placeholder is provided, it will be added before the user input." + }, + "image_compress_options": { + "description": "Model input image settings", + "hint": "Images are always prepared as JPEG/PNG below 512 KiB. Original attachments are preserved.", + "max_size": { + "description": "Input image maximum edge length", + "hint": "Longest edge sent to the model, in pixels. Images may be reduced further to stay below 512 KiB; original attachment paths are unchanged." + } + }, + "reachability_check": { + "description": "Provider Reachability Check", + "hint": "When running the /provider command, test provider connectivity in parallel. This actively pings models and may consume extra tokens." + } + }, + "provider_tts_settings": { + "dual_output": { + "description": "Output Both Voice and Text When TTS is Enabled" + } + } + } + }, + "platform_group": { + "name": "Platforms & Messages", + "platform": { + "description": "Message Platform Adapters", + "app_id": { + "description": "Application ID", + "hint": "The application ID from the messaging platform's developer console." + }, + "app_secret": { + "description": "Application secret", + "hint": "The application secret from the messaging platform's developer console. Keep it secure." + }, + "domain": { + "description": "Open platform API URL", + "hint": "The base URL of the open platform API. The default normally does not need to be changed." + }, + "corpid": { + "description": "Enterprise ID", + "hint": "The enterprise ID (CorpID) from the WeCom administration console." + }, + "token": { + "description": "Callback token", + "hint": "The token used to verify requests in the messaging platform's callback settings." + }, + "encoding_aes_key": { + "description": "Message encryption key", + "hint": "The EncodingAESKey from the callback settings, used to encrypt and decrypt messages." + }, + "api_base_url": { + "description": "API base URL", + "hint": "The messaging platform API base URL. The default normally does not need to be changed." + }, + "client_id": { + "description": "Client ID", + "hint": "The client ID from the messaging platform's developer console." + }, + "client_secret": { + "description": "Client secret", + "hint": "The client secret from the messaging platform's developer console. Keep it secure." + }, + "start_message": { + "description": "Start command reply", + "hint": "The message sent when a user sends the /start command to the Telegram bot." + }, + "telegram_api_base_url": { + "description": "API URL", + "hint": "The Telegram Bot API base URL. The official default normally does not need to be changed." + }, + "telegram_file_base_url": { + "description": "File API URL", + "hint": "The base URL used to download files from the Telegram Bot API. The official default normally does not need to be changed." + }, + "bot_token": { + "description": "Slack Bot Token", + "hint": "The Slack application's Bot User OAuth Token, usually beginning with xoxb-." + }, + "app_token": { + "description": "Slack App Token", + "hint": "The App-Level Token used by Slack Socket Mode, usually beginning with xapp-." + }, + "signing_secret": { + "description": "Slack Signing Secret", + "hint": "The Slack application's Signing Secret, used to verify webhook requests." + }, + "channel_access_token": { + "description": "LINE Channel Access Token", + "hint": "The Channel Access Token for the LINE Messaging API channel." + }, + "channel_secret": { + "description": "LINE Channel Secret", + "hint": "The Channel Secret for the LINE Messaging API channel." + }, + "active_send_mode": { + "description": "Use Proactive Send API" + }, + "appid": { + "description": "App ID", + "hint": "Required. App ID for the current messaging platform. See the platform integration docs for how to obtain it." + }, + "callback_server_host": { + "description": "Callback Server Host", + "hint": "Callback server host. Leave empty to disable the callback server." + }, + "card_template_id": { + "description": "Card Template ID", + "hint": "Optional. DingTalk interactive card template ID. When enabled, streaming replies will use interactive cards." + }, + "discord_activity_name": { + "description": "Discord Activity Name", + "hint": "Optional Discord activity name. Leave empty to disable." + }, + "discord_allow_bot_messages": { + "description": "Allow Bot Messages", + "hint": "When enabled, AstrBot will receive messages from other Discord bots. Useful for bot-to-bot communication scenarios (e.g., message forwarding). Disabled by default." + }, + "discord_command_register": { + "description": "Register Discord slash commands", + "hint": "When enabled, AstrBot will automatically register plugin commands as Discord slash commands" + }, + "discord_proxy": { + "description": "Discord Proxy URL", + "hint": "Optional proxy URL: http://ip:port" + }, + "discord_token": { + "description": "Discord Bot Token", + "hint": "Enter your Discord Bot Token here." + }, + "enable": { + "description": "Enable", + "hint": "Whether to enable this adapter. Disabled adapters will not receive messages." + }, + "enable_group_c2c": { + "description": "Enable Message List Private Chat", + "hint": "When enabled, the bot can receive private chats from QQ message list. You may need to add the bot as a friend by scanning a QR code in the QQ bot platform. See docs." + }, + "enable_guild_direct_message": { + "description": "Enable Guild Direct Messages", + "hint": "When enabled, the bot can receive guild direct messages." + }, + "id": { + "description": "Bot Name", + "hint": "Bot name" + }, + "is_sandbox": { + "description": "Sandbox Mode" + }, + "kf_name": { + "description": "WeChat Customer Service Account Name", + "hint": "Optional. Customer service account name (not ID). Get it at https://kf.weixin.qq.com/kf/frame#/accounts" + }, + "lark_connection_mode": { + "description": "Subscription Mode", + "labels": [ + "Long Connection Mode", + "Webhook Server Mode" + ] + }, + "lark_encrypt_key": { + "description": "Encrypt Key", + "hint": "Encryption key for decrypting Lark callback data." + }, + "lark_verification_token": { + "description": "Verification Token", + "hint": "Token for verifying Lark callback requests." + }, + "misskey_allow_insecure_downloads": { + "description": "Allow Insecure Downloads (Disable SSL Verification)", + "hint": "If remote servers have certificate issues, SSL verification will be disabled as a fallback. Use only when necessary due to security risks." + }, + "misskey_default_visibility": { + "description": "Default Post Visibility", + "hint": "Default visibility for bot posts. public: public, home: home timeline, followers: followers only." + }, + "misskey_download_chunk_size": { + "description": "Stream Download Chunk Size (bytes)", + "hint": "Bytes read per chunk during streaming download and MD5 calculation. Too small increases overhead; too large uses more memory." + }, + "misskey_download_timeout": { + "description": "Remote Download Timeout (seconds)", + "hint": "Timeout for downloading remote files (seconds), used when falling back to local upload." + }, + "misskey_enable_chat": { + "description": "Enable Chat Message Responses", + "hint": "When enabled, the bot listens and responds to private chat messages." + }, + "misskey_enable_file_upload": { + "description": "Enable File Upload to Misskey", + "hint": "When enabled, the adapter uploads files in message chains to Misskey. URL files try server-side upload first; if async upload fails, it falls back to local download and upload." + }, + "misskey_instance_url": { + "description": "Misskey Instance URL", + "hint": "e.g. https://misskey.example. The Misskey instance where the bot account lives." + }, + "misskey_local_only": { + "description": "Local Only (No Federation)", + "hint": "When enabled, bot posts are visible only on this instance and are not federated." + }, + "misskey_max_download_bytes": { + "description": "Max Download Size (bytes)", + "hint": "To limit download size to prevent OOM, set the maximum bytes; empty or null means no limit." + }, + "misskey_token": { + "description": "Misskey Access Token", + "hint": "API access token generated in the connection service settings." + }, + "misskey_upload_concurrency": { + "description": "Upload Concurrency Limit", + "hint": "Max number of concurrent upload tasks (integer, default 3)." + }, + "misskey_upload_folder": { + "description": "Target Drive Folder ID", + "hint": "Optional: ID of the target folder in Misskey drive. Leave empty to use the root folder." + }, + "port": { + "description": "Callback Server Port", + "hint": "Callback server port. Leave empty to disable the callback server." + }, + "satori_api_base_url": { + "description": "Satori API Endpoint", + "hint": "Base URL for the Satori API." + }, + "satori_auto_reconnect": { + "description": "Enable Auto Reconnect", + "hint": "Automatically reconnect the WebSocket when disconnected." + }, + "satori_endpoint": { + "description": "Satori WebSocket Endpoint", + "hint": "WebSocket endpoint for Satori events." + }, + "satori_heartbeat_interval": { + "description": "Satori Heartbeat Interval", + "hint": "Interval in seconds between heartbeat messages." + }, + "satori_reconnect_delay": { + "description": "Satori Reconnect Delay", + "hint": "Delay before attempting to reconnect (seconds)." + }, + "satori_token": { + "description": "Satori Token", + "hint": "Token for Satori API authentication." + }, + "secret": { + "description": "Secret", + "hint": "Required." + }, + "slack_connection_mode": { + "description": "Slack Connection Mode", + "hint": "The connection mode for Slack. `webhook` uses a webhook server, `socket` uses Slack's Socket Mode." + }, + "slack_webhook_host": { + "description": "Slack Webhook Host", + "hint": "Only valid when Slack connection mode is `webhook`." + }, + "slack_webhook_path": { + "description": "Slack Webhook Path", + "hint": "Only valid when Slack connection mode is `webhook`." + }, + "slack_webhook_port": { + "description": "Slack Webhook Port", + "hint": "Only valid when Slack connection mode is `webhook`." + }, + "telegram_command_auto_refresh": { + "description": "Command Auto Refresh", + "hint": "When enabled, AstrBot automatically refreshes Telegram commands at runtime. (Setting this alone has no effect)" + }, + "telegram_command_register": { + "description": "Command Registration", + "hint": "When enabled, AstrBot automatically registers Telegram commands." + }, + "telegram_command_register_interval": { + "description": "Command Auto Refresh Interval", + "hint": "Telegram command auto-refresh interval in seconds." + }, + "telegram_polling_restart_delay": { + "description": "Polling Restart Delay", + "hint": "Waiting time in seconds when the polling loop needs to restart after unexpected exits. Defaults to 5s." + }, + "telegram_token": { + "description": "Bot Token", + "hint": "If you are in mainland China, set a proxy or change api_base in Other Settings." + }, + "mattermost_url": { + "description": "Mattermost URL", + "hint": "Mattermost service URL, for example https://chat.example.com." + }, + "mattermost_bot_token": { + "description": "Mattermost Bot Token", + "hint": "The access token generated after creating a bot account in Mattermost." + }, + "mattermost_reconnect_delay": { + "description": "Mattermost Reconnect Delay", + "hint": "Delay in seconds before reconnecting after the WebSocket disconnects. Defaults to 5 seconds." + }, + "type": { + "description": "Adapter Type" + }, + "unified_webhook_mode": { + "description": "Unified Webhook Mode", + "hint": "When enabled, use AstrBot unified webhook entry without opening a separate port. Callback URL is /api/v1/webhooks/platforms/{webhook_uuid}." + }, + "use_markdown": { + "description": "Use Markdown for Proactive Messages", + "hint": "When enabled, proactive messages are sent in Markdown mode by default; an explicit use_markdown() call from a plugin takes precedence over this option." + }, + "webhook_uuid": { + "description": "Webhook UUID", + "hint": "Unique identifier for unified webhook mode; generated when creating the platform." + }, + "wecom_ai_bot_name": { + "description": "WeCom AI Bot Name", + "hint": "Must be correct; otherwise some commands won't work." + }, + "wecom_ai_bot_connection_mode": { + "description": "WeCom AI Bot Connection Mode", + "hint": "Webhook mode requires Token/EncodingAESKey; long_connection mode requires BotID/Secret." + }, + "wecomaibot_friend_message_welcome_text": { + "description": "WeCom AI Bot DM Welcome Message", + "hint": "When a user enters a DM session on that day, reply with a welcome message. Leave empty to disable." + }, + "wecomaibot_init_respond_text": { + "description": "WeCom AI Bot Initial Response Text", + "hint": "First reply when the bot receives a message. Leave empty to disable." + }, + "wecomaibot_token": { + "description": "WeCom AI Bot Token", + "hint": "Used for authentication in webhook callback mode." + }, + "wecomaibot_encoding_aes_key": { + "description": "WeCom AI Bot EncodingAESKey", + "hint": "Used for message encryption/decryption in webhook callback mode." + }, + "wecomaibot_ws_bot_id": { + "description": "Long Connection BotID", + "hint": "BotID credential for WeCom AI Bot long connection mode." + }, + "wecomaibot_ws_secret": { + "description": "Long Connection Secret", + "hint": "Secret credential for WeCom AI Bot long connection mode." + }, + "wecomaibot_ws_url": { + "description": "Long Connection WebSocket URL", + "hint": "Default is wss://openws.work.weixin.qq.com and usually does not need changes." + }, + "wecomaibot_heartbeat_interval": { + "description": "Long Connection Heartbeat Interval", + "hint": "Heartbeat interval (seconds) in long connection mode. 30 seconds is recommended." + }, + "wpp_active_message_poll": { + "description": "Enable Proactive Message Polling", + "hint": "Only enable if WeChat messages are not syncing to AstrBot on time. Disabled by default." + }, + "wpp_active_message_poll_interval": { + "description": "Proactive Message Poll Interval", + "hint": "Interval in seconds, default 3, should not exceed 60 or it may be considered old messages." + }, + "ws_reverse_host": { + "description": "Reverse WebSocket Host", + "hint": "AstrBot acts as the server." + }, + "ws_reverse_port": { + "description": "Reverse WebSocket Port" + }, + "ws_reverse_token": { + "description": "Reverse WebSocket Token", + "hint": "Reverse WebSocket token. If not set, token verification is disabled." + }, + "msg_push_webhook_url": { + "description": "WeCom Message Push Webhook URL", + "hint": "Used for proactive message push. It is strongly recommended to set this for a better message sending experience." + }, + "only_use_webhook_url_to_send": { + "description": "Send Replies via Webhook Only", + "hint": "When enabled, all WeCom AI Bot replies are sent through msg_push_webhook_url. The message push webhook supports more message types (such as images, files, etc.). If you do not need the typing effect, it is strongly recommended to use this option. " + }, + "weixin_oc_base_url": { + "description": "API Base URL", + "hint": "Default: https://ilinkai.weixin.qq.com" + }, + "weixin_oc_bot_type": { + "description": "bot_type (QR login parameter)", + "hint": "Default: 3" + }, + "weixin_oc_qr_poll_interval": { + "description": "QR status poll interval (seconds)", + "hint": "Polling interval in seconds for QR code status." + }, + "weixin_oc_long_poll_timeout_ms": { + "description": "getUpdates long-poll timeout (ms)", + "hint": "Timeout parameter for polling messages." + }, + "weixin_oc_api_timeout_ms": { + "description": "HTTP timeout (ms)", + "hint": "Generic API request timeout." + }, + "weixin_oc_token": { + "description": "Token after login (optional)", + "hint": "Automatically written after QR login; can be filled manually for advanced scenarios." + }, + "kook_bot_token": { + "description": "Bot Token", + "type": "string", + "hint": "Required. The Bot Token obtained from the KOOK Developer Platform." + }, + "kook_reconnect_delay": { + "description": "Reconnect Delay", + "type": "int", + "hint": "Delay time for reconnection (seconds), using an exponential backoff strategy." + }, + "kook_max_reconnect_delay": { + "description": "Max Reconnect Delay", + "type": "int", + "hint": "The maximum value for reconnection delay (seconds)." + }, + "kook_max_retry_delay": { + "description": "Max Retry Delay", + "type": "int", + "hint": "The maximum delay time for retries (seconds)." + }, + "kook_heartbeat_interval": { + "description": "Heartbeat Interval", + "type": "int", + "hint": "The interval time for heartbeat detection (seconds)." + }, + "kook_heartbeat_timeout": { + "description": "Heartbeat Timeout", + "type": "int", + "hint": "The timeout duration for heartbeat detection (seconds)." + }, + "kook_max_heartbeat_failures": { + "description": "Max Heartbeat Failures", + "type": "int", + "hint": "Maximum allowed heartbeat failures; the connection will be dropped if exceeded." + }, + "kook_max_consecutive_failures": { + "description": "Max Consecutive Failures", + "type": "int", + "hint": "Maximum allowed consecutive failures; retries will stop if exceeded." + } + }, + "general": { + "description": "General", + "platform_settings": { + "unique_session": { + "description": "Isolate Conversation", + "hint": "On supported platforms, each group member has a separate conversation context when enabled. Manage command permissions under Handlers → Command." + }, + "friend_message_needs_wake_prefix": { + "description": "Private Messages Require Wake Word", + "hint": "Private messages must also include a wake prefix to activate the bot." + }, + "reply_prefix": { + "description": "Reply Text Prefix", + "hint": "The text prefix added to replies." + }, + "reply_with_mention": { + "description": "Mention Sender in Reply", + "hint": "Mention the sender when replying." + }, + "reply_with_quote": { + "description": "Quote Sender's Message in Reply", + "hint": "Quote the sender's corresponding message when replying." + }, + "forward_threshold": { + "description": "Forward Message Word Count Threshold", + "hint": "On supported platforms, send overly long replies as merged forwarded messages." + }, + "empty_mention_waiting": { + "description": "Trigger Waiting on Mention-only Messages", + "hint": "After a message that only mentions the bot, stay awake for one minute to wait for the user's next message." + } + }, + "wake_prefix": { + "description": "Wake Word", + "hint": "A list of message prefixes that wake the bot. You can also wake it by mentioning it.\n\nBuilt-in commands such as `/help` and `/sid` also depend on the wake word: in group chats they do not trigger unless the message starts with a wake word; in private chats they trigger without a prefix unless \"Private Messages Require Wake Word\" is enabled." + }, + "disable_builtin_commands": { + "description": "Disable Built-in Commands", + "hint": "Disable all built-in AstrBot commands such as help, sid, new, etc." + } + }, + "rate_limit": { + "description": "Rate Limiting", + "platform_settings": { + "rate_limit": { + "time": { + "description": "Message Rate Limit Time (seconds)" + }, + "count": { + "description": "Message Rate Limit Count" + }, + "strategy": { + "description": "Rate Limit Strategy" + } + } + } + }, + "content_safety": { + "description": "Content Safety", + "content_safety": { + "also_use_in_response": { + "description": "Also Check Model Response Content" + }, + "baidu_aip": { + "enable": { + "description": "Use Baidu Content Safety Moderation", + "hint": "You need to manually install the baidu-aip library." + }, + "app_id": { + "description": "App ID" + }, + "api_key": { + "description": "API Key" + }, + "secret_key": { + "description": "Secret Key" + } + }, + "internal_keywords": { + "enable": { + "description": "Keyword Check" + }, + "extra_keywords": { + "description": "Additional Keywords", + "hint": "Additional keyword blocklist, supports regular expressions." + } + } + } + }, + "others": { + "description": "Other Settings", + "platform_settings": { + "ignore_bot_self_message": { + "description": "Ignore Bot's Own Messages" + }, + "ignore_at_all": { + "description": "Ignore @All Events" + }, + "no_permission_reply": { + "description": "Reply When User Has Insufficient Permissions" + } + }, + "platform_specific": { + "lark": { + "pre_ack_emoji": { + "enable": { + "description": "[Lark] Enable Pre-acknowledgment Emoji" + }, + "emojis": { + "description": "Emoji List (Lark Emoji Enum Names)", + "hint": "Emoji enum names reference: [https://open.feishu.cn/document/server-docs/im-v1/message-reaction/emojis-introduce](https://open.feishu.cn/document/server-docs/im-v1/message-reaction/emojis-introduce)" + } + } + }, + "telegram": { + "pre_ack_emoji": { + "enable": { + "description": "[Telegram] Enable Pre-acknowledgment Emoji" + }, + "emojis": { + "description": "Emoji List (Unicode)", + "hint": "Telegram only supports a fixed reaction set, reference: [https://gist.github.com/Soulter/3f22c8e5f9c7e152e967e8bc28c97fc9](https://gist.github.com/Soulter/3f22c8e5f9c7e152e967e8bc28c97fc9)" + } + } + }, + "discord": { + "pre_ack_emoji": { + "enable": { + "description": "[Discord] Enable Pre-acknowledgment Emoji" + }, + "emojis": { + "description": "Emoji List (Unicode or Custom Emoji Name)", + "hint": "Enter Unicode emoji symbols, e.g., 👍, 🤔, ⏳" + } + } + } + } + } + }, + "access_group": { + "name": "Access Control", + "admins": { + "description": "Administrators", + "admins_id": { + "description": "Administrator IDs", + "hint": "Send the /sid command to the bot to get the ID." + } + }, + "whitelist": { + "description": "Whitelist", + "platform_settings": { + "enable_id_white_list": { + "description": "Enable Whitelist", + "hint": "When enabled, only sessions in the whitelist will be responded to." + }, + "id_whitelist": { + "description": "Whitelist ID List", + "hint": "Send the /sid command to the bot to get the ID. An empty list disables the whitelist." + }, + "id_whitelist_log": { + "description": "Log Blocked Messages", + "hint": "Log messages that fail whitelist checks." + }, + "wl_ignore_admin_on_group": { + "description": "Administrator Group Messages Bypass ID Whitelist" + }, + "wl_ignore_admin_on_friend": { + "description": "Administrator Private Messages Bypass ID Whitelist" + } + } + } + }, + "plugin_group": { + "name": "Plugin", + "plugin": { + "description": "Plugins", + "plugin_set": { + "description": "Available Plugins", + "hint": "All non-disabled plugins are enabled by default. If a plugin is disabled on the plugins page, selections here will not take effect." + } + } + }, + "ext_group": { + "name": "Ext.", + "segmented_reply": { + "description": "Segmented Reply", + "platform_settings": { + "segmented_reply": { + "enable": { + "description": "Enable Segmented Reply", + "hint": "Send replies in multiple segments." + }, + "only_llm_result": { + "description": "Segment Only LLM Results" + }, + "interval_method": { + "description": "Interval Method", + "hint": "random uses a random delay. log calculates delay by message length: $y=log_{log\\_base}(x)$, where x is word count and y is in seconds." + }, + "interval": { + "description": "Random Interval Time", + "hint": "Format: minimum,maximum (e.g., 1.5,3.5)" + }, + "log_base": { + "description": "Logarithm Base", + "hint": "Base for logarithmic intervals, defaults to 2.6. Value range: 1.0-10.0." + }, + "words_count_threshold": { + "description": "Segmented Reply Word Count Threshold", + "hint": "Segmented reply word count threshold. Only messages with less than this number of words will be segmented, and messages with more than this number of words will be sent directly (not segmented)." + }, + "split_mode": { + "description": "Split Mode", + "hint": "Used to segment a message. By default, it will be separated by punctuation marks like period, question mark, etc. For example, filling `[。?!]` will remove all periods, question marks, and exclamation marks. re.findall(r'', text)", + "labels": [ + "Regex", + "Words List" + ] + }, + "regex": { + "description": "Segmentation Regular Expression", + "hint": "Used to identify split points with a regular expression. Prefer patterns that match separators." + }, + "split_words": { + "description": "Split Word List", + "hint": "Split when any word in the list is detected" + }, + "content_cleanup_rule": { + "description": "Content Filtering Regular Expression", + "hint": "Remove specified content from segmented content. For example, `[。?!]` will remove all periods, question marks, and exclamation marks." + } + } + } + }, + "ltm": { + "description": "Group Chat Context Awareness", + "provider_ltm_settings": { + "group_icl_enable": { + "description": "Inject Group Chat Records into Context", + "hint": "Record group messages that do not wake the bot and pass them to the model when the bot is activated." + }, + "group_message_max_cnt": { + "description": "Maximum Messages Injected into Context", + "hint": "The maximum number of messages passed to the model." + }, + "image_caption": { + "description": "Auto-understand Images", + "hint": "Convert image messages that do not wake the bot into text descriptions. Use with care in image-heavy group chats, as this can incur substantial costs." + }, + "image_caption_provider_id": { + "description": "Group Chat Image Caption Model", + "hint": "Used to understand images injected from group chat records, configured separately from the default image caption model." + }, + "group_message_history_enable": { + "description": "Persist Group Chat Messages", + "hint": "Persist all group messages and allow the model to query them using tools." + }, + "group_message_history_max_cnt": { + "description": "Maximum Persisted Messages", + "hint": "The maximum number of persisted messages. Older messages are discarded when the limit is exceeded." + }, + "active_reply": { + "enable": { + "description": "Active Reply", + "hint": "Send messages proactively at suitable times." + }, + "method": { + "description": "Active Reply Method" + }, + "possibility_reply": { + "description": "Reply Probability", + "hint": "Value between 0.0-1.0" + }, + "whitelist": { + "description": "Active Reply Whitelist", + "hint": "Whitelist filtering is disabled when empty. Use /sid to get IDs." + } + } + } + }, + "t2i": { + "description": "Text-to-Image", + "t2i": { + "description": "Text-to-Image Output", + "hint": "Convert model replies to images before sending to avoid flooding the chat." + }, + "t2i_word_threshold": { + "description": "Text-to-Image Word Count Threshold" + }, + "t2i_strategy": { + "description": "Text-to-Image Strategy", + "hint": "Text-to-image strategy. `remote` uses a remote HTML-based rendering service, `local` uses PIL for local rendering. When using local, place a TTF font named 'font.ttf' in the data/ directory to customize the font." + }, + "t2i_endpoint": { + "description": "Text-to-Image Service API Endpoint", + "hint": "Uses AstrBot API service when empty" + }, + "t2i_template": { + "description": "Text-to-Image Custom Template", + "hint": "When enabled, you can customize HTML templates for text-to-image rendering." + }, + "t2i_active_template": { + "description": "Currently Active Text-to-Image Rendering Template", + "hint": "This value is maintained by the text-to-image template management page." + } + } + }, + "system_group": { + "name": "System", + "system": { + "description": "System Settings", + "log_level": { + "description": "Console Log Level", + "hint": "Log level for console output." + }, + "log_file_enable": { + "description": "Enable File Logging", + "hint": "Write logs to a file in addition to the console." + }, + "log_file_path": { + "description": "Log File Path", + "hint": "Relative paths are resolved under the data directory, e.g. logs/astrbot.log; absolute paths are supported." + }, + "log_file_max_mb": { + "description": "Log File Max Size (MB)", + "hint": "Rotate when exceeding this size; default 20MB." + }, + "temp_dir_max_size": { + "description": "Temp Directory Size Limit (MB)", + "hint": "Limits total size of data/temp in MB. The system checks every 10 minutes, and when exceeded, deletes oldest files first to release about 30% of current size." + }, + "trace_enable": { + "description": "Enable Trace Recording", + "hint": "Trace each user command and AI call." + }, + "trace_db_path": { + "description": "Trace Database Path", + "hint": "Relative paths start from the data directory, for example logs/traces.db. Absolute paths are also supported." + }, + "trace_db_max_mb": { + "description": "Trace Database Capacity Budget (MB)", + "hint": "Default: 80 MB. Values below 32 MB use 32 MB. Old data is automatically cleared when this size is exceeded." + }, + "trace_retention_days": { + "description": "Trace Retention Days", + "hint": "Default: 7 days. Old data is cleared when either the retention period or capacity is reached." + }, + "pip_install_arg": { + "description": "Additional pip Installation Arguments", + "hint": "When installing plugin dependencies, Python's pip tool will be used. Additional arguments can be provided here, such as `--break-system-package`. TLS certificates of the PyPI index are verified by default; for self-signed/private-CA mirrors, pass `--cert ` (recommended) or explicitly add `--trusted-host `." + }, + "pypi_index_url": { + "description": "PyPI Repository URL", + "hint": "PyPI repository URL for installing Python dependencies. Defaults to [https://mirrors.aliyun.com/pypi/simple/](https://mirrors.aliyun.com/pypi/simple/)" + }, + "callback_api_base": { + "description": "Externally Accessible Callback API Address", + "hint": "External services may access AstrBot's backend through callback links generated by AstrBot (such as file download links). Since AstrBot cannot automatically determine the externally accessible host address in the deployment environment, this configuration item is needed to explicitly specify how external services should access AstrBot's address. Examples: [http://localhost:6185](http://localhost:6185), [https://example.com](https://example.com), etc." + }, + "disable_metrics": { + "description": "Disable Anonymous Usage Statistics", + "hint": "When disabled, AstrBot will not upload anonymous usage statistics." + }, + "dashboard": { + "trust_proxy_headers": { + "description": "Trust Proxy Headers for Client IP", + "hint": "When disabled, ignore X-Forwarded-For/X-Real-IP and use the connection address only." + }, + "auth_rate_limit": { + "enable": { + "description": "Enable Login Rate Limiting", + "hint": "When disabled, authentication endpoints (login, TOTP, etc.) will not be rate-limited." + }, + "average_interval": { + "description": "Endpoint Rate Limit Average Interval (seconds)", + "hint": "Minimum average interval between authentication requests. For example, 1.0 means at most 1 request per second." + }, + "max_burst": { + "description": "Endpoint Rate Limit Max Burst", + "hint": "Maximum number of consecutive burst requests allowed. For example, 3 allows up to 3 requests in a short burst." + } + }, + "ssl": { + "enable": { + "description": "Enable WebUI HTTPS", + "hint": "When enabled, WebUI serves directly over HTTPS." + }, + "cert_file": { + "description": "SSL Certificate File Path", + "hint": "Certificate file path (PEM). Supports absolute and relative paths (relative to current working directory)." + }, + "key_file": { + "description": "SSL Private Key File Path", + "hint": "Private key file path (PEM). Supports absolute and relative paths (relative to current working directory)." + }, + "ca_certs": { + "description": "SSL CA Certificate File Path", + "hint": "Optional. Path to CA certificate file." + } + }, + "totp": { + "enable": { + "description": "Enable WebUI TOTP", + "hint": "When enabled, a TOTP code is required during dashboard login." + }, + "manage": "Manage", + "configuration": "TOTP", + "statusPending": "Setup required", + "statusEnabled": "Enabled", + "setupRequiredHint": "TOTP is enabled but not yet configured. Click Manage to complete setup.", + "setupTitle": "Set up TOTP", + "setupSubtitle": "Scan this QR code in your authenticator app, then enter a verification code.", + "setupConfirm": "Verify and continue", + "activeSubtitle": "Use this QR code or secret to add another authenticator device.", + "rotateTitle": "Rotate TOTP Secret", + "rotateSubtitle": "Generate a new secret, then enter a code from your authenticator to confirm the replacement.", + "rotate": "Rotate", + "rotateRecovery": "Rotate Recovery Code", + "rotateConfirm": "Confirm Rotation", + "rotateCancel": "Cancel", + "rotateCode": "Verification Code", + "rotateCodeHint": "Enter the code from your authenticator app to confirm the new key.", + "rotateError": "Invalid code, please try again.", + "recoveryTitle": "Recovery Codes", + "recoverySubtitle": "This recovery code is shown once. Save it before continuing.", + "recoveryWarning": "If lost, account access cannot be restored through normal means.", + "recoveryAcknowledge": "I have saved my recovery codes", + "recoveryClose": "Done", + "disableTitle": "Disable TOTP", + "disableSubtitle": "Enter a verification code to disable two-factor authentication.", + "disableRecoverySubtitle": "Enter a recovery code to disable two-factor authentication.", + "disableCode": "Verification Code", + "disableRecoveryCode": "Recovery Code", + "disableConfirm": "Disable", + "disableCancel": "Cancel", + "disableError": "Verification failed. Please try again.", + "disableUseRecovery": "Can't use TOTP?", + "disableUseCode": "Use verification code", + "configSaveTitle": "Two-Factor Verification", + "configSaveSubtitle": "Enter a verification code to change protected configuration.", + "configSaveRotationHint": "When rotating TOTP keys, both the old and new verification codes are accepted (allowed once per rotation operation).", + "configSaveCode": "Verification Code", + "configSaveConfirm": "Continue", + "configSaveCancel": "Cancel", + "configSaveError": "Verification failed. Please try again." + } + }, + "timezone": { + "description": "Timezone", + "hint": "Timezone setting. Please enter an IANA timezone name, such as Asia/Shanghai. Uses system default timezone when empty. For all timezones, see: [https://data.iana.org/time-zones/tzdb-2021a/zone1970.tab](https://data.iana.org/time-zones/tzdb-2021a/zone1970.tab)" + }, + "http_proxy": { + "description": "HTTP Proxy", + "hint": "When enabled, proxy will be set by adding environment variables. Format: `http://ip:port`" + }, + "no_proxy": { + "description": "Direct Connection Address List" + } + } + }, + "provider_group": { + "provider": { + "api_key": { + "description": "API Key" + }, + "dashscope_api_key": { + "description": "DashScope API Key" + }, + "gemini_tts_api_key": { + "description": "Gemini API Key" + }, + "genie_onnx_model_dir": { + "description": "ONNX Model Directory", + "hint": "The directory path containing the ONNX model files" + }, + "genie_language": { + "description": "Language" + }, + "xai_native_search": { + "description": "Enable native search", + "hint": "When enabled, uses xAI Chat Completions native Live Search for web queries (billed on demand). Only applies to xAI providers." + }, + "rerank_api_base": { + "description": "Rerank Model API Base URL", + "hint": "The full request URL is formed by combining the Base URL and a path suffix (defaults to /v1/rerank)." + }, + "rerank_api_suffix": { + "description": "API URL path suffix", + "hint": "Path appended to base_url, e.g. /v1/rerank. Leave empty to disable auto-append." + }, + "rerank_api_key": { + "description": "API Key", + "hint": "Leave empty if no API key is required." + }, + "rerank_model": { + "description": "Rerank model name" + }, + "return_documents": { + "description": "Return source documents in rerank results", + "hint": "Default is false to reduce network overhead." + }, + "instruct": { + "description": "Custom rerank task description", + "hint": "Only effective for qwen3-rerank models. Recommended to write in English." + }, + "nvidia_rerank_api_base": { + "description": "API Base URL" + }, + "nvidia_rerank_api_key": { + "description": "API Key" + }, + "nvidia_rerank_model": { + "description": "Rerank Model Name", + "hint": "Please refer to the NVIDIA Docs for the model name." + }, + "nvidia_rerank_model_endpoint": { + "description": "Custom Model Endpoint", + "hint": "Custom URL suffix endpoint, defaults to /reranking." + }, + "nvidia_rerank_truncate": { + "description": "Text Truncation Strategy", + "hint": "Whether to truncate the input to fit the model's maximum context length when the input text is too long." + }, + "tei_rerank_truncate": { + "description": "Truncate Long Text", + "hint": "Whether to automatically truncate input when it exceeds the model's maximum context length. Requires Truncation Direction when enabled." + }, + "tei_rerank_truncation_direction": { + "description": "Truncation Direction", + "hint": "Choose to truncate from the left or right side of the text. Only takes effect when Truncate Long Text is True." + }, + "tei_rerank_raw_scores": { + "description": "Return Raw Scores", + "hint": "If True, returns raw model logit scores (which may be negative) without sigmoid normalization. Default is False." + }, + "tei_rerank_return_text": { + "description": "Return Document Text in Results", + "hint": "If True, each result will include the original document text. Default is False to reduce network overhead." + }, + "launch_model_if_not_running": { + "description": "Auto-start model if not running", + "hint": "If the model is not running in Xinference, attempt to start it automatically. Recommended to disable in production." + }, + "modalities": { + "description": "Model capabilities", + "hint": "Modalities supported by the model. If the model does not support images, uncheck image.", + "labels": [ + "Text", + "Image", + "Audio", + "Tool use" + ] + }, + + "custom_headers": { + "description": "Custom request headers", + "hint": "Key/value pairs added here are sent by AstrBot as custom HTTP headers to the provider. Values must be strings." + }, + "ollama_disable_thinking": { + "description": "Disable thinking mode", + "hint": "Close Ollama thinking mode." + }, + "custom_extra_body": { + "description": "Custom request body parameters", + "hint": "Add extra parameters to requests, such as temperature, top_p, max_tokens, etc.", + "template_schema": { + "temperature": { + "description": "Temperature", + "hint": "Controls randomness, typically 0-2. Higher is more random.", + "name": "Temperature" + }, + "top_p": { + "description": "Top-p sampling", + "hint": "Nucleus sampling parameter, usually 0-1. Controls probability mass considered.", + "name": "Top-p" + }, + "max_tokens": { + "description": "Max tokens", + "hint": "Maximum number of generated tokens.", + "name": "Max Tokens" + }, + "max_output_tokens": { + "description": "Max output tokens", + "hint": "Maximum number of generated tokens.", + "name": "Max Output Tokens" + }, + "reasoning_effort": { + "description": "Reasoning effort", + "hint": "Controls the effort used by reasoning models. Supported values depend on the model.", + "name": "Reasoning Effort" + } + } + }, + "gpt_weights_path": { + "description": "GPT model file path", + "hint": "The .ckpt file. Use an absolute path without quotes. Leave empty to use the GPT_SoVITS built-in SoVITS model (recommended to change defaults in GPT_SoVITS)." + }, + "sovits_weights_path": { + "description": "SoVITS model file path", + "hint": "The .pth file. Use an absolute path without quotes. Leave empty to use the GPT_SoVITS built-in SoVITS model (recommended to change defaults in GPT_SoVITS)." + }, + "gsv_default_parms": { + "description": "GPT_SoVITS default parameters", + "hint": "Reference audio file path and text are required; other parameters are optional.", + "gsv_ref_audio_path": { + "description": "Reference audio file path", + "hint": "Required! Use an absolute path without quotes." + }, + "gsv_prompt_text": { + "description": "Reference audio text", + "hint": "Required! Provide the transcript of the reference audio." + }, + "gsv_prompt_lang": { + "description": "Reference audio text language", + "hint": "Language of the reference audio text; default is Chinese." + }, + "gsv_aux_ref_audio_paths": { + "description": "Auxiliary reference audio file paths", + "hint": "Auxiliary reference audio files; optional." + }, + "gsv_text_lang": { + "description": "Text language", + "hint": "Default is Chinese." + }, + "gsv_top_k": { + "description": "Speech diversity", + "hint": "" + }, + "gsv_top_p": { + "description": "Nucleus sampling threshold", + "hint": "" + }, + "gsv_temperature": { + "description": "Speech randomness", + "hint": "" + }, + "gsv_text_split_method": { + "description": "Text splitting method", + "hint": "Options: `cut0` no split, `cut1` split every 4 sentences, `cut2` split every 50 chars, `cut3` split by Chinese period, `cut4` split by English period, `cut5` split by punctuation." + }, + "gsv_batch_size": { + "description": "Batch size", + "hint": "" + }, + "gsv_batch_threshold": { + "description": "Batch threshold", + "hint": "" + }, + "gsv_split_bucket": { + "description": "Split text into buckets for parallel processing", + "hint": "" + }, + "gsv_speed_factor": { + "description": "Speech playback speed", + "hint": "1 is the original speed." + }, + "gsv_fragment_interval": { + "description": "Interval between speech segments", + "hint": "" + }, + "gsv_streaming_mode": { + "description": "Enable streaming mode", + "hint": "" + }, + "gsv_seed": { + "description": "Random seed", + "hint": "For reproducible results." + }, + "gsv_parallel_infer": { + "description": "Run inference in parallel", + "hint": "" + }, + "gsv_repetition_penalty": { + "description": "Repetition penalty", + "hint": "" + }, + "gsv_media_type": { + "description": "Output media type", + "hint": "Recommended: wav" + } + }, + "embedding_dimensions": { + "description": "Embedding dimensions", + "hint": "Embedding vector dimensions. May need adjustment per model; see model documentation. This must be correct or the vector database will not work." + }, + "embedding_dimensions_mode": { + "description": "Embedding dimensions mode", + "hint": "Controls whether to send the dimensions parameter in OpenAI-compatible embedding requests. auto sends it only for official OpenAI embedding-3 models; use always when a compatible API supports it, or never when it rejects the parameter." + }, + "embedding_model": { + "description": "Embedding model", + "hint": "Embedding model name." + }, + "embedding_api_key": { + "description": "API Key" + }, + "embedding_api_base": { + "description": "API Base URL" + }, + "openai_embedding": { + "hint": "If testing fails, try adding /v1 at the end for some OpenAI API versions." + }, + "gemini_embedding": { + "hint": "Gemini Embedding does not require manually adding /v1beta.", + "embedding_task_type_mode": { + "description": "Task type delivery mode", + "hint": "auto: pick by model generation (gemini-embedding-001 uses the task_type parameter, gemini-embedding-2 uses text prefixes); never: always use task_type; always: always use text prefixes." + }, + "embedding_query_task_type": { + "description": "Query-side task_type", + "hint": "Only applies in task_type mode. Use RETRIEVAL_QUERY for retrieval queries, CODE_RETRIEVAL_QUERY for code search." + }, + "embedding_document_task_type": { + "description": "Document-side task_type", + "hint": "Only applies in task_type mode. Use RETRIEVAL_DOCUMENT for stored documents, optionally with a title." + }, + "embedding_query_task_name": { + "description": "Query-side task prefix (gemini-embedding-2)", + "hint": "Only applies in text-prefix mode. One of: search result / question answering / fact checking / code retrieval. Invalid values fall back to search result." + }, + "embedding_document_title": { + "description": "Document title (gemini-embedding-2)", + "hint": "Falls back to title: none when empty. Note that knowledge base ingestion already prepends the document title to the text, so setting this repeats the title; usually leave empty." + } + }, + "dashscope_embedding": { + "hint": "Aliyun DashScope Embedding. Default base URL: https://dashscope.aliyuncs.com/api/v1." + }, + "volcengine_cluster": { + "description": "Volcengine cluster", + "hint": "For voice cloning models, choose volcano_icl or volcano_icl_concurr; default is volcano_tts." + }, + "volcengine_voice_type": { + "description": "Volcengine voice", + "hint": "Enter voice id (Voice_type)." + }, + "volcengine_speed_ratio": { + "description": "Speech rate", + "hint": "Speech rate, range 0.2 to 3.0, default 1.0." + }, + "volcengine_volume_ratio": { + "description": "Volume", + "hint": "Volume, range 0.0 to 2.0, default 1.0." + }, + "azure_tts_voice": { + "description": "Voice style", + "hint": "API voice name" + }, + "azure_tts_style": { + "description": "Style", + "hint": "A voice-specific speaking style. Can express emotions like happy, sympathetic, and calm." + }, + "azure_tts_role": { + "description": "Role (optional)", + "hint": "Speaking role-play. The voice can emulate different ages and genders without changing the voice name. For example, a male voice can raise pitch to simulate a female voice, but the voice name does not change. If the role is missing or unsupported, this attribute is ignored." + }, + "azure_tts_rate": { + "description": "Speech rate", + "hint": "Controls speaking rate. You can apply the rate at word or sentence level. Rate should be 0.5x to 2x of original audio." + }, + "azure_tts_volume": { + "description": "Speech volume", + "hint": "Controls volume level. You can apply changes at sentence level. Use 0.0 to 100.0 (quiet to loud, e.g., 75). Default is 100.0." + }, + "azure_tts_region": { + "description": "API region", + "hint": "Region where Azure TTS processes data. See https://learn.microsoft.com/zh-cn/azure/ai-services/speech-service/regions" + }, + "azure_tts_subscription_key": { + "description": "Service subscription key", + "hint": "Azure TTS subscription key (not a token)." + }, + "dashscope_tts_voice": { + "description": "Voice" + }, + "gm_resp_image_modal": { + "description": "Enable image modality", + "hint": "When enabled, responses can include images. Requires model support or it will error. See the Google Gemini website for supported models. Tip: if you need image generation, disable the `Enable member recognition` setting for better results." + }, + "gm_native_search": { + "description": "Enable native search", + "hint": "Only Gemini 3 and later models support using this together with function tools. For Gemini 3 and later, native search is only available on the paid tier; see the official docs for pricing." + }, + "gm_native_coderunner": { + "description": "Enable native code runner", + "hint": "Only Gemini 3 and later models support using this together with function tools." + }, + "gm_url_context": { + "description": "Enable URL context", + "hint": "Only Gemini 3 and later models support using this together with function tools." + }, + "gm_safety_settings": { + "description": "Safety filters", + "hint": "Set the safety filtering level for model input. Levels: NONE (no blocking), HIGH (block high risk), MEDIUM_AND_ABOVE (block medium risk and above), LOW_AND_ABOVE (block low risk and above). See Gemini API docs.", + "harassment": { + "description": "Harassment", + "hint": "Negative or harmful comments" + }, + "hate_speech": { + "description": "Hate speech", + "hint": "Rude, disrespectful, or profane content" + }, + "sexually_explicit": { + "description": "Sexually explicit content", + "hint": "References to sexual acts or other obscene content" + }, + "dangerous_content": { + "description": "Dangerous content", + "hint": "Content that promotes, encourages, or assists harmful behavior" + } + }, + "gm_thinking_config": { + "description": "Thinking Config", + "budget": { + "description": "Thinking Budget", + "hint": "Guides the model on the specific number of thinking tokens to use for reasoning. See: https://ai.google.dev/gemini-api/docs/thinking#set-budget" + }, + "level": { + "description": "Thinking Level", + "hint": "Recommended for Gemini 3 models and onwards, lets you control reasoning behavior.See: https://ai.google.dev/gemini-api/docs/thinking#thinking-levels" + } + }, + "anth_thinking_config": { + "description": "Thinking Config", + "type": { + "description": "Thinking Type", + "hint": "Set 'adaptive' for Opus 4.6+ / Sonnet 4.6+ (recommended). Leave empty to use manual budget mode. See: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking" + }, + "budget": { + "description": "Thinking Budget", + "hint": "Anthropic thinking.budget_tokens param. Must >= 1024. Only used when type is empty. Deprecated on Opus 4.6 / Sonnet 4.6. See: https://platform.claude.com/docs/en/build-with-claude/extended-thinking" + }, + "effort": { + "description": "Effort Level", + "hint": "Controls thinking depth when type is 'adaptive'. 'high' is the default. 'max' is Opus 4.6 only. See: https://platform.claude.com/docs/en/build-with-claude/effort" + } + }, + "minimax-group-id": { + "description": "User group", + "hint": "Visible in Account Management -> Basic Info." + }, + "minimax-langboost": { + "description": "Target language/dialect", + "hint": "Enhances recognition for specified languages/dialects and improves speech performance in those scenarios." + }, + "minimax-voice-speed": { + "description": "Speech rate", + "hint": "Speech speed for synthesis, range [0.5, 2], default 1.0. Higher is faster." + }, + "minimax-voice-vol": { + "description": "Volume", + "hint": "Volume for synthesis, range (0, 10], default 1.0. Higher is louder." + }, + "minimax-voice-pitch": { + "description": "Pitch", + "hint": "Pitch for synthesis, range [-12, 12], default 0." + }, + "minimax-is-timber-weight": { + "description": "Enable mixed voices", + "hint": "Enable mixing up to four voices with custom weights. When enabled, single voice settings are ignored." + }, + "minimax-timber-weight": { + "description": "Mixed voices", + "hint": "Mixed voices and their weights. Up to four voices, integer weights in [1, 100]. Get presets and templates from the official API TTS debug console. Must be a JSON string; check the console to confirm parsing. See defaults and the official code preview for structure." + }, + "minimax-voice-id": { + "description": "Single voice", + "hint": "Single voice ID; see the official documentation." + }, + "minimax-voice-emotion": { + "description": "Emotion", + "hint": "Controls emotion of synthesized speech. When set to auto, it selects emotion based on text." + }, + "minimax-voice-latex": { + "description": "Read LaTeX formulas", + "hint": "Read LaTeX formulas, but ensure input text is formatted per the official requirements." + }, + "minimax-voice-english-normalization": { + "description": "English text normalization", + "hint": "Improves number-reading performance but slightly increases latency." + }, + "rag_options": { + "description": "RAG options", + "hint": "Knowledge base retrieval settings, optional. Only supported for Agent app types (agent apps, including RAG apps). For Bailian apps, enabling this disables multi-turn conversations.", + "pipeline_ids": { + "description": "Knowledge base ID list", + "hint": "Retrieve all documents in the specified knowledge bases. Go to https://bailian.console.aliyun.com/ Data Apps -> Knowledge Index to create and get IDs." + }, + "file_ids": { + "description": "Unstructured document IDs", + "hint": "Retrieve specified unstructured documents. Go to https://bailian.console.aliyun.com/ Data Management to create and get IDs." + }, + "output_reference": { + "description": "Output knowledge base/document references", + "hint": "Append reference sources to the end of each answer. Default is False." + } + }, + "sensevoice_hint": { + "description": "Deploy SenseVoice", + "hint": "Before enabling, install funasr, funasr_onnx, torchaudio, torch, modelscope, and jieba (CPU by default, about 1 GB download), and install ffmpeg. Otherwise STT will not work." + }, + "is_emotion": { + "description": "Emotion recognition", + "hint": "Enable emotion recognition. happy?sad?angry?neutral?fearful?disgusted?surprised?unknown" + }, + "stt_model": { + "description": "Model name", + "hint": "Model name on modelscope. Default: iic/SenseVoiceSmall." + }, + "variables": { + "description": "Workflow fixed input variables", + "hint": "Optional. Fixed workflow input variables are used as workflow inputs. You can also set variables dynamically with /set during a chat. If names conflict, dynamic settings take precedence." + }, + "dashscope_app_type": { + "description": "App type", + "hint": "Bailian app type." + }, + "timeout": { + "description": "Timeout", + "hint": "Timeout in seconds." + }, + "openai-tts-voice": { + "description": "voice", + "hint": "OpenAI TTS voice. OpenAI defaults: 'alloy', 'echo', 'fable', 'onyx', 'nova', 'shimmer'." + }, + "elevenlabs-tts-voice-id": { + "description": "Voice ID", + "hint": "ElevenLabs voice ID. Browse and copy voice IDs at https://elevenlabs.io/app/voice-library. Default 'JBFqnCBsd6RMkjVDRZzb' (George)." + }, + "elevenlabs-tts-output-format": { + "description": "Output format", + "hint": "Audio output format, e.g. 'mp3_44100_128', 'mp3_22050_32', 'wav_44100', or 'opus_48000_128'. Raw PCM/u-law/a-law formats are not supported. Default 'mp3_44100_128'." + }, + "elevenlabs-tts-stability": { + "description": "Stability", + "hint": "Voice stability, range [0, 1]. Higher is more consistent, lower is more expressive. Leave empty to use the server default." + }, + "elevenlabs-tts-similarity-boost": { + "description": "Similarity boost", + "hint": "How closely the output matches the original voice, range [0, 1]. Leave empty to use the server default." + }, + "elevenlabs-tts-style": { + "description": "Style exaggeration", + "hint": "Style exaggeration of the voice, range [0, 1]. Higher values increase latency. Leave empty to use the server default." + }, + "elevenlabs-tts-use-speaker-boost": { + "description": "Speaker boost", + "hint": "Boost similarity to the original speaker. May slightly increase latency." + }, + "mimo-tts-voice": { + "description": "Voice", + "hint": "MiMo TTS voice name. Supported values include 'mimo_default', 'default_en', and 'default_zh'." + }, + "mimo-tts-format": { + "description": "Output format", + "hint": "Audio format generated by MiMo TTS. Supported values: 'wav', 'mp3', and 'pcm'." + }, + "mimo-tts-style-prompt": { + "description": "Style prompt", + "hint": "Prepended to the synthesis target text as a tag to control speed, emotion, character, or style, such as happy, faster, Sun Wukong, or whispering. Optional." + }, + "mimo-tts-dialect": { + "description": "Dialect", + "hint": "Combined with the style prompt inside the leading tag, for example Northeastern Mandarin, Sichuan dialect, Henan dialect, or Cantonese. Optional." + }, + "mimo-tts-seed-text": { + "description": "Seed text", + "hint": "Sent as an optional user message to help guide tone and speaking style. It is not appended to the synthesis target text." + }, + "fishaudio-tts-character": { + "description": "character", + "hint": "Fishaudio TTS character. Default is Klee. More roles: https://fish.audio/zh-CN/discovery" + }, + "fishaudio-tts-reference-id": { + "description": "reference_id", + "hint": "Fishaudio TTS reference model ID (optional). If set, the model ID is used directly instead of looking up by role name. Example: 626bb6d3f3364c9cbc3aa6a67300a664. More models: https://fish.audio/zh-CN/discovery; open a model detail page to copy the model ID." + }, + "whisper_hint": { + "description": "Notes for local Whisper deployment", + "hint": "Before enabling, install the openai-whisper library (NVIDIA users download ~2GB mainly for torch and cuda; CPU users download ~1GB), and install ffmpeg. Otherwise STT will not work." + }, + "whisper_device": { + "description": "Inference device", + "hint": "Whisper inference device. Apple Silicon can use mps; other environments should use cpu. If mps is selected but unavailable, AstrBot will fall back to cpu." + }, + "id": { + "description": "ID" + }, + "type": { + "description": "Provider category" + }, + "provider_type": { + "description": "Provider capability type" + }, + "enable": { + "description": "Enable" + }, + "key": { + "description": "API Key" + }, + "api_base": { + "description": "API Base URL" + }, + "total_timeout": { + "description": "Total timeout", + "hint": "Total timeout in seconds for one decision request, including concurrency-slot wait, retries, and backoff; default 5 seconds." + }, + "max_concurrency": { + "description": "Maximum concurrency", + "hint": "Maximum number of simultaneous decision requests for this provider; default 4." + }, + "proxy": { + "description": "Proxy address", + "hint": "HTTP/HTTPS proxy URL, e.g. http://127.0.0.1:7890. Applies only to this provider's API requests and does not affect Docker internal networking." + }, + "model": { + "description": "Model ID", + "hint": "Model name, e.g., gpt-4o-mini, deepseek-chat." + }, + "max_context_tokens": { + "description": "Model context window size", + "hint": "Maximum context tokens. If 0, it auto-fills from model metadata (if available); you can also edit manually." + }, + "dify_api_key": { + "description": "API Key", + "hint": "Dify API Key. This field is required." + }, + "dify_api_base": { + "description": "API Base URL", + "hint": "Dify API Base URL. Default: https://api.dify.ai/v1" + }, + "dify_api_type": { + "description": "Dify app type", + "hint": "Dify API type. According to Dify docs, supported types are chat, chatflow, agent, workflow." + }, + "dify_workflow_output_key": { + "description": "Dify workflow output variable name", + "hint": "Dify workflow output variable name. Only used when app type is workflow. Default: astrbot_wf_output." + }, + "dify_query_input_key": { + "description": "Prompt input variable name", + "hint": "Input variable name for the message text. Default: astrbot_text_query." + }, + "coze_api_key": { + "description": "Coze API Key", + "hint": "Coze API key for accessing Coze services." + }, + "bot_id": { + "description": "Bot ID", + "hint": "Coze bot ID, obtained after creating a bot on the Coze platform." + }, + "coze_api_base": { + "description": "API Base URL", + "hint": "Base URL for the Coze API. Default: https://api.coze.cn" + }, + "deerflow_api_base": { + "description": "API Base URL", + "hint": "DeerFlow API gateway URL. Default: http://127.0.0.1:2026" + }, + "deerflow_api_key": { + "description": "DeerFlow API Key", + "hint": "Optional. Fill this if your DeerFlow gateway is protected by Bearer auth." + }, + "deerflow_auth_header": { + "description": "Authorization Header", + "hint": "Optional. Custom Authorization header value; takes precedence over DeerFlow API Key." + }, + "deerflow_assistant_id": { + "description": "Assistant ID", + "hint": "LangGraph assistant_id, default is lead_agent." + }, + "deerflow_model_name": { + "description": "Model name override", + "hint": "Optional. Overrides DeerFlow default model (maps to runtime context model_name)." + }, + "deerflow_thinking_enabled": { + "description": "Enable thinking mode" + }, + "deerflow_plan_mode": { + "description": "Enable plan mode", + "hint": "Maps to DeerFlow is_plan_mode." + }, + "deerflow_subagent_enabled": { + "description": "Enable subagent", + "hint": "Maps to DeerFlow subagent_enabled." + }, + "deerflow_max_concurrent_subagents": { + "description": "Max concurrent subagents", + "hint": "Maps to DeerFlow max_concurrent_subagents. Effective only when subagent is enabled. Default: 3." + }, + "deerflow_recursion_limit": { + "description": "Recursion limit", + "hint": "Maps to LangGraph recursion_limit." + }, + "auto_save_history": { + "description": "Conversation history managed by Coze", + "hint": "When enabled, Coze manages conversation history. AstrBot's locally saved context will not take effect (read-only), and operations on AstrBot context will not apply. If disabled, AstrBot manages the context." + } + } + }, + "help": { + "documentation": "Official Documentation", + "support": "Join Support Group", + "helpText": "Don't understand the configuration? See {documentation} or {support}.", + "helpPrefix": "Don't understand the configuration? See", + "helpMiddle": "or", + "helpSuffix": "." + } +} diff --git a/dashboard/src/i18n/locales/zh-CN/features/config-metadata.json b/dashboard/src/i18n/locales/zh-CN/features/config-metadata.json index 6e8b16e7ddf..bb07afc86e9 100644 --- a/dashboard/src/i18n/locales/zh-CN/features/config-metadata.json +++ b/dashboard/src/i18n/locales/zh-CN/features/config-metadata.json @@ -1,2095 +1,2115 @@ -{ - "ai_group": { - "name": "AI", - "agent_runner": { - "description": "Agent 执行方式", - "hint": "选择 AI 对话的执行器。切换执行器会使用新类型的默认配置,不保留上一类型的参数。", - "provider_settings": { - "enable": { - "description": "启用", - "hint": "AI 对话总开关" - } - }, - "agent_runner": { - "runner_type": { - "description": "执行器", - "labels": [ - "内置 Agent", - "Dify", - "Coze", - "阿里云百炼应用", - "DeerFlow" - ] - } - } - }, - "dify_runner": { - "description": "Dify 配置", - "agent_runner": { - "config": { - "dify_api_type": { "description": "应用类型" }, - "dify_api_key": { "description": "API Key" }, - "dify_api_base": { "description": "API Base URL" }, - "dify_workflow_output_key": { "description": "Workflow 输出变量名" }, - "dify_query_input_key": { "description": "Prompt 输入变量名" }, - "variables": { "description": "变量" }, - "timeout": { "description": "超时时间(秒)" }, - "proxy": { "description": "代理地址" } - } - } - }, - "coze_runner": { - "description": "Coze 配置", - "agent_runner": { - "config": { - "coze_api_key": { "description": "API Key" }, - "bot_id": { "description": "Bot ID" }, - "coze_api_base": { "description": "API Base URL" }, - "auto_save_history": { "description": "由 Coze 管理对话记录" }, - "timeout": { "description": "超时时间(秒)" }, - "proxy": { "description": "代理地址" } - } - } - }, - "dashscope_runner": { - "description": "阿里云百炼应用配置", - "agent_runner": { - "config": { - "dashscope_app_type": { "description": "应用类型" }, - "dashscope_api_key": { "description": "API Key" }, - "dashscope_app_id": { "description": "应用 ID" }, - "rag_options": { - "pipeline_ids": { "description": "知识库 Pipeline ID" }, - "file_ids": { "description": "文件 ID" }, - "output_reference": { "description": "输出引用" } - }, - "variables": { "description": "变量" }, - "timeout": { "description": "超时时间(秒)" }, - "proxy": { "description": "代理地址" } - } - } - }, - "deerflow_runner": { - "description": "DeerFlow 配置", - "agent_runner": { - "config": { - "deerflow_api_base": { "description": "API Base URL" }, - "deerflow_api_key": { "description": "API Key" }, - "deerflow_auth_header": { "description": "Authorization Header" }, - "deerflow_assistant_id": { "description": "Assistant ID" }, - "deerflow_model_name": { "description": "模型名称覆盖" }, - "deerflow_thinking_enabled": { "description": "启用思考模式" }, - "deerflow_plan_mode": { "description": "启用计划模式" }, - "deerflow_subagent_enabled": { "description": "启用子智能体" }, - "deerflow_max_concurrent_subagents": { "description": "子智能体最大并发数" }, - "deerflow_recursion_limit": { "description": "递归深度上限" }, - "timeout": { "description": "超时时间(秒)" }, - "proxy": { "description": "代理地址" } - } - } - }, - "ai": { - "description": "模型", - "hint": "配置内置 Agent 使用的对话模型,以及通用的图片转述、语音模型。", - "agent_runner": { - "config": { - "model": { - "provider_id": { - "description": "对话模型", - "hint": "留空时使用第一个模型" - }, - "fallback_provider_ids": { - "description": "回退对话模型", - "hint": "主对话模型请求失败时,按顺序切换到这些对话模型。" - }, - "request_max_retries": { - "description": "异常重试次数", - "hint": "单次模型请求遇到可重试错误时的最大尝试次数。" - } - } - } - }, - "provider_settings": { - "default_image_caption_provider_id": { - "description": "图片转述模型", - "hint": "当对话模型不支持图片输入时,调用图片转述模型来获得图片描述。留空代表不使用。" - }, - "image_caption_prompt": { - "description": "图片转述提示词", - "hint": "用于图片转述模型的提示词。" - } - }, - "provider_stt_settings": { - "enable": { - "description": "语音识别", - "hint": "使用语音转文字模型将用户语音转述为文本,方便模型理解。" - }, - "provider_id": { - "description": "默认语音转文本模型", - "hint": "也可使用 /provider 指令单独选择会话的模型。" - } - }, - "provider_tts_settings": { - "enable": { - "description": "语音回复", - "hint": "使用文字转语音模型将文字转为语音回复。" - }, - "provider_id": { - "description": "默认文本转语音模型", - "hint": "也可使用 /provider 指令单独选择会话的模型。" - }, - "trigger_probability": { - "description": "TTS 触发概率", - "hint": "采用随机概率触发语音回复。" - } - } - }, - "persona": { - "description": "人格", - "hint": "赋予 AstrBot 人格。", - "agent_runner": { - "config": { - "persona": { - "persona_id": { "description": "默认采用的人格" }, - "safety_mode": { - "description": "健康模式", - "hint": "引导模型输出健康、安全的内容,避免有害或敏感话题。" - }, - "safety_mode_strategy": { - "description": "健康模式策略", - "hint": "选择健康模式的实现策略。" - } - } - } - } - }, - "knowledgebase": { - "description": "知识库", - "hint": "AstrBot 的 “外置大脑”。", - "kb_names": { - "description": "知识库列表", - "hint": "支持多选" - }, - "kb_fusion_top_k": { - "description": "融合检索结果数", - "hint": "多个知识库检索结果融合后的返回结果数量" - }, - "kb_final_top_k": { - "description": "最终返回结果数", - "hint": "从知识库中检索到的结果数量,越大可能获得越多相关信息,但也可能引入噪音。建议根据实际需求调整" - }, - "kb_agentic_mode": { - "description": "Agentic 知识库检索", - "hint": "启用后,知识库检索将作为 LLM Tool,由模型自主决定何时调用知识库进行查询。需要模型支持函数调用能力。" - } - }, - "websearch": { - "description": "网页搜索", - "hint": "让 AstrBot 能够访问互联网,获悉时讯。", - "provider_settings": { - "web_search": { - "description": "启用网页搜索" - }, - "websearch_provider": { - "description": "网页搜索提供商", - "labels": [ - "SerpApi", - "DeepSeek Search API", - "Tavily", - "Baidu AI Search", - "Bocha", - "Brave", - "Firecrawl", - "Exa", - "AnySearch" - ], - "subtitles": [ - "Google 网页、新闻、图片、学术和财经搜索", - "DeepSeek 官方搜索接口", - "", - "", - "", - "", - "", - "", - "" - ] - }, - "websearch_tavily_key": { - "description": "Tavily API Key", - "hint": "可添加多个 Key 进行轮询。" - }, - "websearch_bocha_key": { - "description": "BoCha API Key", - "hint": "可添加多个 Key 进行轮询。" - }, - "websearch_brave_key": { - "description": "Brave Search API Key", - "hint": "可添加多个 Key 进行轮询。" - }, - "websearch_firecrawl_key": { - "description": "Firecrawl API Key", - "hint": "可添加多个 Key 进行轮询。" - }, - "websearch_baidu_app_builder_key": { - "description": "百度千帆智能云 APP Builder API Key", - "hint": "参考:[https://console.bce.baidu.com/iam/#/iam/apikey/list](https://console.bce.baidu.com/iam/#/iam/apikey/list)" - }, - "web_search_link": { - "description": "显示来源引用" - }, - "websearch_exa_key": { - "description": "Exa API Key", - "hint": "可添加多个 Key 进行轮询。获取 Key: https://dashboard.exa.ai" - }, - "websearch_anysearch_key": { - "description": "AnySearch API Key", - "hint": "可添加多个 Key 进行轮询。留空则使用匿名模式(每日免费额度)。" - }, - "websearch_serpapi_key": { - "description": "SerpApi API Key", - "hint": "支持 Google 网页、新闻、图片、学术和财经搜索。可添加多个 Key 轮询。获取 Key:[https://serpapi.com/manage-api-key](https://serpapi.com/manage-api-key)" - }, - "websearch_deepseek_key": { - "description": "DeepSeek API Key", - "hint": "填入 DeepSeek API Key。可使用与对话模型相同的 Key(需独立填写)。可添加多个 Key 轮询。 获取 Key: [https://platform.deepseek.com/api_keys](https://platform.deepseek.com/api_keys)" - } - } - }, - "file_extract": { - "description": "文档解析能力", - "provider_settings": { - "file_extract": { - "enable": { - "description": "启用文档解析能力" - }, - "provider": { - "description": "文档解析提供商" - }, - "moonshotai_api_key": { - "description": "Moonshot AI API Key" - } - } - } - }, - "agent_computer_use": { - "description": "使用电脑能力", - "hint": "让 AstrBot 访问和使用本机环境或者隔离的沙盒环境,以执行更复杂的任务。详见: [Agent 沙盒环境](https://docs.astrbot.app/use/astrbot-agent-sandbox.html)。", - "provider_settings": { - "computer_use_runtime": { - "description": "运行环境", - "hint": "允许 Agent 访问的环境。", - "labels": ["不允许任何环境", "本机环境", "第三方沙箱环境"] - }, - "computer_use_local_permissions": { - "description": "本地权限策略" - }, - "computer_use_require_admin": { - "description": "沙箱能力需要 AstrBot 管理员权限", - "hint": "开启后,需要 AstrBot 管理员权限才能调用远程沙箱能力。在配置文件 -> 访问控制 -> 管理员 -> 管理员 ID 中可添加管理员。给机器人发送 /sid 指令以获取 ID。" - }, - "sandbox": { - "booter": { - "description": "沙箱环境驱动器" - }, - "shipyard_neo_endpoint": { - "description": "Shipyard Neo API Endpoint", - "hint": "Shipyard Neo(Bay) 服务的 API 地址,默认 http://127.0.0.1:8114。" - }, - "shipyard_neo_access_token": { - "description": "Shipyard Neo 访问令牌", - "hint": "Bay 的 API Key(sk-bay-...)。留空时自动从 credentials.json 发现。" - }, - "shipyard_neo_profile": { - "description": "Shipyard Neo Profile", - "hint": "Shipyard Neo 沙箱 profile,例如 python-default。留空时自动选择能力更完整的 profile。" - }, - "shipyard_neo_ttl": { - "description": "Shipyard Neo Sandbox 存活时间(秒)", - "hint": "Shipyard Neo 沙箱的生存时间(秒)。" - }, - "cua_image": { - "description": "CUA 镜像", - "hint": "CUA 沙箱镜像/系统类型,默认 linux。可填写 linux、macos、windows、android,具体取决于 CUA SDK 支持。" - }, - "cua_os_type": { - "description": "CUA 操作系统类型", - "hint": "CUA 沙箱操作系统类型,默认 linux。" - }, - "cua_idle_timeout": { - "description": "CUA 空闲超时(秒)", - "hint": "CUA 沙箱空闲超时时间(秒)。大于 0 时,AstrBot 会在会话空闲达到该时长后主动关闭 CUA 沙箱;0 表示禁用。" - }, - "cua_telemetry_enabled": { - "description": "CUA 遥测", - "hint": "是否允许 CUA SDK 发送遥测数据。默认关闭。" - }, - "cua_local": { - "description": "CUA 本地沙箱", - "hint": "是否优先使用 CUA 本地沙箱。默认开启,避免云端沙箱要求 CUA_API_KEY。关闭后可使用 CUA 云端沙箱。" - }, - "cua_api_key": { - "description": "CUA API Key", - "hint": "CUA 云端沙箱 API Key。仅在关闭本地沙箱时需要。也可以通过 CUA_API_KEY 环境变量提供。" - }, - "shipyard_endpoint": { - "description": "Shipyard API Endpoint", - "hint": "Shipyard 服务的 API 访问地址。" - }, - "shipyard_access_token": { - "description": "Shipyard 访问令牌", - "hint": "用于访问 Shipyard 服务的访问令牌。" - }, - "shipyard_ttl": { - "description": "Shipyard Ship 存活时间(秒)", - "hint": "Shipyard 会话的生存时间(秒)。" - }, - "shipyard_max_sessions": { - "description": "Shipyard Ship 会话复用上限", - "hint": "决定了一个实例承载的最大会话数量。" - } - } - }, - "local_permissions": { - "role": "用户身份", - "execution": "允许执行代码", - "network": "允许执行环境联网", - "filesystem": "文件访问范围", - "scopes": { - "workspace": "工作区", - "host": "整个环境" - }, - "scopeHints": { - "none": "不允许访问任何文件", - "workspace": "受限的工作区、临时目录和技能文件。", - "workspaceUnsupported": "当前系统不支持受限工作区文件访问。", - "host": "AstrBot 所在运行环境的所有文件。" - }, - "scopeDetails": { - "account": "1. 可访问 AstrBot 运行账户有权限访问的文件。", - "docker": "2. 如果通过 Docker 部署,则仅可访问容器内及挂载的文件,并非宿主机全部文件。" - }, - "roles": { - "member": "普通成员", - "admin": "管理员" - }, - "modes": { - "none": "关闭" - }, - "networkAlwaysOn": "始终开启", - "windowsHostNetworkHint": "Windows 暂不支持在“整个环境”执行代码时单独禁网。切换到“工作区”后可关闭联网。", - "runtimeUnknown": "运行环境信息不可用。", - "memberWarning": "普通成员已获得联网或整个环境访问权限。", - "executionInactive": "未生效", - "executionInactiveHelp": "查看未生效原因", - "executionBlocked": "{role}已开启代码执行,但当前无法满足所配置的隔离限制。原因:{reason}", - "runtime": { - "os": "操作系统", - "arch": "架构", - "sandbox": "本地隔离", - "windowsUnavailable": "{backend} · 尚未就绪", - "windowsSetupHint": "请保存配置并重启 AstrBot;如出现管理员授权提示,请允许以完成沙盒初始化。", - "errorDetails": "查看诊断详情", - "unavailableHint": "沙箱启动失败,受限 Shell/Python 执行及工作区文件搜索会受到影响。请根据下方错误检查系统安全策略(如 Linux 的 AppArmor、用户命名空间限制)或容器限制,修复后重启 AstrBot 重新检测。", - "dialog": { - "intro": "利用 macOS 的 Seatbelt 或 Linux 的 bubblewrap(bwrap)技术,为 AstrBot Agent 的执行提供安全隔离,以限制不同用户使用 AstrBot Agent 时的文件访问范围和联网权限,获得更高的安全性。", - "startupError": "查看启动错误", - "documentation": "查看详细配置文档" - }, - "close": "关闭", - "setupHint": { - "missing": "安装 {dependency} 以获得完整的本地隔离功能。", - "unavailable": "配置 {backend},启用完整的本地隔离功能。", - "unsupported": "了解本地隔离支持情况。" - }, - "isolationFailure": { - "missing": "缺少 {dependency}。", - "unavailable": "{backend} 启动探测失败。", - "unsupported": "当前系统不支持本地进程隔离。" - }, - "executionUnavailable": { - "missing": "缺少 {dependency},无法在“文件访问范围”选择“工作区”时允许执行代码。", - "unavailable": "{backend} 无法启动,无法在“文件访问范围”选择“工作区”时允许执行代码。", - "unsupported": "当前系统不支持本地隔离,无法在“文件访问范围”选择“工作区”时允许执行代码。" - }, - "status": { - "detected": "{backend}", - "missing": "缺少 {dependency}", - "unavailable": "{backend} · 已安装但无法启动", - "unsupported": "暂不支持" - } - } - } - }, - "proactive_capability": { - "description": "主动型能力", - "hint": "让 AstrBot 能够在某一时刻自动唤醒,帮你完成任务。详见: [主动型 Agent](https://docs.astrbot.app/use/proactive-agent.html)。", - "provider_settings": { - "proactive_capability": { - "add_cron_tools": { - "description": "启用", - "hint": "启用后,将会传递给 Agent 相关工具来实现主动型 Agent。你可以告诉 AstrBot 未来某个时间要做的事情,它将被定时触发然后执行任务,然后将结果发送给你。" - } - } - } - }, - "truncate_and_compress": { - "hint": "AstrBot 如何管理工作记忆。详见: [上下文管理策略](https://docs.astrbot.app/use/context-compress.html)。", - "description": "上下文管理策略", - "agent_runner": { - "config": { - "compression": { - "max_turns": { - "description": "压缩前最多保留对话轮数", - "hint": "普通会话历史超过该轮数后,才会按下方策略进行持久化截断或 LLM 压缩;请求发送前也会先按该值约束上下文。-1 表示不按轮数限制。" - }, - "trim_turns": { - "description": "轮次超限时一次丢弃轮数", - "hint": "当超过\"压缩前最多保留对话轮数\"且无法使用 LLM 压缩时,一次丢弃多少轮旧对话;请求期截断也会复用该值。" - }, - "overflow_strategy": { - "description": "压缩策略", - "labels": ["按对话轮数截断", "由 LLM 压缩上下文"], - "hint": "模型上下文超限时的处理策略。" - }, - "instruction": { - "description": "上下文压缩提示词", - "hint": "如果为空则使用默认提示词。" - }, - "keep_recent_ratio": { - "description": "压缩时保留最近上下文比例", - "hint": "按当前上下文 token 数保留最近内容,范围 0-0.3。0.15 表示保留 15%;比例大于 0 时至少保留最后一轮。" - }, - "provider_id": { - "description": "压缩模型", - "hint": "用于上下文压缩的模型。默认选择当前的对话模型。" - }, - "fallback_max_tokens": { - "description": "上下文窗口兜底值", - "hint": "当 max_context_tokens 为 0 且模型不在内置元数据中时,使用此值作为上下文窗口大小。默认 128000。" - } - } - } - } - }, - "others": { - "description": "其他配置", - "agent_runner": { - "config": { - "misc": { - "max_steps": { "description": "工具调用轮数上限" }, - "tool_schema_mode": { - "description": "工具调用模式", - "hint": "skills-like 先下发工具名称与描述,再下发参数;full 一次性下发完整参数。", - "labels": ["Skills-like(两阶段)", "Full(完整参数)"] - }, - "tool_call_timeout": { - "description": "工具调用超时时间(秒)" - }, - "sanitize_context_by_modalities": { - "description": "按模型能力清理历史上下文", - "hint": "开启后,在每次请求 LLM 前会按当前模型提供商中所选择的模型能力删除对话中不支持的图片/工具调用结构(会改变模型看到的历史)" - } - } - } - }, - "provider_settings": { - "display_reasoning_text": { - "description": "显示思考内容", - "hint": "显示模型的思维链信息到最终回复中。" - }, - "identifier": { - "description": "用户识别", - "hint": "在用户提示词前带上用户 ID 信息。" - }, - "group_name_display": { - "description": "显示群名称", - "hint": "在受支持的消息平台的群聊中的用户提示词前带上群名称信息。" - }, - "datetime_system_prompt": { - "description": "现实世界时间感知", - "hint": "在用户提示词中带上当前的时间信息。" - }, - "show_tool_use_status": { - "description": "输出工具调用信息", - "hint": "有工具调用时,同时发送带有工具调用名字的消息。" - }, - "show_tool_call_result": { - "description": "输出工具调用结果", - "hint": "仅在启用“输出工具调用信息”时生效,且最多展示 70 个字符。" - }, - "buffer_intermediate_messages": { - "description": "合并 Agent 中间消息", - "hint": "开启后,非流式模式下多步工具调用过程中产生的中间文本将缓冲,待 Agent 完成后合并为一条回复发送。" - }, - "max_quoted_fallback_images": { - "description": "转发消息中图片获取上限", - "hint": "转发消息解析到的图片最多注入数量,超出部分会截断。" - }, - "quoted_message_parser": { - "max_component_chain_depth": { - "description": "转发消息富文本解析深度", - "hint": "解析转发消息中的富文本组件链时允许的最大递归深度。" - }, - "max_forward_node_depth": { - "description": "转发消息嵌套解析深度", - "hint": "解析嵌套转发节点时允许的最大递归深度。" - }, - "max_forward_fetch": { - "description": "转发消息递归拉取上限", - "hint": "递归调用 get_forward_msg 拉取转发内容的最大次数。" - }, - "warn_on_action_failure": { - "description": "转发消息解析失败告警", - "hint": "开启后,get_msg/get_forward_msg 全部尝试失败时输出 warning 日志。" - } - }, - "streaming_response": { - "description": "流式输出", - "hint": "在受支持的聊天平台中以打字机的形式输出响应。" - }, - "unsupported_streaming_strategy": { - "description": "不支持流式回复的平台", - "hint": "选择在不支持流式回复的平台上的处理方式。实时分段回复会在系统接收流式响应检测到诸如标点符号等分段点时,立即发送当前已接收的内容", - "labels": [ - "实时分段回复", - "关闭流式回复" - ] - }, - "wake_prefix": { - "description": "额外唤醒前缀", - "hint": "如果唤醒前缀为 /, 额外聊天唤醒前缀为 chat,则需要 /chat 才会触发 LLM 请求" - }, - "prompt_prefix": { - "description": "用户提示词", - "hint": "可使用 {{prompt}} 作为用户输入的占位符。如果不输入占位符则代表添加在用户输入的前面。" - }, - "image_compress_options": { - "description": "模型输入图片设置", - "hint": "图片始终处理为严格小于 512 KiB 的 JPEG/PNG,原始附件保留。", - "max_size": { - "description": "输入图片最大边长", - "hint": "发送给模型的图片最长边(像素),系统会在必要时进一步压缩。" - } - }, - "reachability_check": { - "description": "提供商可达性检测", - "hint": "/provider 命令列出模型时并发检测连通性。开启后会主动调用模型测试连通性,可能产生额外 token 消耗。" - } - }, - "provider_tts_settings": { - "dual_output": { - "description": "开启 TTS 时同时输出语音和文字内容" - } - } - } - }, - "platform_group": { - "name": "平台与消息", - "platform": { - "description": "消息平台适配器", - "app_id": { - "description": "应用 ID", - "hint": "消息平台开放平台中的应用 ID。" - }, - "app_secret": { - "description": "应用密钥", - "hint": "消息平台开放平台中的应用密钥。请妥善保管,避免泄露。" - }, - "domain": { - "description": "开放平台 API 地址", - "hint": "开放平台 API 的基础地址。使用默认官方服务时通常无需修改。" - }, - "corpid": { - "description": "企业 ID", - "hint": "企业微信后台中的企业 ID(CorpID)。" - }, - "token": { - "description": "回调 Token", - "hint": "消息平台回调配置中用于验证请求的 Token。" - }, - "encoding_aes_key": { - "description": "消息加密密钥", - "hint": "消息平台回调配置中的 EncodingAESKey,用于加密和解密消息。" - }, - "api_base_url": { - "description": "API 基础地址", - "hint": "消息平台 API 的基础地址。使用默认官方服务时通常无需修改。" - }, - "client_id": { - "description": "客户端 ID", - "hint": "消息平台开放平台中的客户端 ID。" - }, - "client_secret": { - "description": "客户端密钥", - "hint": "消息平台开放平台中的客户端密钥。请妥善保管,避免泄露。" - }, - "start_message": { - "description": "Start 命令回复", - "hint": "用户向 Telegram 机器人发送 /start 命令时回复的内容。" - }, - "telegram_api_base_url": { - "description": "API 地址", - "hint": "Telegram Bot API 的基础地址。使用官方服务时通常无需修改。" - }, - "telegram_file_base_url": { - "description": "文件 API 地址", - "hint": "Telegram Bot API 文件下载接口的基础地址。使用官方服务时通常无需修改。" - }, - "bot_token": { - "description": "Slack Bot Token", - "hint": "Slack 应用的 Bot User OAuth Token,通常以 xoxb- 开头。" - }, - "app_token": { - "description": "Slack App Token", - "hint": "Slack Socket Mode 使用的 App-Level Token,通常以 xapp- 开头。" - }, - "signing_secret": { - "description": "Slack Signing Secret", - "hint": "Slack 应用的 Signing Secret,用于验证 Webhook 请求。" - }, - "channel_access_token": { - "description": "LINE 频道访问令牌", - "hint": "LINE Messaging API 频道的 Channel Access Token。" - }, - "channel_secret": { - "description": "LINE 频道密钥", - "hint": "LINE Messaging API 频道的 Channel Secret。" - }, - "active_send_mode": { - "description": "是否换用主动发送接口" - }, - "appid": { - "description": "appid", - "hint": "必填项。当前消息平台的 AppID。如何获取请参考对应平台接入文档。" - }, - "callback_server_host": { - "description": "回调服务器主机", - "hint": "回调服务器主机。留空则不启用回调服务器。" - }, - "card_template_id": { - "description": "卡片模板 ID", - "hint": "可选。钉钉互动卡片模板 ID。启用后将使用互动卡片进行流式回复。" - }, - "discord_activity_name": { - "description": "Discord 活动名称", - "hint": "可选的 Discord 活动名称。留空则不设置活动。" - }, - "discord_allow_bot_messages": { - "description": "允许接收机器人消息", - "hint": "启用后,AstrBot 将接收来自其他 Discord 机器人的消息。适用于机器人间通信场景(如消息转发)。默认关闭。" - }, - "discord_command_register": { - "description": "注册 Discord 指令", - "hint": "启用后,自动将插件指令注册为 Discord 斜杠指令" - }, - "discord_proxy": { - "description": "Discord 代理地址", - "hint": "可选的代理地址:http://ip:port" - }, - "discord_token": { - "description": "Discord Bot Token", - "hint": "在此处填入你的 Discord Bot Token" - }, - "enable": { - "description": "启用", - "hint": "是否启用该适配器。未启用的适配器对应的消息平台将不会接收到消息。" - }, - "enable_group_c2c": { - "description": "启用消息列表单聊", - "hint": "启用后,机器人可以接收到 QQ 消息列表中的私聊消息。你可能需要在 QQ 机器人平台上通过扫描二维码的方式添加机器人为你的好友。详见文档。" - }, - "enable_guild_direct_message": { - "description": "启用频道私聊", - "hint": "启用后,机器人可以接收到频道的私聊消息。" - }, - "id": { - "description": "机器人名称", - "hint": "机器人名称" - }, - "is_sandbox": { - "description": "沙箱模式" - }, - "kf_name": { - "description": "微信客服账号名", - "hint": "如果填写此项,即代表你将使用企业微信客服,而不是企业微信应用。可在 https://kf.weixin.qq.com/kf/frame#/accounts 获取。" - }, - "lark_connection_mode": { - "description": "订阅方式", - "labels": [ - "长连接模式", - "推送至服务器模式" - ] - }, - "lark_encrypt_key": { - "description": "Encrypt Key", - "hint": "用于解密飞书回调数据的加密密钥" - }, - "lark_verification_token": { - "description": "Verification Token", - "hint": "用于验证飞书回调请求的令牌" - }, - "misskey_allow_insecure_downloads": { - "description": "允许不安全下载(禁用 SSL 验证)", - "hint": "当远端服务器存在证书问题导致无法正常下载时,自动禁用 SSL 验证作为回退方案。适用于某些图床的证书配置问题。启用有安全风险,仅在必要时使用。" - }, - "misskey_default_visibility": { - "description": "默认帖子可见性", - "hint": "机器人发帖时的默认可见性设置。public:公开,home:主页时间线,followers:仅关注者。" - }, - "misskey_download_chunk_size": { - "description": "流式下载分块大小(字节)", - "hint": "流式下载和计算 MD5 时使用的每次读取字节数,过小会增加开销,过大会占用内存。" - }, - "misskey_download_timeout": { - "description": "远端下载超时时间(秒)", - "hint": "下载远程文件时的超时时间(秒),用于异步上传回退到本地上传的场景。" - }, - "misskey_enable_chat": { - "description": "启用聊天消息响应", - "hint": "启用后,机器人将会监听和响应私信聊天消息" - }, - "misskey_enable_file_upload": { - "description": "启用文件上传到 Misskey", - "hint": "启用后,适配器会尝试将消息链中的文件上传到 Misskey。URL 文件会先尝试服务器端上传,异步上传失败时会回退到下载后本地上传。" - }, - "misskey_instance_url": { - "description": "Misskey 实例 URL", - "hint": "例如 https://misskey.example,填写 Bot 账号所在的 Misskey 实例地址" - }, - "misskey_local_only": { - "description": "仅限本站(不参与联合)", - "hint": "启用后,机器人发出的帖子将仅在本实例可见,不会联合到其他实例" - }, - "misskey_max_download_bytes": { - "description": "最大允许下载字节数(超出则中止)", - "hint": "如果希望限制下载文件的最大大小以防止 OOM,请填写最大字节数;留空或 null 表示不限制。" - }, - "misskey_token": { - "description": "Misskey Access Token", - "hint": "连接服务设置生成的 API 鉴权访问令牌(Access token)" - }, - "misskey_upload_concurrency": { - "description": "并发上传限制", - "hint": "同时进行的文件上传任务上限(整数,默认 3)。" - }, - "misskey_upload_folder": { - "description": "上传到网盘的目标文件夹 ID", - "hint": "可选:填写 Misskey 网盘中目标文件夹的 ID,上传的文件将放置到该文件夹内。留空则使用账号网盘根目录。" - }, - "port": { - "description": "回调服务器端口", - "hint": "回调服务器端口。留空则不启用回调服务器。" - }, - "satori_api_base_url": { - "description": "Satori API 终结点", - "hint": "Satori API 的基础地址。" - }, - "satori_auto_reconnect": { - "description": "启用自动重连", - "hint": "断开连接时是否自动重新连接 WebSocket。" - }, - "satori_endpoint": { - "description": "Satori WebSocket 终结点", - "hint": "Satori 事件的 WebSocket 端点。" - }, - "satori_heartbeat_interval": { - "description": "Satori 心跳间隔", - "hint": "发送心跳消息的间隔(秒)。" - }, - "satori_reconnect_delay": { - "description": "Satori 重连延迟", - "hint": "尝试重新连接前的延迟时间(秒)。" - }, - "satori_token": { - "description": "Satori 令牌", - "hint": "用于 Satori API 身份验证的令牌。" - }, - "secret": { - "description": "secret", - "hint": "必填项。" - }, - "slack_connection_mode": { - "description": "Slack Connection Mode", - "hint": "The connection mode for Slack. `webhook` uses a webhook server, `socket` uses Slack's Socket Mode." - }, - "slack_webhook_host": { - "description": "Slack Webhook Host", - "hint": "Only valid when Slack connection mode is `webhook`." - }, - "slack_webhook_path": { - "description": "Slack Webhook Path", - "hint": "Only valid when Slack connection mode is `webhook`." - }, - "slack_webhook_port": { - "description": "Slack Webhook Port", - "hint": "Only valid when Slack connection mode is `webhook`." - }, - "telegram_command_auto_refresh": { - "description": "命令自动刷新", - "hint": "启用后,AstrBot 将会在运行时自动刷新 Telegram 命令。(单独设置此项无效)" - }, - "telegram_command_register": { - "description": "命令注册", - "hint": "启用后,AstrBot 将会自动注册 Telegram 命令。" - }, - "telegram_command_register_interval": { - "description": "命令自动刷新间隔", - "hint": "Telegram 命令自动刷新间隔,单位为秒。" - }, - "telegram_polling_restart_delay": { - "description": "轮询重启延迟", - "hint": "当轮询意外结束尝试自动重启时的延迟时间,单位为秒。默认为 5s。" - }, - "telegram_token": { - "description": "Bot Token", - "hint": "如果你的网络环境为中国大陆,请在 `其他配置` 处设置代理或更改 api_base。" - }, - "mattermost_url": { - "description": "Mattermost URL", - "hint": "Mattermost 服务地址,例如 https://chat.example.com。" - }, - "mattermost_bot_token": { - "description": "Mattermost Bot Token", - "hint": "在 Mattermost 中创建 Bot 账户后生成的访问令牌。" - }, - "mattermost_reconnect_delay": { - "description": "Mattermost 重连延迟", - "hint": "WebSocket 断开后的重连等待时间,单位为秒。默认 5 秒。" - }, - "type": { - "description": "适配器类型" - }, - "unified_webhook_mode": { - "description": "统一 Webhook 模式", - "hint": "Webhook 模式下使用 AstrBot 统一 Webhook 入口,无需单独开启端口。回调地址为 /api/v1/webhooks/platforms/{webhook_uuid}。" - }, - "use_markdown": { - "description": "主动消息使用 Markdown", - "hint": "启用后,机器人主动发送消息默认以 Markdown 模式发送;插件显式调用 use_markdown() 指定行为时不受此配置影响。" - }, - "webhook_uuid": { - "description": "Webhook UUID", - "hint": "统一 Webhook 模式下的唯一标识符,创建平台时自动生成。" - }, - "wecom_ai_bot_name": { - "description": "企业微信智能机器人的名字", - "hint": "请务必填写正确,否则无法使用一些指令。" - }, - "wecom_ai_bot_connection_mode": { - "description": "企业微信智能机器人连接模式", - "hint": "Webhook 回调模式需要配置 Token/EncodingAESKey;长连接模式需要配置 BotID/Secret。" - }, - "wecomaibot_friend_message_welcome_text": { - "description": "企业微信智能机器人私聊欢迎语", - "hint": "可选。当用户当天进入智能机器人单聊会话,回复欢迎语,如 “💭 思考中...”。留空则不回复。" - }, - "wecomaibot_init_respond_text": { - "description": "企业微信智能机器人初始响应文本", - "hint": "可选。当机器人收到消息时,首先回复的文本内容。留空则不设置。" - }, - "wecomaibot_token": { - "description": "企业微信智能机器人 Token", - "hint": "用于 Webhook 回调模式的身份验证。" - }, - "wecomaibot_encoding_aes_key": { - "description": "企业微信智能机器人 EncodingAESKey", - "hint": "用于 Webhook 回调模式的消息加密解密。" - }, - "wecomaibot_ws_bot_id": { - "description": "长连接 BotID", - "hint": "企业微信智能机器人长连接模式凭证 BotID。" - }, - "wecomaibot_ws_secret": { - "description": "长连接 Secret", - "hint": "企业微信智能机器人长连接模式凭证 Secret。" - }, - "wecomaibot_ws_url": { - "description": "长连接 WebSocket 地址", - "hint": "默认值为 wss://openws.work.weixin.qq.com,一般无需修改。" - }, - "wecomaibot_heartbeat_interval": { - "description": "长连接心跳间隔", - "hint": "长连接模式心跳间隔(秒),建议 30 秒。" - }, - "wpp_active_message_poll": { - "description": "是否启用主动消息轮询", - "hint": "只有当你发现微信消息没有按时同步到 AstrBot 时,才需要启用这个功能,默认不启用。" - }, - "wpp_active_message_poll_interval": { - "description": "主动消息轮询间隔", - "hint": "主动消息轮询间隔,单位为秒,默认 3 秒,最大不要超过 60 秒,否则可能被认为是旧消息。" - }, - "ws_reverse_host": { - "description": "反向 Websocket 主机", - "hint": "AstrBot 将作为服务器端。" - }, - "ws_reverse_port": { - "description": "反向 Websocket 端口" - }, - "ws_reverse_token": { - "description": "反向 Websocket Token", - "hint": "反向 Websocket Token。未设置则不启用 Token 验证。" - }, - "msg_push_webhook_url": { - "description": "企业微信消息推送 Webhook URL", - "hint": "可选。用于主动消息推送,请在企微群->消息推送得到 URL。建议设置此项以带来更好的消息发送体验。" - }, - "only_use_webhook_url_to_send": { - "description": "仅使用 Webhook 发送消息", - "hint": "可选。启用后,企业微信智能机器人的所有回复都改为通过消息推送 Webhook 发送。消息推送 Webhook 支持更多的消息类型(如图片、文件等)。如果不需要打字机效果,强烈建议使用此选项。" - }, - "weixin_oc_base_url": { - "description": "Base URL 地址", - "hint": "默认值: https://ilinkai.weixin.qq.com" - }, - "weixin_oc_bot_type": { - "description": "扫码参数 bot_type", - "hint": "默认值: 3" - }, - "weixin_oc_qr_poll_interval": { - "description": "二维码状态轮询间隔(秒)", - "hint": "每隔多少秒轮询一次二维码状态。" - }, - "weixin_oc_long_poll_timeout_ms": { - "description": "getUpdates 长轮询超时时间(毫秒)", - "hint": "会话消息拉取接口超时参数。" - }, - "weixin_oc_api_timeout_ms": { - "description": "HTTP 请求超时(毫秒)", - "hint": "通用 API 请求超时参数。" - }, - "weixin_oc_token": { - "description": "登录后 token(可留空)", - "hint": "扫码登录成功后会自动写入;高级场景可手动填写。" - }, - "kook_bot_token": { - "description": "机器人 Token", - "type": "string", - "hint": "必填项。从 KOOK 开发者平台获取的机器人 Token" - }, - "kook_reconnect_delay": { - "description": "重连延迟", - "type": "int", - "hint": "重连延迟时间(秒),使用指数退避策略" - }, - "kook_max_reconnect_delay": { - "description": "最大重连延迟", - "type": "int", - "hint": "重连延迟的最大值(秒)" - }, - "kook_max_retry_delay": { - "description": "最大重试延迟", - "type": "int", - "hint": "重试的最大延迟时间(秒)" - }, - "kook_heartbeat_interval": { - "description": "心跳间隔", - "type": "int", - "hint": "心跳检测间隔时间(秒)" - }, - "kook_heartbeat_timeout": { - "description": "心跳超时时间", - "type": "int", - "hint": "心跳检测超时时间(秒)" - }, - "kook_max_heartbeat_failures": { - "description": "最大心跳失败次数", - "type": "int", - "hint": "允许的最大心跳失败次数,超过后断开连接" - }, - "kook_max_consecutive_failures": { - "description": "最大连续失败次数", - "type": "int", - "hint": "允许的最大连续失败次数,超过后停止重试" - } - }, - "general": { - "description": "基本", - "platform_settings": { - "unique_session": { - "description": "隔离对话", - "hint": "启用后,支持隔离的渠道会为每位群成员使用独立上下文。指令权限请在「管理行为 → 指令」中设置。" - }, - "friend_message_needs_wake_prefix": { - "description": "私聊消息需要唤醒词", - "hint": "私聊消息也必须带上唤醒前缀才能唤醒机器人。" - }, - "reply_prefix": { - "description": "回复时的文本前缀", - "hint": "回复中附带的文本前缀。" - }, - "reply_with_mention": { - "description": "回复时 @ 发送人", - "hint": "回复时提及发送人。" - }, - "reply_with_quote": { - "description": "回复时引用发送人消息", - "hint": "回复时引用发送人的对应消息。" - }, - "forward_threshold": { - "description": "转发消息的字数阈值", - "hint": "在受支持的平台上,当回复消息过长时,采用 “合并消息转发” 的方式发送消息。" - }, - "empty_mention_waiting": { - "description": "只 @ 机器人是否触发等待", - "hint": "当发送一条只有提及机器人的消息时,是否在接下来的 1 分钟内保持唤醒状态等待用户的第二条消息。" - } - }, - "wake_prefix": { - "description": "唤醒词", - "hint": "唤醒机器人的消息前缀的列表,也可以通过 @ 机器人来唤醒。\n\n内置指令(如 `/help`、`/sid`)也依赖唤醒词:群聊中不带唤醒词直接输入将无法触发;私聊在未启用「私聊消息需要唤醒词」时无需前缀,可直接输入指令触发。" - }, - "disable_builtin_commands": { - "description": "禁用自带指令", - "hint": "禁用所有 AstrBot 自带指令,如 help, sid, new 等" - } - }, - "rate_limit": { - "description": "速率限制", - "platform_settings": { - "rate_limit": { - "time": { - "description": "消息速率限制时间(秒)" - }, - "count": { - "description": "消息速率限制计数" - }, - "strategy": { - "description": "速率限制策略" - } - } - } - }, - "content_safety": { - "description": "内容安全", - "content_safety": { - "also_use_in_response": { - "description": "同时检查模型的响应内容" - }, - "baidu_aip": { - "enable": { - "description": "使用百度内容安全审核", - "hint": "您需要手动安装 baidu-aip 库。" - }, - "app_id": { - "description": "App ID" - }, - "api_key": { - "description": "API Key" - }, - "secret_key": { - "description": "Secret Key" - } - }, - "internal_keywords": { - "enable": { - "description": "关键词检查" - }, - "extra_keywords": { - "description": "额外关键词", - "hint": "额外的屏蔽关键词列表,支持正则表达式。" - } - } - } - }, - "others": { - "description": "其他配置", - "platform_settings": { - "ignore_bot_self_message": { - "description": "是否忽略机器人自身的消息" - }, - "ignore_at_all": { - "description": "是否忽略 @ 全体成员事件" - }, - "no_permission_reply": { - "description": "用户权限不足时是否回复" - } - }, - "platform_specific": { - "lark": { - "pre_ack_emoji": { - "enable": { - "description": "[飞书] 启用预回应表情" - }, - "emojis": { - "description": "表情列表(飞书表情枚举名)", - "hint": "表情枚举名参考:[https://open.feishu.cn/document/server-docs/im-v1/message-reaction/emojis-introduce](https://open.feishu.cn/document/server-docs/im-v1/message-reaction/emojis-introduce)" - } - } - }, - "telegram": { - "pre_ack_emoji": { - "enable": { - "description": "[Telegram] 启用预回应表情" - }, - "emojis": { - "description": "表情列表(Unicode)", - "hint": "Telegram 仅支持固定反应集合,参考:[https://gist.github.com/Soulter/3f22c8e5f9c7e152e967e8bc28c97fc9](https://gist.github.com/Soulter/3f22c8e5f9c7e152e967e8bc28c97fc9)" - } - } - }, - "discord": { - "pre_ack_emoji": { - "enable": { - "description": "[Discord] 启用预回应表情" - }, - "emojis": { - "description": "表情列表(Unicode 或自定义表情名)", - "hint": "填写 Unicode 表情符号,例如:👍、🤔、⏳" - } - } - } - } - } - }, - "access_group": { - "name": "访问控制", - "admins": { - "description": "管理员", - "admins_id": { - "description": "管理员 ID", - "hint": "给机器人发送 /sid 指令以获取 ID。" - } - }, - "whitelist": { - "description": "白名单", - "platform_settings": { - "enable_id_white_list": { - "description": "启用白名单", - "hint": "启用后,只有在白名单内的会话会被响应。" - }, - "id_whitelist": { - "description": "白名单 ID 列表", - "hint": "给机器人发送 /sid 指令以获取 ID。为空时代表不启用白名单功能。" - }, - "id_whitelist_log": { - "description": "输出拦截日志", - "hint": "输出未通过白名单校验的消息的日志。" - }, - "wl_ignore_admin_on_group": { - "description": "管理员群组消息无视 ID 白名单" - }, - "wl_ignore_admin_on_friend": { - "description": "管理员私聊消息无视 ID 白名单" - } - } - } - }, - "plugin_group": { - "name": "插件", - "plugin": { - "description": "插件", - "plugin_set": { - "description": "可用插件", - "hint": "默认启用全部未被禁用的插件。若插件在插件管理页被禁用,则此处的选择不会生效。" - } - } - }, - "ext_group": { - "name": "扩展功能", - "segmented_reply": { - "description": "分段回复", - "platform_settings": { - "segmented_reply": { - "enable": { - "description": "启用分段回复", - "hint": "以分段输出的方式发送回复消息。" - }, - "only_llm_result": { - "description": "仅对 LLM 结果分段" - }, - "interval_method": { - "description": "间隔方法", - "hint": "random 为随机时间,log 为根据消息长度计算,$y=log_(x)$,x为字数,y的单位为秒。" - }, - "interval": { - "description": "随机间隔时间", - "hint": "格式:最小值,最大值(如:1.5,3.5)" - }, - "log_base": { - "description": "对数底数", - "hint": "对数间隔的底数,默认为 2.6。取值范围为 1.0-10.0。" - }, - "words_count_threshold": { - "description": "分段回复字数阈值", - "hint": "分段回复的字数上限。只有字数小于此值的消息才会被分段,超过此值的长消息将直接发送(不分段),默认为 150。" - }, - "split_mode": { - "description": "分段模式", - "hint": "用于分隔一段消息。默认情况下会根据句号、问号等标点符号分隔。如填写 `[。?!]` 将移除所有的句号、问号、感叹号。re.findall(r'', text)", - "labels": [ - "正则表达式", - "分段词列表" - ] - }, - "regex": { - "description": "分段正则表达式", - "hint": "用于按正则规则识别分段点。建议使用能匹配分隔符的表达式。" - }, - "split_words": { - "description": "分段词列表", - "hint": "检测到列表中的任意词时进行分段" - }, - "content_cleanup_rule": { - "description": "内容过滤正则表达式", - "hint": "移除分段后内容中的指定内容。如填写 `[。?!]` 将移除所有的句号、问号、感叹号。" - } - } - } - }, - "ltm": { - "description": "群聊上下文感知", - "provider_ltm_settings": { - "group_icl_enable": { - "description": "群聊消息记录注入上下文", - "hint": "是否记录群聊非唤醒机器人的消息,并在唤醒机器人时将消息传给模型。" - }, - "group_message_max_cnt": { - "description": "注入上下文最大消息数量", - "hint": "传给模型的消息的最大数量。" - }, - "image_caption": { - "description": "自动理解图片", - "hint": "对非唤醒机器人的图片消息启用图片转述,转换成图片描述文本。对于图片消息频繁的群聊,此功能可能造成较大的开销,请慎用。" - }, - "image_caption_provider_id": { - "description": "群聊图片转述模型", - "hint": "用于群聊记录注入上下文的图片理解,与图片转述模型分开配置。" - }, - "group_message_history_enable": { - "description": "持久化群聊消息记录", - "hint": "将群内的所有消息都持久化保存,并允许模型通过工具来查询群内消息。" - }, - "group_message_history_max_cnt": { - "description": "持久化最大消息数量", - "hint": "持久化保存的消息的最大数量,超过后抛弃旧的消息。" - }, - "active_reply": { - "enable": { - "description": "主动回复", - "hint": "是否在合适的时机主动发消息。" - }, - "method": { - "description": "主动回复方法" - }, - "possibility_reply": { - "description": "回复概率", - "hint": "0.0-1.0 之间的数值" - }, - "whitelist": { - "description": "主动回复白名单", - "hint": "为空时不启用白名单过滤。使用 /sid 获取 ID。" - } - } - } - }, - "t2i": { - "description": "文本转图像", - "t2i": { - "description": "文本转图像输出", - "hint": "将模型回复转换成图片后再发送,防止刷屏。" - }, - "t2i_word_threshold": { - "description": "文本转图像字数阈值" - }, - "t2i_strategy": { - "description": "文本转图像策略", - "hint": "文本转图像策略。`remote` 为使用远程基于 HTML 的渲染服务,`local` 为使用 PIL 本地渲染。当使用 local 时,将 ttf 字体命名为 'font.ttf' 放在 data/ 目录下可自定义字体。" - }, - "t2i_endpoint": { - "description": "文本转图像服务 API 地址", - "hint": "为空时使用 AstrBot API 服务" - }, - "t2i_template": { - "description": "文本转图像自定义模版", - "hint": "启用后可自定义 HTML 模板用于文转图渲染。" - }, - "t2i_active_template": { - "description": "当前应用的文转图渲染模板", - "hint": "此处的值由文转图模板管理页面进行维护。" - } - } - }, - "system_group": { - "name": "系统配置", - "system": { - "description": "系统配置", - "log_level": { - "description": "控制台日志级别", - "hint": "控制台输出日志的级别。" - }, - "log_file_enable": { - "description": "启用文件日志", - "hint": "在控制台输出的同时,将日志写入文件。" - }, - "log_file_path": { - "description": "日志文件路径", - "hint": "相对路径以 data 目录为基准,例如 logs/astrbot.log;支持绝对路径。" - }, - "log_file_max_mb": { - "description": "日志文件大小上限 (MB)", - "hint": "超过大小后自动轮转,默认 20MB。" - }, - "temp_dir_max_size": { - "description": "临时目录大小上限 (MB)", - "hint": "用于限制 data/temp 目录总大小,单位为 MB。系统每 10 分钟检查一次,超限时按文件修改时间从旧到新删除,释放约 30% 当前体积。" - }, - "trace_enable": { - "description": "启用追踪记录", - "hint": "追踪用户的每次指令和 AI 调用。" - }, - "trace_db_path": { - "description": "追踪数据库路径", - "hint": "相对路径以 data 目录为基准,例如 logs/traces.db;支持绝对路径。" - }, - "trace_db_max_mb": { - "description": "追踪数据库容量预算 (MB)", - "hint": "默认 80 MB,最小 32 MB,低于最小值时按 32 MB 生效。超出后自动清除旧数据。" - }, - "trace_retention_days": { - "description": "追踪保留天数", - "hint": "默认 7 天,期限或容量先达到者触发清理。" - }, - "pip_install_arg": { - "description": "pip 安装额外参数", - "hint": "安装插件依赖时,会使用 Python 的 pip 工具。这里可以填写额外的参数,如 `--break-system-package` 等。PyPI 镜像的 TLS 证书默认会校验;若使用自签名/私有 CA 镜像,请通过 `--cert ` 指定信任的证书(推荐),或显式添加 `--trusted-host <主机名>`。" - }, - "pypi_index_url": { - "description": "PyPI 软件仓库地址", - "hint": "安装 Python 依赖时请求的 PyPI 软件仓库地址。默认为 [https://mirrors.aliyun.com/pypi/simple/](https://mirrors.aliyun.com/pypi/simple/)" - }, - "callback_api_base": { - "description": "对外可达的回调接口地址", - "hint": "外部服务可能会通过 AstrBot 生成的回调链接(如文件下载链接)访问 AstrBot 后端。由于 AstrBot 无法自动判断部署环境中对外可达的主机地址(host),因此需要通过此配置项显式指定外部服务如何访问 AstrBot 的地址。如 [http://localhost:6185](http://localhost:6185),[https://example.com](https://example.com) 等。" - }, - "disable_metrics": { - "description": "禁用匿名使用统计", - "hint": "禁用后,AstrBot 将不再上传匿名使用统计数据。" - }, - "dashboard": { - "trust_proxy_headers": { - "description": "信任代理请求头获取客户端 IP", - "hint": "关闭时忽略 X-Forwarded-For/X-Real-IP,仅使用连接地址。" - }, - "auth_rate_limit": { - "enable": { - "description": "启用登录验证速率限制", - "hint": "关闭后将不对登录、TOTP 等身份验证接口进行速率限制。" - }, - "average_interval": { - "description": "验证端点速率限制平均间隔(秒)", - "hint": "两次身份验证请求之间的最小平均间隔时间。例如设置为 1.0 表示每秒最多处理 1 个请求。" - }, - "max_burst": { - "description": "验证端点速率限制最大突发数", - "hint": "允许的瞬时最大突发请求数。例如设置为 3 表示在短时间内最多连续处理 3 个请求。" - } - }, - "ssl": { - "enable": { - "description": "启用 WebUI HTTPS", - "hint": "启用后,WebUI 将直接使用 HTTPS 提供服务。" - }, - "cert_file": { - "description": "SSL 证书文件路径", - "hint": "证书文件路径(PEM)。支持绝对路径和相对路径(相对于当前工作目录)。" - }, - "key_file": { - "description": "SSL 私钥文件路径", - "hint": "私钥文件路径(PEM)。支持绝对路径和相对路径(相对于当前工作目录)。" - }, - "ca_certs": { - "description": "SSL CA 证书文件路径", - "hint": "可选。用于指定 CA 证书文件路径。" - } - }, - "totp": { - "enable": { - "description": "启用 WebUI TOTP 双因素认证", - "hint": "启用后,登录 WebUI 需要额外输入验证码。" - }, - "manage": "管理", - "configuration": "TOTP", - "statusPending": "需完成设置", - "statusEnabled": "已启用", - "setupRequiredHint": "TOTP 已开启但尚未完成配置,请点击“管理”完成初始化。", - "setupTitle": "设置 TOTP", - "setupSubtitle": "请使用认证器应用扫描二维码,然后输入验证码。", - "setupConfirm": "验证并继续", - "activeSubtitle": "可使用此二维码和密钥添加新的认证器设备。", - "rotateTitle": "更换 TOTP 密钥", - "rotateSubtitle": "生成新密钥并完成验证后,将替换当前密钥。", - "rotate": "更换密钥", - "rotateRecovery": "更换恢复码", - "rotateConfirm": "确认更换", - "rotateCancel": "取消", - "rotateCode": "验证码", - "rotateCodeHint": "输入认证器应用中的验证码以确认新密钥。", - "rotateError": "验证码无效,请重试。", - "recoveryTitle": "恢复码", - "recoverySubtitle": "恢复码仅展示一次,请在继续前妥善保存。", - "recoveryWarning": "若恢复码丢失将无法通过常规途径恢复账户访问权限。", - "recoveryAcknowledge": "我已保存恢复码", - "recoveryClose": "完成", - "disableTitle": "关闭 TOTP", - "disableSubtitle": "输入验证码以确认关闭双因素认证。", - "disableRecoverySubtitle": "输入恢复码以确认关闭双因素认证。", - "disableCode": "验证码", - "disableRecoveryCode": "恢复码", - "disableConfirm": "确认关闭", - "disableCancel": "取消", - "disableError": "验证失败,请重试。", - "disableUseRecovery": "无法使用TOTP?", - "disableUseCode": "使用验证码", - "configSaveTitle": "两步验证", - "configSaveSubtitle": "输入验证码以更改受保护的配置。", - "configSaveRotationHint": "轮换 TOTP 密钥时,轮换前和轮换后的验证码均可用(仅轮换操作中单次允许)。", - "configSaveCode": "验证码", - "configSaveConfirm": "继续", - "configSaveCancel": "取消", - "configSaveError": "验证失败,请重试。" - } - }, - "timezone": { - "description": "时区", - "hint": "时区设置。请填写 IANA 时区名称, 如 Asia/Shanghai, 为空时使用系统默认时区。所有时区请查看: [https://data.iana.org/time-zones/tzdb-2021a/zone1970.tab](https://data.iana.org/time-zones/tzdb-2021a/zone1970.tab)" - }, - "http_proxy": { - "description": "HTTP 代理", - "hint": "启用后,会以添加环境变量的方式设置代理。格式为 `http://ip:port`" - }, - "no_proxy": { - "description": "直连地址列表" - } - } - }, - "provider_group": { - "provider": { - "api_key": { - "description": "API Key" - }, - "dashscope_api_key": { - "description": "DashScope API Key" - }, - "gemini_tts_api_key": { - "description": "Gemini API Key" - }, - "genie_onnx_model_dir": { - "description": "ONNX Model Directory", - "hint": "The directory path containing the ONNX model files" - }, - "genie_language": { - "description": "Language" - }, - "xai_native_search": { - "description": "启用原生搜索功能", - "hint": "启用后,将通过 xAI 的 Chat Completions 原生 Live Search 进行联网检索(按需计费)。仅对 xAI 提供商生效。" - }, - "rerank_api_base": { - "description": "重排序模型 API Base URL", - "hint": "最终请求路径由 Base URL 和路径后缀拼接而成(默认为 /v1/rerank)。" - }, - "rerank_api_suffix": { - "description": "API URL 路径后缀", - "hint": "追加到 base_url 后的路径后缀,如 /v1/rerank。留空则不追加。" - }, - "rerank_api_key": { - "description": "API Key", - "hint": "如果不需要 API Key, 请留空。" - }, - "rerank_model": { - "description": "重排序模型名称" - }, - "return_documents": { - "description": "是否在排序结果中返回文档原文", - "hint": "默认值false,以减少网络传输开销。" - }, - "instruct": { - "description": "自定义排序任务类型说明", - "hint": "仅在使用 qwen3-rerank 模型时生效。建议使用英文撰写。" - }, - "nvidia_rerank_api_base": { - "description": "API Base URL" - }, - "nvidia_rerank_api_key": { - "description": "API Key" - }, - "nvidia_rerank_model": { - "description": "重排序模型名称", - "hint": "请参照NVIDIA Docs中模型名称填写。" - }, - "nvidia_rerank_model_endpoint": { - "description": "自定义模型端点", - "hint": "自定义URL末尾端点,默认为 /reranking" - }, - "nvidia_rerank_truncate": { - "description": "文本截断策略", - "hint": "当输入文本过长时,是否截断输入以适应模型的最大上下文长度。" - }, - "tei_rerank_truncate": { - "description": "截断超长文本", - "hint": "当输入超过模型最大上下文长度时,是否自动截断。启用后需配合 截断方向 使用。" - }, - "tei_rerank_truncation_direction": { - "description": "截断方向", - "hint": "选择从文本的左侧(left)还是右侧(right)开始截断。仅在 截断超长文本 为 True 时生效。" - }, - "tei_rerank_raw_scores": { - "description": "返回原始分数", - "hint": "如果为 True,返回模型原始 logit 分数(可能为负值),不经过 sigmoid 归一化。默认 False。" - }, - "tei_rerank_return_text": { - "description": "返回排序结果中的文档原文", - "hint": "如果为 True,每个排序结果将附带原始文本。默认 False 以减少网络传输。" - }, - "launch_model_if_not_running": { - "description": "模型未运行时自动启动", - "hint": "如果模型当前未在 Xinference 服务中运行,是否尝试自动启动它。在生产环境中建议关闭。" - }, - "modalities": { - "description": "模型能力", - "hint": "模型支持的模态及能力。", - "labels": [ - "文本", - "图像", - "音频", - "工具使用" - ] - }, - - "custom_headers": { - "description": "自定义请求头", - "hint": "此处添加的键值对将作为自定义 HTTP 请求头,附加到 AstrBot 发往模型服务商的请求中。值必须为字符串。" - }, - "ollama_disable_thinking": { - "description": "关闭思考模式", - "hint": "关闭 Ollama 思考模式。" - }, - "custom_extra_body": { - "description": "自定义请求体参数", - "hint": "用于在请求时添加额外的参数,如 temperature, top_p, max_tokens, reasoning_effort 等。", - "template_schema": { - "temperature": { - "description": "温度参数", - "hint": "控制输出的随机性,范围通常为 0-2。值越高越随机。", - "name": "Temperature" - }, - "top_p": { - "description": "Top-p 采样", - "hint": "核采样参数,范围通常为 0-1。控制模型考虑的概率质量。", - "name": "Top-p" - }, - "max_tokens": { - "description": "最大词元(Tokens)数", - "hint": "生成的最大词元(Tokens)数。", - "name": "Max Tokens" - }, - "max_output_tokens": { - "description": "最大输出词元(Tokens)数", - "hint": "生成的最大词元(Tokens)数。", - "name": "Max Output Tokens" - }, - "reasoning_effort": { - "description": "推理强度", - "hint": "控制推理模型的推理强度,支持的值取决于具体模型。", - "name": "Reasoning Effort" - } - } - }, - "gpt_weights_path": { - "description": "GPT模型文件路径", - "hint": "即“.ckpt”后缀的文件,请使用绝对路径,路径两端不要带双引号,不填则默认用GPT_SoVITS内置的SoVITS模型(建议直接在GPT_SoVITS中改默认模型)" - }, - "sovits_weights_path": { - "description": "SoVITS模型文件路径", - "hint": "即“.pth”后缀的文件,请使用绝对路径,路径两端不要带双引号,不填则默认用GPT_SoVITS内置的SoVITS模型(建议直接在GPT_SoVITS中改默认模型)" - }, - "gsv_default_parms": { - "description": "GPT_SoVITS默认参数", - "hint": "参考音频文件路径、参考音频文本必填,其他参数根据个人爱好自行填写", - "gsv_ref_audio_path": { - "description": "参考音频文件路径", - "hint": "必填!请使用绝对路径!路径两端不要带双引号!" - }, - "gsv_prompt_text": { - "description": "参考音频文本", - "hint": "必填!请填写参考音频讲述的文本" - }, - "gsv_prompt_lang": { - "description": "参考音频文本语言", - "hint": "请填写参考音频讲述的文本的语言,默认为中文" - }, - "gsv_aux_ref_audio_paths": { - "description": "辅助参考音频文件路径", - "hint": "辅助参考音频文件,可不填" - }, - "gsv_text_lang": { - "description": "文本语言", - "hint": "默认为中文" - }, - "gsv_top_k": { - "description": "生成语音的多样性", - "hint": "" - }, - "gsv_top_p": { - "description": "核采样的阈值", - "hint": "" - }, - "gsv_temperature": { - "description": "生成语音的随机性", - "hint": "" - }, - "gsv_text_split_method": { - "description": "切分文本的方法", - "hint": "可选值: `cut0`:不切分 `cut1`:四句一切 `cut2`:50字一切 `cut3`:按中文句号切 `cut4`:按英文句号切 `cut5`:按标点符号切" - }, - "gsv_batch_size": { - "description": "批处理大小", - "hint": "" - }, - "gsv_batch_threshold": { - "description": "批处理阈值", - "hint": "" - }, - "gsv_split_bucket": { - "description": "将文本分割成桶以便并行处理", - "hint": "" - }, - "gsv_speed_factor": { - "description": "语音播放速度", - "hint": "1为原始语速" - }, - "gsv_fragment_interval": { - "description": "语音片段之间的间隔时间", - "hint": "" - }, - "gsv_streaming_mode": { - "description": "启用流模式", - "hint": "" - }, - "gsv_seed": { - "description": "随机种子", - "hint": "用于结果的可重复性" - }, - "gsv_parallel_infer": { - "description": "并行执行推理", - "hint": "" - }, - "gsv_repetition_penalty": { - "description": "重复惩罚因子", - "hint": "" - }, - "gsv_media_type": { - "description": "输出媒体的类型", - "hint": "建议用wav" - } - }, - "embedding_dimensions": { - "description": "嵌入维度", - "hint": "嵌入向量的维度。根据模型不同,可能需要调整,请参考具体模型的文档。此配置项请务必填写正确,否则将导致向量数据库无法正常工作。" - }, - "embedding_dimensions_mode": { - "description": "嵌入维度参数发送模式", - "hint": "控制是否在 OpenAI 兼容 Embedding 请求中发送 dimensions 参数。auto 会仅对官方 OpenAI embedding-3 模型自动发送;第三方兼容 API 如需该参数可改为 always,报错时改为 never。" - }, - "embedding_model": { - "description": "嵌入模型", - "hint": "嵌入模型名称。" - }, - "embedding_api_key": { - "description": "API Key" - }, - "embedding_api_base": { - "description": "API Base URL" - }, - "openai_embedding": { - "hint": "如果测试不通过,可以尝试添加 /v1 在末尾以兼容部分 OpenAI API 版本。" - }, - "gemini_embedding": { - "hint": "Gemini Embedding 无需手动添加 /v1beta。" - }, - "dashscope_embedding": { - "hint": "阿里云百炼 Embedding,默认地址为 https://dashscope.aliyuncs.com/api/v1。" - }, - "volcengine_cluster": { - "description": "火山引擎集群", - "hint": "若使用语音复刻大模型,可选volcano_icl或volcano_icl_concurr,默认使用volcano_tts" - }, - "volcengine_voice_type": { - "description": "火山引擎音色", - "hint": "输入声音id(Voice_type)" - }, - "volcengine_speed_ratio": { - "description": "语速设置", - "hint": "语速设置,范围为 0.2 到 3.0,默认值为 1.0" - }, - "volcengine_volume_ratio": { - "description": "音量设置", - "hint": "音量设置,范围为 0.0 到 2.0,默认值为 1.0" - }, - "azure_tts_voice": { - "description": "音色设置", - "hint": "API 音色" - }, - "azure_tts_style": { - "description": "风格设置", - "hint": "声音特定的讲话风格。 可以表达快乐、同情和平静等情绪。" - }, - "azure_tts_role": { - "description": "模仿设置(可选)", - "hint": "讲话角色扮演。 声音可以模仿不同的年龄和性别,但声音名称不会更改。 例如,男性语音可以提高音调和改变语调来模拟女性语音,但语音名称不会更改。 如果角色缺失或不受声音的支持,则会忽略此属性。" - }, - "azure_tts_rate": { - "description": "语速设置", - "hint": "指示文本的讲出速率。可在字词或句子层面应用语速。 速率变化应为原始音频的 0.5 到 2 倍。" - }, - "azure_tts_volume": { - "description": "语音音量设置", - "hint": "指示语音的音量级别。 可在句子层面应用音量的变化。以从 0.0 到 100.0(从最安静到最大声,例如 75)的数字表示。 默认值为 100.0。" - }, - "azure_tts_region": { - "description": "API 地区", - "hint": "Azure_TTS 处理数据所在区域,具体参考 https://learn.microsoft.com/zh-cn/azure/ai-services/speech-service/regions" - }, - "azure_tts_subscription_key": { - "description": "服务订阅密钥", - "hint": "Azure_TTS 服务的订阅密钥(注意不是令牌)" - }, - "dashscope_tts_voice": { - "description": "音色" - }, - "gm_resp_image_modal": { - "description": "启用图片模态", - "hint": "启用后,将支持返回图片内容。需要模型支持,否则会报错。具体支持模型请查看 Google Gemini 官方网站。温馨提示,如果您需要生成图片,请关闭 `启用群员识别` 配置获得更好的效果。" - }, - "gm_native_search": { - "description": "启用原生搜索功能", - "hint": "仅 Gemini 3 及以上模型支持与函数工具同时使用;Gemini 3 及以上模型的原生搜索仅限付费层级,计费规则请查阅官方文档" - }, - "gm_native_coderunner": { - "description": "启用原生代码执行器", - "hint": "仅 Gemini 3 及以上模型支持与函数工具同时使用" - }, - "gm_url_context": { - "description": "启用URL上下文功能", - "hint": "仅 Gemini 3 及以上模型支持与函数工具同时使用" - }, - "gm_safety_settings": { - "description": "安全过滤器", - "hint": "设置模型输入的内容安全过滤级别。过滤级别分类为NONE(不屏蔽)、HIGH(高风险时屏蔽)、MEDIUM_AND_ABOVE(中等风险及以上屏蔽)、LOW_AND_ABOVE(低风险及以上时屏蔽),具体参见Gemini API文档。", - "harassment": { - "description": "骚扰内容", - "hint": "负面或有害评论" - }, - "hate_speech": { - "description": "仇恨言论", - "hint": "粗鲁、无礼或亵渎性质内容" - }, - "sexually_explicit": { - "description": "露骨色情内容", - "hint": "包含性行为或其他淫秽内容的引用" - }, - "dangerous_content": { - "description": "危险内容", - "hint": "宣扬、助长或鼓励有害行为的信息" - } - }, - "gm_thinking_config": { - "description": "思考配置", - "budget": { - "description": "思考预算", - "hint": "用于指定模型推理时使用的思考 token 数量上限。参见: https://ai.google.dev/gemini-api/docs/thinking#set-budget" - }, - "level": { - "description": "思考级别", - "hint": "推荐用于 Gemini 3 及以上模型,可控制推理行为。参见: https://ai.google.dev/gemini-api/docs/thinking#thinking-levels" - } - }, - "anth_thinking_config": { - "description": "思考配置", - "type": { - "description": "思考类型", - "hint": "设为 'adaptive' 以使用自适应思考(推荐 Opus 4.6+ / Sonnet 4.6+)。留空则使用手动预算模式。参见: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking" - }, - "budget": { - "description": "思考预算", - "hint": "Anthropic thinking.budget_tokens 参数。必须 >= 1024。仅在思考类型为空时生效。Opus 4.6 / Sonnet 4.6 已弃用。参见: https://platform.claude.com/docs/en/build-with-claude/extended-thinking" - }, - "effort": { - "description": "思考深度", - "hint": "当思考类型为 'adaptive' 时控制思考深度。'high' 为默认值。'max' 仅限 Opus 4.6。参见: https://platform.claude.com/docs/en/build-with-claude/effort" - } - }, - "minimax-group-id": { - "description": "用户组", - "hint": "于账户管理->基本信息中可见" - }, - "minimax-langboost": { - "description": "指定语言/方言", - "hint": "增强对指定的小语种和方言的识别能力,设置后可以提升在指定小语种/方言场景下的语音表现" - }, - "minimax-voice-speed": { - "description": "语速", - "hint": "生成声音的语速, 取值[0.5, 2], 默认为1.0, 取值越大,语速越快" - }, - "minimax-voice-vol": { - "description": "音量", - "hint": "生成声音的音量, 取值(0, 10], 默认为1.0, 取值越大,音量越高" - }, - "minimax-voice-pitch": { - "description": "语调", - "hint": "生成声音的语调, 取值[-12, 12], 默认为0" - }, - "minimax-is-timber-weight": { - "description": "启用混合音色", - "hint": "启用混合音色, 支持以自定义权重混合最多四种音色, 启用后自动忽略单一音色设置" - }, - "minimax-timber-weight": { - "description": "混合音色", - "hint": "混合音色及其权重, 最多支持四种音色, 权重为整数, 取值[1, 100]. 可在官网API语音调试台预览代码获得预设以及编写模板, 需要严格按照json字符串格式编写, 可以查看控制台判断是否解析成功. 具体结构可参照默认值以及官网代码预览." - }, - "minimax-voice-id": { - "description": "单一音色", - "hint": "单一音色编号, 详见官网文档" - }, - "minimax-voice-emotion": { - "description": "情绪", - "hint": "控制合成语音的情绪。当为 auto 时,将根据文本内容自动选择情绪。" - }, - "minimax-voice-latex": { - "description": "支持朗读latex公式", - "hint": "朗读latex公式, 但是需要确保输入文本按官网要求格式化" - }, - "minimax-voice-english-normalization": { - "description": "支持英语文本规范化", - "hint": "可提升数字阅读场景的性能,但会略微增加延迟" - }, - "rag_options": { - "description": "RAG 选项", - "hint": "检索知识库设置, 非必填。仅 Agent 应用类型支持(智能体应用, 包括 RAG 应用)。阿里云百炼应用开启此功能后将无法多轮对话。", - "pipeline_ids": { - "description": "知识库 ID 列表", - "hint": "对指定知识库内所有文档进行检索, 前往 https://bailian.console.aliyun.com/ 数据应用->知识索引创建和获取 ID。" - }, - "file_ids": { - "description": "非结构化文档 ID, 传入该参数将对指定非结构化文档进行检索。", - "hint": "对指定非结构化文档进行检索。前往 https://bailian.console.aliyun.com/ 数据管理创建和获取 ID。" - }, - "output_reference": { - "description": "是否输出知识库/文档的引用", - "hint": "在每次回答尾部加上引用源。默认为 False。" - } - }, - "sensevoice_hint": { - "description": "部署SenseVoice", - "hint": "启用前请 pip 安装 funasr、funasr_onnx、torchaudio、torch、modelscope、jieba 库(默认使用CPU,大约下载 1 GB),并且安装 ffmpeg。否则将无法正常转文字。" - }, - "is_emotion": { - "description": "情绪识别", - "hint": "是否开启情绪识别。happy|sad|angry|neutral|fearful|disgusted|surprised|unknown" - }, - "stt_model": { - "description": "模型名称", - "hint": "modelscope 上的模型名称。默认:iic/SenseVoiceSmall。" - }, - "variables": { - "description": "工作流固定输入变量", - "hint": "可选。工作流固定输入变量,将会作为工作流的输入。也可以在对话时使用 /set 指令动态设置变量。如果变量名冲突,优先使用动态设置的变量。" - }, - "dashscope_app_type": { - "description": "应用类型", - "hint": "百炼应用的应用类型。" - }, - "timeout": { - "description": "超时时间", - "hint": "超时时间,单位为秒。" - }, - "openai-tts-voice": { - "description": "voice", - "hint": "OpenAI TTS 的声音。OpenAI 默认支持:'alloy', 'echo', 'fable', 'onyx', 'nova', 'shimmer'" - }, - "elevenlabs-tts-voice-id": { - "description": "音色 ID", - "hint": "ElevenLabs 音色 ID。可在 https://elevenlabs.io/app/voice-library 浏览并复制音色 ID。默认 'JBFqnCBsd6RMkjVDRZzb'(George)。" - }, - "elevenlabs-tts-output-format": { - "description": "输出格式", - "hint": "音频输出格式,例如 'mp3_44100_128'、'mp3_22050_32'、'wav_44100'、'opus_48000_128'。不支持裸 PCM/u-law/a-law 格式。默认 'mp3_44100_128'。" - }, - "elevenlabs-tts-stability": { - "description": "稳定性", - "hint": "音色稳定性,范围 [0, 1]。值越高越稳定,越低越富有表现力。留空则使用服务端默认值。" - }, - "elevenlabs-tts-similarity-boost": { - "description": "相似度增强", - "hint": "输出与原始音色的接近程度,范围 [0, 1]。留空则使用服务端默认值。" - }, - "elevenlabs-tts-style": { - "description": "风格夸张度", - "hint": "音色风格的夸张程度,范围 [0, 1]。值越高延迟越大。留空则使用服务端默认值。" - }, - "elevenlabs-tts-use-speaker-boost": { - "description": "说话人增强", - "hint": "增强与原始说话人的相似度,可能略微增加延迟。" - }, - "mimo-tts-voice": { - "description": "音色", - "hint": "MiMo TTS 的音色名称。可选值包括 'mimo_default'、'default_en'、'default_zh'。" - }, - "mimo-tts-format": { - "description": "输出格式", - "hint": "MiMo TTS 生成音频的格式。支持 'wav'、'mp3'、'pcm'。" - }, - "mimo-tts-style-prompt": { - "description": "风格提示词", - "hint": "会以 标签形式添加到待合成文本开头,用于控制语速、情绪、角色或风格,例如 开心、变快、孙悟空、悄悄话。可留空。" - }, - "mimo-tts-dialect": { - "description": "方言", - "hint": "会与风格提示词一起写入开头的 标签中,例如 东北话、四川话、河南话、粤语。可留空。" - }, - "mimo-tts-seed-text": { - "description": "种子文本", - "hint": "作为可选的 user 消息发送,用于辅助调节语气和风格,不会拼接到待合成文本中。" - }, - "fishaudio-tts-character": { - "description": "character", - "hint": "fishaudio TTS 的角色。默认为可莉。更多角色请访问:https://fish.audio/zh-CN/discovery" - }, - "fishaudio-tts-reference-id": { - "description": "reference_id", - "hint": "fishaudio TTS 的参考模型ID(可选)。如果填入此字段,将直接使用模型ID而不通过角色名称查询。例如:626bb6d3f3364c9cbc3aa6a67300a664。更多模型请访问:https://fish.audio/zh-CN/discovery,进入模型详情界面后可复制模型ID" - }, - "whisper_hint": { - "description": "本地部署 Whisper 模型须知", - "hint": "启用前请 pip 安装 openai-whisper 库(N卡用户大约下载 2GB,主要是 torch 和 cuda,CPU 用户大约下载 1 GB),并且安装 ffmpeg。否则将无法正常转文字。" - }, - "whisper_device": { - "description": "推理设备", - "hint": "Whisper 推理设备。Apple Silicon 可选 mps;其他环境建议使用 cpu。若指定 mps 但当前环境不可用,将自动回退到 cpu。" - }, - "id": { - "description": "ID" - }, - "type": { - "description": "模型提供商种类" - }, - "provider_type": { - "description": "模型提供商能力种类" - }, - "enable": { - "description": "启用" - }, - "key": { - "description": "API Key" - }, - "api_base": { - "description": "API Base URL" - }, - "total_timeout": { - "description": "总超时时间", - "hint": "单次决策请求的总超时时间(秒),包含等待并发名额、重试与退避;默认 5 秒。" - }, - "max_concurrency": { - "description": "最大并发数", - "hint": "该提供商同时进行的决策请求上限;默认 4。" - }, - "proxy": { - "description": "代理地址", - "hint": "HTTP/HTTPS 代理地址,格式如 http://127.0.0.1:7890。仅对该提供商的 API 请求生效,不影响 Docker 内网通信。" - }, - "model": { - "description": "模型 ID", - "hint": "模型名称,如 gpt-4o-mini, deepseek-chat。" - }, - "max_context_tokens": { - "description": "模型上下文窗口大小", - "hint": "模型最大上下文 Token 大小。如果为 0,则会自动从模型元数据填充(如有)。" - }, - "dify_api_key": { - "description": "API Key", - "hint": "Dify API Key。此项必填。" - }, - "dify_api_base": { - "description": "API Base URL", - "hint": "Dify API Base URL。默认为 https://api.dify.ai/v1" - }, - "dify_api_type": { - "description": "Dify 应用类型", - "hint": "Dify API 类型。根据 Dify 官网,目前支持 chat, chatflow, agent, workflow 三种应用类型。" - }, - "dify_workflow_output_key": { - "description": "Dify Workflow 输出变量名", - "hint": "Dify Workflow 输出变量名。当应用类型为 workflow 时才使用。默认为 astrbot_wf_output。" - }, - "dify_query_input_key": { - "description": "Prompt 输入变量名", - "hint": "发送的消息文本内容对应的输入变量名。默认为 astrbot_text_query。" - }, - "coze_api_key": { - "description": "Coze API Key", - "hint": "Coze API 密钥,用于访问 Coze 服务。" - }, - "bot_id": { - "description": "Bot ID", - "hint": "Coze 机器人的 ID,在 Coze 平台上创建机器人后获得。" - }, - "coze_api_base": { - "description": "API Base URL", - "hint": "Coze API 的基础 URL 地址,默认为 https://api.coze.cn" - }, - "deerflow_api_base": { - "description": "API Base URL", - "hint": "DeerFlow API 网关地址,默认为 http://127.0.0.1:2026" - }, - "deerflow_api_key": { - "description": "DeerFlow API Key", - "hint": "可选。若 DeerFlow 网关配置了 Bearer 鉴权,则在此填写。" - }, - "deerflow_auth_header": { - "description": "Authorization Header", - "hint": "可选。自定义 Authorization 请求头,优先级高于 DeerFlow API Key。" - }, - "deerflow_assistant_id": { - "description": "Assistant ID", - "hint": "DeerFlow 2.0 LangGraph assistant_id,默认为 lead_agent。" - }, - "deerflow_model_name": { - "description": "模型名称覆盖", - "hint": "可选。覆盖 DeerFlow 默认模型(对应运行时 configurable 的 model_name)。" - }, - "deerflow_thinking_enabled": { - "description": "启用思考模式" - }, - "deerflow_plan_mode": { - "description": "启用计划模式", - "hint": "对应 DeerFlow 2.0 运行时 configurable 的 is_plan_mode。" - }, - "deerflow_subagent_enabled": { - "description": "启用子智能体", - "hint": "对应 DeerFlow 2.0 运行时 configurable 的 subagent_enabled。" - }, - "deerflow_max_concurrent_subagents": { - "description": "子智能体最大并发数", - "hint": "对应 DeerFlow 2.0 运行时 configurable 的 max_concurrent_subagents。仅在启用子智能体时生效,默认 3。" - }, - "deerflow_recursion_limit": { - "description": "递归深度上限", - "hint": "对应 LangGraph recursion_limit。" - }, - "auto_save_history": { - "description": "由 Coze 管理对话记录", - "hint": "启用后,将由 Coze 进行对话历史记录管理, 此时 AstrBot 本地保存的上下文不会生效(仅供浏览), 对 AstrBot 的上下文进行的操作也不会生效。如果为禁用, 则使用 AstrBot 管理上下文。" - } - } - }, - "help": { - "documentation": "官方文档", - "support": "加群询问", - "helpText": "不了解配置?请见 {documentation} 或 {support}。", - "helpPrefix": "不了解配置?请见", - "helpMiddle": "或", - "helpSuffix": "。" - } -} +{ + "ai_group": { + "name": "AI", + "agent_runner": { + "description": "Agent 执行方式", + "hint": "选择 AI 对话的执行器。切换执行器会使用新类型的默认配置,不保留上一类型的参数。", + "provider_settings": { + "enable": { + "description": "启用", + "hint": "AI 对话总开关" + } + }, + "agent_runner": { + "runner_type": { + "description": "执行器", + "labels": [ + "内置 Agent", + "Dify", + "Coze", + "阿里云百炼应用", + "DeerFlow" + ] + } + } + }, + "dify_runner": { + "description": "Dify 配置", + "agent_runner": { + "config": { + "dify_api_type": { "description": "应用类型" }, + "dify_api_key": { "description": "API Key" }, + "dify_api_base": { "description": "API Base URL" }, + "dify_workflow_output_key": { "description": "Workflow 输出变量名" }, + "dify_query_input_key": { "description": "Prompt 输入变量名" }, + "variables": { "description": "变量" }, + "timeout": { "description": "超时时间(秒)" }, + "proxy": { "description": "代理地址" } + } + } + }, + "coze_runner": { + "description": "Coze 配置", + "agent_runner": { + "config": { + "coze_api_key": { "description": "API Key" }, + "bot_id": { "description": "Bot ID" }, + "coze_api_base": { "description": "API Base URL" }, + "auto_save_history": { "description": "由 Coze 管理对话记录" }, + "timeout": { "description": "超时时间(秒)" }, + "proxy": { "description": "代理地址" } + } + } + }, + "dashscope_runner": { + "description": "阿里云百炼应用配置", + "agent_runner": { + "config": { + "dashscope_app_type": { "description": "应用类型" }, + "dashscope_api_key": { "description": "API Key" }, + "dashscope_app_id": { "description": "应用 ID" }, + "rag_options": { + "pipeline_ids": { "description": "知识库 Pipeline ID" }, + "file_ids": { "description": "文件 ID" }, + "output_reference": { "description": "输出引用" } + }, + "variables": { "description": "变量" }, + "timeout": { "description": "超时时间(秒)" }, + "proxy": { "description": "代理地址" } + } + } + }, + "deerflow_runner": { + "description": "DeerFlow 配置", + "agent_runner": { + "config": { + "deerflow_api_base": { "description": "API Base URL" }, + "deerflow_api_key": { "description": "API Key" }, + "deerflow_auth_header": { "description": "Authorization Header" }, + "deerflow_assistant_id": { "description": "Assistant ID" }, + "deerflow_model_name": { "description": "模型名称覆盖" }, + "deerflow_thinking_enabled": { "description": "启用思考模式" }, + "deerflow_plan_mode": { "description": "启用计划模式" }, + "deerflow_subagent_enabled": { "description": "启用子智能体" }, + "deerflow_max_concurrent_subagents": { "description": "子智能体最大并发数" }, + "deerflow_recursion_limit": { "description": "递归深度上限" }, + "timeout": { "description": "超时时间(秒)" }, + "proxy": { "description": "代理地址" } + } + } + }, + "ai": { + "description": "模型", + "hint": "配置内置 Agent 使用的对话模型,以及通用的图片转述、语音模型。", + "agent_runner": { + "config": { + "model": { + "provider_id": { + "description": "对话模型", + "hint": "留空时使用第一个模型" + }, + "fallback_provider_ids": { + "description": "回退对话模型", + "hint": "主对话模型请求失败时,按顺序切换到这些对话模型。" + }, + "request_max_retries": { + "description": "异常重试次数", + "hint": "单次模型请求遇到可重试错误时的最大尝试次数。" + } + } + } + }, + "provider_settings": { + "default_image_caption_provider_id": { + "description": "图片转述模型", + "hint": "当对话模型不支持图片输入时,调用图片转述模型来获得图片描述。留空代表不使用。" + }, + "image_caption_prompt": { + "description": "图片转述提示词", + "hint": "用于图片转述模型的提示词。" + } + }, + "provider_stt_settings": { + "enable": { + "description": "语音识别", + "hint": "使用语音转文字模型将用户语音转述为文本,方便模型理解。" + }, + "provider_id": { + "description": "默认语音转文本模型", + "hint": "也可使用 /provider 指令单独选择会话的模型。" + } + }, + "provider_tts_settings": { + "enable": { + "description": "语音回复", + "hint": "使用文字转语音模型将文字转为语音回复。" + }, + "provider_id": { + "description": "默认文本转语音模型", + "hint": "也可使用 /provider 指令单独选择会话的模型。" + }, + "trigger_probability": { + "description": "TTS 触发概率", + "hint": "采用随机概率触发语音回复。" + } + } + }, + "persona": { + "description": "人格", + "hint": "赋予 AstrBot 人格。", + "agent_runner": { + "config": { + "persona": { + "persona_id": { "description": "默认采用的人格" }, + "safety_mode": { + "description": "健康模式", + "hint": "引导模型输出健康、安全的内容,避免有害或敏感话题。" + }, + "safety_mode_strategy": { + "description": "健康模式策略", + "hint": "选择健康模式的实现策略。" + } + } + } + } + }, + "knowledgebase": { + "description": "知识库", + "hint": "AstrBot 的 “外置大脑”。", + "kb_names": { + "description": "知识库列表", + "hint": "支持多选" + }, + "kb_fusion_top_k": { + "description": "融合检索结果数", + "hint": "多个知识库检索结果融合后的返回结果数量" + }, + "kb_final_top_k": { + "description": "最终返回结果数", + "hint": "从知识库中检索到的结果数量,越大可能获得越多相关信息,但也可能引入噪音。建议根据实际需求调整" + }, + "kb_agentic_mode": { + "description": "Agentic 知识库检索", + "hint": "启用后,知识库检索将作为 LLM Tool,由模型自主决定何时调用知识库进行查询。需要模型支持函数调用能力。" + } + }, + "websearch": { + "description": "网页搜索", + "hint": "让 AstrBot 能够访问互联网,获悉时讯。", + "provider_settings": { + "web_search": { + "description": "启用网页搜索" + }, + "websearch_provider": { + "description": "网页搜索提供商", + "labels": [ + "SerpApi", + "DeepSeek Search API", + "Tavily", + "Baidu AI Search", + "Bocha", + "Brave", + "Firecrawl", + "Exa", + "AnySearch" + ], + "subtitles": [ + "Google 网页、新闻、图片、学术和财经搜索", + "DeepSeek 官方搜索接口", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "websearch_tavily_key": { + "description": "Tavily API Key", + "hint": "可添加多个 Key 进行轮询。" + }, + "websearch_bocha_key": { + "description": "BoCha API Key", + "hint": "可添加多个 Key 进行轮询。" + }, + "websearch_brave_key": { + "description": "Brave Search API Key", + "hint": "可添加多个 Key 进行轮询。" + }, + "websearch_firecrawl_key": { + "description": "Firecrawl API Key", + "hint": "可添加多个 Key 进行轮询。" + }, + "websearch_baidu_app_builder_key": { + "description": "百度千帆智能云 APP Builder API Key", + "hint": "参考:[https://console.bce.baidu.com/iam/#/iam/apikey/list](https://console.bce.baidu.com/iam/#/iam/apikey/list)" + }, + "web_search_link": { + "description": "显示来源引用" + }, + "websearch_exa_key": { + "description": "Exa API Key", + "hint": "可添加多个 Key 进行轮询。获取 Key: https://dashboard.exa.ai" + }, + "websearch_anysearch_key": { + "description": "AnySearch API Key", + "hint": "可添加多个 Key 进行轮询。留空则使用匿名模式(每日免费额度)。" + }, + "websearch_serpapi_key": { + "description": "SerpApi API Key", + "hint": "支持 Google 网页、新闻、图片、学术和财经搜索。可添加多个 Key 轮询。获取 Key:[https://serpapi.com/manage-api-key](https://serpapi.com/manage-api-key)" + }, + "websearch_deepseek_key": { + "description": "DeepSeek API Key", + "hint": "填入 DeepSeek API Key。可使用与对话模型相同的 Key(需独立填写)。可添加多个 Key 轮询。 获取 Key: [https://platform.deepseek.com/api_keys](https://platform.deepseek.com/api_keys)" + } + } + }, + "file_extract": { + "description": "文档解析能力", + "provider_settings": { + "file_extract": { + "enable": { + "description": "启用文档解析能力" + }, + "provider": { + "description": "文档解析提供商" + }, + "moonshotai_api_key": { + "description": "Moonshot AI API Key" + } + } + } + }, + "agent_computer_use": { + "description": "使用电脑能力", + "hint": "让 AstrBot 访问和使用本机环境或者隔离的沙盒环境,以执行更复杂的任务。详见: [Agent 沙盒环境](https://docs.astrbot.app/use/astrbot-agent-sandbox.html)。", + "provider_settings": { + "computer_use_runtime": { + "description": "运行环境", + "hint": "允许 Agent 访问的环境。", + "labels": ["不允许任何环境", "本机环境", "第三方沙箱环境"] + }, + "computer_use_local_permissions": { + "description": "本地权限策略" + }, + "computer_use_require_admin": { + "description": "沙箱能力需要 AstrBot 管理员权限", + "hint": "开启后,需要 AstrBot 管理员权限才能调用远程沙箱能力。在配置文件 -> 访问控制 -> 管理员 -> 管理员 ID 中可添加管理员。给机器人发送 /sid 指令以获取 ID。" + }, + "sandbox": { + "booter": { + "description": "沙箱环境驱动器" + }, + "shipyard_neo_endpoint": { + "description": "Shipyard Neo API Endpoint", + "hint": "Shipyard Neo(Bay) 服务的 API 地址,默认 http://127.0.0.1:8114。" + }, + "shipyard_neo_access_token": { + "description": "Shipyard Neo 访问令牌", + "hint": "Bay 的 API Key(sk-bay-...)。留空时自动从 credentials.json 发现。" + }, + "shipyard_neo_profile": { + "description": "Shipyard Neo Profile", + "hint": "Shipyard Neo 沙箱 profile,例如 python-default。留空时自动选择能力更完整的 profile。" + }, + "shipyard_neo_ttl": { + "description": "Shipyard Neo Sandbox 存活时间(秒)", + "hint": "Shipyard Neo 沙箱的生存时间(秒)。" + }, + "cua_image": { + "description": "CUA 镜像", + "hint": "CUA 沙箱镜像/系统类型,默认 linux。可填写 linux、macos、windows、android,具体取决于 CUA SDK 支持。" + }, + "cua_os_type": { + "description": "CUA 操作系统类型", + "hint": "CUA 沙箱操作系统类型,默认 linux。" + }, + "cua_idle_timeout": { + "description": "CUA 空闲超时(秒)", + "hint": "CUA 沙箱空闲超时时间(秒)。大于 0 时,AstrBot 会在会话空闲达到该时长后主动关闭 CUA 沙箱;0 表示禁用。" + }, + "cua_telemetry_enabled": { + "description": "CUA 遥测", + "hint": "是否允许 CUA SDK 发送遥测数据。默认关闭。" + }, + "cua_local": { + "description": "CUA 本地沙箱", + "hint": "是否优先使用 CUA 本地沙箱。默认开启,避免云端沙箱要求 CUA_API_KEY。关闭后可使用 CUA 云端沙箱。" + }, + "cua_api_key": { + "description": "CUA API Key", + "hint": "CUA 云端沙箱 API Key。仅在关闭本地沙箱时需要。也可以通过 CUA_API_KEY 环境变量提供。" + }, + "shipyard_endpoint": { + "description": "Shipyard API Endpoint", + "hint": "Shipyard 服务的 API 访问地址。" + }, + "shipyard_access_token": { + "description": "Shipyard 访问令牌", + "hint": "用于访问 Shipyard 服务的访问令牌。" + }, + "shipyard_ttl": { + "description": "Shipyard Ship 存活时间(秒)", + "hint": "Shipyard 会话的生存时间(秒)。" + }, + "shipyard_max_sessions": { + "description": "Shipyard Ship 会话复用上限", + "hint": "决定了一个实例承载的最大会话数量。" + } + } + }, + "local_permissions": { + "role": "用户身份", + "execution": "允许执行代码", + "network": "允许执行环境联网", + "filesystem": "文件访问范围", + "scopes": { + "workspace": "工作区", + "host": "整个环境" + }, + "scopeHints": { + "none": "不允许访问任何文件", + "workspace": "受限的工作区、临时目录和技能文件。", + "workspaceUnsupported": "当前系统不支持受限工作区文件访问。", + "host": "AstrBot 所在运行环境的所有文件。" + }, + "scopeDetails": { + "account": "1. 可访问 AstrBot 运行账户有权限访问的文件。", + "docker": "2. 如果通过 Docker 部署,则仅可访问容器内及挂载的文件,并非宿主机全部文件。" + }, + "roles": { + "member": "普通成员", + "admin": "管理员" + }, + "modes": { + "none": "关闭" + }, + "networkAlwaysOn": "始终开启", + "windowsHostNetworkHint": "Windows 暂不支持在“整个环境”执行代码时单独禁网。切换到“工作区”后可关闭联网。", + "runtimeUnknown": "运行环境信息不可用。", + "memberWarning": "普通成员已获得联网或整个环境访问权限。", + "executionInactive": "未生效", + "executionInactiveHelp": "查看未生效原因", + "executionBlocked": "{role}已开启代码执行,但当前无法满足所配置的隔离限制。原因:{reason}", + "runtime": { + "os": "操作系统", + "arch": "架构", + "sandbox": "本地隔离", + "windowsUnavailable": "{backend} · 尚未就绪", + "windowsSetupHint": "请保存配置并重启 AstrBot;如出现管理员授权提示,请允许以完成沙盒初始化。", + "errorDetails": "查看诊断详情", + "unavailableHint": "沙箱启动失败,受限 Shell/Python 执行及工作区文件搜索会受到影响。请根据下方错误检查系统安全策略(如 Linux 的 AppArmor、用户命名空间限制)或容器限制,修复后重启 AstrBot 重新检测。", + "dialog": { + "intro": "利用 macOS 的 Seatbelt 或 Linux 的 bubblewrap(bwrap)技术,为 AstrBot Agent 的执行提供安全隔离,以限制不同用户使用 AstrBot Agent 时的文件访问范围和联网权限,获得更高的安全性。", + "startupError": "查看启动错误", + "documentation": "查看详细配置文档" + }, + "close": "关闭", + "setupHint": { + "missing": "安装 {dependency} 以获得完整的本地隔离功能。", + "unavailable": "配置 {backend},启用完整的本地隔离功能。", + "unsupported": "了解本地隔离支持情况。" + }, + "isolationFailure": { + "missing": "缺少 {dependency}。", + "unavailable": "{backend} 启动探测失败。", + "unsupported": "当前系统不支持本地进程隔离。" + }, + "executionUnavailable": { + "missing": "缺少 {dependency},无法在“文件访问范围”选择“工作区”时允许执行代码。", + "unavailable": "{backend} 无法启动,无法在“文件访问范围”选择“工作区”时允许执行代码。", + "unsupported": "当前系统不支持本地隔离,无法在“文件访问范围”选择“工作区”时允许执行代码。" + }, + "status": { + "detected": "{backend}", + "missing": "缺少 {dependency}", + "unavailable": "{backend} · 已安装但无法启动", + "unsupported": "暂不支持" + } + } + } + }, + "proactive_capability": { + "description": "主动型能力", + "hint": "让 AstrBot 能够在某一时刻自动唤醒,帮你完成任务。详见: [主动型 Agent](https://docs.astrbot.app/use/proactive-agent.html)。", + "provider_settings": { + "proactive_capability": { + "add_cron_tools": { + "description": "启用", + "hint": "启用后,将会传递给 Agent 相关工具来实现主动型 Agent。你可以告诉 AstrBot 未来某个时间要做的事情,它将被定时触发然后执行任务,然后将结果发送给你。" + } + } + } + }, + "truncate_and_compress": { + "hint": "AstrBot 如何管理工作记忆。详见: [上下文管理策略](https://docs.astrbot.app/use/context-compress.html)。", + "description": "上下文管理策略", + "agent_runner": { + "config": { + "compression": { + "max_turns": { + "description": "压缩前最多保留对话轮数", + "hint": "普通会话历史超过该轮数后,才会按下方策略进行持久化截断或 LLM 压缩;请求发送前也会先按该值约束上下文。-1 表示不按轮数限制。" + }, + "trim_turns": { + "description": "轮次超限时一次丢弃轮数", + "hint": "当超过\"压缩前最多保留对话轮数\"且无法使用 LLM 压缩时,一次丢弃多少轮旧对话;请求期截断也会复用该值。" + }, + "overflow_strategy": { + "description": "压缩策略", + "labels": ["按对话轮数截断", "由 LLM 压缩上下文"], + "hint": "模型上下文超限时的处理策略。" + }, + "instruction": { + "description": "上下文压缩提示词", + "hint": "如果为空则使用默认提示词。" + }, + "keep_recent_ratio": { + "description": "压缩时保留最近上下文比例", + "hint": "按当前上下文 token 数保留最近内容,范围 0-0.3。0.15 表示保留 15%;比例大于 0 时至少保留最后一轮。" + }, + "provider_id": { + "description": "压缩模型", + "hint": "用于上下文压缩的模型。默认选择当前的对话模型。" + }, + "fallback_max_tokens": { + "description": "上下文窗口兜底值", + "hint": "当 max_context_tokens 为 0 且模型不在内置元数据中时,使用此值作为上下文窗口大小。默认 128000。" + } + } + } + } + }, + "others": { + "description": "其他配置", + "agent_runner": { + "config": { + "misc": { + "max_steps": { "description": "工具调用轮数上限" }, + "tool_schema_mode": { + "description": "工具调用模式", + "hint": "skills-like 先下发工具名称与描述,再下发参数;full 一次性下发完整参数。", + "labels": ["Skills-like(两阶段)", "Full(完整参数)"] + }, + "tool_call_timeout": { + "description": "工具调用超时时间(秒)" + }, + "sanitize_context_by_modalities": { + "description": "按模型能力清理历史上下文", + "hint": "开启后,在每次请求 LLM 前会按当前模型提供商中所选择的模型能力删除对话中不支持的图片/工具调用结构(会改变模型看到的历史)" + } + } + } + }, + "provider_settings": { + "display_reasoning_text": { + "description": "显示思考内容", + "hint": "显示模型的思维链信息到最终回复中。" + }, + "identifier": { + "description": "用户识别", + "hint": "在用户提示词前带上用户 ID 信息。" + }, + "group_name_display": { + "description": "显示群名称", + "hint": "在受支持的消息平台的群聊中的用户提示词前带上群名称信息。" + }, + "datetime_system_prompt": { + "description": "现实世界时间感知", + "hint": "在用户提示词中带上当前的时间信息。" + }, + "show_tool_use_status": { + "description": "输出工具调用信息", + "hint": "有工具调用时,同时发送带有工具调用名字的消息。" + }, + "show_tool_call_result": { + "description": "输出工具调用结果", + "hint": "仅在启用“输出工具调用信息”时生效,且最多展示 70 个字符。" + }, + "buffer_intermediate_messages": { + "description": "合并 Agent 中间消息", + "hint": "开启后,非流式模式下多步工具调用过程中产生的中间文本将缓冲,待 Agent 完成后合并为一条回复发送。" + }, + "max_quoted_fallback_images": { + "description": "转发消息中图片获取上限", + "hint": "转发消息解析到的图片最多注入数量,超出部分会截断。" + }, + "quoted_message_parser": { + "max_component_chain_depth": { + "description": "转发消息富文本解析深度", + "hint": "解析转发消息中的富文本组件链时允许的最大递归深度。" + }, + "max_forward_node_depth": { + "description": "转发消息嵌套解析深度", + "hint": "解析嵌套转发节点时允许的最大递归深度。" + }, + "max_forward_fetch": { + "description": "转发消息递归拉取上限", + "hint": "递归调用 get_forward_msg 拉取转发内容的最大次数。" + }, + "warn_on_action_failure": { + "description": "转发消息解析失败告警", + "hint": "开启后,get_msg/get_forward_msg 全部尝试失败时输出 warning 日志。" + } + }, + "streaming_response": { + "description": "流式输出", + "hint": "在受支持的聊天平台中以打字机的形式输出响应。" + }, + "unsupported_streaming_strategy": { + "description": "不支持流式回复的平台", + "hint": "选择在不支持流式回复的平台上的处理方式。实时分段回复会在系统接收流式响应检测到诸如标点符号等分段点时,立即发送当前已接收的内容", + "labels": [ + "实时分段回复", + "关闭流式回复" + ] + }, + "wake_prefix": { + "description": "额外唤醒前缀", + "hint": "如果唤醒前缀为 /, 额外聊天唤醒前缀为 chat,则需要 /chat 才会触发 LLM 请求" + }, + "prompt_prefix": { + "description": "用户提示词", + "hint": "可使用 {{prompt}} 作为用户输入的占位符。如果不输入占位符则代表添加在用户输入的前面。" + }, + "image_compress_options": { + "description": "模型输入图片设置", + "hint": "图片始终处理为严格小于 512 KiB 的 JPEG/PNG,原始附件保留。", + "max_size": { + "description": "输入图片最大边长", + "hint": "发送给模型的图片最长边(像素),系统会在必要时进一步压缩。" + } + }, + "reachability_check": { + "description": "提供商可达性检测", + "hint": "/provider 命令列出模型时并发检测连通性。开启后会主动调用模型测试连通性,可能产生额外 token 消耗。" + } + }, + "provider_tts_settings": { + "dual_output": { + "description": "开启 TTS 时同时输出语音和文字内容" + } + } + } + }, + "platform_group": { + "name": "平台与消息", + "platform": { + "description": "消息平台适配器", + "app_id": { + "description": "应用 ID", + "hint": "消息平台开放平台中的应用 ID。" + }, + "app_secret": { + "description": "应用密钥", + "hint": "消息平台开放平台中的应用密钥。请妥善保管,避免泄露。" + }, + "domain": { + "description": "开放平台 API 地址", + "hint": "开放平台 API 的基础地址。使用默认官方服务时通常无需修改。" + }, + "corpid": { + "description": "企业 ID", + "hint": "企业微信后台中的企业 ID(CorpID)。" + }, + "token": { + "description": "回调 Token", + "hint": "消息平台回调配置中用于验证请求的 Token。" + }, + "encoding_aes_key": { + "description": "消息加密密钥", + "hint": "消息平台回调配置中的 EncodingAESKey,用于加密和解密消息。" + }, + "api_base_url": { + "description": "API 基础地址", + "hint": "消息平台 API 的基础地址。使用默认官方服务时通常无需修改。" + }, + "client_id": { + "description": "客户端 ID", + "hint": "消息平台开放平台中的客户端 ID。" + }, + "client_secret": { + "description": "客户端密钥", + "hint": "消息平台开放平台中的客户端密钥。请妥善保管,避免泄露。" + }, + "start_message": { + "description": "Start 命令回复", + "hint": "用户向 Telegram 机器人发送 /start 命令时回复的内容。" + }, + "telegram_api_base_url": { + "description": "API 地址", + "hint": "Telegram Bot API 的基础地址。使用官方服务时通常无需修改。" + }, + "telegram_file_base_url": { + "description": "文件 API 地址", + "hint": "Telegram Bot API 文件下载接口的基础地址。使用官方服务时通常无需修改。" + }, + "bot_token": { + "description": "Slack Bot Token", + "hint": "Slack 应用的 Bot User OAuth Token,通常以 xoxb- 开头。" + }, + "app_token": { + "description": "Slack App Token", + "hint": "Slack Socket Mode 使用的 App-Level Token,通常以 xapp- 开头。" + }, + "signing_secret": { + "description": "Slack Signing Secret", + "hint": "Slack 应用的 Signing Secret,用于验证 Webhook 请求。" + }, + "channel_access_token": { + "description": "LINE 频道访问令牌", + "hint": "LINE Messaging API 频道的 Channel Access Token。" + }, + "channel_secret": { + "description": "LINE 频道密钥", + "hint": "LINE Messaging API 频道的 Channel Secret。" + }, + "active_send_mode": { + "description": "是否换用主动发送接口" + }, + "appid": { + "description": "appid", + "hint": "必填项。当前消息平台的 AppID。如何获取请参考对应平台接入文档。" + }, + "callback_server_host": { + "description": "回调服务器主机", + "hint": "回调服务器主机。留空则不启用回调服务器。" + }, + "card_template_id": { + "description": "卡片模板 ID", + "hint": "可选。钉钉互动卡片模板 ID。启用后将使用互动卡片进行流式回复。" + }, + "discord_activity_name": { + "description": "Discord 活动名称", + "hint": "可选的 Discord 活动名称。留空则不设置活动。" + }, + "discord_allow_bot_messages": { + "description": "允许接收机器人消息", + "hint": "启用后,AstrBot 将接收来自其他 Discord 机器人的消息。适用于机器人间通信场景(如消息转发)。默认关闭。" + }, + "discord_command_register": { + "description": "注册 Discord 指令", + "hint": "启用后,自动将插件指令注册为 Discord 斜杠指令" + }, + "discord_proxy": { + "description": "Discord 代理地址", + "hint": "可选的代理地址:http://ip:port" + }, + "discord_token": { + "description": "Discord Bot Token", + "hint": "在此处填入你的 Discord Bot Token" + }, + "enable": { + "description": "启用", + "hint": "是否启用该适配器。未启用的适配器对应的消息平台将不会接收到消息。" + }, + "enable_group_c2c": { + "description": "启用消息列表单聊", + "hint": "启用后,机器人可以接收到 QQ 消息列表中的私聊消息。你可能需要在 QQ 机器人平台上通过扫描二维码的方式添加机器人为你的好友。详见文档。" + }, + "enable_guild_direct_message": { + "description": "启用频道私聊", + "hint": "启用后,机器人可以接收到频道的私聊消息。" + }, + "id": { + "description": "机器人名称", + "hint": "机器人名称" + }, + "is_sandbox": { + "description": "沙箱模式" + }, + "kf_name": { + "description": "微信客服账号名", + "hint": "如果填写此项,即代表你将使用企业微信客服,而不是企业微信应用。可在 https://kf.weixin.qq.com/kf/frame#/accounts 获取。" + }, + "lark_connection_mode": { + "description": "订阅方式", + "labels": [ + "长连接模式", + "推送至服务器模式" + ] + }, + "lark_encrypt_key": { + "description": "Encrypt Key", + "hint": "用于解密飞书回调数据的加密密钥" + }, + "lark_verification_token": { + "description": "Verification Token", + "hint": "用于验证飞书回调请求的令牌" + }, + "misskey_allow_insecure_downloads": { + "description": "允许不安全下载(禁用 SSL 验证)", + "hint": "当远端服务器存在证书问题导致无法正常下载时,自动禁用 SSL 验证作为回退方案。适用于某些图床的证书配置问题。启用有安全风险,仅在必要时使用。" + }, + "misskey_default_visibility": { + "description": "默认帖子可见性", + "hint": "机器人发帖时的默认可见性设置。public:公开,home:主页时间线,followers:仅关注者。" + }, + "misskey_download_chunk_size": { + "description": "流式下载分块大小(字节)", + "hint": "流式下载和计算 MD5 时使用的每次读取字节数,过小会增加开销,过大会占用内存。" + }, + "misskey_download_timeout": { + "description": "远端下载超时时间(秒)", + "hint": "下载远程文件时的超时时间(秒),用于异步上传回退到本地上传的场景。" + }, + "misskey_enable_chat": { + "description": "启用聊天消息响应", + "hint": "启用后,机器人将会监听和响应私信聊天消息" + }, + "misskey_enable_file_upload": { + "description": "启用文件上传到 Misskey", + "hint": "启用后,适配器会尝试将消息链中的文件上传到 Misskey。URL 文件会先尝试服务器端上传,异步上传失败时会回退到下载后本地上传。" + }, + "misskey_instance_url": { + "description": "Misskey 实例 URL", + "hint": "例如 https://misskey.example,填写 Bot 账号所在的 Misskey 实例地址" + }, + "misskey_local_only": { + "description": "仅限本站(不参与联合)", + "hint": "启用后,机器人发出的帖子将仅在本实例可见,不会联合到其他实例" + }, + "misskey_max_download_bytes": { + "description": "最大允许下载字节数(超出则中止)", + "hint": "如果希望限制下载文件的最大大小以防止 OOM,请填写最大字节数;留空或 null 表示不限制。" + }, + "misskey_token": { + "description": "Misskey Access Token", + "hint": "连接服务设置生成的 API 鉴权访问令牌(Access token)" + }, + "misskey_upload_concurrency": { + "description": "并发上传限制", + "hint": "同时进行的文件上传任务上限(整数,默认 3)。" + }, + "misskey_upload_folder": { + "description": "上传到网盘的目标文件夹 ID", + "hint": "可选:填写 Misskey 网盘中目标文件夹的 ID,上传的文件将放置到该文件夹内。留空则使用账号网盘根目录。" + }, + "port": { + "description": "回调服务器端口", + "hint": "回调服务器端口。留空则不启用回调服务器。" + }, + "satori_api_base_url": { + "description": "Satori API 终结点", + "hint": "Satori API 的基础地址。" + }, + "satori_auto_reconnect": { + "description": "启用自动重连", + "hint": "断开连接时是否自动重新连接 WebSocket。" + }, + "satori_endpoint": { + "description": "Satori WebSocket 终结点", + "hint": "Satori 事件的 WebSocket 端点。" + }, + "satori_heartbeat_interval": { + "description": "Satori 心跳间隔", + "hint": "发送心跳消息的间隔(秒)。" + }, + "satori_reconnect_delay": { + "description": "Satori 重连延迟", + "hint": "尝试重新连接前的延迟时间(秒)。" + }, + "satori_token": { + "description": "Satori 令牌", + "hint": "用于 Satori API 身份验证的令牌。" + }, + "secret": { + "description": "secret", + "hint": "必填项。" + }, + "slack_connection_mode": { + "description": "Slack Connection Mode", + "hint": "The connection mode for Slack. `webhook` uses a webhook server, `socket` uses Slack's Socket Mode." + }, + "slack_webhook_host": { + "description": "Slack Webhook Host", + "hint": "Only valid when Slack connection mode is `webhook`." + }, + "slack_webhook_path": { + "description": "Slack Webhook Path", + "hint": "Only valid when Slack connection mode is `webhook`." + }, + "slack_webhook_port": { + "description": "Slack Webhook Port", + "hint": "Only valid when Slack connection mode is `webhook`." + }, + "telegram_command_auto_refresh": { + "description": "命令自动刷新", + "hint": "启用后,AstrBot 将会在运行时自动刷新 Telegram 命令。(单独设置此项无效)" + }, + "telegram_command_register": { + "description": "命令注册", + "hint": "启用后,AstrBot 将会自动注册 Telegram 命令。" + }, + "telegram_command_register_interval": { + "description": "命令自动刷新间隔", + "hint": "Telegram 命令自动刷新间隔,单位为秒。" + }, + "telegram_polling_restart_delay": { + "description": "轮询重启延迟", + "hint": "当轮询意外结束尝试自动重启时的延迟时间,单位为秒。默认为 5s。" + }, + "telegram_token": { + "description": "Bot Token", + "hint": "如果你的网络环境为中国大陆,请在 `其他配置` 处设置代理或更改 api_base。" + }, + "mattermost_url": { + "description": "Mattermost URL", + "hint": "Mattermost 服务地址,例如 https://chat.example.com。" + }, + "mattermost_bot_token": { + "description": "Mattermost Bot Token", + "hint": "在 Mattermost 中创建 Bot 账户后生成的访问令牌。" + }, + "mattermost_reconnect_delay": { + "description": "Mattermost 重连延迟", + "hint": "WebSocket 断开后的重连等待时间,单位为秒。默认 5 秒。" + }, + "type": { + "description": "适配器类型" + }, + "unified_webhook_mode": { + "description": "统一 Webhook 模式", + "hint": "Webhook 模式下使用 AstrBot 统一 Webhook 入口,无需单独开启端口。回调地址为 /api/v1/webhooks/platforms/{webhook_uuid}。" + }, + "use_markdown": { + "description": "主动消息使用 Markdown", + "hint": "启用后,机器人主动发送消息默认以 Markdown 模式发送;插件显式调用 use_markdown() 指定行为时不受此配置影响。" + }, + "webhook_uuid": { + "description": "Webhook UUID", + "hint": "统一 Webhook 模式下的唯一标识符,创建平台时自动生成。" + }, + "wecom_ai_bot_name": { + "description": "企业微信智能机器人的名字", + "hint": "请务必填写正确,否则无法使用一些指令。" + }, + "wecom_ai_bot_connection_mode": { + "description": "企业微信智能机器人连接模式", + "hint": "Webhook 回调模式需要配置 Token/EncodingAESKey;长连接模式需要配置 BotID/Secret。" + }, + "wecomaibot_friend_message_welcome_text": { + "description": "企业微信智能机器人私聊欢迎语", + "hint": "可选。当用户当天进入智能机器人单聊会话,回复欢迎语,如 “💭 思考中...”。留空则不回复。" + }, + "wecomaibot_init_respond_text": { + "description": "企业微信智能机器人初始响应文本", + "hint": "可选。当机器人收到消息时,首先回复的文本内容。留空则不设置。" + }, + "wecomaibot_token": { + "description": "企业微信智能机器人 Token", + "hint": "用于 Webhook 回调模式的身份验证。" + }, + "wecomaibot_encoding_aes_key": { + "description": "企业微信智能机器人 EncodingAESKey", + "hint": "用于 Webhook 回调模式的消息加密解密。" + }, + "wecomaibot_ws_bot_id": { + "description": "长连接 BotID", + "hint": "企业微信智能机器人长连接模式凭证 BotID。" + }, + "wecomaibot_ws_secret": { + "description": "长连接 Secret", + "hint": "企业微信智能机器人长连接模式凭证 Secret。" + }, + "wecomaibot_ws_url": { + "description": "长连接 WebSocket 地址", + "hint": "默认值为 wss://openws.work.weixin.qq.com,一般无需修改。" + }, + "wecomaibot_heartbeat_interval": { + "description": "长连接心跳间隔", + "hint": "长连接模式心跳间隔(秒),建议 30 秒。" + }, + "wpp_active_message_poll": { + "description": "是否启用主动消息轮询", + "hint": "只有当你发现微信消息没有按时同步到 AstrBot 时,才需要启用这个功能,默认不启用。" + }, + "wpp_active_message_poll_interval": { + "description": "主动消息轮询间隔", + "hint": "主动消息轮询间隔,单位为秒,默认 3 秒,最大不要超过 60 秒,否则可能被认为是旧消息。" + }, + "ws_reverse_host": { + "description": "反向 Websocket 主机", + "hint": "AstrBot 将作为服务器端。" + }, + "ws_reverse_port": { + "description": "反向 Websocket 端口" + }, + "ws_reverse_token": { + "description": "反向 Websocket Token", + "hint": "反向 Websocket Token。未设置则不启用 Token 验证。" + }, + "msg_push_webhook_url": { + "description": "企业微信消息推送 Webhook URL", + "hint": "可选。用于主动消息推送,请在企微群->消息推送得到 URL。建议设置此项以带来更好的消息发送体验。" + }, + "only_use_webhook_url_to_send": { + "description": "仅使用 Webhook 发送消息", + "hint": "可选。启用后,企业微信智能机器人的所有回复都改为通过消息推送 Webhook 发送。消息推送 Webhook 支持更多的消息类型(如图片、文件等)。如果不需要打字机效果,强烈建议使用此选项。" + }, + "weixin_oc_base_url": { + "description": "Base URL 地址", + "hint": "默认值: https://ilinkai.weixin.qq.com" + }, + "weixin_oc_bot_type": { + "description": "扫码参数 bot_type", + "hint": "默认值: 3" + }, + "weixin_oc_qr_poll_interval": { + "description": "二维码状态轮询间隔(秒)", + "hint": "每隔多少秒轮询一次二维码状态。" + }, + "weixin_oc_long_poll_timeout_ms": { + "description": "getUpdates 长轮询超时时间(毫秒)", + "hint": "会话消息拉取接口超时参数。" + }, + "weixin_oc_api_timeout_ms": { + "description": "HTTP 请求超时(毫秒)", + "hint": "通用 API 请求超时参数。" + }, + "weixin_oc_token": { + "description": "登录后 token(可留空)", + "hint": "扫码登录成功后会自动写入;高级场景可手动填写。" + }, + "kook_bot_token": { + "description": "机器人 Token", + "type": "string", + "hint": "必填项。从 KOOK 开发者平台获取的机器人 Token" + }, + "kook_reconnect_delay": { + "description": "重连延迟", + "type": "int", + "hint": "重连延迟时间(秒),使用指数退避策略" + }, + "kook_max_reconnect_delay": { + "description": "最大重连延迟", + "type": "int", + "hint": "重连延迟的最大值(秒)" + }, + "kook_max_retry_delay": { + "description": "最大重试延迟", + "type": "int", + "hint": "重试的最大延迟时间(秒)" + }, + "kook_heartbeat_interval": { + "description": "心跳间隔", + "type": "int", + "hint": "心跳检测间隔时间(秒)" + }, + "kook_heartbeat_timeout": { + "description": "心跳超时时间", + "type": "int", + "hint": "心跳检测超时时间(秒)" + }, + "kook_max_heartbeat_failures": { + "description": "最大心跳失败次数", + "type": "int", + "hint": "允许的最大心跳失败次数,超过后断开连接" + }, + "kook_max_consecutive_failures": { + "description": "最大连续失败次数", + "type": "int", + "hint": "允许的最大连续失败次数,超过后停止重试" + } + }, + "general": { + "description": "基本", + "platform_settings": { + "unique_session": { + "description": "隔离对话", + "hint": "启用后,支持隔离的渠道会为每位群成员使用独立上下文。指令权限请在「管理行为 → 指令」中设置。" + }, + "friend_message_needs_wake_prefix": { + "description": "私聊消息需要唤醒词", + "hint": "私聊消息也必须带上唤醒前缀才能唤醒机器人。" + }, + "reply_prefix": { + "description": "回复时的文本前缀", + "hint": "回复中附带的文本前缀。" + }, + "reply_with_mention": { + "description": "回复时 @ 发送人", + "hint": "回复时提及发送人。" + }, + "reply_with_quote": { + "description": "回复时引用发送人消息", + "hint": "回复时引用发送人的对应消息。" + }, + "forward_threshold": { + "description": "转发消息的字数阈值", + "hint": "在受支持的平台上,当回复消息过长时,采用 “合并消息转发” 的方式发送消息。" + }, + "empty_mention_waiting": { + "description": "只 @ 机器人是否触发等待", + "hint": "当发送一条只有提及机器人的消息时,是否在接下来的 1 分钟内保持唤醒状态等待用户的第二条消息。" + } + }, + "wake_prefix": { + "description": "唤醒词", + "hint": "唤醒机器人的消息前缀的列表,也可以通过 @ 机器人来唤醒。\n\n内置指令(如 `/help`、`/sid`)也依赖唤醒词:群聊中不带唤醒词直接输入将无法触发;私聊在未启用「私聊消息需要唤醒词」时无需前缀,可直接输入指令触发。" + }, + "disable_builtin_commands": { + "description": "禁用自带指令", + "hint": "禁用所有 AstrBot 自带指令,如 help, sid, new 等" + } + }, + "rate_limit": { + "description": "速率限制", + "platform_settings": { + "rate_limit": { + "time": { + "description": "消息速率限制时间(秒)" + }, + "count": { + "description": "消息速率限制计数" + }, + "strategy": { + "description": "速率限制策略" + } + } + } + }, + "content_safety": { + "description": "内容安全", + "content_safety": { + "also_use_in_response": { + "description": "同时检查模型的响应内容" + }, + "baidu_aip": { + "enable": { + "description": "使用百度内容安全审核", + "hint": "您需要手动安装 baidu-aip 库。" + }, + "app_id": { + "description": "App ID" + }, + "api_key": { + "description": "API Key" + }, + "secret_key": { + "description": "Secret Key" + } + }, + "internal_keywords": { + "enable": { + "description": "关键词检查" + }, + "extra_keywords": { + "description": "额外关键词", + "hint": "额外的屏蔽关键词列表,支持正则表达式。" + } + } + } + }, + "others": { + "description": "其他配置", + "platform_settings": { + "ignore_bot_self_message": { + "description": "是否忽略机器人自身的消息" + }, + "ignore_at_all": { + "description": "是否忽略 @ 全体成员事件" + }, + "no_permission_reply": { + "description": "用户权限不足时是否回复" + } + }, + "platform_specific": { + "lark": { + "pre_ack_emoji": { + "enable": { + "description": "[飞书] 启用预回应表情" + }, + "emojis": { + "description": "表情列表(飞书表情枚举名)", + "hint": "表情枚举名参考:[https://open.feishu.cn/document/server-docs/im-v1/message-reaction/emojis-introduce](https://open.feishu.cn/document/server-docs/im-v1/message-reaction/emojis-introduce)" + } + } + }, + "telegram": { + "pre_ack_emoji": { + "enable": { + "description": "[Telegram] 启用预回应表情" + }, + "emojis": { + "description": "表情列表(Unicode)", + "hint": "Telegram 仅支持固定反应集合,参考:[https://gist.github.com/Soulter/3f22c8e5f9c7e152e967e8bc28c97fc9](https://gist.github.com/Soulter/3f22c8e5f9c7e152e967e8bc28c97fc9)" + } + } + }, + "discord": { + "pre_ack_emoji": { + "enable": { + "description": "[Discord] 启用预回应表情" + }, + "emojis": { + "description": "表情列表(Unicode 或自定义表情名)", + "hint": "填写 Unicode 表情符号,例如:👍、🤔、⏳" + } + } + } + } + } + }, + "access_group": { + "name": "访问控制", + "admins": { + "description": "管理员", + "admins_id": { + "description": "管理员 ID", + "hint": "给机器人发送 /sid 指令以获取 ID。" + } + }, + "whitelist": { + "description": "白名单", + "platform_settings": { + "enable_id_white_list": { + "description": "启用白名单", + "hint": "启用后,只有在白名单内的会话会被响应。" + }, + "id_whitelist": { + "description": "白名单 ID 列表", + "hint": "给机器人发送 /sid 指令以获取 ID。为空时代表不启用白名单功能。" + }, + "id_whitelist_log": { + "description": "输出拦截日志", + "hint": "输出未通过白名单校验的消息的日志。" + }, + "wl_ignore_admin_on_group": { + "description": "管理员群组消息无视 ID 白名单" + }, + "wl_ignore_admin_on_friend": { + "description": "管理员私聊消息无视 ID 白名单" + } + } + } + }, + "plugin_group": { + "name": "插件", + "plugin": { + "description": "插件", + "plugin_set": { + "description": "可用插件", + "hint": "默认启用全部未被禁用的插件。若插件在插件管理页被禁用,则此处的选择不会生效。" + } + } + }, + "ext_group": { + "name": "扩展功能", + "segmented_reply": { + "description": "分段回复", + "platform_settings": { + "segmented_reply": { + "enable": { + "description": "启用分段回复", + "hint": "以分段输出的方式发送回复消息。" + }, + "only_llm_result": { + "description": "仅对 LLM 结果分段" + }, + "interval_method": { + "description": "间隔方法", + "hint": "random 为随机时间,log 为根据消息长度计算,$y=log_(x)$,x为字数,y的单位为秒。" + }, + "interval": { + "description": "随机间隔时间", + "hint": "格式:最小值,最大值(如:1.5,3.5)" + }, + "log_base": { + "description": "对数底数", + "hint": "对数间隔的底数,默认为 2.6。取值范围为 1.0-10.0。" + }, + "words_count_threshold": { + "description": "分段回复字数阈值", + "hint": "分段回复的字数上限。只有字数小于此值的消息才会被分段,超过此值的长消息将直接发送(不分段),默认为 150。" + }, + "split_mode": { + "description": "分段模式", + "hint": "用于分隔一段消息。默认情况下会根据句号、问号等标点符号分隔。如填写 `[。?!]` 将移除所有的句号、问号、感叹号。re.findall(r'', text)", + "labels": [ + "正则表达式", + "分段词列表" + ] + }, + "regex": { + "description": "分段正则表达式", + "hint": "用于按正则规则识别分段点。建议使用能匹配分隔符的表达式。" + }, + "split_words": { + "description": "分段词列表", + "hint": "检测到列表中的任意词时进行分段" + }, + "content_cleanup_rule": { + "description": "内容过滤正则表达式", + "hint": "移除分段后内容中的指定内容。如填写 `[。?!]` 将移除所有的句号、问号、感叹号。" + } + } + } + }, + "ltm": { + "description": "群聊上下文感知", + "provider_ltm_settings": { + "group_icl_enable": { + "description": "群聊消息记录注入上下文", + "hint": "是否记录群聊非唤醒机器人的消息,并在唤醒机器人时将消息传给模型。" + }, + "group_message_max_cnt": { + "description": "注入上下文最大消息数量", + "hint": "传给模型的消息的最大数量。" + }, + "image_caption": { + "description": "自动理解图片", + "hint": "对非唤醒机器人的图片消息启用图片转述,转换成图片描述文本。对于图片消息频繁的群聊,此功能可能造成较大的开销,请慎用。" + }, + "image_caption_provider_id": { + "description": "群聊图片转述模型", + "hint": "用于群聊记录注入上下文的图片理解,与图片转述模型分开配置。" + }, + "group_message_history_enable": { + "description": "持久化群聊消息记录", + "hint": "将群内的所有消息都持久化保存,并允许模型通过工具来查询群内消息。" + }, + "group_message_history_max_cnt": { + "description": "持久化最大消息数量", + "hint": "持久化保存的消息的最大数量,超过后抛弃旧的消息。" + }, + "active_reply": { + "enable": { + "description": "主动回复", + "hint": "是否在合适的时机主动发消息。" + }, + "method": { + "description": "主动回复方法" + }, + "possibility_reply": { + "description": "回复概率", + "hint": "0.0-1.0 之间的数值" + }, + "whitelist": { + "description": "主动回复白名单", + "hint": "为空时不启用白名单过滤。使用 /sid 获取 ID。" + } + } + } + }, + "t2i": { + "description": "文本转图像", + "t2i": { + "description": "文本转图像输出", + "hint": "将模型回复转换成图片后再发送,防止刷屏。" + }, + "t2i_word_threshold": { + "description": "文本转图像字数阈值" + }, + "t2i_strategy": { + "description": "文本转图像策略", + "hint": "文本转图像策略。`remote` 为使用远程基于 HTML 的渲染服务,`local` 为使用 PIL 本地渲染。当使用 local 时,将 ttf 字体命名为 'font.ttf' 放在 data/ 目录下可自定义字体。" + }, + "t2i_endpoint": { + "description": "文本转图像服务 API 地址", + "hint": "为空时使用 AstrBot API 服务" + }, + "t2i_template": { + "description": "文本转图像自定义模版", + "hint": "启用后可自定义 HTML 模板用于文转图渲染。" + }, + "t2i_active_template": { + "description": "当前应用的文转图渲染模板", + "hint": "此处的值由文转图模板管理页面进行维护。" + } + } + }, + "system_group": { + "name": "系统配置", + "system": { + "description": "系统配置", + "log_level": { + "description": "控制台日志级别", + "hint": "控制台输出日志的级别。" + }, + "log_file_enable": { + "description": "启用文件日志", + "hint": "在控制台输出的同时,将日志写入文件。" + }, + "log_file_path": { + "description": "日志文件路径", + "hint": "相对路径以 data 目录为基准,例如 logs/astrbot.log;支持绝对路径。" + }, + "log_file_max_mb": { + "description": "日志文件大小上限 (MB)", + "hint": "超过大小后自动轮转,默认 20MB。" + }, + "temp_dir_max_size": { + "description": "临时目录大小上限 (MB)", + "hint": "用于限制 data/temp 目录总大小,单位为 MB。系统每 10 分钟检查一次,超限时按文件修改时间从旧到新删除,释放约 30% 当前体积。" + }, + "trace_enable": { + "description": "启用追踪记录", + "hint": "追踪用户的每次指令和 AI 调用。" + }, + "trace_db_path": { + "description": "追踪数据库路径", + "hint": "相对路径以 data 目录为基准,例如 logs/traces.db;支持绝对路径。" + }, + "trace_db_max_mb": { + "description": "追踪数据库容量预算 (MB)", + "hint": "默认 80 MB,最小 32 MB,低于最小值时按 32 MB 生效。超出后自动清除旧数据。" + }, + "trace_retention_days": { + "description": "追踪保留天数", + "hint": "默认 7 天,期限或容量先达到者触发清理。" + }, + "pip_install_arg": { + "description": "pip 安装额外参数", + "hint": "安装插件依赖时,会使用 Python 的 pip 工具。这里可以填写额外的参数,如 `--break-system-package` 等。PyPI 镜像的 TLS 证书默认会校验;若使用自签名/私有 CA 镜像,请通过 `--cert ` 指定信任的证书(推荐),或显式添加 `--trusted-host <主机名>`。" + }, + "pypi_index_url": { + "description": "PyPI 软件仓库地址", + "hint": "安装 Python 依赖时请求的 PyPI 软件仓库地址。默认为 [https://mirrors.aliyun.com/pypi/simple/](https://mirrors.aliyun.com/pypi/simple/)" + }, + "callback_api_base": { + "description": "对外可达的回调接口地址", + "hint": "外部服务可能会通过 AstrBot 生成的回调链接(如文件下载链接)访问 AstrBot 后端。由于 AstrBot 无法自动判断部署环境中对外可达的主机地址(host),因此需要通过此配置项显式指定外部服务如何访问 AstrBot 的地址。如 [http://localhost:6185](http://localhost:6185),[https://example.com](https://example.com) 等。" + }, + "disable_metrics": { + "description": "禁用匿名使用统计", + "hint": "禁用后,AstrBot 将不再上传匿名使用统计数据。" + }, + "dashboard": { + "trust_proxy_headers": { + "description": "信任代理请求头获取客户端 IP", + "hint": "关闭时忽略 X-Forwarded-For/X-Real-IP,仅使用连接地址。" + }, + "auth_rate_limit": { + "enable": { + "description": "启用登录验证速率限制", + "hint": "关闭后将不对登录、TOTP 等身份验证接口进行速率限制。" + }, + "average_interval": { + "description": "验证端点速率限制平均间隔(秒)", + "hint": "两次身份验证请求之间的最小平均间隔时间。例如设置为 1.0 表示每秒最多处理 1 个请求。" + }, + "max_burst": { + "description": "验证端点速率限制最大突发数", + "hint": "允许的瞬时最大突发请求数。例如设置为 3 表示在短时间内最多连续处理 3 个请求。" + } + }, + "ssl": { + "enable": { + "description": "启用 WebUI HTTPS", + "hint": "启用后,WebUI 将直接使用 HTTPS 提供服务。" + }, + "cert_file": { + "description": "SSL 证书文件路径", + "hint": "证书文件路径(PEM)。支持绝对路径和相对路径(相对于当前工作目录)。" + }, + "key_file": { + "description": "SSL 私钥文件路径", + "hint": "私钥文件路径(PEM)。支持绝对路径和相对路径(相对于当前工作目录)。" + }, + "ca_certs": { + "description": "SSL CA 证书文件路径", + "hint": "可选。用于指定 CA 证书文件路径。" + } + }, + "totp": { + "enable": { + "description": "启用 WebUI TOTP 双因素认证", + "hint": "启用后,登录 WebUI 需要额外输入验证码。" + }, + "manage": "管理", + "configuration": "TOTP", + "statusPending": "需完成设置", + "statusEnabled": "已启用", + "setupRequiredHint": "TOTP 已开启但尚未完成配置,请点击“管理”完成初始化。", + "setupTitle": "设置 TOTP", + "setupSubtitle": "请使用认证器应用扫描二维码,然后输入验证码。", + "setupConfirm": "验证并继续", + "activeSubtitle": "可使用此二维码和密钥添加新的认证器设备。", + "rotateTitle": "更换 TOTP 密钥", + "rotateSubtitle": "生成新密钥并完成验证后,将替换当前密钥。", + "rotate": "更换密钥", + "rotateRecovery": "更换恢复码", + "rotateConfirm": "确认更换", + "rotateCancel": "取消", + "rotateCode": "验证码", + "rotateCodeHint": "输入认证器应用中的验证码以确认新密钥。", + "rotateError": "验证码无效,请重试。", + "recoveryTitle": "恢复码", + "recoverySubtitle": "恢复码仅展示一次,请在继续前妥善保存。", + "recoveryWarning": "若恢复码丢失将无法通过常规途径恢复账户访问权限。", + "recoveryAcknowledge": "我已保存恢复码", + "recoveryClose": "完成", + "disableTitle": "关闭 TOTP", + "disableSubtitle": "输入验证码以确认关闭双因素认证。", + "disableRecoverySubtitle": "输入恢复码以确认关闭双因素认证。", + "disableCode": "验证码", + "disableRecoveryCode": "恢复码", + "disableConfirm": "确认关闭", + "disableCancel": "取消", + "disableError": "验证失败,请重试。", + "disableUseRecovery": "无法使用TOTP?", + "disableUseCode": "使用验证码", + "configSaveTitle": "两步验证", + "configSaveSubtitle": "输入验证码以更改受保护的配置。", + "configSaveRotationHint": "轮换 TOTP 密钥时,轮换前和轮换后的验证码均可用(仅轮换操作中单次允许)。", + "configSaveCode": "验证码", + "configSaveConfirm": "继续", + "configSaveCancel": "取消", + "configSaveError": "验证失败,请重试。" + } + }, + "timezone": { + "description": "时区", + "hint": "时区设置。请填写 IANA 时区名称, 如 Asia/Shanghai, 为空时使用系统默认时区。所有时区请查看: [https://data.iana.org/time-zones/tzdb-2021a/zone1970.tab](https://data.iana.org/time-zones/tzdb-2021a/zone1970.tab)" + }, + "http_proxy": { + "description": "HTTP 代理", + "hint": "启用后,会以添加环境变量的方式设置代理。格式为 `http://ip:port`" + }, + "no_proxy": { + "description": "直连地址列表" + } + } + }, + "provider_group": { + "provider": { + "api_key": { + "description": "API Key" + }, + "dashscope_api_key": { + "description": "DashScope API Key" + }, + "gemini_tts_api_key": { + "description": "Gemini API Key" + }, + "genie_onnx_model_dir": { + "description": "ONNX Model Directory", + "hint": "The directory path containing the ONNX model files" + }, + "genie_language": { + "description": "Language" + }, + "xai_native_search": { + "description": "启用原生搜索功能", + "hint": "启用后,将通过 xAI 的 Chat Completions 原生 Live Search 进行联网检索(按需计费)。仅对 xAI 提供商生效。" + }, + "rerank_api_base": { + "description": "重排序模型 API Base URL", + "hint": "最终请求路径由 Base URL 和路径后缀拼接而成(默认为 /v1/rerank)。" + }, + "rerank_api_suffix": { + "description": "API URL 路径后缀", + "hint": "追加到 base_url 后的路径后缀,如 /v1/rerank。留空则不追加。" + }, + "rerank_api_key": { + "description": "API Key", + "hint": "如果不需要 API Key, 请留空。" + }, + "rerank_model": { + "description": "重排序模型名称" + }, + "return_documents": { + "description": "是否在排序结果中返回文档原文", + "hint": "默认值false,以减少网络传输开销。" + }, + "instruct": { + "description": "自定义排序任务类型说明", + "hint": "仅在使用 qwen3-rerank 模型时生效。建议使用英文撰写。" + }, + "nvidia_rerank_api_base": { + "description": "API Base URL" + }, + "nvidia_rerank_api_key": { + "description": "API Key" + }, + "nvidia_rerank_model": { + "description": "重排序模型名称", + "hint": "请参照NVIDIA Docs中模型名称填写。" + }, + "nvidia_rerank_model_endpoint": { + "description": "自定义模型端点", + "hint": "自定义URL末尾端点,默认为 /reranking" + }, + "nvidia_rerank_truncate": { + "description": "文本截断策略", + "hint": "当输入文本过长时,是否截断输入以适应模型的最大上下文长度。" + }, + "tei_rerank_truncate": { + "description": "截断超长文本", + "hint": "当输入超过模型最大上下文长度时,是否自动截断。启用后需配合 截断方向 使用。" + }, + "tei_rerank_truncation_direction": { + "description": "截断方向", + "hint": "选择从文本的左侧(left)还是右侧(right)开始截断。仅在 截断超长文本 为 True 时生效。" + }, + "tei_rerank_raw_scores": { + "description": "返回原始分数", + "hint": "如果为 True,返回模型原始 logit 分数(可能为负值),不经过 sigmoid 归一化。默认 False。" + }, + "tei_rerank_return_text": { + "description": "返回排序结果中的文档原文", + "hint": "如果为 True,每个排序结果将附带原始文本。默认 False 以减少网络传输。" + }, + "launch_model_if_not_running": { + "description": "模型未运行时自动启动", + "hint": "如果模型当前未在 Xinference 服务中运行,是否尝试自动启动它。在生产环境中建议关闭。" + }, + "modalities": { + "description": "模型能力", + "hint": "模型支持的模态及能力。", + "labels": [ + "文本", + "图像", + "音频", + "工具使用" + ] + }, + + "custom_headers": { + "description": "自定义请求头", + "hint": "此处添加的键值对将作为自定义 HTTP 请求头,附加到 AstrBot 发往模型服务商的请求中。值必须为字符串。" + }, + "ollama_disable_thinking": { + "description": "关闭思考模式", + "hint": "关闭 Ollama 思考模式。" + }, + "custom_extra_body": { + "description": "自定义请求体参数", + "hint": "用于在请求时添加额外的参数,如 temperature, top_p, max_tokens, reasoning_effort 等。", + "template_schema": { + "temperature": { + "description": "温度参数", + "hint": "控制输出的随机性,范围通常为 0-2。值越高越随机。", + "name": "Temperature" + }, + "top_p": { + "description": "Top-p 采样", + "hint": "核采样参数,范围通常为 0-1。控制模型考虑的概率质量。", + "name": "Top-p" + }, + "max_tokens": { + "description": "最大词元(Tokens)数", + "hint": "生成的最大词元(Tokens)数。", + "name": "Max Tokens" + }, + "max_output_tokens": { + "description": "最大输出词元(Tokens)数", + "hint": "生成的最大词元(Tokens)数。", + "name": "Max Output Tokens" + }, + "reasoning_effort": { + "description": "推理强度", + "hint": "控制推理模型的推理强度,支持的值取决于具体模型。", + "name": "Reasoning Effort" + } + } + }, + "gpt_weights_path": { + "description": "GPT模型文件路径", + "hint": "即“.ckpt”后缀的文件,请使用绝对路径,路径两端不要带双引号,不填则默认用GPT_SoVITS内置的SoVITS模型(建议直接在GPT_SoVITS中改默认模型)" + }, + "sovits_weights_path": { + "description": "SoVITS模型文件路径", + "hint": "即“.pth”后缀的文件,请使用绝对路径,路径两端不要带双引号,不填则默认用GPT_SoVITS内置的SoVITS模型(建议直接在GPT_SoVITS中改默认模型)" + }, + "gsv_default_parms": { + "description": "GPT_SoVITS默认参数", + "hint": "参考音频文件路径、参考音频文本必填,其他参数根据个人爱好自行填写", + "gsv_ref_audio_path": { + "description": "参考音频文件路径", + "hint": "必填!请使用绝对路径!路径两端不要带双引号!" + }, + "gsv_prompt_text": { + "description": "参考音频文本", + "hint": "必填!请填写参考音频讲述的文本" + }, + "gsv_prompt_lang": { + "description": "参考音频文本语言", + "hint": "请填写参考音频讲述的文本的语言,默认为中文" + }, + "gsv_aux_ref_audio_paths": { + "description": "辅助参考音频文件路径", + "hint": "辅助参考音频文件,可不填" + }, + "gsv_text_lang": { + "description": "文本语言", + "hint": "默认为中文" + }, + "gsv_top_k": { + "description": "生成语音的多样性", + "hint": "" + }, + "gsv_top_p": { + "description": "核采样的阈值", + "hint": "" + }, + "gsv_temperature": { + "description": "生成语音的随机性", + "hint": "" + }, + "gsv_text_split_method": { + "description": "切分文本的方法", + "hint": "可选值: `cut0`:不切分 `cut1`:四句一切 `cut2`:50字一切 `cut3`:按中文句号切 `cut4`:按英文句号切 `cut5`:按标点符号切" + }, + "gsv_batch_size": { + "description": "批处理大小", + "hint": "" + }, + "gsv_batch_threshold": { + "description": "批处理阈值", + "hint": "" + }, + "gsv_split_bucket": { + "description": "将文本分割成桶以便并行处理", + "hint": "" + }, + "gsv_speed_factor": { + "description": "语音播放速度", + "hint": "1为原始语速" + }, + "gsv_fragment_interval": { + "description": "语音片段之间的间隔时间", + "hint": "" + }, + "gsv_streaming_mode": { + "description": "启用流模式", + "hint": "" + }, + "gsv_seed": { + "description": "随机种子", + "hint": "用于结果的可重复性" + }, + "gsv_parallel_infer": { + "description": "并行执行推理", + "hint": "" + }, + "gsv_repetition_penalty": { + "description": "重复惩罚因子", + "hint": "" + }, + "gsv_media_type": { + "description": "输出媒体的类型", + "hint": "建议用wav" + } + }, + "embedding_dimensions": { + "description": "嵌入维度", + "hint": "嵌入向量的维度。根据模型不同,可能需要调整,请参考具体模型的文档。此配置项请务必填写正确,否则将导致向量数据库无法正常工作。" + }, + "embedding_dimensions_mode": { + "description": "嵌入维度参数发送模式", + "hint": "控制是否在 OpenAI 兼容 Embedding 请求中发送 dimensions 参数。auto 会仅对官方 OpenAI embedding-3 模型自动发送;第三方兼容 API 如需该参数可改为 always,报错时改为 never。" + }, + "embedding_model": { + "description": "嵌入模型", + "hint": "嵌入模型名称。" + }, + "embedding_api_key": { + "description": "API Key" + }, + "embedding_api_base": { + "description": "API Base URL" + }, + "openai_embedding": { + "hint": "如果测试不通过,可以尝试添加 /v1 在末尾以兼容部分 OpenAI API 版本。" + }, + "gemini_embedding": { + "hint": "Gemini Embedding 无需手动添加 /v1beta。", + "embedding_task_type_mode": { + "description": "任务类型传递方式", + "hint": "auto:按模型代际自动选择(gemini-embedding-001 走 task_type 参数,gemini-embedding-2 走文本前缀);never:强制走 task_type;always:强制走文本前缀。" + }, + "embedding_query_task_type": { + "description": "查询侧 task_type", + "hint": "仅 task_type 模式生效。检索查询用 RETRIEVAL_QUERY,代码检索可用 CODE_RETRIEVAL_QUERY。" + }, + "embedding_document_task_type": { + "description": "文档侧 task_type", + "hint": "仅 task_type 模式生效。入库文档用 RETRIEVAL_DOCUMENT,可配合 title 提升效果。" + }, + "embedding_query_task_name": { + "description": "查询侧任务前缀(gemini-embedding-2)", + "hint": "仅文本前缀模式生效,可选:search result / question answering / fact checking / code retrieval。填错会自动回退为 search result。" + }, + "embedding_document_title": { + "description": "文档标题(gemini-embedding-2)", + "hint": "留空时使用 title: none。注意知识库入库时已把文档标题拼进正文,这里再填会让标题重复两遍,一般保持留空。" + } + }, + "dashscope_embedding": { + "hint": "阿里云百炼 Embedding,默认地址为 https://dashscope.aliyuncs.com/api/v1。" + }, + "volcengine_cluster": { + "description": "火山引擎集群", + "hint": "若使用语音复刻大模型,可选volcano_icl或volcano_icl_concurr,默认使用volcano_tts" + }, + "volcengine_voice_type": { + "description": "火山引擎音色", + "hint": "输入声音id(Voice_type)" + }, + "volcengine_speed_ratio": { + "description": "语速设置", + "hint": "语速设置,范围为 0.2 到 3.0,默认值为 1.0" + }, + "volcengine_volume_ratio": { + "description": "音量设置", + "hint": "音量设置,范围为 0.0 到 2.0,默认值为 1.0" + }, + "azure_tts_voice": { + "description": "音色设置", + "hint": "API 音色" + }, + "azure_tts_style": { + "description": "风格设置", + "hint": "声音特定的讲话风格。 可以表达快乐、同情和平静等情绪。" + }, + "azure_tts_role": { + "description": "模仿设置(可选)", + "hint": "讲话角色扮演。 声音可以模仿不同的年龄和性别,但声音名称不会更改。 例如,男性语音可以提高音调和改变语调来模拟女性语音,但语音名称不会更改。 如果角色缺失或不受声音的支持,则会忽略此属性。" + }, + "azure_tts_rate": { + "description": "语速设置", + "hint": "指示文本的讲出速率。可在字词或句子层面应用语速。 速率变化应为原始音频的 0.5 到 2 倍。" + }, + "azure_tts_volume": { + "description": "语音音量设置", + "hint": "指示语音的音量级别。 可在句子层面应用音量的变化。以从 0.0 到 100.0(从最安静到最大声,例如 75)的数字表示。 默认值为 100.0。" + }, + "azure_tts_region": { + "description": "API 地区", + "hint": "Azure_TTS 处理数据所在区域,具体参考 https://learn.microsoft.com/zh-cn/azure/ai-services/speech-service/regions" + }, + "azure_tts_subscription_key": { + "description": "服务订阅密钥", + "hint": "Azure_TTS 服务的订阅密钥(注意不是令牌)" + }, + "dashscope_tts_voice": { + "description": "音色" + }, + "gm_resp_image_modal": { + "description": "启用图片模态", + "hint": "启用后,将支持返回图片内容。需要模型支持,否则会报错。具体支持模型请查看 Google Gemini 官方网站。温馨提示,如果您需要生成图片,请关闭 `启用群员识别` 配置获得更好的效果。" + }, + "gm_native_search": { + "description": "启用原生搜索功能", + "hint": "仅 Gemini 3 及以上模型支持与函数工具同时使用;Gemini 3 及以上模型的原生搜索仅限付费层级,计费规则请查阅官方文档" + }, + "gm_native_coderunner": { + "description": "启用原生代码执行器", + "hint": "仅 Gemini 3 及以上模型支持与函数工具同时使用" + }, + "gm_url_context": { + "description": "启用URL上下文功能", + "hint": "仅 Gemini 3 及以上模型支持与函数工具同时使用" + }, + "gm_safety_settings": { + "description": "安全过滤器", + "hint": "设置模型输入的内容安全过滤级别。过滤级别分类为NONE(不屏蔽)、HIGH(高风险时屏蔽)、MEDIUM_AND_ABOVE(中等风险及以上屏蔽)、LOW_AND_ABOVE(低风险及以上时屏蔽),具体参见Gemini API文档。", + "harassment": { + "description": "骚扰内容", + "hint": "负面或有害评论" + }, + "hate_speech": { + "description": "仇恨言论", + "hint": "粗鲁、无礼或亵渎性质内容" + }, + "sexually_explicit": { + "description": "露骨色情内容", + "hint": "包含性行为或其他淫秽内容的引用" + }, + "dangerous_content": { + "description": "危险内容", + "hint": "宣扬、助长或鼓励有害行为的信息" + } + }, + "gm_thinking_config": { + "description": "思考配置", + "budget": { + "description": "思考预算", + "hint": "用于指定模型推理时使用的思考 token 数量上限。参见: https://ai.google.dev/gemini-api/docs/thinking#set-budget" + }, + "level": { + "description": "思考级别", + "hint": "推荐用于 Gemini 3 及以上模型,可控制推理行为。参见: https://ai.google.dev/gemini-api/docs/thinking#thinking-levels" + } + }, + "anth_thinking_config": { + "description": "思考配置", + "type": { + "description": "思考类型", + "hint": "设为 'adaptive' 以使用自适应思考(推荐 Opus 4.6+ / Sonnet 4.6+)。留空则使用手动预算模式。参见: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking" + }, + "budget": { + "description": "思考预算", + "hint": "Anthropic thinking.budget_tokens 参数。必须 >= 1024。仅在思考类型为空时生效。Opus 4.6 / Sonnet 4.6 已弃用。参见: https://platform.claude.com/docs/en/build-with-claude/extended-thinking" + }, + "effort": { + "description": "思考深度", + "hint": "当思考类型为 'adaptive' 时控制思考深度。'high' 为默认值。'max' 仅限 Opus 4.6。参见: https://platform.claude.com/docs/en/build-with-claude/effort" + } + }, + "minimax-group-id": { + "description": "用户组", + "hint": "于账户管理->基本信息中可见" + }, + "minimax-langboost": { + "description": "指定语言/方言", + "hint": "增强对指定的小语种和方言的识别能力,设置后可以提升在指定小语种/方言场景下的语音表现" + }, + "minimax-voice-speed": { + "description": "语速", + "hint": "生成声音的语速, 取值[0.5, 2], 默认为1.0, 取值越大,语速越快" + }, + "minimax-voice-vol": { + "description": "音量", + "hint": "生成声音的音量, 取值(0, 10], 默认为1.0, 取值越大,音量越高" + }, + "minimax-voice-pitch": { + "description": "语调", + "hint": "生成声音的语调, 取值[-12, 12], 默认为0" + }, + "minimax-is-timber-weight": { + "description": "启用混合音色", + "hint": "启用混合音色, 支持以自定义权重混合最多四种音色, 启用后自动忽略单一音色设置" + }, + "minimax-timber-weight": { + "description": "混合音色", + "hint": "混合音色及其权重, 最多支持四种音色, 权重为整数, 取值[1, 100]. 可在官网API语音调试台预览代码获得预设以及编写模板, 需要严格按照json字符串格式编写, 可以查看控制台判断是否解析成功. 具体结构可参照默认值以及官网代码预览." + }, + "minimax-voice-id": { + "description": "单一音色", + "hint": "单一音色编号, 详见官网文档" + }, + "minimax-voice-emotion": { + "description": "情绪", + "hint": "控制合成语音的情绪。当为 auto 时,将根据文本内容自动选择情绪。" + }, + "minimax-voice-latex": { + "description": "支持朗读latex公式", + "hint": "朗读latex公式, 但是需要确保输入文本按官网要求格式化" + }, + "minimax-voice-english-normalization": { + "description": "支持英语文本规范化", + "hint": "可提升数字阅读场景的性能,但会略微增加延迟" + }, + "rag_options": { + "description": "RAG 选项", + "hint": "检索知识库设置, 非必填。仅 Agent 应用类型支持(智能体应用, 包括 RAG 应用)。阿里云百炼应用开启此功能后将无法多轮对话。", + "pipeline_ids": { + "description": "知识库 ID 列表", + "hint": "对指定知识库内所有文档进行检索, 前往 https://bailian.console.aliyun.com/ 数据应用->知识索引创建和获取 ID。" + }, + "file_ids": { + "description": "非结构化文档 ID, 传入该参数将对指定非结构化文档进行检索。", + "hint": "对指定非结构化文档进行检索。前往 https://bailian.console.aliyun.com/ 数据管理创建和获取 ID。" + }, + "output_reference": { + "description": "是否输出知识库/文档的引用", + "hint": "在每次回答尾部加上引用源。默认为 False。" + } + }, + "sensevoice_hint": { + "description": "部署SenseVoice", + "hint": "启用前请 pip 安装 funasr、funasr_onnx、torchaudio、torch、modelscope、jieba 库(默认使用CPU,大约下载 1 GB),并且安装 ffmpeg。否则将无法正常转文字。" + }, + "is_emotion": { + "description": "情绪识别", + "hint": "是否开启情绪识别。happy|sad|angry|neutral|fearful|disgusted|surprised|unknown" + }, + "stt_model": { + "description": "模型名称", + "hint": "modelscope 上的模型名称。默认:iic/SenseVoiceSmall。" + }, + "variables": { + "description": "工作流固定输入变量", + "hint": "可选。工作流固定输入变量,将会作为工作流的输入。也可以在对话时使用 /set 指令动态设置变量。如果变量名冲突,优先使用动态设置的变量。" + }, + "dashscope_app_type": { + "description": "应用类型", + "hint": "百炼应用的应用类型。" + }, + "timeout": { + "description": "超时时间", + "hint": "超时时间,单位为秒。" + }, + "openai-tts-voice": { + "description": "voice", + "hint": "OpenAI TTS 的声音。OpenAI 默认支持:'alloy', 'echo', 'fable', 'onyx', 'nova', 'shimmer'" + }, + "elevenlabs-tts-voice-id": { + "description": "音色 ID", + "hint": "ElevenLabs 音色 ID。可在 https://elevenlabs.io/app/voice-library 浏览并复制音色 ID。默认 'JBFqnCBsd6RMkjVDRZzb'(George)。" + }, + "elevenlabs-tts-output-format": { + "description": "输出格式", + "hint": "音频输出格式,例如 'mp3_44100_128'、'mp3_22050_32'、'wav_44100'、'opus_48000_128'。不支持裸 PCM/u-law/a-law 格式。默认 'mp3_44100_128'。" + }, + "elevenlabs-tts-stability": { + "description": "稳定性", + "hint": "音色稳定性,范围 [0, 1]。值越高越稳定,越低越富有表现力。留空则使用服务端默认值。" + }, + "elevenlabs-tts-similarity-boost": { + "description": "相似度增强", + "hint": "输出与原始音色的接近程度,范围 [0, 1]。留空则使用服务端默认值。" + }, + "elevenlabs-tts-style": { + "description": "风格夸张度", + "hint": "音色风格的夸张程度,范围 [0, 1]。值越高延迟越大。留空则使用服务端默认值。" + }, + "elevenlabs-tts-use-speaker-boost": { + "description": "说话人增强", + "hint": "增强与原始说话人的相似度,可能略微增加延迟。" + }, + "mimo-tts-voice": { + "description": "音色", + "hint": "MiMo TTS 的音色名称。可选值包括 'mimo_default'、'default_en'、'default_zh'。" + }, + "mimo-tts-format": { + "description": "输出格式", + "hint": "MiMo TTS 生成音频的格式。支持 'wav'、'mp3'、'pcm'。" + }, + "mimo-tts-style-prompt": { + "description": "风格提示词", + "hint": "会以 标签形式添加到待合成文本开头,用于控制语速、情绪、角色或风格,例如 开心、变快、孙悟空、悄悄话。可留空。" + }, + "mimo-tts-dialect": { + "description": "方言", + "hint": "会与风格提示词一起写入开头的 标签中,例如 东北话、四川话、河南话、粤语。可留空。" + }, + "mimo-tts-seed-text": { + "description": "种子文本", + "hint": "作为可选的 user 消息发送,用于辅助调节语气和风格,不会拼接到待合成文本中。" + }, + "fishaudio-tts-character": { + "description": "character", + "hint": "fishaudio TTS 的角色。默认为可莉。更多角色请访问:https://fish.audio/zh-CN/discovery" + }, + "fishaudio-tts-reference-id": { + "description": "reference_id", + "hint": "fishaudio TTS 的参考模型ID(可选)。如果填入此字段,将直接使用模型ID而不通过角色名称查询。例如:626bb6d3f3364c9cbc3aa6a67300a664。更多模型请访问:https://fish.audio/zh-CN/discovery,进入模型详情界面后可复制模型ID" + }, + "whisper_hint": { + "description": "本地部署 Whisper 模型须知", + "hint": "启用前请 pip 安装 openai-whisper 库(N卡用户大约下载 2GB,主要是 torch 和 cuda,CPU 用户大约下载 1 GB),并且安装 ffmpeg。否则将无法正常转文字。" + }, + "whisper_device": { + "description": "推理设备", + "hint": "Whisper 推理设备。Apple Silicon 可选 mps;其他环境建议使用 cpu。若指定 mps 但当前环境不可用,将自动回退到 cpu。" + }, + "id": { + "description": "ID" + }, + "type": { + "description": "模型提供商种类" + }, + "provider_type": { + "description": "模型提供商能力种类" + }, + "enable": { + "description": "启用" + }, + "key": { + "description": "API Key" + }, + "api_base": { + "description": "API Base URL" + }, + "total_timeout": { + "description": "总超时时间", + "hint": "单次决策请求的总超时时间(秒),包含等待并发名额、重试与退避;默认 5 秒。" + }, + "max_concurrency": { + "description": "最大并发数", + "hint": "该提供商同时进行的决策请求上限;默认 4。" + }, + "proxy": { + "description": "代理地址", + "hint": "HTTP/HTTPS 代理地址,格式如 http://127.0.0.1:7890。仅对该提供商的 API 请求生效,不影响 Docker 内网通信。" + }, + "model": { + "description": "模型 ID", + "hint": "模型名称,如 gpt-4o-mini, deepseek-chat。" + }, + "max_context_tokens": { + "description": "模型上下文窗口大小", + "hint": "模型最大上下文 Token 大小。如果为 0,则会自动从模型元数据填充(如有)。" + }, + "dify_api_key": { + "description": "API Key", + "hint": "Dify API Key。此项必填。" + }, + "dify_api_base": { + "description": "API Base URL", + "hint": "Dify API Base URL。默认为 https://api.dify.ai/v1" + }, + "dify_api_type": { + "description": "Dify 应用类型", + "hint": "Dify API 类型。根据 Dify 官网,目前支持 chat, chatflow, agent, workflow 三种应用类型。" + }, + "dify_workflow_output_key": { + "description": "Dify Workflow 输出变量名", + "hint": "Dify Workflow 输出变量名。当应用类型为 workflow 时才使用。默认为 astrbot_wf_output。" + }, + "dify_query_input_key": { + "description": "Prompt 输入变量名", + "hint": "发送的消息文本内容对应的输入变量名。默认为 astrbot_text_query。" + }, + "coze_api_key": { + "description": "Coze API Key", + "hint": "Coze API 密钥,用于访问 Coze 服务。" + }, + "bot_id": { + "description": "Bot ID", + "hint": "Coze 机器人的 ID,在 Coze 平台上创建机器人后获得。" + }, + "coze_api_base": { + "description": "API Base URL", + "hint": "Coze API 的基础 URL 地址,默认为 https://api.coze.cn" + }, + "deerflow_api_base": { + "description": "API Base URL", + "hint": "DeerFlow API 网关地址,默认为 http://127.0.0.1:2026" + }, + "deerflow_api_key": { + "description": "DeerFlow API Key", + "hint": "可选。若 DeerFlow 网关配置了 Bearer 鉴权,则在此填写。" + }, + "deerflow_auth_header": { + "description": "Authorization Header", + "hint": "可选。自定义 Authorization 请求头,优先级高于 DeerFlow API Key。" + }, + "deerflow_assistant_id": { + "description": "Assistant ID", + "hint": "DeerFlow 2.0 LangGraph assistant_id,默认为 lead_agent。" + }, + "deerflow_model_name": { + "description": "模型名称覆盖", + "hint": "可选。覆盖 DeerFlow 默认模型(对应运行时 configurable 的 model_name)。" + }, + "deerflow_thinking_enabled": { + "description": "启用思考模式" + }, + "deerflow_plan_mode": { + "description": "启用计划模式", + "hint": "对应 DeerFlow 2.0 运行时 configurable 的 is_plan_mode。" + }, + "deerflow_subagent_enabled": { + "description": "启用子智能体", + "hint": "对应 DeerFlow 2.0 运行时 configurable 的 subagent_enabled。" + }, + "deerflow_max_concurrent_subagents": { + "description": "子智能体最大并发数", + "hint": "对应 DeerFlow 2.0 运行时 configurable 的 max_concurrent_subagents。仅在启用子智能体时生效,默认 3。" + }, + "deerflow_recursion_limit": { + "description": "递归深度上限", + "hint": "对应 LangGraph recursion_limit。" + }, + "auto_save_history": { + "description": "由 Coze 管理对话记录", + "hint": "启用后,将由 Coze 进行对话历史记录管理, 此时 AstrBot 本地保存的上下文不会生效(仅供浏览), 对 AstrBot 的上下文进行的操作也不会生效。如果为禁用, 则使用 AstrBot 管理上下文。" + } + } + }, + "help": { + "documentation": "官方文档", + "support": "加群询问", + "helpText": "不了解配置?请见 {documentation} 或 {support}。", + "helpPrefix": "不了解配置?请见", + "helpMiddle": "或", + "helpSuffix": "。" + } +} diff --git a/tests/test_gemini_embedding_source.py b/tests/test_gemini_embedding_source.py new file mode 100644 index 00000000000..83738f9af7a --- /dev/null +++ b/tests/test_gemini_embedding_source.py @@ -0,0 +1,247 @@ +"""Gemini Embedding 适配器的任务条件化测试。 + +覆盖 issue #11006:gemini-embedding-001 需要 ``task_type``, +gemini-embedding-2 需要把任务指令写进文本前缀。 +""" + +import pytest + +from astrbot.core.provider.sources.gemini_embedding_source import ( + GeminiEmbeddingProvider, + build_document_prefix, + build_query_prefix, + resolve_query_task, + uses_task_prefix, +) + + +class _RecordingClient: + """记录 embed_content 调用参数的假客户端。""" + + def __init__(self, dim: int = 8) -> None: + self.calls: list[dict] = [] + self.dim = dim + self.models = self + + async def embed_content(self, **kwargs): + self.calls.append(kwargs) + + class _Emb: + values = [0.1] * 8 + + class _Result: + pass + + result = _Result() + contents = kwargs["contents"] + if isinstance(contents, str): + result.embeddings = [_Emb()] + else: + result.embeddings = [_Emb() for _ in contents] + return result + + +def _make_provider(model: str, **overrides) -> GeminiEmbeddingProvider: + """绕开 __init__ 的 SDK 依赖,构造可测的实例。""" + provider = GeminiEmbeddingProvider.__new__(GeminiEmbeddingProvider) + provider.provider_config = { + "embedding_dimensions": 768, + "embedding_model": model, + **overrides, + } + provider.provider_settings = {} + provider.model = model + provider.task_config_mode = overrides.get("embedding_task_type_mode", "auto") + provider.query_task = overrides.get("embedding_query_task_type", "RETRIEVAL_QUERY") + provider.document_task = overrides.get( + "embedding_document_task_type", "RETRIEVAL_DOCUMENT" + ) + provider.query_prefix_task = resolve_query_task( + overrides.get("embedding_query_task_name") + ) + provider.document_title = overrides.get("embedding_document_title", "") + provider.client = _RecordingClient() + return provider + + +# ── 前缀构造 ──────────────────────────────────────────────── + + +def test_query_prefix_matches_google_format(): + assert build_query_prefix("search result") == "task: search result | query: " + + +def test_query_prefix_normalizes_underscore_task_name(): + assert build_query_prefix("QUESTION_ANSWERING") == ( + "task: question answering | query: " + ) + + +def test_query_prefix_falls_back_for_unsupported_task(): + """配置笔误不能打断检索链路,回退到默认任务名。""" + assert build_query_prefix("classification") == "task: search result | query: " + assert build_query_prefix("") == "task: search result | query: " + + +def test_document_prefix_uses_none_when_title_missing(): + assert build_document_prefix(None) == "title: none | text: " + assert build_document_prefix("") == "title: none | text: " + + +def test_document_prefix_includes_title(): + assert build_document_prefix("我的文档") == "title: 我的文档 | text: " + + +@pytest.mark.parametrize( + ("model", "expected"), + [ + ("gemini-embedding-2", True), + ("gemini-embedding-2-preview", True), + ("models/gemini-embedding-2", True), + ("gemini-embedding-001", False), + ("text-embedding-004", False), + ], +) +def test_uses_task_prefix_by_generation(model, expected): + assert uses_task_prefix(model) is expected + + +# ── 请求参数:001 走 task_type ────────────────────────────── + + +@pytest.mark.asyncio +async def test_gemini_embedding_001_sends_task_type_not_prefix(): + provider = _make_provider("gemini-embedding-001") + + await provider.get_embedding("文档正文") + await provider.get_query_embedding("查询词") + + doc_call, query_call = provider.client.calls + assert doc_call["config"].task_type == "RETRIEVAL_DOCUMENT" + assert query_call["config"].task_type == "RETRIEVAL_QUERY" + # 001 不应改写文本内容 + assert doc_call["contents"] == "文档正文" + assert query_call["contents"] == "查询词" + + +@pytest.mark.asyncio +async def test_gemini_embedding_001_batch_sends_document_task_type(): + provider = _make_provider("gemini-embedding-001") + + await provider.get_embeddings(["甲", "乙"]) + + call = provider.client.calls[0] + assert call["config"].task_type == "RETRIEVAL_DOCUMENT" + texts = [c.parts[0].text for c in call["contents"]] + assert texts == ["甲", "乙"] + + +# ── 请求参数:embedding-2 走文本前缀 ──────────────────────── + + +@pytest.mark.asyncio +async def test_gemini_embedding_2_uses_text_prefix_and_no_task_type(): + provider = _make_provider("gemini-embedding-2") + + await provider.get_embedding("文档正文") + await provider.get_query_embedding("查询词") + + doc_call, query_call = provider.client.calls + assert doc_call["config"].task_type is None + assert query_call["config"].task_type is None + assert doc_call["contents"] == "title: none | text: 文档正文" + assert query_call["contents"] == "task: search result | query: 查询词" + + +@pytest.mark.asyncio +async def test_gemini_embedding_2_applies_document_title(): + provider = _make_provider("gemini-embedding-2", embedding_document_title="群聊记忆") + + await provider.get_embedding("正文") + + assert provider.client.calls[0]["contents"] == "title: 群聊记忆 | text: 正文" + + +@pytest.mark.asyncio +async def test_gemini_embedding_2_batch_applies_document_prefix(): + provider = _make_provider("gemini-embedding-2") + + await provider.get_embeddings(["甲", "乙"]) + + texts = [c.parts[0].text for c in provider.client.calls[0]["contents"]] + assert texts == ["title: none | text: 甲", "title: none | text: 乙"] + + +# ── 开关与回退 ────────────────────────────────────────────── + + +@pytest.mark.asyncio +async def test_task_prefix_mode_never_disables_prefix_for_embedding_2(): + provider = _make_provider("gemini-embedding-2", embedding_task_type_mode="never") + + await provider.get_query_embedding("查询词") + + call = provider.client.calls[0] + assert call["contents"] == "查询词" + # never 模式回退到 task_type 路径 + assert call["config"].task_type == "RETRIEVAL_QUERY" + + +@pytest.mark.asyncio +async def test_task_prefix_mode_always_forces_prefix_on_older_model(): + provider = _make_provider("gemini-embedding-001", embedding_task_type_mode="always") + + await provider.get_query_embedding("查询词") + + call = provider.client.calls[0] + assert call["contents"] == "task: search result | query: 查询词" + assert call["config"].task_type is None + + +@pytest.mark.asyncio +async def test_query_embedding_falls_back_without_override(): + """未覆盖 get_query_embedding 的提供商标,基类回退到 get_embedding。""" + + class _Plain: + def __init__(self) -> None: + self.seen: list[str] = [] + + async def get_embedding(self, text: str) -> list[float]: + self.seen.append(text) + return [1.0] + + from astrbot.core.provider.provider import EmbeddingProvider + + plain = _Plain() + result = await EmbeddingProvider.get_query_embedding(plain, "查询词") + + assert plain.seen == ["查询词"] + assert result == [1.0] + + +@pytest.mark.parametrize( + ("configured", "expected"), + [ + ("search result", "search result"), + ("QUESTION_ANSWERING", "question answering"), + (" Code_Retrieval ", "code retrieval"), + # 笔误一律回退,不要让检索链路在调用时崩掉 + ("Search-Result", "search result"), + ("nonsense-task", "search result"), + ("", "search result"), + (None, "search result"), + ], +) +def test_resolve_query_task(configured, expected): + assert resolve_query_task(configured) == expected + + +@pytest.mark.asyncio +async def test_misspelled_task_name_produces_valid_prefix_end_to_end(): + provider = _make_provider( + "gemini-embedding-2", embedding_query_task_name="Search-Result" + ) + + await provider.get_query_embedding("查询词") + + assert provider.client.calls[0]["contents"] == "task: search result | query: 查询词" diff --git a/tests/unit/test_faiss_vec_db.py b/tests/unit/test_faiss_vec_db.py index 8b30d2ca017..07679575b17 100644 --- a/tests/unit/test_faiss_vec_db.py +++ b/tests/unit/test_faiss_vec_db.py @@ -1,167 +1,542 @@ -import asyncio -from unittest.mock import AsyncMock - -import pytest - -from astrbot.core.db.vec_db.faiss_impl.embedding_storage import EmbeddingStorage -from astrbot.core.db.vec_db.faiss_impl.vec_db import FaissVecDB -from astrbot.core.exceptions import KnowledgeBaseUploadError -from astrbot.core.provider.provider import EmbeddingProvider - - -class DelayedEmbeddingProvider(EmbeddingProvider): - def __init__(self) -> None: - super().__init__({}, {}) - - async def get_embedding(self, text: str) -> list[float]: - return [float(text.removeprefix("chunk-"))] - - async def get_embeddings(self, text: list[str]) -> list[list[float]]: - if text[0] == "chunk-0": - await asyncio.sleep(0.02) - return [[float(item.removeprefix("chunk-"))] for item in text] - - def get_dim(self) -> int: - return 1 - - -@pytest.mark.asyncio -async def test_insert_batch_skips_empty_contents() -> None: - vec_db = FaissVecDB.__new__(FaissVecDB) - vec_db.embedding_provider = AsyncMock() - vec_db.document_storage = AsyncMock() - vec_db.embedding_storage = AsyncMock() - - result = await FaissVecDB.insert_batch(vec_db, []) - - assert result == [] - vec_db.embedding_provider.get_embeddings_batch.assert_not_awaited() - vec_db.document_storage.insert_documents_batch.assert_not_awaited() - vec_db.embedding_storage.insert_batch.assert_not_awaited() - - -@pytest.mark.asyncio -async def test_insert_batch_raises_friendly_error_for_embedding_count_mismatch() -> ( - None -): - vec_db = FaissVecDB.__new__(FaissVecDB) - vec_db.embedding_provider = AsyncMock() - vec_db.embedding_provider.get_embeddings_batch.return_value = [[0.1, 0.2]] - vec_db.document_storage = AsyncMock() - vec_db.embedding_storage = AsyncMock() - vec_db.embedding_storage.dimension = 2 - - with pytest.raises(KnowledgeBaseUploadError) as exc_info: - await FaissVecDB.insert_batch( - vec_db, - contents=["chunk-1", "chunk-2"], - metadatas=[{}, {}], - ids=["doc-1", "doc-2"], - ) - - assert "向量化失败" in str(exc_info.value) - assert "期望 2,实际 1" in str(exc_info.value) - vec_db.document_storage.insert_documents_batch.assert_not_awaited() - vec_db.embedding_storage.insert_batch.assert_not_awaited() - - -@pytest.mark.asyncio -@pytest.mark.parametrize( - ("embedding_contents", "expected_embedding_contents"), - [ - (None, ["chunk one", "chunk two"]), - ( - ["guide\n\nchunk one", "guide\n\nchunk two"], - ["guide\n\nchunk one", "guide\n\nchunk two"], - ), - ], -) -async def test_insert_batch_uses_embedding_contents_without_changing_storage( - embedding_contents: list[str] | None, - expected_embedding_contents: list[str], -) -> None: - vec_db = FaissVecDB.__new__(FaissVecDB) - vec_db.embedding_provider = AsyncMock() - vec_db.embedding_provider.get_embeddings_batch.return_value = [ - [0.1, 0.2], - [0.3, 0.4], - ] - vec_db.document_storage = AsyncMock() - vec_db.document_storage.insert_documents_batch.return_value = [11, 12] - vec_db.embedding_storage = AsyncMock() - vec_db.embedding_storage.dimension = 2 - - await FaissVecDB.insert_batch( - vec_db, - contents=["chunk one", "chunk two"], - metadatas=[{}, {}], - ids=["doc-1", "doc-2"], - embedding_contents=embedding_contents, - ) - - vec_db.embedding_provider.get_embeddings_batch.assert_awaited_once_with( - expected_embedding_contents, - batch_size=32, - tasks_limit=3, - max_retries=3, - progress_callback=None, - ) - vec_db.document_storage.insert_documents_batch.assert_awaited_once_with( - ["doc-1", "doc-2"], - ["chunk one", "chunk two"], - [{}, {}], - ) - - -@pytest.mark.asyncio -async def test_insert_batch_rejects_embedding_content_count_mismatch() -> None: - vec_db = FaissVecDB.__new__(FaissVecDB) - vec_db.embedding_provider = AsyncMock() - vec_db.document_storage = AsyncMock() - vec_db.embedding_storage = AsyncMock() - - with pytest.raises(KnowledgeBaseUploadError) as exc_info: - await FaissVecDB.insert_batch( - vec_db, - contents=["chunk one", "chunk two"], - metadatas=[{}, {}], - ids=["doc-1", "doc-2"], - embedding_contents=["guide\n\nchunk one"], - ) - - assert exc_info.value.stage == "storage" - assert exc_info.value.details == { - "expected_contents": 2, - "actual_embedding_contents": 1, - } - vec_db.embedding_provider.get_embeddings_batch.assert_not_awaited() - vec_db.document_storage.insert_documents_batch.assert_not_awaited() - - -def test_embedding_storage_rejects_zero_dimension_for_a_fresh_index(tmp_path) -> None: - with pytest.raises(ValueError, match="无效的嵌入向量维度"): - EmbeddingStorage(0, str(tmp_path / "index.faiss")) - - -def test_embedding_storage_rejects_negative_dimension_for_a_fresh_index() -> None: - with pytest.raises(ValueError, match="无效的嵌入向量维度"): - EmbeddingStorage(-1) - - -def test_embedding_storage_accepts_a_valid_dimension_for_a_fresh_index() -> None: - storage = EmbeddingStorage(4) - - assert storage.index.d == 4 - - -@pytest.mark.asyncio -async def test_get_embeddings_batch_preserves_input_order_when_batches_finish_out_of_order(): - provider = DelayedEmbeddingProvider() - - embeddings = await provider.get_embeddings_batch( - ["chunk-0", "chunk-1", "chunk-2", "chunk-3"], - batch_size=2, - tasks_limit=2, - ) - - assert embeddings == [[0.0], [1.0], [2.0], [3.0]] +import asyncio +from unittest.mock import AsyncMock + +import pytest + +from astrbot.core.db.vec_db.faiss_impl.embedding_storage import EmbeddingStorage +from astrbot.core.db.vec_db.faiss_impl.vec_db import FaissVecDB +from astrbot.core.exceptions import KnowledgeBaseUploadError +from astrbot.core.provider.provider import EmbeddingProvider + + +class DelayedEmbeddingProvider(EmbeddingProvider): + def __init__(self) -> None: + super().__init__({}, {}) + + async def get_embedding(self, text: str) -> list[float]: + return [float(text.removeprefix("chunk-"))] + + async def get_embeddings(self, text: list[str]) -> list[list[float]]: + if text[0] == "chunk-0": + await asyncio.sleep(0.02) + return [[float(item.removeprefix("chunk-"))] for item in text] + + def get_dim(self) -> int: + return 1 + + +@pytest.mark.asyncio +async def test_insert_batch_skips_empty_contents() -> None: + vec_db = FaissVecDB.__new__(FaissVecDB) + vec_db.embedding_provider = AsyncMock() + vec_db.document_storage = AsyncMock() + vec_db.embedding_storage = AsyncMock() + + result = await FaissVecDB.insert_batch(vec_db, []) + + assert result == [] + vec_db.embedding_provider.get_embeddings_batch.assert_not_awaited() + vec_db.document_storage.insert_documents_batch.assert_not_awaited() + vec_db.embedding_storage.insert_batch.assert_not_awaited() + + +@pytest.mark.asyncio +async def test_insert_batch_raises_friendly_error_for_embedding_count_mismatch() -> ( + None +): + vec_db = FaissVecDB.__new__(FaissVecDB) + vec_db.embedding_provider = AsyncMock() + vec_db.embedding_provider.get_embeddings_batch.return_value = [[0.1, 0.2]] + vec_db.document_storage = AsyncMock() + vec_db.embedding_storage = AsyncMock() + vec_db.embedding_storage.dimension = 2 + + with pytest.raises(KnowledgeBaseUploadError) as exc_info: + await FaissVecDB.insert_batch( + vec_db, + contents=["chunk-1", "chunk-2"], + metadatas=[{}, {}], + ids=["doc-1", "doc-2"], + ) + + assert "向量化失败" in str(exc_info.value) + assert "期望 2,实际 1" in str(exc_info.value) + vec_db.document_storage.insert_documents_batch.assert_not_awaited() + vec_db.embedding_storage.insert_batch.assert_not_awaited() + + +@pytest.mark.asyncio +@pytest.mark.parametrize( + ("embedding_contents", "expected_embedding_contents"), + [ + (None, ["chunk one", "chunk two"]), + ( + ["guide\n\nchunk one", "guide\n\nchunk two"], + ["guide\n\nchunk one", "guide\n\nchunk two"], + ), + ], +) +async def test_insert_batch_uses_embedding_contents_without_changing_storage( + embedding_contents: list[str] | None, + expected_embedding_contents: list[str], +) -> None: + vec_db = FaissVecDB.__new__(FaissVecDB) + vec_db.embedding_provider = AsyncMock() + vec_db.embedding_provider.get_embeddings_batch.return_value = [ + [0.1, 0.2], + [0.3, 0.4], + ] + vec_db.document_storage = AsyncMock() + vec_db.document_storage.insert_documents_batch.return_value = [11, 12] + vec_db.embedding_storage = AsyncMock() + vec_db.embedding_storage.dimension = 2 + + await FaissVecDB.insert_batch( + vec_db, + contents=["chunk one", "chunk two"], + metadatas=[{}, {}], + ids=["doc-1", "doc-2"], + embedding_contents=embedding_contents, + ) + + vec_db.embedding_provider.get_embeddings_batch.assert_awaited_once_with( + expected_embedding_contents, + batch_size=32, + tasks_limit=3, + max_retries=3, + progress_callback=None, + ) + vec_db.document_storage.insert_documents_batch.assert_awaited_once_with( + ["doc-1", "doc-2"], + ["chunk one", "chunk two"], + [{}, {}], + ) + + +@pytest.mark.asyncio +async def test_insert_batch_rejects_embedding_content_count_mismatch() -> None: + vec_db = FaissVecDB.__new__(FaissVecDB) + vec_db.embedding_provider = AsyncMock() + vec_db.document_storage = AsyncMock() + vec_db.embedding_storage = AsyncMock() + + with pytest.raises(KnowledgeBaseUploadError) as exc_info: + await FaissVecDB.insert_batch( + vec_db, + contents=["chunk one", "chunk two"], + metadatas=[{}, {}], + ids=["doc-1", "doc-2"], + embedding_contents=["guide\n\nchunk one"], + ) + + assert exc_info.value.stage == "storage" + assert exc_info.value.details == { + "expected_contents": 2, + "actual_embedding_contents": 1, + } + vec_db.embedding_provider.get_embeddings_batch.assert_not_awaited() + vec_db.document_storage.insert_documents_batch.assert_not_awaited() + + +def test_embedding_storage_rejects_zero_dimension_for_a_fresh_index(tmp_path) -> None: + with pytest.raises(ValueError, match="无效的嵌入向量维度"): + EmbeddingStorage(0, str(tmp_path / "index.faiss")) + + +def test_embedding_storage_rejects_negative_dimension_for_a_fresh_index() -> None: + with pytest.raises(ValueError, match="无效的嵌入向量维度"): + EmbeddingStorage(-1) + + +def test_embedding_storage_accepts_a_valid_dimension_for_a_fresh_index() -> None: + storage = EmbeddingStorage(4) + + assert storage.index.d == 4 + + +@pytest.mark.asyncio +async def test_get_embeddings_batch_preserves_input_order_when_batches_finish_out_of_order(): + provider = DelayedEmbeddingProvider() + + embeddings = await provider.get_embeddings_batch( + ["chunk-0", "chunk-1", "chunk-2", "chunk-3"], + batch_size=2, + tasks_limit=2, + ) + + assert embeddings == [[0.0], [1.0], [2.0], [3.0]] + + +def test_l2_normalize_scales_rows_to_unit_length() -> None: + import numpy as np + + from astrbot.core.db.vec_db.faiss_impl.embedding_storage import _l2_normalize + + vectors = np.array([[3.0, 4.0], [0.0, 0.0], [0.5, 0.0]], dtype=np.float32) + normalized = _l2_normalize(vectors) + + norms = np.linalg.norm(normalized, axis=1) + assert norms[0] == pytest.approx(1.0) + assert norms[1] == pytest.approx(0.0) # 全零行保持为零,不产生 NaN + assert norms[2] == pytest.approx(1.0) + assert np.array_equal(normalized[0], np.array([0.6, 0.8], dtype=np.float32)) + + +@pytest.mark.asyncio +async def test_embedding_storage_ranks_by_cosine_regardless_of_magnitude() -> None: + """issue #11006:模长不同的向量必须按方向(余弦)排序,而不是按模长。""" + import numpy as np + + storage = EmbeddingStorage(2) + + # 相关文档:方向接近查询,但模长被压到很小 + await storage.insert(np.array([0.6, 0.8], dtype=np.float32) * 0.2, 1) + # 无关文档:与查询正交,但模长很大 + await storage.insert(np.array([0.0, 1.0], dtype=np.float32) * 5.0, 2) + + distances, indices = await storage.search(np.array([1.0, 0.0], dtype=np.float32), 2) + + assert indices[0][0] == 1, "语义更近的文档必须排在前面" + scores = 1 - distances[0] / 2.0 + assert scores[0] == pytest.approx(0.6, abs=1e-5) + assert scores[1] == pytest.approx(0.0, abs=1e-5) + + +@pytest.mark.asyncio +async def test_embedding_storage_batch_insert_also_normalizes() -> None: + import numpy as np + + storage = EmbeddingStorage(2) + vectors = np.array( + [[0.6, 0.8], [0.0, 2.0]], + dtype=np.float32, + ) * np.array([[0.3], [1.0]], dtype=np.float32) + + await storage.insert_batch(vectors, [1, 2]) + distances, indices = await storage.search(np.array([1.0, 0.0], dtype=np.float32), 2) + + assert indices[0].tolist() == [1, 2] + assert (1 - distances[0] / 2.0)[0] == pytest.approx(0.6, abs=1e-5) + + +@pytest.mark.asyncio +async def test_retrieve_uses_query_embedding_hook() -> None: + """retrieve 必须走 get_query_embedding,才能带上查询侧任务条件化。""" + import numpy as np + + class QueryAwareProvider(EmbeddingProvider): + def __init__(self) -> None: + super().__init__({}, {}) + self.query_calls: list[str] = [] + + async def get_embedding(self, text: str) -> list[float]: + return [1.0, 0.0] + + async def get_query_embedding(self, text: str) -> list[float]: + self.query_calls.append(text) + return [1.0, 0.0] + + async def get_embeddings(self, text: list[str]) -> list[list[float]]: + return [[1.0, 0.0] for _ in text] + + def get_dim(self) -> int: + return 2 + + provider = QueryAwareProvider() + vec_db = FaissVecDB.__new__(FaissVecDB) + from astrbot.core.db.vec_db.faiss_impl.document_storage import DocumentStorage + + vec_db.embedding_provider = provider + vec_db.rerank_provider = None + vec_db.embedding_storage = EmbeddingStorage(2) + vec_db.document_storage = DocumentStorage(":memory:") + await vec_db.document_storage.initialize() + await vec_db.embedding_storage.insert(np.array([1.0, 0.0], dtype=np.float32), 1) + + await vec_db.retrieve(query="查询词", k=1) + + assert provider.query_calls == ["查询词"] + + +def test_l2_normalize_handles_extreme_magnitudes_without_nan() -> None: + """极大/极小模长都不能产出 NaN 或 inf。""" + import numpy as np + + from astrbot.core.db.vec_db.faiss_impl.embedding_storage import _l2_normalize + + vectors = np.array( + [[1e-30, 0.0], [3e38, 0.0], [0.0, 0.0], [3.0, 4.0]], + dtype=np.float32, + ) + normalized = _l2_normalize(vectors) + + assert not np.isnan(normalized).any() + assert not np.isinf(normalized).any() + # 极小模长不放大噪声,保持原样 + assert normalized[0][0] == pytest.approx(1e-30, rel=1e-6) + # 极大模长应正确归一化,而不是被 float32 溢出成 0 + assert normalized[1][0] == pytest.approx(1.0) + assert normalized[3] == pytest.approx(np.array([0.6, 0.8], dtype=np.float32)) + + +def test_l2_normalize_preserves_empty_batch() -> None: + import numpy as np + + from astrbot.core.db.vec_db.faiss_impl.embedding_storage import _l2_normalize + + empty = np.zeros((0, 4), dtype=np.float32) + assert _l2_normalize(empty).shape == (0, 4) + + +@pytest.mark.asyncio +async def test_loading_legacy_index_normalizes_stored_vectors() -> None: + """旧版本入库未归一化,加载时必须重建,否则两侧标准不一致。""" + import os + + import numpy as np + + faiss = pytest.importorskip("faiss") + from astrbot.core.db.vec_db.faiss_impl.embedding_storage import EmbeddingStorage + + # faiss 的 C++ 层在 Windows 上无法写非 ASCII 路径,这里用纯 ASCII 临时目录。 + tmp_dir = _ascii_tmp_dir() + path = os.path.join(tmp_dir, "legacy.faiss") + # 旧索引:未归一化,模长各不相同 + legacy = faiss.IndexIDMap(faiss.IndexFlatL2(2)) + legacy.add_with_ids( + np.array([[0.6, 0.8], [0.0, 1.0]], dtype=np.float32) + * np.array([[0.5], [3.0]], dtype=np.float32), + np.array([1, 2], dtype=np.int64), + ) + faiss.write_index(legacy, path) + + storage = EmbeddingStorage(2, path) + assert storage._pending_save is True + + distances, indices = await storage.search(np.array([1.0, 0.0], dtype=np.float32), 2) + assert indices[0].tolist() == [1, 2] + scores = 1 - distances[0] / 2.0 + assert scores[0] == pytest.approx(0.6, abs=1e-5) + assert scores[1] == pytest.approx(0.0, abs=1e-5) + + await storage.flush() + assert storage._pending_save is False + + # 重新加载后不应再次触发迁移 + reloaded = EmbeddingStorage(2, path) + assert reloaded._pending_save is False + redo_dist, _ = await reloaded.search(np.array([1.0, 0.0], dtype=np.float32), 2) + assert (1 - redo_dist[0] / 2.0)[0] == pytest.approx(0.6, abs=1e-5) + + +@pytest.mark.asyncio +async def test_flush_is_noop_for_fresh_index() -> None: + storage = EmbeddingStorage(4) + assert storage._pending_save is False + await storage.flush() + assert storage._pending_save is False + + +@pytest.mark.asyncio +async def test_zero_vector_does_not_retrigger_migration() -> None: + """零向量模长为 0,不能让它被误判成"未归一化"而反复重建索引。""" + import os + + import numpy as np + + faiss = pytest.importorskip("faiss") + from astrbot.core.db.vec_db.faiss_impl.embedding_storage import EmbeddingStorage + + tmp_dir = _ascii_tmp_dir() + path = os.path.join(tmp_dir, "zero.faiss") + + index = faiss.IndexIDMap(faiss.IndexFlatL2(2)) + index.add_with_ids( + np.array([[0.6, 0.8], [0.0, 0.0]], dtype=np.float32), + np.array([1, 2], dtype=np.int64), + ) + faiss.write_index(index, path) + + first = EmbeddingStorage(2, path) + assert first._pending_save is False, "全部已归一化时不应重建" + + second = EmbeddingStorage(2, path) + assert second._pending_save is False, "零向量不能触发重复迁移" + + +@pytest.mark.asyncio +async def test_migration_still_runs_when_zero_vector_mixed_with_unnormalized() -> None: + import os + + import numpy as np + + faiss = pytest.importorskip("faiss") + from astrbot.core.db.vec_db.faiss_impl.embedding_storage import EmbeddingStorage + + tmp_dir = _ascii_tmp_dir() + path = os.path.join(tmp_dir, "mix.faiss") + + index = faiss.IndexIDMap(faiss.IndexFlatL2(2)) + index.add_with_ids( + np.array([[0.3, 0.4], [0.0, 0.0]], dtype=np.float32), # 前一个模长 0.5 + np.array([1, 2], dtype=np.int64), + ) + faiss.write_index(index, path) + + storage = EmbeddingStorage(2, path) + assert storage._pending_save is True, "存在未归一化向量时仍需迁移" + + distances, indices = await storage.search(np.array([1.0, 0.0], dtype=np.float32), 2) + assert indices[0][0] == 1 + assert (1 - distances[0] / 2.0)[0] == pytest.approx(0.6, abs=1e-5) + + +@pytest.mark.asyncio +async def test_flush_failure_does_not_break_initialization() -> None: + """归一化落盘失败不能让知识库打不开;内存索引仍应可用。""" + import os + from unittest.mock import patch + + import numpy as np + + faiss = pytest.importorskip("faiss") + from astrbot.core.db.vec_db.faiss_impl.embedding_storage import EmbeddingStorage + + tmp_dir = _ascii_tmp_dir() + path = os.path.join(tmp_dir, "readonly.faiss") + + index = faiss.IndexIDMap(faiss.IndexFlatL2(2)) + index.add_with_ids( + np.array([[0.3, 0.4]], dtype=np.float32), + np.array([1], dtype=np.int64), + ) + faiss.write_index(index, path) + + storage = EmbeddingStorage(2, path) + assert storage._pending_save is True + + with patch.object( + EmbeddingStorage, "_write_index", side_effect=OSError("No space left") + ): + # 不应抛出 + await storage.flush() + + # 写盘失败要保留标记,以便后续 initialize/close 重试 + assert storage._pending_save is True + + # 内存中的索引已经归一化,检索照常工作 + distances, indices = await storage.search(np.array([1.0, 0.0], dtype=np.float32), 1) + assert indices[0][0] == 1 + assert (1 - distances[0] / 2.0)[0] == pytest.approx(0.6, abs=1e-5) + + +@pytest.mark.asyncio +async def test_flush_retries_after_a_write_failure() -> None: + """一次写盘失败不能让归一化结果永远丢掉。""" + import os + from unittest.mock import patch + + import numpy as np + + faiss = pytest.importorskip("faiss") + from astrbot.core.db.vec_db.faiss_impl.embedding_storage import EmbeddingStorage + + tmp_dir = _ascii_tmp_dir() + path = os.path.join(tmp_dir, "retry.faiss") + + index = faiss.IndexIDMap(faiss.IndexFlatL2(2)) + index.add_with_ids( + np.array([[0.3, 0.4]], dtype=np.float32), + np.array([1], dtype=np.int64), + ) + faiss.write_index(index, path) + + storage = EmbeddingStorage(2, path) + assert storage._pending_save is True + + with patch.object( + EmbeddingStorage, "_write_index", side_effect=OSError("disk full") + ): + await storage.flush() + assert storage._pending_save is True, "失败后必须保留重试标记" + + # 第二次成功 + await storage.flush() + assert storage._pending_save is False + + reloaded = EmbeddingStorage(2, path) + assert reloaded._pending_save is False + distances, _ = await reloaded.search(np.array([1.0, 0.0], dtype=np.float32), 1) + assert (1 - distances[0] / 2.0)[0] == pytest.approx(0.6, abs=1e-5) + + +@pytest.mark.asyncio +async def test_close_flushes_pending_normalization() -> None: + """close() 也要尝试落盘,别让内存里的归一化结果丢掉。""" + import os + + import numpy as np + + faiss = pytest.importorskip("faiss") + from astrbot.core.db.vec_db.faiss_impl.embedding_storage import EmbeddingStorage + + tmp_dir = _ascii_tmp_dir() + path = os.path.join(tmp_dir, "close.faiss") + + index = faiss.IndexIDMap(faiss.IndexFlatL2(2)) + index.add_with_ids( + np.array([[0.3, 0.4]], dtype=np.float32), + np.array([1], dtype=np.int64), + ) + faiss.write_index(index, path) + + storage = EmbeddingStorage(2, path) + assert storage._pending_save is True + + await storage.flush() + + reloaded = EmbeddingStorage(2, path) + assert reloaded._pending_save is False, "落盘后重新加载不应再次迁移" + + +@pytest.mark.asyncio +async def test_migration_logs_do_not_leak_local_paths(caplog) -> None: + """日志不能带出索引绝对路径(含用户名等本地信息)。""" + import logging + import os + + import numpy as np + + faiss = pytest.importorskip("faiss") + from astrbot.core.db.vec_db.faiss_impl.embedding_storage import EmbeddingStorage + + tmp_dir = _ascii_tmp_dir() + secret_name = "leakcanary.faiss" + path = os.path.join(tmp_dir, secret_name) + + index = faiss.IndexIDMap(faiss.IndexFlatL2(2)) + index.add_with_ids( + np.array([[0.3, 0.4]], dtype=np.float32), + np.array([1], dtype=np.int64), + ) + faiss.write_index(index, path) + + with caplog.at_level(logging.DEBUG): + storage = EmbeddingStorage(2, path) + assert storage._pending_save is True + await storage.flush() + + assert secret_name not in caplog.text, "日志里不应出现索引文件名" + assert tmp_dir not in caplog.text, "日志里不应出现索引所在目录" + + +def _ascii_tmp_dir() -> str: + """返回纯 ASCII 的临时目录。 + + faiss 的 C++ 层在 Windows 上按 ANSI codepage 打开文件,含中文的用户名路径 + 会写失败,因此 Windows 上固定用系统 Temp。 + """ + import os + import tempfile + + return tempfile.mkdtemp(dir="C:/Windows/Temp" if os.name == "nt" else None) From 9a211e146a21cc6fc256f9b9db6829d162706ba7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BA=A2=E8=B1=86=E7=B3=95?= <3083636750@qq.com> Date: Thu, 5 Nov 2026 20:23:52 +0800 Subject: [PATCH 10/10] fix: distinguish query and document embeddings for DashScope and NVIDIA Both adapters embedded retrieval queries with the document-side encoding mode, which lowers retrieval accuracy. DashScope supports `text_type`: `query` for user queries and `document` for stored text. The adapter never sent it, so everything was embedded as a document (that is the API default). The multimodal endpoint does not accept `text_type`, so it is excluded. NVIDIA is more explicit about the consequence. Their docs state that models such as NV-Embed-QA, E5 and nemotron "require the input_type parameter" and that using the wrong value "will result in large drops in retrieval accuracy". The adapter hardcoded `input_type` to a single configured value (default `passage`), so queries were also embedded as passages. Changes: - `get_query_embedding()` is now implemented in both adapters; `get_embedding()` and `get_embeddings()` keep document semantics for indexing and for the existing connectivity/dimension probes. - DashScope gains `embedding_text_type_mode` (`auto` / `never`); the default `auto` sends the correct `text_type` per call and skips it for multimodal models. - NVIDIA gains `query_input_type` (default `query`) while `input_type` keeps controlling the document side. Both are opt-outable in case a deployment hits a provider that rejects the extra field. Tests use a fake SDK/HTTP client, so this has not been exercised against the live APIs. --- astrbot/core/config/default.py | 10090 ++++++++-------- .../sources/dashscope_embedding_source.py | 65 +- .../sources/nvidia_embedding_source.py | 32 +- .../en-US/features/config-metadata.json | 4203 +++---- .../zh-CN/features/config-metadata.json | 4245 +++---- tests/test_embedding_task_types.py | 164 + 6 files changed, 9535 insertions(+), 9264 deletions(-) create mode 100644 tests/test_embedding_task_types.py diff --git a/astrbot/core/config/default.py b/astrbot/core/config/default.py index f1529fb345f..c416f7c2fcc 100644 --- a/astrbot/core/config/default.py +++ b/astrbot/core/config/default.py @@ -1,5044 +1,5046 @@ -"""如需修改配置,请在 `data/cmd_config.json` 中修改或者在管理面板中可视化修改。""" - -import os - -from astrbot import __version__ -from astrbot.core.computer.booters.cua_defaults import CUA_DEFAULT_CONFIG -from astrbot.core.utils.astrbot_path import get_astrbot_data_path - -from .agent_runner import get_agent_runner_config_default - - -def get_local_permission_defaults(system: str | None = None) -> dict: - """Return fresh Local permission defaults shared by all operating systems. - - Args: - system: Retained for callers supplying an operating system name. - - Returns: - Workspace files without execution for members and unrestricted local - execution for administrators. Neither policy requires process isolation. - """ - return { - "member": { - "allow_execution": False, - "allow_network": False, - "filesystem_scope": "workspace", - }, - "admin": { - "allow_execution": True, - "allow_network": True, - "filesystem_scope": "host", - }, - } - - -VERSION = __version__ - -DB_PATH = os.path.join(get_astrbot_data_path(), "data_v4.db") -PERSONAL_WECHAT_CONFIG_METADATA = { - "weixin_oc_base_url": { - "description": "Base URL", - "type": "string", - "hint": "默认值: https://ilinkai.weixin.qq.com", - }, - "weixin_oc_bot_type": { - "description": "扫码参数 bot_type", - "type": "string", - "hint": "默认值: 3", - "invisible": True, - }, - "weixin_oc_qr_poll_interval": { - "description": "二维码状态轮询间隔(秒)", - "type": "int", - "hint": "每隔多少秒轮询一次二维码状态。", - "invisible": True, - }, - "weixin_oc_long_poll_timeout_ms": { - "description": "getUpdates 长轮询超时时间(毫秒)", - "type": "int", - "hint": "会话消息拉取接口超时参数。", - }, - "weixin_oc_api_timeout_ms": { - "description": "HTTP 请求超时(毫秒)", - "type": "int", - "hint": "通用 API 请求超时参数。", - }, - "weixin_oc_token": { - "description": "登录后 token(可留空)", - "type": "string", - "hint": "扫码登录成功后会自动写入;高级场景可手动填写。", - "secret": True, - "invisible": True, - }, - "weixin_oc_account_id": {"invisible": True}, - "weixin_oc_sync_buf": {"invisible": True}, - "weixin_oc_context_tokens": {"invisible": True}, -} - -WEBHOOK_SUPPORTED_PLATFORMS = [ - "qq_official_webhook", - "weixin_official_account", - "wecom", - "wecom_ai_bot", - "slack", - "lark", - "line", - "mattermost", -] - -# 默认配置 -DEFAULT_CONFIG = { - "config_version": 5, - "platform_settings": { - "unique_session": False, - "rate_limit": { - "time": 60, - "count": 30, - "strategy": "stall", # stall, discard - }, - "reply_prefix": "", - "forward_threshold": 1500, - "enable_id_white_list": True, - "id_whitelist": [], - "id_whitelist_log": True, - "wl_ignore_admin_on_group": True, - "wl_ignore_admin_on_friend": True, - "reply_with_mention": False, - "reply_with_quote": False, - "path_mapping": [], - "segmented_reply": { - "enable": False, - "only_llm_result": True, - "interval_method": "random", - "interval": "1.5,3.5", - "log_base": 2.6, - "words_count_threshold": 150, - "split_mode": "regex", # regex 或 words - "regex": ".*?[。?!~…]+|.+$", - "split_words": [ - "。", - "?", - "!", - "~", - "…", - ], # 当 split_mode 为 words 时使用 - "content_cleanup_rule": "", - }, - "no_permission_reply": True, - "empty_mention_waiting": True, - "empty_mention_waiting_need_reply": True, - "friend_message_needs_wake_prefix": False, - "ignore_bot_self_message": False, - "ignore_at_all": False, - }, - "provider_sources": [], # provider sources - "provider": [], # models from provider_sources - "provider_settings": { - "enable": True, - "default_image_caption_provider_id": "", - "image_caption_prompt": "Please describe the image using Chinese.", - "provider_pool": ["*"], # "*" 表示使用所有可用的提供者 - "wake_prefix": "", - "web_search": False, - "websearch_provider": "tavily", - "websearch_tavily_key": [], - "websearch_bocha_key": [], - "websearch_brave_key": [], - "websearch_baidu_app_builder_key": "", - "websearch_firecrawl_key": [], - "websearch_exa_key": [], - "websearch_anysearch_key": [], - "websearch_deepseek_key": [], - "websearch_serpapi_key": [], - "web_search_link": False, - "display_reasoning_text": False, - "identifier": False, - "group_name_display": False, - "datetime_system_prompt": True, - "persona_pool": ["*"], - "prompt_prefix": "{{prompt}}", - "streaming_response": False, - "show_tool_use_status": False, - "show_tool_call_result": False, - "buffer_intermediate_messages": False, - "max_quoted_fallback_images": 20, - "quoted_message_parser": { - "max_component_chain_depth": 4, - "max_forward_node_depth": 6, - "max_forward_fetch": 32, - "warn_on_action_failure": False, - }, - "unsupported_streaming_strategy": "realtime_segmenting", - "reachability_check": False, - "file_extract": { - "enable": False, - "provider": "moonshotai", - "moonshotai_api_key": "", - }, - "proactive_capability": { - "add_cron_tools": True, - }, - "computer_use_runtime": "none", - "computer_use_local_permissions": get_local_permission_defaults(), - "computer_use_require_admin": True, - "sandbox": { - "booter": "shipyard_neo", - "shipyard_endpoint": "", - "shipyard_access_token": "", - "shipyard_ttl": 3600, - "shipyard_max_sessions": 10, - "shipyard_neo_endpoint": "", - "shipyard_neo_access_token": "", - "shipyard_neo_profile": "python-default", - "shipyard_neo_ttl": 3600, - "cua_image": CUA_DEFAULT_CONFIG["image"], - "cua_os_type": CUA_DEFAULT_CONFIG["os_type"], - "cua_idle_timeout": CUA_DEFAULT_CONFIG["idle_timeout"], - "cua_telemetry_enabled": CUA_DEFAULT_CONFIG["telemetry_enabled"], - "cua_local": CUA_DEFAULT_CONFIG["local"], - "cua_api_key": CUA_DEFAULT_CONFIG["api_key"], - }, - "image_compress_options": { - "max_size": 1280, - }, - }, - "agent_runner": { - "runner_type": "local", - "config": get_agent_runner_config_default("local"), - }, - # SubAgent orchestrator mode: - # - main_enable = False: disabled; main LLM mounts tools normally (persona selection). - # - main_enable = True: enabled; main LLM keeps its own tools and includes handoff - # tools (transfer_to_*). remove_main_duplicate_tools can remove tools that are - # duplicated on subagents from the main LLM toolset. - "subagent_orchestrator": { - "main_enable": False, - "remove_main_duplicate_tools": False, - "router_system_prompt": ( - "You are a task router. Your job is to chat naturally, recognize user intent, " - "and delegate work to the most suitable subagent using transfer_to_* tools. " - "Do not try to use domain tools yourself. If no subagent fits, respond directly." - ), - "agents": [], - }, - "provider_stt_settings": { - "enable": False, - "provider_id": "", - }, - "provider_tts_settings": { - "enable": False, - "provider_id": "", - "dual_output": False, - "use_file_service": False, - "trigger_probability": 1.0, - }, - "provider_ltm_settings": { - "group_icl_enable": False, - "group_message_max_cnt": 1000, - "image_caption": False, - "image_caption_provider_id": "", - "group_message_history_enable": False, - "group_message_history_max_cnt": 700, - "active_reply": { - "enable": False, - "method": "possibility_reply", - "possibility_reply": 0.1, - "whitelist": [], - }, - }, - "content_safety": { - "also_use_in_response": False, - "internal_keywords": {"enable": True, "extra_keywords": []}, - "baidu_aip": {"enable": False, "app_id": "", "api_key": "", "secret_key": ""}, - }, - "admins_id": ["astrbot"], - "t2i": False, - "t2i_word_threshold": 150, - "t2i_strategy": "remote", - "t2i_endpoint": "", - "t2i_use_file_service": False, - "t2i_active_template": "base", - "http_proxy": "", - "no_proxy": ["localhost", "127.0.0.1", "::1", "10.*", "192.168.*"], - "dashboard": { - "enable": True, - "username": "astrbot", - "password": "", - "pbkdf2_password": "", - "password_storage_upgraded": False, - "password_change_required": False, - "jwt_secret": "", - "host": "0.0.0.0", - "port": 6185, - "disable_access_log": True, - "trust_proxy_headers": False, - "auth_rate_limit": { - "enable": True, - "average_interval": 1.0, - "max_burst": 3, - }, - "totp": { - "enable": False, - "secret": "", - "recovery_code_hash": "", - }, - "ssl": { - "enable": False, - "cert_file": "", - "key_file": "", - "ca_certs": "", - }, - }, - "platform": [], - "platform_specific": { - # 平台特异配置:按平台分类,平台下按功能分组 - "lark": { - "pre_ack_emoji": {"enable": False, "emojis": ["Typing"]}, - }, - "telegram": { - "pre_ack_emoji": {"enable": False, "emojis": ["✍️"]}, - }, - "discord": { - "pre_ack_emoji": {"enable": False, "emojis": ["🤔"]}, - }, - }, - "wake_prefix": ["/"], - "log_level": "INFO", - "log_file_enable": False, - "log_file_path": "logs/astrbot.log", - "log_file_max_mb": 20, - "temp_dir_max_size": 1024, - "trace_enable": False, - "trace_db_path": "logs/traces.db", - "trace_db_max_mb": 80, - "trace_retention_days": 7, - "pip_install_arg": "", - "pypi_index_url": "https://mirrors.aliyun.com/pypi/simple/", - "persona": [], # deprecated - "timezone": "Asia/Shanghai", - "callback_api_base": "", - "default_kb_collection": "", # 默认知识库名称, 已经过时 - "plugin_set": ["*"], # "*" 表示使用所有可用的插件, 空列表表示不使用任何插件 - "kb_names": [], # 默认知识库名称列表 - "kb_fusion_top_k": 20, # 知识库检索融合阶段返回结果数量 - "kb_final_top_k": 5, # 知识库检索最终返回结果数量 - "kb_agentic_mode": False, - "disable_builtin_commands": False, - "disable_metrics": False, -} - - -""" -AstrBot v3 时代的配置元数据,目前仅承担以下功能: - -1. 保存配置时,配置项的类型验证 -2. WebUI 展示提供商和平台适配器模版 - -WebUI 的配置文件在 `CONFIG_METADATA_3` 中。 - -未来将会逐步淘汰此配置元数据。 -""" -CONFIG_METADATA_2 = { - "platform_group": { - "metadata": { - "platform": { - "description": "消息平台适配器", - "type": "list", - "config_template": { - "QQ 官方机器人(Websocket, 推荐)": { - "id": "default", - "type": "qq_official", - "enable": True, - "appid": "", - "secret": "", - "enable_group_c2c": True, - "enable_guild_direct_message": True, - "use_markdown": True, - }, - "QQ 官方机器人(Webhook)": { - "id": "default", - "type": "qq_official_webhook", - "enable": True, - "appid": "", - "secret": "", - "use_markdown": True, - "is_sandbox": False, - "unified_webhook_mode": True, - "webhook_uuid": "", - "callback_server_host": "0.0.0.0", - "port": 6196, - }, - "OneBot v11": { - "id": "default", - "type": "aiocqhttp", - "enable": True, - "ws_reverse_host": "0.0.0.0", - "ws_reverse_port": 6199, - "ws_reverse_token": "", - }, - "飞书(Lark)": { - "id": "lark", - "type": "lark", - "enable": True, - "app_id": "", - "app_secret": "", - "domain": "https://open.feishu.cn", - "lark_connection_mode": "socket", # webhook, socket - "webhook_uuid": "", - "lark_encrypt_key": "", - "lark_verification_token": "", - }, - "个人微信": { - "id": "weixin_personal", - "type": "weixin_oc", - "enable": True, - "weixin_oc_base_url": "https://ilinkai.weixin.qq.com", - "weixin_oc_bot_type": "3", - "weixin_oc_qr_poll_interval": 1, - "weixin_oc_long_poll_timeout_ms": 35_000, - "weixin_oc_api_timeout_ms": 120_000, - }, - "企业微信 (智能机器人)": { - "id": "wecom_ai_bot", - "type": "wecom_ai_bot", - "hint": "如果发现字段有异常,请重新创建", - "enable": True, - "wecom_ai_bot_connection_mode": "long_connection", # long_connection, webhook - "wecom_ai_bot_name": "", - "wecomaibot_ws_bot_id": "", - "wecomaibot_ws_secret": "", - "wecomaibot_token": "", - "wecomaibot_encoding_aes_key": "", - "wecomaibot_init_respond_text": "", - "wecomaibot_friend_message_welcome_text": "", - "msg_push_webhook_url": "", - "only_use_webhook_url_to_send": False, - "wecomaibot_ws_url": "wss://openws.work.weixin.qq.com", - "wecomaibot_heartbeat_interval": 30, - "unified_webhook_mode": True, - "webhook_uuid": "", - "callback_server_host": "0.0.0.0", - "port": 6198, - }, - "企业微信应用 & 微信客服": { - "id": "wecom", - "type": "wecom", - "enable": True, - "corpid": "", - "secret": "", - "token": "", - "encoding_aes_key": "", - "kf_name": "", - "api_base_url": "https://qyapi.weixin.qq.com/cgi-bin/", - "unified_webhook_mode": True, - "webhook_uuid": "", - "callback_server_host": "0.0.0.0", - "port": 6195, - }, - "微信公众平台": { - "id": "weixin_official_account", - "type": "weixin_official_account", - "enable": True, - "appid": "", - "secret": "", - "token": "", - "encoding_aes_key": "", - "api_base_url": "https://api.weixin.qq.com/cgi-bin/", - "unified_webhook_mode": True, - "webhook_uuid": "", - "callback_server_host": "0.0.0.0", - "port": 6194, - "active_send_mode": False, - }, - "钉钉(DingTalk)": { - "id": "dingtalk", - "type": "dingtalk", - "enable": True, - "client_id": "", - "client_secret": "", - "card_template_id": "", - }, - "Telegram": { - "id": "telegram", - "type": "telegram", - "enable": True, - "telegram_token": "", - "start_message": "Hello, I'm AstrBot!", - "telegram_api_base_url": "https://api.telegram.org/bot", - "telegram_file_base_url": "https://api.telegram.org/file/bot", - "telegram_command_register": True, - "telegram_command_auto_refresh": True, - "telegram_command_register_interval": 300, - "telegram_polling_restart_delay": 5.0, - }, - "Discord": { - "id": "discord", - "type": "discord", - "enable": True, - "discord_token": "", - "discord_proxy": "", - "discord_command_register": True, - "discord_activity_name": "", - "discord_allow_bot_messages": False, - }, - "Misskey": { - "id": "misskey", - "type": "misskey", - "enable": True, - "misskey_instance_url": "https://misskey.example", - "misskey_token": "", - "misskey_default_visibility": "public", - "misskey_local_only": False, - "misskey_enable_chat": True, - # download / security options - "misskey_allow_insecure_downloads": False, - "misskey_download_timeout": 15, - "misskey_download_chunk_size": 65536, - "misskey_max_download_bytes": None, - "misskey_enable_file_upload": True, - "misskey_upload_concurrency": 3, - "misskey_upload_folder": "", - }, - "Slack": { - "id": "slack", - "type": "slack", - "enable": True, - "bot_token": "", - "app_token": "", - "signing_secret": "", - "slack_connection_mode": "socket", # webhook, socket - "unified_webhook_mode": True, - "webhook_uuid": "", - "slack_webhook_host": "0.0.0.0", - "slack_webhook_port": 6197, - "slack_webhook_path": "/astrbot-slack-webhook/callback", - }, - "Line": { - "id": "line", - "type": "line", - "enable": True, - "channel_access_token": "", - "channel_secret": "", - "unified_webhook_mode": True, - "webhook_uuid": "", - }, - "Satori": { - "id": "satori", - "type": "satori", - "enable": True, - "satori_api_base_url": "http://localhost:5140/satori/v1", - "satori_endpoint": "ws://localhost:5140/satori/v1/events", - "satori_token": "", - "satori_auto_reconnect": True, - "satori_heartbeat_interval": 10, - "satori_reconnect_delay": 5, - }, - "KOOK": { - "id": "kook", - "type": "kook", - "enable": True, - "kook_bot_token": "", - "kook_reconnect_delay": 1, - "kook_max_reconnect_delay": 60, - "kook_max_retry_delay": 60, - "kook_heartbeat_interval": 30, - "kook_heartbeat_timeout": 6, - "kook_max_heartbeat_failures": 3, - "kook_max_consecutive_failures": 5, - }, - "Mattermost": { - "id": "mattermost", - "type": "mattermost", - "enable": True, - "mattermost_url": "https://chat.example.com", - "mattermost_bot_token": "", - "mattermost_reconnect_delay": 5.0, - "unified_webhook_mode": True, - "webhook_uuid": "", - }, - # "WebChat": { - # "id": "webchat", - # "type": "webchat", - # "enable": False, - # "webchat_link_path": "", - # "webchat_present_type": "fullscreen", - # }, - }, - "items": { - # "webchat_link_path": { - # "description": "链接路径", - # "_special": "webchat_link_path", - # "type": "string", - # }, - # "webchat_present_type": { - # "_special": "webchat_present_type", - # "description": "展现形式", - # "type": "string", - # "options": ["fullscreen", "embedded"], - # }, - "app_id": { - "description": "应用 ID", - "type": "string", - "hint": "消息平台开放平台中的应用 ID。", - "show_key": True, - }, - "app_secret": { - "description": "应用密钥", - "type": "string", - "hint": "消息平台开放平台中的应用密钥。请妥善保管,避免泄露。", - "show_key": True, - "secret": True, - }, - "domain": { - "description": "开放平台 API 地址", - "type": "string", - "hint": "开放平台 API 的基础地址。使用默认官方服务时通常无需修改。", - "show_key": True, - }, - "corpid": { - "description": "企业 ID", - "type": "string", - "hint": "企业微信后台中的企业 ID(CorpID)。", - "show_key": True, - }, - "token": { - "description": "回调 Token", - "type": "string", - "hint": "消息平台回调配置中用于验证请求的 Token。", - "show_key": True, - "secret": True, - }, - "encoding_aes_key": { - "description": "消息加密密钥", - "type": "string", - "hint": "消息平台回调配置中的 EncodingAESKey,用于加密和解密消息。", - "show_key": True, - "secret": True, - }, - "api_base_url": { - "description": "API 基础地址", - "type": "string", - "hint": "消息平台 API 的基础地址。使用默认官方服务时通常无需修改。", - "show_key": True, - }, - "client_id": { - "description": "客户端 ID", - "type": "string", - "hint": "消息平台开放平台中的客户端 ID。", - "show_key": True, - }, - "client_secret": { - "description": "客户端密钥", - "type": "string", - "hint": "消息平台开放平台中的客户端密钥。请妥善保管,避免泄露。", - "show_key": True, - "secret": True, - }, - "start_message": { - "description": "Start 命令回复", - "type": "string", - "hint": "用户向 Telegram 机器人发送 /start 命令时回复的内容。", - "show_key": True, - }, - "telegram_api_base_url": { - "description": "API 地址", - "type": "string", - "hint": "Telegram Bot API 的基础地址。使用官方服务时通常无需修改。", - "show_key": True, - }, - "telegram_file_base_url": { - "description": "文件 API 地址", - "type": "string", - "hint": "Telegram Bot API 文件下载接口的基础地址。使用官方服务时通常无需修改。", - "show_key": True, - }, - "bot_token": { - "description": "Slack Bot Token", - "type": "string", - "hint": "Slack 应用的 Bot User OAuth Token,通常以 xoxb- 开头。", - "show_key": True, - "secret": True, - }, - "app_token": { - "description": "Slack App Token", - "type": "string", - "hint": "Slack Socket Mode 使用的 App-Level Token,通常以 xapp- 开头。", - "condition": { - "slack_connection_mode": "socket", - }, - "show_key": True, - "secret": True, - }, - "signing_secret": { - "description": "Slack Signing Secret", - "type": "string", - "hint": "Slack 应用的 Signing Secret,用于验证 Webhook 请求。", - "condition": { - "slack_connection_mode": "webhook", - }, - "show_key": True, - "secret": True, - }, - "channel_access_token": { - "description": "LINE 频道访问令牌", - "type": "string", - "hint": "LINE Messaging API 频道的 Channel Access Token。", - "show_key": True, - "secret": True, - }, - "channel_secret": { - "description": "LINE 频道密钥", - "type": "string", - "hint": "LINE Messaging API 频道的 Channel Secret。", - "show_key": True, - "secret": True, - }, - "lark_connection_mode": { - "description": "订阅方式", - "type": "string", - "options": ["socket", "webhook"], - "labels": ["长连接模式", "推送至服务器模式"], - }, - "lark_encrypt_key": { - "description": "Encrypt Key", - "type": "string", - "hint": "用于解密飞书回调数据的加密密钥", - "secret": True, - "condition": { - "lark_connection_mode": "webhook", - }, - }, - "lark_verification_token": { - "description": "Verification Token", - "type": "string", - "hint": "用于验证飞书回调请求的令牌", - "secret": True, - "condition": { - "lark_connection_mode": "webhook", - }, - }, - "is_sandbox": { - "description": "沙箱模式", - "type": "bool", - }, - "satori_api_base_url": { - "description": "Satori API 终结点", - "type": "string", - "hint": "Satori API 的基础地址。", - }, - "satori_endpoint": { - "description": "Satori WebSocket 终结点", - "type": "string", - "hint": "Satori 事件的 WebSocket 端点。", - }, - "satori_token": { - "description": "Satori 令牌", - "type": "string", - "hint": "用于 Satori API 身份验证的令牌。", - "secret": True, - }, - "satori_auto_reconnect": { - "description": "启用自动重连", - "type": "bool", - "hint": "断开连接时是否自动重新连接 WebSocket。", - }, - "satori_heartbeat_interval": { - "description": "Satori 心跳间隔", - "type": "int", - "hint": "发送心跳消息的间隔(秒)。", - }, - "satori_reconnect_delay": { - "description": "Satori 重连延迟", - "type": "int", - "hint": "尝试重新连接前的延迟时间(秒)。", - }, - "slack_connection_mode": { - "description": "Slack Connection Mode", - "type": "string", - "options": ["webhook", "socket"], - "hint": "The connection mode for Slack. `webhook` uses a webhook server, `socket` uses Slack's Socket Mode.", - }, - "slack_webhook_host": { - "description": "Slack Webhook Host", - "type": "string", - "hint": "Only valid when Slack connection mode is `webhook`.", - "condition": { - "slack_connection_mode": "webhook", - "unified_webhook_mode": False, - }, - }, - "slack_webhook_port": { - "description": "Slack Webhook Port", - "type": "int", - "hint": "Only valid when Slack connection mode is `webhook`.", - "condition": { - "slack_connection_mode": "webhook", - "unified_webhook_mode": False, - }, - }, - "slack_webhook_path": { - "description": "Slack Webhook Path", - "type": "string", - "hint": "Only valid when Slack connection mode is `webhook`.", - "condition": { - "slack_connection_mode": "webhook", - "unified_webhook_mode": False, - }, - }, - "active_send_mode": { - "description": "是否换用主动发送接口", - "type": "bool", - "desc": "只有企业认证的公众号才能主动发送。主动发送接口的限制会少一些。", - }, - "wpp_active_message_poll": { - "description": "是否启用主动消息轮询", - "type": "bool", - "hint": "只有当你发现微信消息没有按时同步到 AstrBot 时,才需要启用这个功能,默认不启用。", - }, - "wpp_active_message_poll_interval": { - "description": "主动消息轮询间隔", - "type": "int", - "hint": "主动消息轮询间隔,单位为秒,默认 3 秒,最大不要超过 60 秒,否则可能被认为是旧消息。", - }, - "kf_name": { - "description": "微信客服账号名", - "type": "string", - "hint": "可选。微信客服账号名(不是 ID)。可在 https://kf.weixin.qq.com/kf/frame#/accounts 获取", - }, - "telegram_token": { - "description": "Bot Token", - "type": "string", - "hint": "如果你的网络环境为中国大陆,请在 `其他配置` 处设置代理或更改 api_base。", - "secret": True, - }, - "mattermost_url": { - "description": "Mattermost URL", - "type": "string", - "hint": "Mattermost 服务地址,例如 https://chat.example.com。", - }, - "mattermost_bot_token": { - "description": "Mattermost Bot Token", - "type": "string", - "hint": "在 Mattermost 中创建 Bot 账户后生成的访问令牌。", - "secret": True, - }, - "mattermost_reconnect_delay": { - "description": "Mattermost 重连延迟", - "type": "float", - "hint": "WebSocket 断开后的重连等待时间,单位为秒。默认 5 秒。", - }, - "misskey_instance_url": { - "description": "Misskey 实例 URL", - "type": "string", - "hint": "例如 https://misskey.example,填写 Bot 账号所在的 Misskey 实例地址", - }, - "misskey_token": { - "description": "Misskey Access Token", - "type": "string", - "hint": "连接服务设置生成的 API 鉴权访问令牌(Access token)", - "secret": True, - }, - "misskey_default_visibility": { - "description": "默认帖子可见性", - "type": "string", - "options": ["public", "home", "followers"], - "hint": "机器人发帖时的默认可见性设置。public:公开,home:主页时间线,followers:仅关注者。", - }, - "misskey_local_only": { - "description": "仅限本站(不参与联合)", - "type": "bool", - "hint": "启用后,机器人发出的帖子将仅在本实例可见,不会联合到其他实例", - }, - "misskey_enable_chat": { - "description": "启用聊天消息响应", - "type": "bool", - "hint": "启用后,机器人将会监听和响应私信聊天消息", - }, - "misskey_enable_file_upload": { - "description": "启用文件上传到 Misskey", - "type": "bool", - "hint": "启用后,适配器会尝试将消息链中的文件上传到 Misskey。URL 文件会先尝试服务器端上传,异步上传失败时会回退到下载后本地上传。", - }, - "misskey_allow_insecure_downloads": { - "description": "允许不安全下载(禁用 SSL 验证)", - "type": "bool", - "hint": "当远端服务器存在证书问题导致无法正常下载时,自动禁用 SSL 验证作为回退方案。适用于某些图床的证书配置问题。启用有安全风险,仅在必要时使用。", - }, - "misskey_download_timeout": { - "description": "远端下载超时时间(秒)", - "type": "int", - "hint": "下载远程文件时的超时时间(秒),用于异步上传回退到本地上传的场景。", - }, - "misskey_download_chunk_size": { - "description": "流式下载分块大小(字节)", - "type": "int", - "hint": "流式下载和计算 MD5 时使用的每次读取字节数,过小会增加开销,过大会占用内存。", - }, - "misskey_max_download_bytes": { - "description": "最大允许下载字节数(超出则中止)", - "type": "int", - "hint": "如果希望限制下载文件的最大大小以防止 OOM,请填写最大字节数;留空或 null 表示不限制。", - }, - "misskey_upload_concurrency": { - "description": "并发上传限制", - "type": "int", - "hint": "同时进行的文件上传任务上限(整数,默认 3)。", - }, - "misskey_upload_folder": { - "description": "上传到网盘的目标文件夹 ID", - "type": "string", - "hint": "可选:填写 Misskey 网盘中目标文件夹的 ID,上传的文件将放置到该文件夹内。留空则使用账号网盘根目录。", - }, - "card_template_id": { - "description": "卡片模板 ID", - "type": "string", - "hint": "可选。钉钉互动卡片模板 ID。启用后将使用互动卡片进行流式回复。", - }, - "telegram_command_register": { - "description": "命令注册", - "type": "bool", - "hint": "启用后,AstrBot 将会自动注册 Telegram 命令。", - "show_key": True, - }, - "telegram_command_auto_refresh": { - "description": "命令自动刷新", - "type": "bool", - "hint": "启用后,AstrBot 将会在运行时自动刷新 Telegram 命令。(单独设置此项无效)", - "show_key": True, - }, - "telegram_command_register_interval": { - "description": "命令自动刷新间隔", - "type": "int", - "hint": "Telegram 命令自动刷新间隔,单位为秒。", - "show_key": True, - }, - "telegram_polling_restart_delay": { - "description": "轮询重启延迟", - "type": "float", - "hint": "当轮询意外结束尝试自动重启时的延迟时间,理论上越短恢复越快,但过短(<0.1s)可能导致死循环针对 API 服务器的请求阻断。单位为秒。默认为 5s。", - "show_key": True, - }, - "id": { - "description": "机器人名称", - "type": "string", - "hint": "机器人名称", - }, - "type": { - "description": "适配器类型", - "type": "string", - "invisible": True, - }, - "enable": { - "description": "启用", - "type": "bool", - "hint": "是否启用该适配器。未启用的适配器对应的消息平台将不会接收到消息。", - }, - "appid": { - "description": "appid", - "type": "string", - "hint": "必填项。当前消息平台的 AppID。如何获取请参考对应平台接入文档。", - }, - "secret": { - "description": "secret", - "type": "string", - "hint": "必填项。", - "secret": True, - }, - "enable_group_c2c": { - "description": "启用消息列表单聊", - "type": "bool", - "hint": "启用后,机器人可以接收到 QQ 消息列表中的私聊消息。你可能需要在 QQ 机器人平台上通过扫描二维码的方式添加机器人为你的好友。详见文档。", - }, - "enable_guild_direct_message": { - "description": "启用频道私聊", - "type": "bool", - "hint": "启用后,机器人可以接收到频道的私聊消息。", - }, - "use_markdown": { - "description": "主动消息使用 Markdown", - "type": "bool", - "hint": "启用后,机器人主动发送消息默认以 Markdown 模式发送;插件显式调用 use_markdown() 指定行为时不受此配置影响。", - }, - "ws_reverse_host": { - "description": "反向 Websocket 主机", - "type": "string", - "hint": "AstrBot 将作为服务器端。", - }, - "ws_reverse_port": { - "description": "反向 Websocket 端口", - "type": "int", - }, - "ws_reverse_token": { - "description": "反向 Websocket Token", - "type": "string", - "hint": "反向 Websocket Token。未设置则不启用 Token 验证。", - "secret": True, - }, - "wecom_ai_bot_name": { - "description": "企业微信智能机器人的名字", - "type": "string", - "hint": "请务必填写正确,否则无法使用一些指令。", - }, - "wecom_ai_bot_connection_mode": { - "description": "企业微信智能机器人连接模式", - "type": "string", - "options": ["webhook", "long_connection"], - "labels": ["Webhook 回调", "长连接"], - "hint": "Webhook 回调模式需要配置 Token/EncodingAESKey。长连接模式需要配置 BotID/Secret。", - }, - "wecomaibot_init_respond_text": { - "description": "企业微信智能机器人初始响应文本", - "type": "string", - "hint": "当机器人收到消息时,首先回复的文本内容。留空则不设置。", - }, - "wecomaibot_friend_message_welcome_text": { - "description": "企业微信智能机器人私聊欢迎语", - "type": "string", - "hint": "当用户当天进入智能机器人单聊会话,回复欢迎语,留空则不回复。", - }, - "wecomaibot_token": { - "description": "企业微信智能机器人 Token", - "type": "string", - "hint": "用于 Webhook 回调模式的身份验证。", - "secret": True, - "condition": { - "wecom_ai_bot_connection_mode": "webhook", - }, - }, - "wecomaibot_encoding_aes_key": { - "description": "企业微信智能机器人 EncodingAESKey", - "type": "string", - "hint": "用于 Webhook 回调模式的消息加密解密。", - "secret": True, - "condition": { - "wecom_ai_bot_connection_mode": "webhook", - }, - }, - "msg_push_webhook_url": { - "description": "企业微信消息推送 Webhook URL", - "type": "string", - "hint": "用于 send_by_session 主动消息推送。格式示例: https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=xxx", - "secret": True, - }, - "only_use_webhook_url_to_send": { - "description": "仅使用 Webhook 发送消息", - "type": "bool", - "hint": "启用后,企业微信智能机器人的所有回复都改为通过消息推送 Webhook 发送。消息推送 Webhook 支持更多的消息类型(如图片、文件等)。", - }, - "wecomaibot_ws_bot_id": { - "description": "长连接 BotID", - "type": "string", - "hint": "企业微信智能机器人长连接模式凭证 BotID。", - "condition": { - "wecom_ai_bot_connection_mode": "long_connection", - }, - }, - "wecomaibot_ws_secret": { - "description": "长连接 Secret", - "type": "string", - "hint": "企业微信智能机器人长连接模式凭证 Secret。", - "secret": True, - "condition": { - "wecom_ai_bot_connection_mode": "long_connection", - }, - }, - "wecomaibot_ws_url": { - "description": "长连接 WebSocket 地址", - "type": "string", - "invisible": True, - "hint": "默认值为 wss://openws.work.weixin.qq.com,一般无需修改。", - "condition": { - "wecom_ai_bot_connection_mode": "long_connection", - }, - }, - "wecomaibot_heartbeat_interval": { - "description": "长连接心跳间隔", - "type": "int", - "invisible": True, - "hint": "长连接模式心跳间隔(秒),建议 30 秒。", - "condition": { - "wecom_ai_bot_connection_mode": "long_connection", - }, - }, - "discord_token": { - "description": "Discord Bot Token", - "type": "string", - "hint": "在此处填入你的Discord Bot Token", - "secret": True, - }, - "discord_proxy": { - "description": "Discord 代理地址", - "type": "string", - "hint": "可选的代理地址:http://ip:port", - }, - "discord_command_register": { - "description": "注册 Discord 指令", - "hint": "启用后,自动将插件指令注册为 Discord 斜杠指令", - "type": "bool", - }, - "discord_activity_name": { - "description": "Discord 活动名称", - "type": "string", - "hint": "可选的 Discord 活动名称。留空则不设置活动。", - }, - "discord_allow_bot_messages": { - "description": "允许接收机器人消息", - "type": "bool", - "hint": "启用后,AstrBot 将接收来自其他 Discord 机器人的消息。适用于机器人间通信场景(如消息转发)。默认关闭。", - }, - "port": { - "description": "回调服务器端口", - "type": "int", - "hint": "回调服务器端口。留空则不启用回调服务器。", - "condition": { - "unified_webhook_mode": False, - }, - }, - "callback_server_host": { - "description": "回调服务器主机", - "type": "string", - "hint": "回调服务器主机。留空则不启用回调服务器。", - "condition": { - "unified_webhook_mode": False, - }, - }, - "unified_webhook_mode": { - "description": "统一 Webhook 模式", - "type": "bool", - "hint": "Webhook 模式下使用 AstrBot 统一 Webhook 入口,无需单独开启端口。回调地址为 /api/platform/webhook/{webhook_uuid}。", - }, - **PERSONAL_WECHAT_CONFIG_METADATA, - "webhook_uuid": { - "invisible": True, - "description": "Webhook UUID", - "type": "string", - "hint": "统一 Webhook 模式下的唯一标识符,创建平台时自动生成。", - }, - "kook_bot_token": { - "description": "机器人 Token", - "type": "string", - "hint": "必填项。从 KOOK 开发者平台获取的机器人 Token。", - "secret": True, - }, - "kook_reconnect_delay": { - "description": "重连延迟", - "type": "int", - "hint": "重连延迟时间(秒),使用指数退避策略。", - }, - "kook_max_reconnect_delay": { - "description": "最大重连延迟", - "type": "int", - "hint": "重连延迟的最大值(秒)。", - }, - "kook_max_retry_delay": { - "description": "最大重试延迟", - "type": "int", - "hint": "重试的最大延迟时间(秒)。", - }, - "kook_heartbeat_interval": { - "description": "心跳间隔", - "type": "int", - "hint": "心跳检测间隔时间(秒)。", - }, - "kook_heartbeat_timeout": { - "description": "心跳超时时间", - "type": "int", - "hint": "心跳检测超时时间(秒)。", - }, - "kook_max_heartbeat_failures": { - "description": "最大心跳失败次数", - "type": "int", - "hint": "允许的最大心跳失败次数,超过后断开连接。", - }, - "kook_max_consecutive_failures": { - "description": "最大连续失败次数", - "type": "int", - "hint": "允许的最大连续失败次数,超过后停止重试。", - }, - }, - }, - "platform_settings": { - "type": "object", - "items": { - "unique_session": { - "type": "bool", - }, - "rate_limit": { - "type": "object", - "items": { - "time": {"type": "int"}, - "count": {"type": "int"}, - "strategy": { - "type": "string", - "options": ["stall", "discard"], - }, - }, - }, - "no_permission_reply": { - "type": "bool", - "hint": "启用后,当用户没有权限执行某个操作时,机器人会回复一条消息。", - }, - "empty_mention_waiting": { - "type": "bool", - "hint": "启用后,当消息内容只有 @ 机器人时,会触发等待,在 60 秒内的该用户的任意一条消息均会唤醒机器人。这在某些平台不支持 @ 和语音/图片等消息同时发送时特别有用。", - }, - "empty_mention_waiting_need_reply": { - "type": "bool", - "hint": "在上面一个配置项中,如果启用了触发等待,启用此项后,机器人会使用 LLM 生成一条回复。否则,将不回复而只是等待。", - }, - "friend_message_needs_wake_prefix": { - "type": "bool", - "hint": "启用后,私聊消息需要唤醒前缀才会被处理,同群聊一样。", - }, - "ignore_bot_self_message": { - "type": "bool", - "hint": "某些平台会将自身账号在其他 APP 端发送的消息也当做消息事件下发导致给自己发消息时唤醒机器人", - }, - "ignore_at_all": { - "type": "bool", - "hint": "启用后,机器人会忽略 @ 全体成员 的消息事件。", - }, - "segmented_reply": { - "type": "object", - "items": { - "enable": { - "type": "bool", - }, - "only_llm_result": { - "type": "bool", - }, - "interval_method": { - "type": "string", - "options": ["random", "log"], - }, - "interval": { - "type": "string", - }, - "log_base": { - "type": "float", - }, - "words_count_threshold": { - "type": "int", - }, - "regex": { - "type": "string", - }, - "content_cleanup_rule": { - "type": "string", - }, - }, - }, - "reply_prefix": { - "type": "string", - "hint": "机器人回复消息时带有的前缀。", - }, - "forward_threshold": { - "type": "int", - "hint": "超过一定字数后,机器人会将消息折叠成 QQ 群聊的 “转发消息”,以防止刷屏。目前仅 QQ 平台适配器适用。", - }, - "enable_id_white_list": { - "type": "bool", - }, - "id_whitelist": { - "type": "list", - "_special": "umo", - "items": {"type": "string"}, - "hint": "只处理填写的 ID 发来的消息事件,为空时不启用。可使用 /sid 指令获取在平台上的会话 ID(类似 abc:GroupMessage:123)。管理员可在 WebUI 的配置文件 -> 访问控制 -> 白名单中管理白名单。", - }, - "id_whitelist_log": { - "type": "bool", - "hint": "启用后,当一条消息没通过白名单时,会输出 INFO 级别的日志。", - }, - "wl_ignore_admin_on_group": { - "type": "bool", - }, - "wl_ignore_admin_on_friend": { - "type": "bool", - }, - "reply_with_mention": { - "type": "bool", - "hint": "启用后,机器人回复消息时会 @ 发送者。实际效果以具体的平台适配器为准。", - }, - "reply_with_quote": { - "type": "bool", - "hint": "启用后,机器人回复消息时会引用原消息。实际效果以具体的平台适配器为准。", - }, - "path_mapping": { - "type": "list", - "items": {"type": "string"}, - "hint": "此功能解决由于文件系统不一致导致路径不存在的问题。格式为 <原路径>:<映射路径>。如 `/app/.config/QQ:/var/lib/docker/volumes/xxxx/_data`。这样,当消息平台下发的事件中图片和语音路径以 `/app/.config/QQ` 开头时,开头被替换为 `/var/lib/docker/volumes/xxxx/_data`。这在 AstrBot 或者平台协议端使用 Docker 部署时特别有用。", - }, - }, - }, - "content_safety": { - "type": "object", - "items": { - "also_use_in_response": { - "type": "bool", - "hint": "启用后,大模型的响应也会通过内容安全审核。", - }, - "baidu_aip": { - "type": "object", - "items": { - "enable": { - "type": "bool", - "hint": "启用此功能前,您需要手动在设备中安装 baidu-aip 库。一般来说,安装指令如下: `pip3 install baidu-aip`", - }, - "app_id": {"description": "APP ID", "type": "string"}, - "api_key": { - "description": "API Key", - "type": "string", - "secret": True, - }, - "secret_key": { - "type": "string", - "secret": True, - }, - }, - }, - "internal_keywords": { - "type": "object", - "items": { - "enable": { - "type": "bool", - }, - "extra_keywords": { - "type": "list", - "items": {"type": "string"}, - "hint": "额外的屏蔽关键词列表,支持正则表达式。", - }, - }, - }, - }, - }, - }, - }, - "provider_group": { - "name": "服务提供商", - "metadata": { - "provider": { - "type": "list", - # provider sources templates - "config_template": { - "OpenAI Compatible": { - "id": "openai", - "provider": "openai", - "type": "openai_chat_completion", - "provider_type": "chat_completion", - "enable": True, - "key": [], - "api_base": "https://api.openai.com/v1", - "timeout": 120, - "proxy": "", - "custom_headers": {}, - }, - "OpenAI Responses": { - "id": "openai-responses", - "provider": "openai", - "type": "openai_responses", - "provider_type": "chat_completion", - "enable": True, - "key": [], - "api_base": "https://api.openai.com/v1", - "timeout": 120, - "proxy": "", - "custom_headers": {}, - }, - "Google Gemini": { - "id": "google_gemini", - "provider": "google", - "type": "googlegenai_chat_completion", - "provider_type": "chat_completion", - "enable": True, - "key": [], - "api_base": "https://generativelanguage.googleapis.com/", - "timeout": 120, - "gm_resp_image_modal": False, - "gm_native_search": False, - "gm_native_coderunner": False, - "gm_url_context": False, - "gm_safety_settings": { - "harassment": "BLOCK_MEDIUM_AND_ABOVE", - "hate_speech": "BLOCK_MEDIUM_AND_ABOVE", - "sexually_explicit": "BLOCK_MEDIUM_AND_ABOVE", - "dangerous_content": "BLOCK_MEDIUM_AND_ABOVE", - }, - "gm_thinking_config": {"budget": 0, "level": "HIGH"}, - "proxy": "", - }, - "Anthropic": { - "id": "anthropic", - "provider": "anthropic", - "type": "anthropic_chat_completion", - "provider_type": "chat_completion", - "enable": True, - "key": [], - "api_base": "https://api.anthropic.com", - "timeout": 120, - "proxy": "", - "custom_headers": {}, - "anth_thinking_config": {"type": "", "budget": 0, "effort": ""}, - }, - "Kimi Coding Plan": { - "id": "kimi-code", - "provider": "kimi-code", - "type": "kimi_code_chat_completion", - "provider_type": "chat_completion", - "enable": True, - "key": [], - "api_base": "https://api.kimi.com/coding", - "timeout": 120, - "proxy": "", - "custom_headers": {}, - "anth_thinking_config": {"type": "", "budget": 0, "effort": ""}, - }, - "Moonshot": { - "id": "moonshot", - "provider": "moonshot", - "type": "openai_chat_completion", - "provider_type": "chat_completion", - "enable": True, - "key": [], - "timeout": 120, - "api_base": "https://api.moonshot.cn/v1", - "proxy": "", - "custom_headers": {}, - }, - "MiniMax": { - "id": "minimax", - "provider": "minimax", - "type": "openai_chat_completion", - "provider_type": "chat_completion", - "enable": True, - "key": [], - "api_base": "https://api.minimaxi.com/v1", - "timeout": 120, - "proxy": "", - "custom_headers": {}, - }, - "MiniMax Token Plan": { - "id": "minimax-token-plan", - "provider": "minimax-token-plan", - "type": "minimax_token_plan", - "provider_type": "chat_completion", - "enable": True, - "key": [], - "api_base": "https://api.minimaxi.com/anthropic", - "timeout": 120, - "proxy": "", - "custom_headers": {}, - "anth_thinking_config": {"type": "", "budget": 0, "effort": ""}, - }, - "Xiaomi": { - "id": "xiaomi", - "provider": "xiaomi", - "type": "xiaomi_chat_completion", - "provider_type": "chat_completion", - "enable": True, - "key": [], - "api_base": "https://api.xiaomimimo.com/v1", - "timeout": 120, - "proxy": "", - "custom_headers": {}, - }, - "Xiaomi Token Plan": { - "id": "xiaomi-token-plan", - "provider": "xiaomi-token-plan", - "type": "xiaomi_token_plan", - "provider_type": "chat_completion", - "enable": True, - "key": [], - "api_base": "https://token-plan-cn.xiaomimimo.com/anthropic", - "timeout": 120, - "proxy": "", - "custom_headers": {}, - "anth_thinking_config": {"type": "", "budget": 0, "effort": ""}, - }, - "xAI": { - "id": "xai", - "provider": "xai", - "type": "openai_responses", - "provider_type": "chat_completion", - "enable": True, - "key": [], - "api_base": "https://api.x.ai/v1", - "timeout": 120, - "proxy": "", - "custom_headers": {}, - }, - "DeepSeek": { - "id": "deepseek", - "provider": "deepseek", - "type": "openai_chat_completion", - "provider_type": "chat_completion", - "enable": True, - "key": [], - "api_base": "https://api.deepseek.com/v1", - "timeout": 120, - "proxy": "", - "custom_headers": {}, - }, - "DeepSeek Responses": { - "id": "deepseek-responses", - "provider": "deepseek", - "type": "openai_responses", - "provider_type": "chat_completion", - "enable": True, - "key": [], - "api_base": "https://api.deepseek.com/v1", - "timeout": 120, - "proxy": "", - "custom_headers": {}, - }, - "Zhipu": { - "id": "zhipu", - "provider": "zhipu", - "type": "zhipu_chat_completion", - "provider_type": "chat_completion", - "enable": True, - "key": [], - "timeout": 120, - "api_base": "https://open.bigmodel.cn/api/paas/v4/", - "proxy": "", - "custom_headers": {}, - }, - "LongCat": { - "id": "longcat", - "provider": "longcat", - "type": "longcat_chat_completion", - "provider_type": "chat_completion", - "enable": True, - "key": [], - "api_base": "https://api.longcat.chat/openai", - "timeout": 120, - "proxy": "", - "custom_headers": {}, - }, - "AIHubMix": { - "id": "aihubmix", - "provider": "aihubmix", - "type": "aihubmix_chat_completion", - "provider_type": "chat_completion", - "enable": True, - "key": [], - "timeout": 120, - "api_base": "https://aihubmix.com/v1", - "proxy": "", - "custom_headers": {}, - }, - "MiraRouter": { - "id": "mirarouter", - "provider": "mirarouter", - "type": "mirarouter_chat_completion", - "provider_type": "chat_completion", - "enable": True, - "key": [], - "timeout": 120, - "api_base": "https://api.mirarouter.com/v1", - "proxy": "", - "custom_headers": {}, - }, - "OpenRouter": { - "id": "openrouter", - "provider": "openrouter", - "type": "openrouter_chat_completion", - "provider_type": "chat_completion", - "enable": True, - "key": [], - "timeout": 120, - "api_base": "https://openrouter.ai/api/v1", - "proxy": "", - "custom_headers": {}, - }, - "SSYCloud(胜算云)": { - "id": "ssycloud", - "provider": "ssycloud", - "type": "ssycloud_chat_completion", - "provider_type": "chat_completion", - "enable": True, - "key": [], - "timeout": 120, - "api_base": "https://router.shengsuanyun.com/api/v1", - "proxy": "", - "custom_headers": {"X-Title": "AstrBot"}, - }, - "NVIDIA": { - "id": "nvidia", - "provider": "nvidia", - "type": "openai_chat_completion", - "provider_type": "chat_completion", - "enable": True, - "key": [], - "api_base": "https://integrate.api.nvidia.com/v1", - "timeout": 120, - "proxy": "", - "custom_headers": {}, - }, - "Azure OpenAI": { - "id": "azure_openai", - "provider": "azure", - "type": "openai_chat_completion", - "provider_type": "chat_completion", - "enable": True, - "api_version": "2024-05-01-preview", - "key": [], - "api_base": "", - "timeout": 120, - "proxy": "", - "custom_headers": {}, - }, - "Ollama": { - "id": "ollama", - "provider": "ollama", - "type": "openai_chat_completion", - "provider_type": "chat_completion", - "enable": True, - "key": ["ollama"], # ollama 的 key 默认是 ollama - "api_base": "http://127.0.0.1:11434/v1", - "proxy": "", - "custom_headers": {}, - "ollama_disable_thinking": False, - }, - "LM Studio": { - "id": "lm_studio", - "provider": "lm_studio", - "type": "openai_chat_completion", - "provider_type": "chat_completion", - "enable": True, - "key": ["lmstudio"], - "api_base": "http://127.0.0.1:1234/v1", - "proxy": "", - "custom_headers": {}, - }, - "Gemini_OpenAI_API": { - "id": "google_gemini_openai", - "provider": "google", - "type": "openai_chat_completion", - "provider_type": "chat_completion", - "enable": True, - "key": [], - "api_base": "https://generativelanguage.googleapis.com/v1beta/openai/", - "timeout": 120, - "proxy": "", - "custom_headers": {}, - }, - "Groq": { - "id": "groq", - "provider": "groq", - "type": "groq_chat_completion", - "provider_type": "chat_completion", - "enable": True, - "key": [], - "api_base": "https://api.groq.com/openai/v1", - "timeout": 120, - "proxy": "", - "custom_headers": {}, - }, - "302.AI": { - "id": "302ai", - "provider": "302ai", - "type": "openai_chat_completion", - "provider_type": "chat_completion", - "enable": True, - "key": [], - "api_base": "https://api.302.ai/v1", - "timeout": 120, - "proxy": "", - "custom_headers": {}, - }, - "SiliconFlow": { - "id": "siliconflow", - "provider": "siliconflow", - "type": "openai_chat_completion", - "provider_type": "chat_completion", - "enable": True, - "key": [], - "timeout": 120, - "api_base": "https://api.siliconflow.cn/v1", - "proxy": "", - "custom_headers": {}, - }, - "PPIO": { - "id": "ppio", - "provider": "ppio", - "type": "openai_chat_completion", - "provider_type": "chat_completion", - "enable": True, - "key": [], - "api_base": "https://api.ppinfra.com/v3/openai", - "timeout": 120, - "proxy": "", - "custom_headers": {}, - }, - "TokenPony": { - "id": "tokenpony", - "provider": "tokenpony", - "type": "openai_chat_completion", - "provider_type": "chat_completion", - "enable": True, - "key": [], - "api_base": "https://api.tokenpony.cn/v1", - "timeout": 120, - "proxy": "", - "custom_headers": {}, - }, - "Compshare": { - "id": "compshare", - "provider": "compshare", - "type": "openai_chat_completion", - "provider_type": "chat_completion", - "enable": True, - "key": [], - "api_base": "https://api.modelverse.cn/v1", - "timeout": 120, - "proxy": "", - "custom_headers": {}, - }, - "ModelScope": { - "id": "modelscope", - "provider": "modelscope", - "type": "openai_chat_completion", - "provider_type": "chat_completion", - "enable": True, - "key": [], - "timeout": 120, - "api_base": "https://api-inference.modelscope.cn/v1", - "proxy": "", - "custom_headers": {}, - }, - "FastGPT": { - "id": "fastgpt", - "provider": "fastgpt", - "type": "openai_chat_completion", - "provider_type": "chat_completion", - "enable": True, - "key": [], - "api_base": "https://api.fastgpt.in/api/v1", - "timeout": 60, - "proxy": "", - "custom_headers": {}, - "custom_extra_body": {}, - }, - "Whisper(API)": { - "id": "whisper", - "provider": "openai", - "type": "openai_whisper_api", - "provider_type": "speech_to_text", - "enable": False, - "api_key": "", - "api_base": "", - "model": "whisper-1", - "proxy": "", - }, - "MiMo STT(API)": { - "id": "mimo_stt", - "provider": "mimo", - "type": "mimo_stt_api", - "provider_type": "speech_to_text", - "enable": False, - "api_key": "", - "api_base": "https://api.xiaomimimo.com/v1", - "model": "mimo-v2.5-asr", - "timeout": "20", - "proxy": "", - }, - "Whisper(Local)": { - "provider": "openai", - "type": "openai_whisper_selfhost", - "provider_type": "speech_to_text", - "enable": False, - "id": "whisper_selfhost", - "model": "tiny", - "whisper_device": "cpu", - }, - "SenseVoice(Local)": { - "type": "sensevoice_stt_selfhost", - "provider": "sensevoice", - "provider_type": "speech_to_text", - "enable": False, - "id": "sensevoice", - "stt_model": "iic/SenseVoiceSmall", - "is_emotion": False, - }, - "OpenAI TTS(API)": { - "id": "openai_tts", - "type": "openai_tts_api", - "provider": "openai", - "provider_type": "text_to_speech", - "enable": False, - "api_key": "", - "api_base": "", - "model": "tts-1", - "openai-tts-voice": "alloy", - "timeout": "20", - "proxy": "", - }, - "MiMo TTS(API)": { - "id": "mimo_tts", - "type": "mimo_tts_api", - "provider": "mimo", - "provider_type": "text_to_speech", - "enable": False, - "api_key": "", - "api_base": "https://api.xiaomimimo.com/v1", - "model": "mimo-v2.5-tts", - "mimo-tts-voice": "mimo_default", - "mimo-tts-format": "wav", - "mimo-tts-style-prompt": "", - "mimo-tts-dialect": "", - "mimo-tts-seed-text": "Hello, MiMo, have you had lunch?", - "timeout": "20", - "proxy": "", - }, - "Genie TTS": { - "id": "genie_tts", - "provider": "genie_tts", - "type": "genie_tts", - "provider_type": "text_to_speech", - "enable": False, - "genie_character_name": "mika", - "genie_onnx_model_dir": "CharacterModels/v2ProPlus/mika/tts_models", - "genie_language": "Japanese", - "genie_refer_audio_path": "", - "genie_refer_text": "", - "timeout": 20, - }, - "Edge TTS": { - "id": "edge_tts", - "provider": "microsoft", - "type": "edge_tts", - "provider_type": "text_to_speech", - "enable": False, - "edge-tts-voice": "zh-CN-XiaoxiaoNeural", - "rate": "+0%", - "volume": "+0%", - "pitch": "+0Hz", - "timeout": 20, - }, - "GSV TTS(Local)": { - "id": "gsv_tts", - "enable": False, - "provider": "gpt_sovits", - "type": "gsv_tts_selfhost", - "provider_type": "text_to_speech", - "api_base": "http://127.0.0.1:9880", - "gpt_weights_path": "", - "sovits_weights_path": "", - "timeout": 60, - "gsv_default_parms": { - "gsv_ref_audio_path": "", - "gsv_prompt_text": "", - "gsv_prompt_lang": "zh", - "gsv_aux_ref_audio_paths": "", - "gsv_text_lang": "zh", - "gsv_top_k": 5, - "gsv_top_p": 1.0, - "gsv_temperature": 1.0, - "gsv_text_split_method": "cut3", - "gsv_batch_size": 1, - "gsv_batch_threshold": 0.75, - "gsv_split_bucket": True, - "gsv_speed_factor": 1, - "gsv_fragment_interval": 0.3, - "gsv_streaming_mode": False, - "gsv_seed": -1, - "gsv_parallel_infer": True, - "gsv_repetition_penalty": 1.35, - "gsv_media_type": "wav", - }, - }, - "GSVI TTS(API)": { - "id": "gsvi_tts", - "type": "gsvi_tts_api", - "provider": "gpt_sovits_inference", - "provider_type": "text_to_speech", - "enable": False, - "api_key": "", - "api_base": "http://127.0.0.1:8000", - "version": "v4", - "character": "", - "prompt_text_lang": "中文", - "emotion": "默认", - "text_lang": "中文", - "timeout": 20, - }, - "FishAudio TTS(API)": { - "id": "fishaudio_tts", - "provider": "fishaudio", - "type": "fishaudio_tts_api", - "provider_type": "text_to_speech", - "enable": False, - "api_key": "", - "api_base": "https://api.fish.audio/v1", - "model": "s2-pro", - "fishaudio-tts-character": "可莉", - "fishaudio-tts-reference-id": "", - "timeout": "20", - "proxy": "", - }, - "阿里云百炼 TTS(API)": { - "hint": "API Key 从 https://bailian.console.aliyun.com/?tab=model#/api-key 获取。模型和音色的选择文档请参考: 阿里云百炼语音合成音色名称。具体可参考 https://help.aliyun.com/zh/model-studio/speech-synthesis-and-speech-recognition", - "id": "dashscope_tts", - "provider": "dashscope", - "type": "dashscope_tts", - "provider_type": "text_to_speech", - "enable": False, - "api_key": "", - "model": "cosyvoice-v1", - "dashscope_tts_voice": "loongstella", - "timeout": "20", - }, - "Azure TTS": { - "id": "azure_tts", - "type": "azure_tts", - "provider": "azure", - "provider_type": "text_to_speech", - "enable": True, - "azure_tts_voice": "zh-CN-YunxiaNeural", - "azure_tts_style": "cheerful", - "azure_tts_role": "Boy", - "azure_tts_rate": "1", - "azure_tts_volume": "100", - "azure_tts_subscription_key": "", - "azure_tts_region": "eastus", - "proxy": "", - }, - "MiniMax TTS(API)": { - "id": "minimax_tts", - "type": "minimax_tts_api", - "provider": "minimax", - "provider_type": "text_to_speech", - "enable": False, - "api_key": "", - "api_base": "https://api.minimax.chat/v1/t2a_v2", - "minimax-group-id": "", - "model": "speech-02-turbo", - "minimax-langboost": "auto", - "minimax-voice-speed": 1.0, - "minimax-voice-vol": 1.0, - "minimax-voice-pitch": 0, - "minimax-is-timber-weight": False, - "minimax-voice-id": "female-shaonv", - "minimax-timber-weight": '[\n {\n "voice_id": "Chinese (Mandarin)_Warm_Girl",\n "weight": 25\n },\n {\n "voice_id": "Chinese (Mandarin)_BashfulGirl",\n "weight": 50\n }\n]', - "minimax-voice-emotion": "auto", - "minimax-voice-latex": False, - "minimax-voice-english-normalization": False, - "timeout": 20, - "proxy": "", - }, - "火山引擎_TTS(API)": { - "id": "volcengine_tts", - "type": "volcengine_tts", - "provider": "volcengine", - "provider_type": "text_to_speech", - "enable": False, - "api_key": "", - "appid": "", - "volcengine_cluster": "volcano_tts", - "volcengine_voice_type": "", - "volcengine_speed_ratio": 1.0, - "api_base": "https://openspeech.bytedance.com/api/v1/tts", - "timeout": 20, - "proxy": "", - }, - "Gemini TTS": { - "id": "gemini_tts", - "type": "gemini_tts", - "provider": "google", - "provider_type": "text_to_speech", - "enable": False, - "gemini_tts_api_key": "", - "gemini_tts_api_base": "", - "gemini_tts_timeout": 20, - "gemini_tts_model": "gemini-3.8-flash-tts", - "gemini_tts_prefix": "", - "gemini_tts_voice_name": "Leda", - "proxy": "", - }, - "ElevenLabs TTS(API)": { - "hint": "API Key 从 https://elevenlabs.io/app/settings/api-keys 获取。Voice ID 可在 https://elevenlabs.io/app/voice-library 浏览选择。", - "id": "elevenlabs_tts", - "type": "elevenlabs_tts_api", - "provider": "elevenlabs", - "provider_type": "text_to_speech", - "enable": False, - "api_key": "", - "api_base": "https://api.elevenlabs.io/v1", - "model": "eleven_multilingual_v2", - "elevenlabs-tts-voice-id": "JBFqnCBsd6RMkjVDRZzb", - "elevenlabs-tts-output-format": "mp3_44100_128", - "elevenlabs-tts-stability": "", - "elevenlabs-tts-similarity-boost": "", - "elevenlabs-tts-style": "", - "elevenlabs-tts-use-speaker-boost": True, - "timeout": "20", - "proxy": "", - }, - "OpenAI Embedding": { - "id": "openai_embedding", - "type": "openai_embedding", - "provider": "openai", - "provider_type": "embedding", - "hint": "provider_group.provider.openai_embedding.hint", - "enable": True, - "embedding_api_key": "", - "embedding_api_base": "", - "embedding_model": "", - "embedding_dimensions": 1024, - "embedding_dimensions_mode": "auto", - "timeout": 20, - "proxy": "", - }, - "Gemini Embedding": { - "id": "gemini_embedding", - "type": "gemini_embedding", - "provider": "google", - "provider_type": "embedding", - "hint": "provider_group.provider.gemini_embedding.hint", - "enable": True, - "embedding_api_key": "", - "embedding_api_base": "", - "embedding_model": "gemini-embedding-001", - "embedding_dimensions": 768, - "embedding_task_type_mode": "auto", - "embedding_query_task_type": "RETRIEVAL_QUERY", - "embedding_document_task_type": "RETRIEVAL_DOCUMENT", - "embedding_query_task_name": "search result", - "embedding_document_title": "", - "timeout": 20, - "proxy": "", - }, - "NVIDIA Embedding": { - "id": "nvidia_embedding", - "type": "nvidia_embedding", - "provider": "nvidia", - "provider_type": "embedding", - "hint": "provider_group.provider.nvidia_embedding.hint", - "enable": True, - "embedding_api_key": "", - "embedding_api_base": "https://integrate.api.nvidia.com/v1", - "embedding_model": "nvidia/nemotron-3-embed-1b", - "input_type": "passage", - "embedding_dimensions": 2048, - "timeout": 20, - "proxy": "", - }, - "Ollama Embedding": { - "id": "ollama_embedding", - "type": "ollama_embedding", - "provider": "ollama", - "provider_type": "embedding", - "hint": "provider_group.provider.ollama_embedding.hint", - "enable": True, - "embedding_api_base": "http://localhost:11434", - "embedding_model": "nomic-embed-text", - "embedding_dimensions": 768, - "timeout": 60, - "proxy": "", - }, - "DashScope Embedding": { - "id": "dashscope_embedding", - "type": "dashscope_embedding", - "provider": "dashscope", - "provider_type": "embedding", - "hint": "provider_group.provider.dashscope_embedding.hint", - "enable": True, - "embedding_api_key": "", - "embedding_api_base": "https://dashscope.aliyuncs.com/api/v1", - "embedding_model": "text-embedding-v4", - "embedding_dimensions": 1024, - "timeout": 60, - "proxy": "", - }, - "vLLM Rerank": { - "id": "vllm_rerank", - "type": "vllm_rerank", - "provider": "vllm", - "provider_type": "rerank", - "enable": True, - "rerank_api_key": "", - "rerank_api_base": "http://127.0.0.1:8000", - "rerank_api_suffix": "/v1/rerank", - "rerank_model": "BAAI/bge-reranker-base", - "timeout": 20, - }, - "Xinference Rerank": { - "id": "xinference_rerank", - "type": "xinference_rerank", - "provider": "xinference", - "provider_type": "rerank", - "enable": True, - "rerank_api_key": "", - "rerank_api_base": "http://127.0.0.1:9997", - "rerank_model": "BAAI/bge-reranker-base", - "timeout": 20, - "launch_model_if_not_running": False, - }, - "阿里云百炼重排序": { - "id": "bailian_rerank", - "type": "bailian_rerank", - "provider": "bailian", - "provider_type": "rerank", - "enable": True, - "rerank_api_key": "", - "rerank_api_base": "https://dashscope.aliyuncs.com/api/v1/services/rerank/text-rerank/text-rerank", - "rerank_model": "qwen3-rerank", - "timeout": 30, - "return_documents": False, - "instruct": "", - }, - "NVIDIA Rerank": { - "id": "nvidia_rerank", - "type": "nvidia_rerank", - "provider": "nvidia", - "provider_type": "rerank", - "enable": True, - "nvidia_rerank_api_key": "", - "nvidia_rerank_api_base": "https://ai.api.nvidia.com/v1/retrieval", - "nvidia_rerank_model": "nvidia/llama-nemotron-rerank-vl-1b-v2", - "nvidia_rerank_model_endpoint": "/reranking", - "timeout": 20, - "nvidia_rerank_truncate": "", - }, - "TEI Rerank": { - "id": "tei_rerank", - "type": "tei_rerank", - "provider": "huggingface", - "provider_type": "rerank", - "enable": True, - "rerank_api_key": "", - "rerank_api_base": "http://127.0.0.1:8080", - "timeout": 20, - "tei_rerank_truncate": False, - "tei_rerank_truncation_direction": "Right", - "tei_rerank_raw_scores": False, - "tei_rerank_return_text": False, - }, - "TypeSafe System One": { - "id": "typesafe_decision", - "type": "system_one_decision", - "provider": "typesafe", - "provider_type": "decision", - "enable": True, - "key": "", - "api_base": "https://api.typesafe.ai/v1/systemone", - "model": "jev-latest", - "timeout": 2, - "total_timeout": 5, - "max_concurrency": 4, - "proxy": "", - "custom_headers": {}, - }, - "OpenRouter System One": { - "id": "openrouter_decision", - "type": "system_one_decision", - "provider": "openrouter", - "provider_type": "decision", - "enable": True, - "key": "", - "api_base": "https://openrouter.ai/api/v1/systemone", - "model": "jev-latest", - "timeout": 2, - "total_timeout": 5, - "max_concurrency": 4, - "proxy": "", - "custom_headers": {}, - }, - "Vercel System One": { - "id": "vercel_decision", - "type": "system_one_decision", - "provider": "vercel", - "provider_type": "decision", - "enable": True, - "key": "", - "api_base": "https://ai-gateway.vercel.sh/typesafe/v1/systemone", - "model": "typesafe-ai/jev", - "timeout": 2, - "total_timeout": 5, - "max_concurrency": 4, - "proxy": "", - "custom_headers": {}, - }, - "Custom System One": { - "id": "custom_decision", - "type": "system_one_decision", - "provider": "custom", - "provider_type": "decision", - "enable": True, - "key": "", - "api_base": "", - "model": "", - "timeout": 2, - "total_timeout": 5, - "max_concurrency": 4, - "proxy": "", - "custom_headers": {}, - }, - "Xinference STT": { - "id": "xinference_stt", - "type": "xinference_stt", - "provider": "xinference", - "provider_type": "speech_to_text", - "enable": False, - "api_key": "", - "api_base": "http://127.0.0.1:9997", - "model": "whisper-large-v3", - "timeout": 180, - "launch_model_if_not_running": False, - }, - }, - "items": { - "genie_onnx_model_dir": { - "description": "ONNX Model Directory", - "type": "string", - "hint": "The directory path containing the ONNX model files", - }, - "genie_language": { - "description": "Language", - "type": "string", - "options": ["Japanese", "English", "Chinese"], - }, - "provider_source_id": { - "invisible": True, - "type": "string", - }, - "api_key": { - "description": "API Key", - "type": "string", - "secret": True, - }, - "dashscope_api_key": { - "description": "DashScope API Key", - "type": "string", - "secret": True, - }, - "gemini_tts_api_key": { - "description": "Gemini API Key", - "type": "string", - "secret": True, - }, - "xai_native_search": { - "description": "启用原生搜索功能", - "type": "bool", - "hint": "启用后,将通过 xAI 的 Chat Completions 原生 Live Search 进行联网检索(按需计费)。仅对 xAI 提供商生效。", - "condition": { - "provider": "xai", - "type": "xai_chat_completion", - }, - }, - "rerank_api_base": { - "description": "重排序模型 API Base URL", - "type": "string", - "hint": "最终请求路径由 Base URL 和路径后缀拼接而成(默认为 /v1/rerank)。", - }, - "rerank_api_suffix": { - "description": "API URL 路径后缀", - "type": "string", - "hint": "追加到 base_url 后的路径,如 /v1/rerank。留空则不追加。", - }, - "rerank_api_key": { - "description": "API Key", - "type": "string", - "hint": "如果不需要 API Key, 请留空。", - "secret": True, - }, - "rerank_model": { - "description": "重排序模型名称", - "type": "string", - }, - "return_documents": { - "description": "是否在排序结果中返回文档原文", - "type": "bool", - "hint": "默认值false,以减少网络传输开销。", - }, - "instruct": { - "description": "自定义排序任务类型说明", - "type": "string", - "hint": "仅在使用 qwen3-rerank 模型时生效。建议使用英文撰写。", - }, - "launch_model_if_not_running": { - "description": "模型未运行时自动启动", - "type": "bool", - "hint": "如果模型当前未在 Xinference 服务中运行,是否尝试自动启动它。在生产环境中建议关闭。", - }, - "nvidia_rerank_api_base": { - "description": "API Base URL", - "type": "string", - }, - "nvidia_rerank_api_key": { - "description": "API Key", - "type": "string", - "secret": True, - }, - "nvidia_rerank_model": { - "description": "重排序模型名称", - "type": "string", - "hint": "请参照NVIDIA Docs中模型名称填写。", - }, - "nvidia_rerank_model_endpoint": { - "description": "自定义模型端点", - "type": "string", - "hint": "自定义URL末尾端点,默认为 /reranking", - }, - "nvidia_rerank_truncate": { - "description": "文本截断策略", - "type": "string", - "hint": "当输入文本过长时,是否截断输入以适应模型的最大上下文长度。", - "options": [ - "", - "NONE", - "END", - ], - }, - "tei_rerank_truncate": { - "description": "截断超长文本", - "type": "bool", - "hint": "当输入超过模型最大上下文长度时,是否自动截断。启用后需配合 截断方向 使用。", - }, - "tei_rerank_truncation_direction": { - "description": "截断方向", - "type": "string", - "options": ["left", "right"], - "hint": "选择从文本的左侧(left)还是右侧(right)开始截断。仅在 截断超长文本 为 True 时生效。", - }, - "tei_rerank_raw_scores": { - "description": "返回原始分数", - "type": "bool", - "hint": "如果为 True,返回模型原始 logit 分数(可能为负值),不经过 sigmoid 归一化。默认 False。", - }, - "tei_rerank_return_text": { - "description": "返回排序结果中的文档原文", - "type": "bool", - "hint": "如果为 True,每个排序结果将附带原始文本。默认 False 以减少网络传输。", - }, - "modalities": { - "description": "模型能力", - "type": "list", - "items": {"type": "string"}, - "options": ["text", "image", "audio", "tool_use"], - "labels": ["文本", "图像", "音频", "工具使用"], - "render_type": "checkbox", - "hint": "模型支持的模态及能力。", - }, - "custom_headers": { - "description": "自定义请求头", - "type": "dict", - "items": {}, - "hint": "此处添加的键值对将作为自定义 HTTP 请求头,附加到 AstrBot 发往模型服务商的请求中。值必须为字符串。", - }, - "ollama_disable_thinking": { - "description": "关闭思考模式", - "type": "bool", - "hint": "关闭 Ollama 思考模式。", - }, - "custom_extra_body": { - "description": "自定义请求体参数", - "type": "dict", - "items": {}, - "hint": "用于在请求时添加额外的参数,如 temperature, top_p, max_tokens, reasoning_effort 等。", - "template_schema": { - "temperature": { - "name": "Temperature", - "description": "温度参数", - "hint": "控制输出的随机性,范围通常为 0-2。值越高越随机。", - "type": "float", - "default": 0.6, - "slider": {"min": 0, "max": 2, "step": 0.1}, - }, - "top_p": { - "name": "Top-p", - "description": "Top-p 采样", - "hint": "核采样参数,范围通常为 0-1。控制模型考虑的概率质量。", - "type": "float", - "default": 1.0, - "slider": {"min": 0, "max": 1, "step": 0.01}, - }, - "max_tokens": { - "name": "Max Tokens", - "description": "最大词元(Tokens)数", - "hint": "生成的最大词元(Tokens)数。", - "type": "int", - "default": 8192, - }, - "reasoning_effort": { - "name": "Reasoning Effort", - "description": "推理强度", - "hint": "控制推理模型的推理强度,支持的值取决于具体模型。", - "type": "string", - "default": "high", - }, - }, - }, - "provider": { - "type": "string", - "invisible": True, - }, - "gpt_weights_path": { - "description": "GPT模型文件路径", - "type": "string", - "hint": "即“.ckpt”后缀的文件,请使用绝对路径,路径两端不要带双引号,不填则默认用GPT_SoVITS内置的SoVITS模型(建议直接在GPT_SoVITS中改默认模型)", - }, - "sovits_weights_path": { - "description": "SoVITS模型文件路径", - "type": "string", - "hint": "即“.pth”后缀的文件,请使用绝对路径,路径两端不要带双引号,不填则默认用GPT_SoVITS内置的SoVITS模型(建议直接在GPT_SoVITS中改默认模型)", - }, - "gsv_default_parms": { - "description": "GPT_SoVITS默认参数", - "hint": "参考音频文件路径、参考音频文本必填,其他参数根据个人爱好自行填写", - "type": "object", - "items": { - "gsv_ref_audio_path": { - "description": "参考音频文件路径", - "type": "string", - "hint": "必填!请使用绝对路径!路径两端不要带双引号!", - }, - "gsv_prompt_text": { - "description": "参考音频文本", - "type": "string", - "hint": "必填!请填写参考音频讲述的文本", - }, - "gsv_prompt_lang": { - "description": "参考音频文本语言", - "type": "string", - "hint": "请填写参考音频讲述的文本的语言,默认为中文", - }, - "gsv_aux_ref_audio_paths": { - "description": "辅助参考音频文件路径", - "type": "string", - "hint": "辅助参考音频文件,可不填", - }, - "gsv_text_lang": { - "description": "文本语言", - "type": "string", - "hint": "默认为中文", - }, - "gsv_top_k": { - "description": "生成语音的多样性", - "type": "int", - "hint": "", - }, - "gsv_top_p": { - "description": "核采样的阈值", - "type": "float", - "hint": "", - }, - "gsv_temperature": { - "description": "生成语音的随机性", - "type": "float", - "hint": "", - }, - "gsv_text_split_method": { - "description": "切分文本的方法", - "type": "string", - "hint": "可选值: `cut0`:不切分 `cut1`:四句一切 `cut2`:50字一切 `cut3`:按中文句号切 `cut4`:按英文句号切 `cut5`:按标点符号切", - "options": [ - "cut0", - "cut1", - "cut2", - "cut3", - "cut4", - "cut5", - ], - }, - "gsv_batch_size": { - "description": "批处理大小", - "type": "int", - "hint": "", - }, - "gsv_batch_threshold": { - "description": "批处理阈值", - "type": "float", - "hint": "", - }, - "gsv_split_bucket": { - "description": "将文本分割成桶以便并行处理", - "type": "bool", - "hint": "", - }, - "gsv_speed_factor": { - "description": "语音播放速度", - "type": "float", - "hint": "1为原始语速", - }, - "gsv_fragment_interval": { - "description": "语音片段之间的间隔时间", - "type": "float", - "hint": "", - }, - "gsv_streaming_mode": { - "description": "启用流模式", - "type": "bool", - "hint": "", - }, - "gsv_seed": { - "description": "随机种子", - "type": "int", - "hint": "用于结果的可重复性", - }, - "gsv_parallel_infer": { - "description": "并行执行推理", - "type": "bool", - "hint": "", - }, - "gsv_repetition_penalty": { - "description": "重复惩罚因子", - "type": "float", - "hint": "", - }, - "gsv_media_type": { - "description": "输出媒体的类型", - "type": "string", - "hint": "建议用wav", - }, - }, - }, - "embedding_dimensions": { - "description": "嵌入维度", - "type": "int", - "hint": "嵌入向量的维度。根据模型不同,可能需要调整,请参考具体模型的文档。此配置项请务必填写正确,否则将导致向量数据库无法正常工作。", - "_special": "get_embedding_dim", - }, - "embedding_dimensions_mode": { - "description": "嵌入维度参数发送模式", - "type": "string", - "options": ["auto", "always", "never"], - "hint": "控制是否在 OpenAI 兼容 Embedding 请求中发送 dimensions 参数。auto 会仅对官方 OpenAI embedding-3 模型自动发送;第三方兼容 API 如需该参数可改为 always,报错时改为 never。", - }, - "embedding_model": { - "description": "嵌入模型", - "type": "string", - "hint": "嵌入模型名称。", - }, - "embedding_api_key": { - "description": "API Key", - "type": "string", - "secret": True, - }, - "embedding_api_base": { - "description": "API Base URL", - "type": "string", - }, - "volcengine_cluster": { - "type": "string", - "description": "火山引擎集群", - "hint": "若使用语音复刻大模型,可选volcano_icl或volcano_icl_concurr,默认使用volcano_tts", - }, - "volcengine_voice_type": { - "type": "string", - "description": "火山引擎音色", - "hint": "输入声音id(Voice_type)", - }, - "volcengine_speed_ratio": { - "type": "float", - "description": "语速设置", - "hint": "语速设置,范围为 0.2 到 3.0,默认值为 1.0", - }, - "volcengine_volume_ratio": { - "type": "float", - "description": "音量设置", - "hint": "音量设置,范围为 0.0 到 2.0,默认值为 1.0", - }, - "azure_tts_voice": { - "type": "string", - "description": "音色设置", - "hint": "API 音色", - }, - "azure_tts_style": { - "type": "string", - "description": "风格设置", - "hint": "声音特定的讲话风格。 可以表达快乐、同情和平静等情绪。", - }, - "azure_tts_role": { - "type": "string", - "description": "模仿设置(可选)", - "hint": "讲话角色扮演。 声音可以模仿不同的年龄和性别,但声音名称不会更改。 例如,男性语音可以提高音调和改变语调来模拟女性语音,但语音名称不会更改。 如果角色缺失或不受声音的支持,则会忽略此属性。", - "options": [ - "Boy", - "Girl", - "YoungAdultFemale", - "YoungAdultMale", - "OlderAdultFemale", - "OlderAdultMale", - "SeniorFemale", - "SeniorMale", - "禁用", - ], - }, - "azure_tts_rate": { - "type": "string", - "description": "语速设置", - "hint": "指示文本的讲出速率。可在字词或句子层面应用语速。 速率变化应为原始音频的 0.5 到 2 倍。", - }, - "azure_tts_volume": { - "type": "string", - "description": "语音音量设置", - "hint": "指示语音的音量级别。 可在句子层面应用音量的变化。以从 0.0 到 100.0(从最安静到最大声,例如 75)的数字表示。 默认值为 100.0。", - }, - "azure_tts_region": { - "type": "string", - "description": "API 地区", - "hint": "Azure_TTS 处理数据所在区域,具体参考 https://learn.microsoft.com/zh-cn/azure/ai-services/speech-service/regions", - "options": [ - "southafricanorth", - "eastasia", - "southeastasia", - "australiaeast", - "centralindia", - "japaneast", - "japanwest", - "koreacentral", - "canadacentral", - "northeurope", - "westeurope", - "francecentral", - "germanywestcentral", - "norwayeast", - "swedencentral", - "switzerlandnorth", - "switzerlandwest", - "uksouth", - "uaenorth", - "brazilsouth", - "qatarcentral", - "centralus", - "eastus", - "eastus2", - "northcentralus", - "southcentralus", - "westcentralus", - "westus", - "westus2", - "westus3", - ], - }, - "azure_tts_subscription_key": { - "type": "string", - "description": "服务订阅密钥", - "hint": "Azure_TTS 服务的订阅密钥(注意不是令牌)", - "secret": True, - }, - "dashscope_tts_voice": {"description": "音色", "type": "string"}, - "gm_resp_image_modal": { - "description": "启用图片模态", - "type": "bool", - "hint": "启用后,将支持返回图片内容。需要模型支持,否则会报错。具体支持模型请查看 Google Gemini 官方网站。温馨提示,如果您需要生成图片,请关闭 `启用群员识别` 配置获得更好的效果。", - }, - "gm_native_search": { - "description": "启用原生搜索功能", - "type": "bool", - "hint": "仅 Gemini 3 及以上模型支持与函数工具同时使用;Gemini 3 及以上模型的原生搜索仅限付费层级,计费规则请查阅官方文档", - }, - "gm_native_coderunner": { - "description": "启用原生代码执行器", - "type": "bool", - "hint": "仅 Gemini 3 及以上模型支持与函数工具同时使用", - }, - "gm_url_context": { - "description": "启用URL上下文功能", - "type": "bool", - "hint": "仅 Gemini 3 及以上模型支持与函数工具同时使用", - }, - "gm_safety_settings": { - "description": "安全过滤器", - "type": "object", - "hint": "设置模型输入的内容安全过滤级别。过滤级别分类为NONE(不屏蔽)、HIGH(高风险时屏蔽)、MEDIUM_AND_ABOVE(中等风险及以上屏蔽)、LOW_AND_ABOVE(低风险及以上时屏蔽),具体参见Gemini API文档。", - "items": { - "harassment": { - "description": "骚扰内容", - "type": "string", - "hint": "负面或有害评论", - "options": [ - "BLOCK_NONE", - "BLOCK_ONLY_HIGH", - "BLOCK_MEDIUM_AND_ABOVE", - "BLOCK_LOW_AND_ABOVE", - ], - }, - "hate_speech": { - "description": "仇恨言论", - "type": "string", - "hint": "粗鲁、无礼或亵渎性质内容", - "options": [ - "BLOCK_NONE", - "BLOCK_ONLY_HIGH", - "BLOCK_MEDIUM_AND_ABOVE", - "BLOCK_LOW_AND_ABOVE", - ], - }, - "sexually_explicit": { - "description": "露骨色情内容", - "type": "string", - "hint": "包含性行为或其他淫秽内容的引用", - "options": [ - "BLOCK_NONE", - "BLOCK_ONLY_HIGH", - "BLOCK_MEDIUM_AND_ABOVE", - "BLOCK_LOW_AND_ABOVE", - ], - }, - "dangerous_content": { - "description": "危险内容", - "type": "string", - "hint": "宣扬、助长或鼓励有害行为的信息", - "options": [ - "BLOCK_NONE", - "BLOCK_ONLY_HIGH", - "BLOCK_MEDIUM_AND_ABOVE", - "BLOCK_LOW_AND_ABOVE", - ], - }, - }, - }, - "gm_thinking_config": { - "description": "Thinking Config", - "type": "object", - "items": { - "budget": { - "description": "Thinking Budget", - "type": "int", - "hint": "Guides the model on the specific number of thinking tokens to use for reasoning. See: https://ai.google.dev/gemini-api/docs/thinking#set-budget", - }, - "level": { - "description": "Thinking Level", - "type": "string", - "hint": "Recommended for Gemini 3 models and onwards, lets you control reasoning behavior.See: https://ai.google.dev/gemini-api/docs/thinking#thinking-levels", - "options": [ - "MINIMAL", - "LOW", - "MEDIUM", - "HIGH", - ], - }, - }, - }, - "anth_thinking_config": { - "description": "思考配置", - "type": "object", - "items": { - "type": { - "description": "思考类型", - "type": "string", - "options": ["", "adaptive"], - "hint": "Opus 4.6+ / Sonnet 4.6+ 推荐设为 'adaptive'。留空则使用手动 budget 模式。参见: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking", - }, - "budget": { - "description": "思考预算", - "type": "int", - "hint": "手动 budget_tokens,需 >= 1024。仅在 type 为空时生效。Opus 4.6 / Sonnet 4.6 上已弃用。参见: https://platform.claude.com/docs/en/build-with-claude/extended-thinking", - }, - "effort": { - "description": "思考深度", - "type": "string", - "options": ["", "low", "medium", "high", "max"], - "hint": "type 为 'adaptive' 时控制思考深度。默认 'high'。'max' 仅限 Opus 4.6。参见: https://platform.claude.com/docs/en/build-with-claude/effort", - }, - }, - }, - "minimax-group-id": { - "type": "string", - "description": "用户组", - "hint": "于账户管理->基本信息中可见", - }, - "minimax-langboost": { - "type": "string", - "description": "指定语言/方言", - "hint": "增强对指定的小语种和方言的识别能力,设置后可以提升在指定小语种/方言场景下的语音表现", - "options": [ - "Chinese", - "Chinese,Yue", - "English", - "Arabic", - "Russian", - "Spanish", - "French", - "Portuguese", - "German", - "Turkish", - "Dutch", - "Ukrainian", - "Vietnamese", - "Indonesian", - "Japanese", - "Italian", - "Korean", - "Thai", - "Polish", - "Romanian", - "Greek", - "Czech", - "Finnish", - "Hindi", - "auto", - ], - }, - "minimax-voice-speed": { - "type": "float", - "description": "语速", - "hint": "生成声音的语速, 取值[0.5, 2], 默认为1.0, 取值越大,语速越快", - }, - "minimax-voice-vol": { - "type": "float", - "description": "音量", - "hint": "生成声音的音量, 取值(0, 10], 默认为1.0, 取值越大,音量越高", - }, - "minimax-voice-pitch": { - "type": "int", - "description": "语调", - "hint": "生成声音的语调, 取值[-12, 12], 默认为0", - }, - "minimax-is-timber-weight": { - "type": "bool", - "description": "启用混合音色", - "hint": "启用混合音色, 支持以自定义权重混合最多四种音色, 启用后自动忽略单一音色设置", - }, - "minimax-timber-weight": { - "type": "string", - "description": "混合音色", - "editor_mode": True, - "hint": "混合音色及其权重, 最多支持四种音色, 权重为整数, 取值[1, 100]. 可在官网API语音调试台预览代码获得预设以及编写模板, 需要严格按照json字符串格式编写, 可以查看控制台判断是否解析成功. 具体结构可参照默认值以及官网代码预览.", - }, - "minimax-voice-id": { - "type": "string", - "description": "单一音色", - "hint": "单一音色编号, 详见官网文档", - }, - "minimax-voice-emotion": { - "type": "string", - "description": "情绪", - "hint": "控制合成语音的情绪。当为 auto 时,将根据文本内容自动选择情绪。", - "options": [ - "auto", - "happy", - "sad", - "angry", - "fearful", - "disgusted", - "surprised", - "calm", - "fluent", - "whisper", - ], - }, - "minimax-voice-latex": { - "type": "bool", - "description": "支持朗读latex公式", - "hint": "朗读latex公式, 但是需要确保输入文本按官网要求格式化", - }, - "minimax-voice-english-normalization": { - "type": "bool", - "description": "支持英语文本规范化", - "hint": "可提升数字阅读场景的性能,但会略微增加延迟", - }, - "rag_options": { - "description": "RAG 选项", - "type": "object", - "hint": "检索知识库设置, 非必填。仅 Agent 应用类型支持(智能体应用, 包括 RAG 应用)。阿里云百炼应用开启此功能后将无法多轮对话。", - "items": { - "pipeline_ids": { - "description": "知识库 ID 列表", - "type": "list", - "items": {"type": "string"}, - "hint": "对指定知识库内所有文档进行检索, 前往 https://bailian.console.aliyun.com/ 数据应用->知识索引创建和获取 ID。", - }, - "file_ids": { - "description": "非结构化文档 ID, 传入该参数将对指定非结构化文档进行检索。", - "type": "list", - "items": {"type": "string"}, - "hint": "对指定非结构化文档进行检索。前往 https://bailian.console.aliyun.com/ 数据管理创建和获取 ID。", - }, - "output_reference": { - "description": "是否输出知识库/文档的引用", - "type": "bool", - "hint": "在每次回答尾部加上引用源。默认为 False。", - }, - }, - }, - "sensevoice_hint": { - "description": "部署SenseVoice", - "type": "string", - "hint": "启用前请 pip 安装 funasr、funasr_onnx、torchaudio、torch、modelscope、jieba 库(默认使用CPU,大约下载 1 GB),并且安装 ffmpeg。否则将无法正常转文字。", - }, - "is_emotion": { - "description": "情绪识别", - "type": "bool", - "hint": "是否开启情绪识别。happy|sad|angry|neutral|fearful|disgusted|surprised|unknown", - }, - "stt_model": { - "description": "模型名称", - "type": "string", - "hint": "modelscope 上的模型名称。默认:iic/SenseVoiceSmall。", - }, - "variables": { - "description": "工作流固定输入变量", - "type": "object", - "items": {}, - "hint": "可选。工作流固定输入变量,将会作为工作流的输入。也可以在对话时使用 /set 指令动态设置变量。如果变量名冲突,优先使用动态设置的变量。", - "invisible": True, - }, - "dashscope_app_type": { - "description": "应用类型", - "type": "string", - "hint": "百炼应用的应用类型。", - "options": [ - "agent", - "agent-arrange", - "dialog-workflow", - "task-workflow", - ], - }, - "timeout": { - "description": "超时时间", - "type": "int", - "hint": "超时时间,单位为秒。", - }, - "total_timeout": { - "description": "总超时时间", - "type": "float", - "hint": "单次决策请求的总超时时间(秒),包含等待并发名额、重试与退避;默认 5 秒。", - "condition": {"type": "system_one_decision"}, - }, - "max_concurrency": { - "description": "最大并发数", - "type": "int", - "hint": "该提供商同时进行的决策请求上限;默认 4。", - "condition": {"type": "system_one_decision"}, - }, - "openai-tts-voice": { - "description": "voice", - "type": "string", - "hint": "OpenAI TTS 的声音。OpenAI 默认支持:'alloy', 'echo', 'fable', 'onyx', 'nova', 'shimmer'", - }, - "mimo-tts-voice": { - "description": "音色", - "type": "string", - "hint": "MiMo TTS 的音色名称。可选值包括 'mimo_default'、'default_en'、'default_zh'。", - }, - "mimo-tts-format": { - "description": "输出格式", - "type": "string", - "hint": "MiMo TTS 生成音频的格式。支持 'wav'、'mp3'、'pcm'。", - }, - "mimo-tts-style-prompt": { - "description": "风格提示词", - "type": "string", - "hint": "会以 标签形式添加到待合成文本开头,用于控制语速、情绪、角色或风格,例如 开心、变快、孙悟空、悄悄话。可留空。", - }, - "mimo-tts-dialect": { - "description": "方言", - "type": "string", - "hint": "会与风格提示词一起写入开头的 标签中,例如 东北话、四川话、河南话、粤语。可留空。", - }, - "mimo-tts-seed-text": { - "description": "种子文本", - "type": "string", - "hint": "作为可选的 user 消息发送,用于辅助调节语气和风格,不会拼接到待合成文本中。", - }, - "fishaudio-tts-character": { - "description": "character", - "type": "string", - "hint": "fishaudio TTS 的角色。默认为可莉。更多角色请访问:https://fish.audio/zh-CN/discovery", - }, - "fishaudio-tts-reference-id": { - "description": "reference_id", - "type": "string", - "hint": "fishaudio TTS 的参考模型ID(可选)。如果填入此字段,将直接使用模型ID而不通过角色名称查询。例如:626bb6d3f3364c9cbc3aa6a67300a664。更多模型请访问:https://fish.audio/zh-CN/discovery,进入模型详情界面后可复制模型ID", - }, - "whisper_hint": { - "description": "本地部署 Whisper 模型须知", - "type": "string", - "hint": "启用前请 pip 安装 openai-whisper 库(N卡用户大约下载 2GB,主要是 torch 和 cuda,CPU 用户大约下载 1 GB),并且安装 ffmpeg。否则将无法正常转文字。", - }, - "whisper_device": { - "description": "推理设备", - "type": "string", - "hint": "Whisper 推理设备。Apple Silicon 可选 mps;其他环境建议使用 cpu。若指定 mps 但当前环境不可用,将自动回退到 cpu。", - "options": ["cpu", "mps"], - }, - "id": { - "description": "ID", - "type": "string", - }, - "type": { - "description": "模型提供商种类", - "type": "string", - "invisible": True, - }, - "provider_type": { - "description": "模型提供商能力种类", - "type": "string", - "invisible": True, - }, - "enable": { - "description": "启用", - "type": "bool", - }, - "key": { - "description": "API Key", - "type": "list", - "items": {"type": "string"}, - "secret": True, - }, - "api_base": { - "description": "API Base URL", - "type": "string", - }, - "proxy": { - "description": "provider_group.provider.proxy.description", - "type": "string", - "hint": "provider_group.provider.proxy.hint", - }, - "model": { - "description": "模型 ID", - "type": "string", - "hint": "模型名称,如 gpt-4o-mini, deepseek-chat。", - }, - "max_context_tokens": { - "description": "模型上下文窗口大小", - "type": "int", - "hint": "模型最大上下文 Token 大小。如果为 0,则会自动从模型元数据填充(如有)", - }, - "dify_api_key": { - "description": "API Key", - "type": "string", - "hint": "Dify API Key。此项必填。", - "secret": True, - }, - "dify_api_base": { - "description": "API Base URL", - "type": "string", - "hint": "Dify API Base URL。默认为 https://api.dify.ai/v1", - }, - "dify_api_type": { - "description": "Dify 应用类型", - "type": "string", - "hint": "Dify API 类型。根据 Dify 官网,目前支持 chat, chatflow, agent, workflow 三种应用类型。", - "options": ["chat", "chatflow", "agent", "workflow"], - }, - "dify_workflow_output_key": { - "description": "Dify Workflow 输出变量名", - "type": "string", - "hint": "Dify Workflow 输出变量名。当应用类型为 workflow 时才使用。默认为 astrbot_wf_output。", - }, - "dify_query_input_key": { - "description": "Prompt 输入变量名", - "type": "string", - "hint": "发送的消息文本内容对应的输入变量名。默认为 astrbot_text_query。", - "obvious": True, - }, - "coze_api_key": { - "description": "Coze API Key", - "type": "string", - "hint": "Coze API 密钥,用于访问 Coze 服务。", - "secret": True, - }, - "bot_id": { - "description": "Bot ID", - "type": "string", - "hint": "Coze 机器人的 ID,在 Coze 平台上创建机器人后获得。", - }, - "coze_api_base": { - "description": "API Base URL", - "type": "string", - "hint": "Coze API 的基础 URL 地址,默认为 https://api.coze.cn", - }, - "deerflow_api_base": { - "description": "API Base URL", - "type": "string", - "hint": "DeerFlow API 网关地址,默认为 http://127.0.0.1:2026", - }, - "deerflow_api_key": { - "description": "DeerFlow API Key", - "type": "string", - "hint": "可选。若 DeerFlow 网关配置了 Bearer 鉴权,则在此填写。", - "secret": True, - }, - "deerflow_auth_header": { - "description": "Authorization Header", - "type": "string", - "hint": "可选。自定义 Authorization 请求头,优先级高于 DeerFlow API Key。", - "secret": True, - }, - "deerflow_assistant_id": { - "description": "Assistant ID", - "type": "string", - "hint": "DeerFlow 2.0 LangGraph assistant_id,默认为 lead_agent。", - }, - "deerflow_model_name": { - "description": "模型名称覆盖", - "type": "string", - "hint": "可选。覆盖 DeerFlow 默认模型(对应运行时 configurable 的 model_name)。", - }, - "deerflow_thinking_enabled": { - "description": "启用思考模式", - "type": "bool", - }, - "deerflow_plan_mode": { - "description": "启用计划模式", - "type": "bool", - "hint": "对应 DeerFlow 2.0 运行时 configurable 的 is_plan_mode。", - }, - "deerflow_subagent_enabled": { - "description": "启用子智能体", - "type": "bool", - "hint": "对应 DeerFlow 2.0 运行时 configurable 的 subagent_enabled。", - }, - "deerflow_max_concurrent_subagents": { - "description": "子智能体最大并发数", - "type": "int", - "hint": "对应 DeerFlow 2.0 运行时 configurable 的 max_concurrent_subagents。仅在启用子智能体时生效,默认 3。", - }, - "deerflow_recursion_limit": { - "description": "递归深度上限", - "type": "int", - "hint": "对应 LangGraph recursion_limit。", - }, - "auto_save_history": { - "description": "由 Coze 管理对话记录", - "type": "bool", - "hint": "启用后,将由 Coze 进行对话历史记录管理, 此时 AstrBot 本地保存的上下文不会生效(仅供浏览), 对 AstrBot 的上下文进行的操作也不会生效。如果为禁用, 则使用 AstrBot 管理上下文。", - }, - }, - }, - "provider_settings": { - "type": "object", - "items": { - "enable": { - "type": "bool", - }, - "wake_prefix": { - "type": "string", - }, - "web_search": { - "type": "bool", - }, - "web_search_link": { - "type": "bool", - }, - "display_reasoning_text": { - "type": "bool", - }, - "identifier": { - "type": "bool", - }, - "group_name_display": { - "type": "bool", - }, - "datetime_system_prompt": { - "type": "bool", - }, - "prompt_prefix": { - "type": "string", - }, - "streaming_response": { - "type": "bool", - }, - "show_tool_use_status": { - "type": "bool", - }, - "show_tool_call_result": { - "type": "bool", - }, - "buffer_intermediate_messages": { - "type": "bool", - }, - "unsupported_streaming_strategy": { - "type": "string", - }, - "file_extract": { - "type": "object", - "items": { - "enable": { - "type": "bool", - }, - "provider": { - "type": "string", - }, - "moonshotai_api_key": { - "type": "string", - "secret": True, - }, - }, - }, - "proactive_capability": { - "type": "object", - "items": { - "add_cron_tools": { - "type": "bool", - }, - }, - }, - }, - }, - "agent_runner": { - "type": "object", - "items": { - "runner_type": {"type": "string"}, - "config": {"type": "dict"}, - }, - }, - "provider_stt_settings": { - "type": "object", - "items": { - "enable": { - "type": "bool", - }, - "provider_id": { - "type": "string", - }, - }, - }, - "provider_tts_settings": { - "type": "object", - "items": { - "enable": { - "type": "bool", - }, - "provider_id": { - "type": "string", - }, - "dual_output": { - "type": "bool", - }, - "use_file_service": { - "type": "bool", - }, - "trigger_probability": { - "type": "float", - }, - }, - }, - "provider_ltm_settings": { - "type": "object", - "items": { - "group_icl_enable": { - "type": "bool", - }, - "group_message_max_cnt": { - "type": "int", - }, - "image_caption": { - "type": "bool", - }, - "image_caption_provider_id": { - "type": "string", - }, - "image_caption_prompt": { - "type": "string", - }, - "group_message_history_enable": { - "type": "bool", - }, - "group_message_history_max_cnt": { - "type": "int", - }, - "active_reply": { - "type": "object", - "items": { - "enable": { - "type": "bool", - }, - "whitelist": { - "type": "list", - "items": {"type": "string"}, - }, - "method": { - "type": "string", - "options": ["possibility_reply"], - }, - "possibility_reply": { - "type": "float", - }, - }, - }, - }, - }, - }, - }, - "misc_config_group": { - "metadata": { - "wake_prefix": { - "type": "list", - "items": {"type": "string"}, - }, - "t2i": { - "type": "bool", - }, - "t2i_word_threshold": { - "type": "int", - }, - "admins_id": { - "type": "list", - "_special": "sender_id", - "items": {"type": "string"}, - }, - "http_proxy": { - "type": "string", - }, - "no_proxy": { - "description": "直连地址列表", - "type": "list", - "items": {"type": "string"}, - "hint": "在此处添加不希望通过代理访问的地址,例如内部服务地址。回车添加,可添加多个,如未设置代理请忽略此配置", - }, - "timezone": { - "type": "string", - }, - "callback_api_base": { - "type": "string", - }, - "disable_metrics": { - "description": "禁用匿名使用统计", - "type": "bool", - "hint": "禁用后,AstrBot 将不再上传匿名使用统计数据。", - }, - "log_level": { - "type": "string", - "options": ["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"], - }, - "dashboard.ssl.enable": {"type": "bool"}, - "dashboard.trust_proxy_headers": {"type": "bool"}, - "dashboard.auth_rate_limit.enable": {"type": "bool"}, - "dashboard.auth_rate_limit.average_interval": {"type": "float"}, - "dashboard.auth_rate_limit.max_burst": {"type": "int"}, - "dashboard.ssl.cert_file": { - "type": "string", - "condition": {"dashboard.ssl.enable": True}, - }, - "dashboard.ssl.key_file": { - "type": "string", - "condition": {"dashboard.ssl.enable": True}, - }, - "dashboard.ssl.ca_certs": { - "type": "string", - "condition": {"dashboard.ssl.enable": True}, - }, - "log_file_enable": {"type": "bool"}, - "log_file_path": {"type": "string", "condition": {"log_file_enable": True}}, - "log_file_max_mb": {"type": "int", "condition": {"log_file_enable": True}}, - "temp_dir_max_size": {"type": "int"}, - "trace_enable": {"type": "bool"}, - "trace_db_path": {"type": "string"}, - "trace_db_max_mb": {"type": "int"}, - "trace_retention_days": {"type": "int"}, - "t2i_strategy": { - "type": "string", - "options": ["remote", "local"], - }, - "t2i_endpoint": { - "type": "string", - }, - "t2i_use_file_service": { - "type": "bool", - }, - "pip_install_arg": { - "type": "string", - }, - "pypi_index_url": { - "type": "string", - }, - "default_kb_collection": { - "type": "string", - }, - "kb_names": {"type": "list", "items": {"type": "string"}}, - "kb_fusion_top_k": {"type": "int", "default": 20}, - "kb_final_top_k": {"type": "int", "default": 5}, - "kb_agentic_mode": {"type": "bool"}, - }, - }, -} - - -""" -Since v4.7.0, fields such as name, description, and hint support i18n. -Their resources are stored in: - -- dashboard/src/i18n/locales//features/config-metadata.json - -When adding configuration fields here, update this file for every supported -Dashboard locale. -""" -CONFIG_METADATA_3 = { - "ai_group": { - "name": "AI", - "metadata": { - "agent_runner": { - "description": "Agent 执行方式", - "hint": "选择 AI 对话的执行器。切换执行器会使用新类型的默认配置,不保留上一类型的参数。", - "type": "object", - "items": { - "provider_settings.enable": { - "description": "启用", - "type": "bool", - "hint": "AI 对话总开关", - }, - "agent_runner.runner_type": { - "description": "执行器", - "type": "string", - "options": ["local", "dify", "coze", "dashscope", "deerflow"], - "labels": [ - "内置 Agent", - "Dify", - "Coze", - "阿里云百炼应用", - "DeerFlow", - ], - "_special": "agent_runner_type", - "runner_defaults": { - runner_type: get_agent_runner_config_default(runner_type) - for runner_type in ( - "local", - "dify", - "coze", - "dashscope", - "deerflow", - ) - }, - "condition": { - "provider_settings.enable": True, - }, - }, - }, - }, - "dify_runner": { - "description": "Dify 配置", - "type": "object", - "condition": { - "provider_settings.enable": True, - "agent_runner.runner_type": "dify", - }, - "items": { - "agent_runner.config.dify_api_type": { - "description": "应用类型", - "type": "string", - "options": ["chat", "chatflow", "agent", "workflow"], - }, - "agent_runner.config.dify_api_key": { - "description": "API Key", - "type": "string", - "secret": True, - }, - "agent_runner.config.dify_api_base": { - "description": "API Base URL", - "type": "string", - }, - "agent_runner.config.dify_workflow_output_key": { - "description": "Workflow 输出变量名", - "type": "string", - }, - "agent_runner.config.dify_query_input_key": { - "description": "Prompt 输入变量名", - "type": "string", - }, - "agent_runner.config.variables": { - "description": "变量", - "type": "dict", - }, - "agent_runner.config.timeout": { - "description": "超时时间(秒)", - "type": "int", - }, - "agent_runner.config.proxy": { - "description": "代理地址", - "type": "string", - }, - }, - }, - "coze_runner": { - "description": "Coze 配置", - "type": "object", - "condition": { - "provider_settings.enable": True, - "agent_runner.runner_type": "coze", - }, - "items": { - "agent_runner.config.coze_api_key": { - "description": "API Key", - "type": "string", - "secret": True, - }, - "agent_runner.config.bot_id": { - "description": "Bot ID", - "type": "string", - }, - "agent_runner.config.coze_api_base": { - "description": "API Base URL", - "type": "string", - }, - "agent_runner.config.auto_save_history": { - "description": "由 Coze 管理对话记录", - "type": "bool", - }, - "agent_runner.config.timeout": { - "description": "超时时间(秒)", - "type": "int", - }, - "agent_runner.config.proxy": { - "description": "代理地址", - "type": "string", - }, - }, - }, - "dashscope_runner": { - "description": "阿里云百炼应用配置", - "type": "object", - "condition": { - "provider_settings.enable": True, - "agent_runner.runner_type": "dashscope", - }, - "items": { - "agent_runner.config.dashscope_app_type": { - "description": "应用类型", - "type": "string", - "options": ["agent", "workflow"], - }, - "agent_runner.config.dashscope_api_key": { - "description": "API Key", - "type": "string", - "secret": True, - }, - "agent_runner.config.dashscope_app_id": { - "description": "应用 ID", - "type": "string", - }, - "agent_runner.config.rag_options.pipeline_ids": { - "description": "知识库 Pipeline ID", - "type": "list", - "items": {"type": "string"}, - }, - "agent_runner.config.rag_options.file_ids": { - "description": "文件 ID", - "type": "list", - "items": {"type": "string"}, - }, - "agent_runner.config.rag_options.output_reference": { - "description": "输出引用", - "type": "bool", - }, - "agent_runner.config.variables": { - "description": "变量", - "type": "dict", - }, - "agent_runner.config.timeout": { - "description": "超时时间(秒)", - "type": "int", - }, - "agent_runner.config.proxy": { - "description": "代理地址", - "type": "string", - }, - }, - }, - "deerflow_runner": { - "description": "DeerFlow 配置", - "type": "object", - "condition": { - "provider_settings.enable": True, - "agent_runner.runner_type": "deerflow", - }, - "items": { - "agent_runner.config.deerflow_api_base": { - "description": "API Base URL", - "type": "string", - }, - "agent_runner.config.deerflow_api_key": { - "description": "API Key", - "type": "string", - "secret": True, - }, - "agent_runner.config.deerflow_auth_header": { - "description": "Authorization Header", - "type": "string", - "secret": True, - }, - "agent_runner.config.deerflow_assistant_id": { - "description": "Assistant ID", - "type": "string", - }, - "agent_runner.config.deerflow_model_name": { - "description": "模型名称覆盖", - "type": "string", - }, - "agent_runner.config.deerflow_thinking_enabled": { - "description": "启用思考模式", - "type": "bool", - }, - "agent_runner.config.deerflow_plan_mode": { - "description": "启用计划模式", - "type": "bool", - }, - "agent_runner.config.deerflow_subagent_enabled": { - "description": "启用子智能体", - "type": "bool", - }, - "agent_runner.config.deerflow_max_concurrent_subagents": { - "description": "子智能体最大并发数", - "type": "int", - }, - "agent_runner.config.deerflow_recursion_limit": { - "description": "递归深度上限", - "type": "int", - }, - "agent_runner.config.timeout": { - "description": "超时时间(秒)", - "type": "int", - }, - "agent_runner.config.proxy": { - "description": "代理地址", - "type": "string", - }, - }, - }, - "ai": { - "description": "模型", - "hint": "配置内置 Agent 使用的对话模型,以及通用的图片转述、语音模型。", - "type": "object", - "items": { - "agent_runner.config.model.provider_id": { - "description": "对话模型", - "type": "string", - "_special": "select_provider", - "hint": "留空时使用第一个模型", - "condition": { - "agent_runner.runner_type": "local", - }, - }, - "agent_runner.config.model.fallback_provider_ids": { - "description": "回退对话模型", - "type": "list", - "items": {"type": "string"}, - "_special": "select_providers", - "hint": "主聊天模型请求失败时,按顺序切换到这些模型。", - "condition": { - "agent_runner.runner_type": "local", - }, - }, - "agent_runner.config.model.request_max_retries": { - "description": "异常重试次数", - "type": "int", - "hint": "单次模型请求遇到可重试错误时的最大尝试次数。", - "condition": { - "agent_runner.runner_type": "local", - }, - }, - "provider_settings.default_image_caption_provider_id": { - "description": "图片转述模型", - "type": "string", - "_special": "select_provider", - "hint": "当对话模型不支持图片输入时,调用图片转述模型来获得图片描述。留空代表不使用。", - }, - "provider_stt_settings.enable": { - "description": "语音识别", - "type": "bool", - "hint": "使用语音转文字模型将用户语音转述为文本,方便模型理解。", - }, - "provider_stt_settings.provider_id": { - "description": "默认语音转文本模型", - "type": "string", - "hint": "也可使用 /provider 指令单独选择会话的模型。", - "_special": "select_provider_stt", - "condition": { - "provider_stt_settings.enable": True, - }, - }, - "provider_tts_settings.enable": { - "description": "语音回复", - "type": "bool", - "hint": "使用文字转语音模型将文字转为语音回复。", - }, - "provider_tts_settings.provider_id": { - "description": "默认文本转语音模型", - "hint": "也可使用 /provider 指令单独选择会话的模型。", - "type": "string", - "_special": "select_provider_tts", - "condition": { - "provider_tts_settings.enable": True, - }, - }, - "provider_tts_settings.trigger_probability": { - "description": "TTS 触发概率", - "hint": "采用随机概率触发语音回复。", - "type": "float", - "slider": {"min": 0, "max": 1, "step": 0.05}, - "condition": { - "provider_tts_settings.enable": True, - }, - }, - "provider_settings.image_caption_prompt": { - "description": "图片转述提示词", - "hint": "用于图片转述模型的提示词。", - "type": "text", - "collapsed": True, - }, - }, - "condition": { - "provider_settings.enable": True, - }, - }, - "persona": { - "description": "人格", - "hint": "", - "type": "object", - "items": { - "agent_runner.config.persona.persona_id": { - "description": "默认采用的人格", - "type": "string", - "_special": "select_persona", - }, - "agent_runner.config.persona.safety_mode": { - "description": "健康模式", - "type": "bool", - "hint": "引导模型输出健康、安全的内容,避免有害或敏感话题。", - }, - "agent_runner.config.persona.safety_mode_strategy": { - "description": "健康模式策略", - "type": "string", - "invisible": True, - "options": ["system_prompt"], - "hint": "选择健康模式的实现策略。", - "condition": { - "agent_runner.config.persona.safety_mode": True, - }, - }, - }, - "condition": { - "agent_runner.runner_type": "local", - "provider_settings.enable": True, - }, - }, - "knowledgebase": { - "description": "知识库", - "hint": "", - "type": "object", - "items": { - "kb_names": { - "description": "知识库列表", - "type": "list", - "items": {"type": "string"}, - "_special": "select_knowledgebase", - "hint": "支持多选", - }, - "kb_fusion_top_k": { - "description": "融合检索结果数", - "type": "int", - "hint": "多个知识库检索结果融合后的返回结果数量", - }, - "kb_final_top_k": { - "description": "最终返回结果数", - "type": "int", - "hint": "从知识库中检索到的结果数量,越大可能获得越多相关信息,但也可能引入噪音。建议根据实际需求调整", - }, - "kb_agentic_mode": { - "description": "Agentic 知识库检索", - "type": "bool", - "hint": "启用后,知识库检索将作为 LLM Tool,由模型自主决定何时调用知识库进行查询。需要模型支持函数调用能力。", - }, - }, - "condition": { - "agent_runner.runner_type": "local", - "provider_settings.enable": True, - }, - }, - "websearch": { - "description": "网页搜索", - "hint": "", - "type": "object", - "items": { - "provider_settings.web_search": { - "description": "启用网页搜索", - "type": "bool", - }, - "provider_settings.websearch_provider": { - "description": "网页搜索提供商", - "type": "string", - "options": [ - "serpapi", - "deepseek", - "tavily", - "baidu_ai_search", - "bocha", - "brave", - "firecrawl", - "exa", - "anysearch", - ], - "labels": [ - "SerpApi", - "DeepSeek Search API", - "Tavily", - "Baidu AI Search", - "Bocha", - "Brave", - "Firecrawl", - "Exa", - "AnySearch", - ], - "subtitles": [ - "Google 网页、新闻、图片、学术和财经搜索", - "DeepSeek 官方搜索接口", - "", - "", - "", - "", - "", - "", - "", - ], - "condition": { - "provider_settings.web_search": True, - }, - }, - "provider_settings.websearch_tavily_key": { - "description": "Tavily API Key", - "type": "list", - "items": {"type": "string"}, - "hint": "可添加多个 Key 进行轮询。", - "secret": True, - "condition": { - "provider_settings.websearch_provider": "tavily", - "provider_settings.web_search": True, - }, - }, - "provider_settings.websearch_bocha_key": { - "description": "BoCha API Key", - "type": "list", - "items": {"type": "string"}, - "hint": "可添加多个 Key 进行轮询。", - "secret": True, - "condition": { - "provider_settings.websearch_provider": "bocha", - "provider_settings.web_search": True, - }, - }, - "provider_settings.websearch_brave_key": { - "description": "Brave Search API Key", - "type": "list", - "items": {"type": "string"}, - "hint": "可添加多个 Key 进行轮询。", - "secret": True, - "condition": { - "provider_settings.websearch_provider": "brave", - "provider_settings.web_search": True, - }, - }, - "provider_settings.websearch_firecrawl_key": { - "description": "Firecrawl API Key", - "type": "list", - "items": {"type": "string"}, - "hint": "可添加多个 Key 进行轮询。", - "secret": True, - "condition": { - "provider_settings.websearch_provider": "firecrawl", - "provider_settings.web_search": True, - }, - }, - "provider_settings.websearch_baidu_app_builder_key": { - "description": "百度千帆智能云 APP Builder API Key", - "type": "string", - "hint": "参考:https://console.bce.baidu.com/iam/#/iam/apikey/list", - "secret": True, - "condition": { - "provider_settings.websearch_provider": "baidu_ai_search", - "provider_settings.web_search": True, - }, - }, - "provider_settings.websearch_exa_key": { - "description": "Exa API Key", - "type": "list", - "items": {"type": "string"}, - "hint": "可添加多个 Key 进行轮询。Get a key at https://dashboard.exa.ai", - "secret": True, - "condition": { - "provider_settings.websearch_provider": "exa", - "provider_settings.web_search": True, - }, - }, - "provider_settings.websearch_anysearch_key": { - "description": "AnySearch API Key", - "type": "list", - "items": {"type": "string"}, - "hint": "可添加多个 Key 进行轮询。留空则使用匿名模式(每日免费额度)。申请地址:https://anysearch.com/console/api-keys", - "condition": { - "provider_settings.websearch_provider": "anysearch", - "provider_settings.web_search": True, - }, - }, - "provider_settings.websearch_deepseek_key": { - "description": "DeepSeek API Key", - "type": "list", - "items": {"type": "string"}, - "hint": "Configure a DeepSeek API key for search and page extraction. Multiple keys rotate. Get a key: [https://platform.deepseek.com/api_keys](https://platform.deepseek.com/api_keys)", - "secret": True, - "condition": { - "provider_settings.websearch_provider": "deepseek", - "provider_settings.web_search": True, - }, - }, - "provider_settings.websearch_serpapi_key": { - "description": "SerpApi API Key", - "type": "list", - "items": {"type": "string"}, - "hint": "支持 Google 网页、新闻、图片、学术和财经搜索。可添加多个 Key 轮询。获取 Key:[https://serpapi.com/manage-api-key](https://serpapi.com/manage-api-key)", - "secret": True, - "condition": { - "provider_settings.websearch_provider": "serpapi", - "provider_settings.web_search": True, - }, - }, - "provider_settings.web_search_link": { - "description": "显示来源引用", - "type": "bool", - "condition": { - "provider_settings.web_search": True, - }, - }, - }, - "condition": { - "agent_runner.runner_type": "local", - "provider_settings.enable": True, - }, - }, - "agent_computer_use": { - "description": "Agent Computer Use", - "hint": "", - "type": "object", - "items": { - "provider_settings.computer_use_runtime": { - "description": "Computer Use Runtime", - "type": "string", - "options": ["none", "local", "sandbox"], - "labels": [ - "不允许任何环境", - "本机环境", - "第三方沙箱环境", - ], - "hint": "选择 Computer Use 运行环境。", - }, - "provider_settings.computer_use_local_permissions": { - "description": "本地权限策略", - "type": "object", - "_special": "local_permission_matrix", - "full_width": True, - "items": { - "member": { - "type": "object", - "items": { - "allow_execution": {"type": "bool"}, - "allow_network": {"type": "bool"}, - "filesystem_scope": { - "type": "string", - "options": ["none", "workspace", "host"], - }, - }, - }, - "admin": { - "type": "object", - "items": { - "allow_execution": {"type": "bool"}, - "allow_network": {"type": "bool"}, - "filesystem_scope": { - "type": "string", - "options": ["none", "workspace", "host"], - }, - }, - }, - }, - "condition": { - "provider_settings.computer_use_runtime": "local", - }, - }, - "provider_settings.computer_use_require_admin": { - "description": "沙箱能力需要 AstrBot 管理员权限", - "type": "bool", - "hint": "开启后,需要 AstrBot 管理员权限才能调用远程沙箱能力。在配置文件 -> 访问控制 -> 管理员 -> 管理员 ID 中可添加管理员。给机器人发送 /sid 指令以获取 ID。", - "condition": { - "provider_settings.computer_use_runtime": "sandbox", - }, - }, - "provider_settings.sandbox.booter": { - "description": "沙箱环境驱动器", - "type": "string", - "options": ["shipyard_neo", "shipyard", "cua"], - "labels": ["Shipyard Neo", "Shipyard", "CUA"], - "condition": { - "provider_settings.computer_use_runtime": "sandbox", - }, - }, - "provider_settings.sandbox.shipyard_neo_endpoint": { - "description": "Shipyard Neo API Endpoint", - "type": "string", - "hint": "Shipyard Neo(Bay) 服务的 API 地址,默认 http://127.0.0.1:8114。", - "condition": { - "provider_settings.computer_use_runtime": "sandbox", - "provider_settings.sandbox.booter": "shipyard_neo", - }, - }, - "provider_settings.sandbox.shipyard_neo_access_token": { - "description": "Shipyard Neo Access Token", - "type": "string", - "hint": "Bay 的 API Key(sk-bay-...)。留空时自动从 credentials.json 发现。", - "secret": True, - "condition": { - "provider_settings.computer_use_runtime": "sandbox", - "provider_settings.sandbox.booter": "shipyard_neo", - }, - }, - "provider_settings.sandbox.shipyard_neo_profile": { - "description": "Shipyard Neo Profile", - "type": "string", - "hint": "Shipyard Neo 沙箱 profile,如 python-default。留空时自动选择能力更完整的 profile。", - "condition": { - "provider_settings.computer_use_runtime": "sandbox", - "provider_settings.sandbox.booter": "shipyard_neo", - }, - }, - "provider_settings.sandbox.shipyard_neo_ttl": { - "description": "Shipyard Neo Sandbox TTL", - "type": "int", - "hint": "Shipyard Neo 沙箱生存时间(秒)。", - "condition": { - "provider_settings.computer_use_runtime": "sandbox", - "provider_settings.sandbox.booter": "shipyard_neo", - }, - }, - "provider_settings.sandbox.cua_image": { - "description": "CUA Image", - "type": "string", - "hint": "CUA 沙箱镜像/系统类型,默认 linux。可填写 linux、macos、windows、android,具体取决于 CUA SDK 支持。", - "condition": { - "provider_settings.computer_use_runtime": "sandbox", - "provider_settings.sandbox.booter": "cua", - }, - }, - "provider_settings.sandbox.cua_os_type": { - "description": "CUA OS Type", - "type": "string", - "options": ["linux", "macos", "windows", "android"], - "labels": ["Linux", "macOS", "Windows", "Android"], - "hint": "CUA 沙箱操作系统类型,默认 linux。", - "condition": { - "provider_settings.computer_use_runtime": "sandbox", - "provider_settings.sandbox.booter": "cua", - }, - }, - "provider_settings.sandbox.cua_idle_timeout": { - "description": "CUA Idle Timeout", - "type": "int", - "hint": "Idle timeout for CUA sandbox sessions in seconds. When greater than 0, AstrBot proactively shuts down an idle CUA sandbox after that amount of inactivity; 0 disables it.", - "condition": { - "provider_settings.computer_use_runtime": "sandbox", - "provider_settings.sandbox.booter": "cua", - }, - }, - "provider_settings.sandbox.cua_telemetry_enabled": { - "description": "CUA Telemetry", - "type": "bool", - "hint": "是否允许 CUA SDK 发送遥测数据。默认关闭。", - "condition": { - "provider_settings.computer_use_runtime": "sandbox", - "provider_settings.sandbox.booter": "cua", - }, - }, - "provider_settings.sandbox.cua_local": { - "description": "CUA Local Sandbox", - "type": "bool", - "hint": "是否优先使用 CUA 本地沙箱。默认开启,避免云端沙箱要求 CUA_API_KEY。关闭后可使用 CUA 云端沙箱。", - "condition": { - "provider_settings.computer_use_runtime": "sandbox", - "provider_settings.sandbox.booter": "cua", - }, - }, - "provider_settings.sandbox.cua_api_key": { - "description": "CUA API Key", - "type": "string", - "hint": "CUA 云端沙箱 API Key。仅在关闭本地沙箱时需要。也可以通过 CUA_API_KEY 环境变量提供。", - "obvious_hint": True, - "secret": True, - "condition": { - "provider_settings.computer_use_runtime": "sandbox", - "provider_settings.sandbox.booter": "cua", - "provider_settings.sandbox.cua_local": False, - }, - }, - "provider_settings.sandbox.shipyard_endpoint": { - "description": "Shipyard API Endpoint", - "type": "string", - "hint": "Shipyard 服务的 API 访问地址。", - "condition": { - "provider_settings.computer_use_runtime": "sandbox", - "provider_settings.sandbox.booter": "shipyard", - }, - "_special": "check_shipyard_connection", - }, - "provider_settings.sandbox.shipyard_access_token": { - "description": "Shipyard Access Token", - "type": "string", - "hint": "用于访问 Shipyard 服务的访问令牌。", - "secret": True, - "condition": { - "provider_settings.computer_use_runtime": "sandbox", - "provider_settings.sandbox.booter": "shipyard", - }, - }, - "provider_settings.sandbox.shipyard_ttl": { - "description": "Shipyard Session TTL", - "type": "int", - "hint": "Shipyard 会话的生存时间(秒)。", - "condition": { - "provider_settings.computer_use_runtime": "sandbox", - "provider_settings.sandbox.booter": "shipyard", - }, - }, - "provider_settings.sandbox.shipyard_max_sessions": { - "description": "Shipyard Max Sessions", - "type": "int", - "hint": "Shipyard 最大会话数量。", - "condition": { - "provider_settings.computer_use_runtime": "sandbox", - "provider_settings.sandbox.booter": "shipyard", - }, - }, - }, - "condition": { - "agent_runner.runner_type": "local", - "provider_settings.enable": True, - }, - }, - # "file_extract": { - # "description": "文档解析能力 [beta]", - # "type": "object", - # "items": { - # "provider_settings.file_extract.enable": { - # "description": "启用文档解析能力", - # "type": "bool", - # }, - # "provider_settings.file_extract.provider": { - # "description": "文档解析提供商", - # "type": "string", - # "options": ["moonshotai"], - # "condition": { - # "provider_settings.file_extract.enable": True, - # }, - # }, - # "provider_settings.file_extract.moonshotai_api_key": { - # "description": "Moonshot AI API Key", - # "type": "string", - # "condition": { - # "provider_settings.file_extract.provider": "moonshotai", - # "provider_settings.file_extract.enable": True, - # }, - # }, - # }, - # "condition": { - # "agent_runner.runner_type": "local", - # "provider_settings.enable": True, - # }, - # }, - "proactive_capability": { - "description": "主动型 Agent", - "hint": "https://docs.astrbot.app/use/proactive-agent.html", - "type": "object", - "items": { - "provider_settings.proactive_capability.add_cron_tools": { - "description": "启用", - "type": "bool", - "hint": "启用后,将会传递给 Agent 相关工具来实现主动型 Agent。你可以告诉 AstrBot 未来某个时间要做的事情,它将被定时触发然后执行任务。", - }, - }, - "condition": { - "agent_runner.runner_type": "local", - "provider_settings.enable": True, - }, - }, - "truncate_and_compress": { - "hint": "", - "description": "上下文管理策略", - "type": "object", - "items": { - "agent_runner.config.compression.max_turns": { - "description": "压缩前最多保留对话轮数", - "type": "int", - "collapsed": True, - "hint": "普通会话历史超过该轮数后,才会按下方策略进行持久化截断或 LLM 压缩;请求发送前也会先按该值约束上下文。-1 表示不按轮数限制。", - "condition": { - "agent_runner.runner_type": "local", - }, - }, - "agent_runner.config.compression.trim_turns": { - "description": "轮次超限时一次丢弃轮数", - "type": "int", - "collapsed": True, - "hint": "当超过“压缩前最多保留对话轮数”且无法使用 LLM 压缩时,一次丢弃多少轮旧对话;请求期截断也会复用该值。", - "condition": { - "agent_runner.runner_type": "local", - }, - }, - "agent_runner.config.compression.overflow_strategy": { - "description": "压缩策略", - "type": "string", - "options": ["truncate_by_turns", "llm_compress"], - "labels": ["按对话轮数截断", "由 LLM 压缩上下文"], - "condition": { - "agent_runner.runner_type": "local", - }, - "hint": "模型上下文超限时的处理策略。", - }, - "agent_runner.config.compression.instruction": { - "description": "上下文压缩提示词", - "type": "text", - "collapsed": True, - "hint": "如果为空则使用默认提示词。", - "condition": { - "agent_runner.config.compression.overflow_strategy": "llm_compress", - "agent_runner.runner_type": "local", - }, - }, - "agent_runner.config.compression.keep_recent_ratio": { - "description": "压缩时保留最近上下文比例", - "type": "float", - "collapsed": True, - "slider": {"min": 0, "max": 0.3, "step": 0.01}, - "hint": "按当前上下文 token 数保留最近内容,范围 0-0.3。0.15 表示保留 15%;比例大于 0 时至少保留最后一轮。", - "condition": { - "agent_runner.config.compression.overflow_strategy": "llm_compress", - "agent_runner.runner_type": "local", - }, - }, - "agent_runner.config.compression.provider_id": { - "description": "压缩模型", - "type": "string", - "_special": "select_provider", - "hint": "用于上下文压缩的模型。默认选择当前的对话模型。", - "condition": { - "agent_runner.config.compression.overflow_strategy": "llm_compress", - "agent_runner.runner_type": "local", - }, - }, - "agent_runner.config.compression.fallback_max_tokens": { - "description": "上下文窗口兜底值", - "type": "int", - "collapsed": True, - "hint": "当 max_context_tokens 为 0 且模型不在内置元数据中时,使用此值作为上下文窗口大小。默认 128000。", - "condition": { - "agent_runner.runner_type": "local", - }, - }, - }, - "condition": { - "agent_runner.runner_type": "local", - "provider_settings.enable": True, - }, - }, - "others": { - "description": "其他配置", - "type": "object", - "items": { - "provider_settings.display_reasoning_text": { - "description": "显示思考内容", - "hint": "显示模型的思维链信息到最终回复中。", - "type": "bool", - "condition": { - "agent_runner.runner_type": "local", - }, - }, - "provider_settings.streaming_response": { - "description": "流式输出", - "hint": "在受支持的聊天平台中以打字机的形式输出响应。", - "type": "bool", - }, - "provider_settings.unsupported_streaming_strategy": { - "description": "不支持流式回复的平台", - "type": "string", - "options": ["realtime_segmenting", "turn_off"], - "hint": "选择在不支持流式回复的平台上的处理方式。实时分段回复会在系统接收流式响应检测到诸如标点符号等分段点时,立即发送当前已接收的内容", - "labels": ["实时分段回复", "关闭流式回复"], - "condition": { - "provider_settings.streaming_response": True, - }, - }, - "provider_settings.identifier": { - "description": "用户识别", - "type": "bool", - "hint": "在用户提示词前带上用户 ID 信息。", - }, - "provider_settings.group_name_display": { - "description": "显示群名称", - "type": "bool", - "hint": "在受支持的消息平台的群聊中的用户提示词前带上群名称信息。", - }, - "provider_settings.datetime_system_prompt": { - "description": "现实世界时间感知", - "type": "bool", - "hint": "在用户提示词中带上当前的时间信息。", - "condition": { - "agent_runner.runner_type": "local", - }, - }, - "provider_settings.show_tool_use_status": { - "description": "输出工具调用信息", - "hint": "有工具调用时,同时发送带有工具调用名字的消息。", - "type": "bool", - "condition": { - "agent_runner.runner_type": "local", - }, - }, - "provider_settings.show_tool_call_result": { - "description": "输出工具调用结果", - "type": "bool", - "hint": "仅在输出工具调用信息启用时生效,展示结果前 70 个字符。", - "condition": { - "agent_runner.runner_type": "local", - "provider_settings.show_tool_use_status": True, - }, - }, - "provider_settings.buffer_intermediate_messages": { - "description": "合并 Agent 中间消息", - "type": "bool", - "hint": "开启后,非流式模式下多步工具调用过程中产生的中间文本将缓冲,待 Agent 完成后合并为一条回复发送。", - "condition": { - "agent_runner.runner_type": "local", - "provider_settings.streaming_response": False, - }, - }, - "agent_runner.config.misc.sanitize_context_by_modalities": { - "description": "按模型能力清理历史上下文", - "type": "bool", - "hint": "开启后,在每次请求 LLM 前会按当前模型提供商中所选择的模型能力删除对话中不支持的图片/工具调用结构(会改变模型看到的历史)", - "condition": { - "agent_runner.runner_type": "local", - }, - }, - "agent_runner.config.misc.max_steps": { - "description": "工具调用轮数上限", - "type": "int", - "condition": { - "agent_runner.runner_type": "local", - }, - }, - "agent_runner.config.misc.tool_call_timeout": { - "description": "工具调用超时时间(秒)", - "type": "int", - "condition": { - "agent_runner.runner_type": "local", - }, - }, - "agent_runner.config.misc.tool_schema_mode": { - "description": "工具调用模式", - "type": "string", - "options": ["skills_like", "full"], - "labels": ["Skills-like(两阶段)", "Full(完整参数)"], - "hint": "skills-like 先下发工具名称与描述,再下发参数;full 一次性下发完整参数。", - "condition": { - "agent_runner.runner_type": "local", - }, - }, - "provider_settings.wake_prefix": { - "description": "额外唤醒前缀", - "type": "string", - "hint": "如果唤醒前缀为 /, 额外聊天唤醒前缀为 chat,则需要 /chat 才会触发 LLM 请求", - }, - "provider_settings.image_compress_options.max_size": { - "description": "输入图片最大边长", - "type": "int", - "hint": "发送给模型的图片最长边(像素),系统会在必要时进一步压缩。", - "slider": {"min": 256, "max": 4096, "step": 64}, - }, - "provider_settings.prompt_prefix": { - "description": "用户提示词", - "type": "string", - "hint": "可使用 {{prompt}} 作为用户输入的占位符。如果不输入占位符则代表添加在用户输入的前面。", - "collapsed": True, - }, - "provider_tts_settings.dual_output": { - "description": "开启 TTS 时同时输出语音和文字内容", - "type": "bool", - "collapsed": True, - }, - "provider_settings.reachability_check": { - "description": "提供商可达性检测", - "type": "bool", - "hint": "/provider 命令列出模型时是否并发检测连通性。开启后会主动调用模型测试连通性,可能产生额外 token 消耗。", - "collapsed": True, - }, - "provider_settings.max_quoted_fallback_images": { - "description": "引用图片回退解析上限", - "type": "int", - "hint": "引用/转发消息回退解析图片时的最大注入数量,超出会截断。", - "condition": { - "agent_runner.runner_type": "local", - }, - "collapsed": True, - }, - "provider_settings.quoted_message_parser.max_component_chain_depth": { - "description": "引用解析组件链深度", - "type": "int", - "hint": "解析 Reply 组件链时允许的最大递归深度。", - "condition": { - "agent_runner.runner_type": "local", - }, - "collapsed": True, - }, - "provider_settings.quoted_message_parser.max_forward_node_depth": { - "description": "引用解析转发节点深度", - "type": "int", - "hint": "解析合并转发节点时允许的最大递归深度。", - "condition": { - "agent_runner.runner_type": "local", - }, - "collapsed": True, - }, - "provider_settings.quoted_message_parser.max_forward_fetch": { - "description": "引用解析转发拉取上限", - "type": "int", - "hint": "递归拉取 get_forward_msg 的最大次数。", - "condition": { - "agent_runner.runner_type": "local", - }, - "collapsed": True, - }, - "provider_settings.quoted_message_parser.warn_on_action_failure": { - "description": "引用解析 action 失败告警", - "type": "bool", - "hint": "开启后,get_msg/get_forward_msg 全部尝试失败时输出 warning 日志。", - "condition": { - "agent_runner.runner_type": "local", - }, - "collapsed": True, - }, - }, - "condition": { - "provider_settings.enable": True, - }, - }, - }, - }, - "platform_group": { - "name": "平台与消息", - "metadata": { - "general": { - "description": "基本", - "type": "object", - "items": { - "platform_settings.unique_session": { - "description": "隔离对话", - "type": "bool", - "hint": "启用后,支持隔离的渠道会为每位群成员使用独立上下文。指令权限请在「管理行为 → 指令」中设置。", - }, - "wake_prefix": { - "description": "唤醒词", - "hint": "唤醒机器人的消息前缀的列表,也可以通过 @ 机器人来唤醒。\n\n内置指令(如 `/help`、`/sid`)也依赖唤醒词:群聊中不带唤醒词直接输入将无法触发;私聊在未启用「私聊消息需要唤醒词」时无需前缀,可直接输入指令触发。", - "type": "list", - "items": {"type": "string"}, - }, - "platform_settings.friend_message_needs_wake_prefix": { - "description": "私聊消息需要唤醒词", - "hint": "私聊消息也必须带上唤醒前缀才能唤醒机器人。", - "type": "bool", - }, - "platform_settings.reply_prefix": { - "description": "回复时的文本前缀", - "hint": "回复中附带的文本前缀。", - "type": "string", - }, - "platform_settings.reply_with_mention": { - "description": "回复时 @ 发送人", - "hint": "回复时提及发送人。", - "type": "bool", - }, - "platform_settings.reply_with_quote": { - "description": "回复时引用发送人消息", - "hint": "回复时引用发送人的对应消息。", - "type": "bool", - }, - "platform_settings.forward_threshold": { - "description": "转发消息的字数阈值", - "hint": "在受支持的平台上,当回复消息过长时,采用 “合并消息转发” 的方式发送消息。", - "type": "int", - }, - "platform_settings.empty_mention_waiting": { - "description": "只 @ 机器人是否触发等待", - "hint": "当发送一条只有提及机器人的消息时,是否在接下来的 1 分钟内保持唤醒状态等待用户的第二条消息。", - "type": "bool", - }, - "disable_builtin_commands": { - "description": "禁用自带指令", - "type": "bool", - "hint": "禁用所有 AstrBot 的自带指令,如 help, sid, new 等。", - }, - }, - }, - "rate_limit": { - "description": "速率限制", - "type": "object", - "items": { - "platform_settings.rate_limit.time": { - "description": "消息速率限制时间(秒)", - "type": "int", - }, - "platform_settings.rate_limit.count": { - "description": "消息速率限制计数", - "type": "int", - }, - "platform_settings.rate_limit.strategy": { - "description": "速率限制策略", - "type": "string", - "options": ["stall", "discard"], - }, - }, - }, - "content_safety": { - "description": "内容安全", - "type": "object", - "items": { - "content_safety.also_use_in_response": { - "description": "同时检查模型的响应内容", - "type": "bool", - }, - "content_safety.baidu_aip.enable": { - "description": "使用百度内容安全审核", - "type": "bool", - "hint": "您需要手动安装 baidu-aip 库。", - }, - "content_safety.baidu_aip.app_id": { - "description": "App ID", - "type": "string", - "condition": { - "content_safety.baidu_aip.enable": True, - }, - }, - "content_safety.baidu_aip.api_key": { - "description": "API Key", - "type": "string", - "secret": True, - "condition": { - "content_safety.baidu_aip.enable": True, - }, - }, - "content_safety.baidu_aip.secret_key": { - "description": "Secret Key", - "type": "string", - "secret": True, - "condition": { - "content_safety.baidu_aip.enable": True, - }, - }, - "content_safety.internal_keywords.enable": { - "description": "关键词检查", - "type": "bool", - }, - "content_safety.internal_keywords.extra_keywords": { - "description": "额外关键词", - "type": "list", - "items": {"type": "string"}, - "hint": "额外的屏蔽关键词列表,支持正则表达式。", - }, - }, - }, - "others": { - "description": "其他配置", - "type": "object", - "items": { - "platform_settings.ignore_bot_self_message": { - "description": "是否忽略机器人自身的消息", - "type": "bool", - }, - "platform_settings.ignore_at_all": { - "description": "是否忽略 @ 全体成员事件", - "type": "bool", - }, - "platform_settings.no_permission_reply": { - "description": "用户权限不足时是否回复", - "type": "bool", - }, - "platform_specific.lark.pre_ack_emoji.enable": { - "description": "[飞书] 启用预回应表情", - "type": "bool", - }, - "platform_specific.lark.pre_ack_emoji.emojis": { - "description": "表情列表(飞书表情枚举名)", - "type": "list", - "items": {"type": "string"}, - "hint": "表情枚举名参考:https://open.feishu.cn/document/server-docs/im-v1/message-reaction/emojis-introduce", - "condition": { - "platform_specific.lark.pre_ack_emoji.enable": True, - }, - }, - "platform_specific.telegram.pre_ack_emoji.enable": { - "description": "[Telegram] 启用预回应表情", - "type": "bool", - }, - "platform_specific.telegram.pre_ack_emoji.emojis": { - "description": "表情列表(Unicode)", - "type": "list", - "items": {"type": "string"}, - "hint": "Telegram 仅支持固定反应集合,参考:https://gist.github.com/Soulter/3f22c8e5f9c7e152e967e8bc28c97fc9", - "condition": { - "platform_specific.telegram.pre_ack_emoji.enable": True, - }, - }, - "platform_specific.discord.pre_ack_emoji.enable": { - "description": "[Discord] 启用预回应表情", - "type": "bool", - }, - "platform_specific.discord.pre_ack_emoji.emojis": { - "description": "表情列表(Unicode 或自定义表情名)", - "type": "list", - "items": {"type": "string"}, - "hint": "填写 Unicode 表情符号,例如:👍、🤔、⏳", - "condition": { - "platform_specific.discord.pre_ack_emoji.enable": True, - }, - }, - }, - }, - }, - }, - "access_group": { - "name": "访问控制", - "metadata": { - "admins": { - "description": "管理员", - "type": "object", - "items": { - "admins_id": { - "description": "管理员 ID", - "type": "list", - "_special": "sender_id", - "items": {"type": "string"}, - "hint": "给机器人发送 /sid 指令以获取 ID。", - }, - }, - }, - "whitelist": { - "description": "白名单", - "type": "object", - "items": { - "platform_settings.enable_id_white_list": { - "description": "启用白名单", - "type": "bool", - "hint": "启用后,只有在白名单内的会话会被响应。", - }, - "platform_settings.id_whitelist": { - "description": "白名单 ID 列表", - "type": "list", - "_special": "umo", - "items": {"type": "string"}, - "hint": "给机器人发送 /sid 指令以获取 ID。为空时代表不启用白名单功能。", - }, - "platform_settings.id_whitelist_log": { - "description": "输出拦截日志", - "type": "bool", - "hint": "输出未通过白名单校验的消息的日志。", - }, - "platform_settings.wl_ignore_admin_on_group": { - "description": "管理员群组消息无视 ID 白名单", - "type": "bool", - }, - "platform_settings.wl_ignore_admin_on_friend": { - "description": "管理员私聊消息无视 ID 白名单", - "type": "bool", - }, - }, - }, - }, - }, - "plugin_group": { - "name": "插件", - "metadata": { - "plugin": { - "description": "插件", - "type": "object", - "items": { - "plugin_set": { - "description": "可用插件", - "type": "bool", - "hint": "默认启用全部未被禁用的插件。若插件在插件页面被禁用,则此处的选择不会生效。", - "_special": "select_plugin_set", - }, - }, - }, - }, - }, - "ext_group": { - "name": "扩展功能", - "metadata": { - "segmented_reply": { - "description": "分段回复", - "type": "object", - "items": { - "platform_settings.segmented_reply.enable": { - "description": "启用分段回复", - "hint": "以分段输出的方式发送回复消息。", - "type": "bool", - }, - "platform_settings.segmented_reply.only_llm_result": { - "description": "仅对 LLM 结果分段", - "type": "bool", - "condition": { - "platform_settings.segmented_reply.enable": True, - }, - }, - "platform_settings.segmented_reply.interval_method": { - "description": "间隔方法。", - "hint": "random 为随机时间,log 为根据消息长度计算,$y=log_(x)$,x为字数,y的单位为秒。", - "type": "string", - "options": ["random", "log"], - "condition": { - "platform_settings.segmented_reply.enable": True, - }, - }, - "platform_settings.segmented_reply.interval": { - "description": "随机间隔时间", - "type": "string", - "hint": "格式:最小值,最大值(如:1.5,3.5)", - "condition": { - "platform_settings.segmented_reply.enable": True, - "platform_settings.segmented_reply.interval_method": "random", - }, - }, - "platform_settings.segmented_reply.log_base": { - "description": "对数底数", - "type": "float", - "hint": "对数间隔的底数,默认为 2.6。取值范围为 1.0-10.0。", - "condition": { - "platform_settings.segmented_reply.enable": True, - "platform_settings.segmented_reply.interval_method": "log", - }, - }, - "platform_settings.segmented_reply.words_count_threshold": { - "description": "分段回复字数阈值", - "hint": "分段回复的字数上限。只有字数小于此值的消息才会被分段,超过此值的长消息将直接发送(不分段)。默认为 150", - "type": "int", - "condition": { - "platform_settings.segmented_reply.enable": True, - }, - }, - "platform_settings.segmented_reply.split_mode": { - "description": "分段模式", - "type": "string", - "options": ["regex", "words"], - "labels": ["正则表达式", "分段词列表"], - "condition": { - "platform_settings.segmented_reply.enable": True, - }, - }, - "platform_settings.segmented_reply.regex": { - "description": "分段正则表达式", - "hint": "用于分隔一段消息。默认情况下会根据句号、问号等标点符号分隔。如填写 `[。?!]` 将移除所有的句号、问号、感叹号。re.findall(r'', text)", - "type": "string", - "condition": { - "platform_settings.segmented_reply.enable": True, - "platform_settings.segmented_reply.split_mode": "regex", - }, - }, - "platform_settings.segmented_reply.split_words": { - "description": "分段词列表", - "type": "list", - "hint": "检测到列表中的任意词时进行分段,如:。、?、!等", - "condition": { - "platform_settings.segmented_reply.enable": True, - "platform_settings.segmented_reply.split_mode": "words", - }, - }, - "platform_settings.segmented_reply.content_cleanup_rule": { - "description": "内容过滤正则表达式", - "type": "string", - "hint": "移除分段后内容中的指定内容。如填写 `[。?!]` 将移除所有的句号、问号、感叹号。", - "condition": { - "platform_settings.segmented_reply.enable": True, - }, - }, - }, - }, - "ltm": { - "description": "群聊上下文感知", - "type": "object", - "items": { - "provider_ltm_settings.group_icl_enable": { - "description": "群聊消息记录注入上下文", - "hint": "是否记录群聊非唤醒机器人的消息,并在唤醒机器人时将消息传给模型。", - "type": "bool", - }, - "provider_ltm_settings.group_message_max_cnt": { - "description": "注入上下文最大消息数量", - "hint": "传给模型的消息的最大数量。", - "type": "int", - "condition": { - "provider_ltm_settings.group_icl_enable": True, - }, - }, - "provider_ltm_settings.image_caption": { - "description": "自动理解图片", - "type": "bool", - "hint": "对非唤醒机器人的图片消息启用图片转述,转换成图片描述文本。对于图片消息频繁的群聊,此功能可能造成较大的开销,请慎用。", - "condition": { - "provider_ltm_settings.group_icl_enable": True, - }, - }, - "provider_ltm_settings.image_caption_provider_id": { - "description": "群聊图片转述模型", - "type": "string", - "_special": "select_provider", - "hint": "用于群聊记录注入上下文的图片理解,与图片转述模型分开配置。", - "condition": { - "provider_ltm_settings.group_icl_enable": True, - "provider_ltm_settings.image_caption": True, - }, - }, - "provider_ltm_settings.group_message_history_enable": { - "description": "持久化群聊消息记录", - "type": "bool", - "hint": "将群内的所有消息都持久化保存,并允许模型通过工具来查询群内消息。", - }, - "provider_ltm_settings.group_message_history_max_cnt": { - "description": "持久化最大消息数量", - "hint": "持久化保存的消息的最大数量,超过后抛弃旧的消息。", - "type": "int", - "condition": { - "provider_ltm_settings.group_message_history_enable": True, - }, - }, - "provider_ltm_settings.active_reply.enable": { - "description": "主动回复", - "hint": "是否在合适的时机主动发消息。", - "type": "bool", - }, - "provider_ltm_settings.active_reply.method": { - "description": "主动回复方法", - "type": "string", - "options": ["possibility_reply"], - "condition": { - "provider_ltm_settings.active_reply.enable": True, - }, - }, - "provider_ltm_settings.active_reply.possibility_reply": { - "description": "回复概率", - "type": "float", - "hint": "0.0-1.0 之间的数值", - "slider": {"min": 0, "max": 1, "step": 0.05}, - "condition": { - "provider_ltm_settings.active_reply.enable": True, - }, - }, - "provider_ltm_settings.active_reply.whitelist": { - "description": "主动回复白名单", - "type": "list", - "items": {"type": "string"}, - "hint": "为空时不启用白名单过滤。使用 /sid 获取 ID。", - "condition": { - "provider_ltm_settings.active_reply.enable": True, - }, - }, - }, - }, - "t2i": { - "description": "文本转图像", - "type": "object", - "items": { - "t2i": { - "description": "文本转图像输出", - "hint": "将模型回复转换成图片后再发送,防止刷屏。", - "type": "bool", - }, - "t2i_word_threshold": { - "description": "文本转图像字数阈值", - "type": "int", - "condition": { - "t2i": True, - }, - }, - "t2i_strategy": { - "description": "文本转图像策略", - "type": "string", - "hint": "文本转图像策略。`remote` 为使用远程基于 HTML 的渲染服务,`local` 为使用 PIL 本地渲染。当使用 local 时,将 ttf 字体命名为 'font.ttf' 放在 data/ 目录下可自定义字体。", - "options": ["remote", "local"], - "condition": { - "t2i": True, - }, - }, - "t2i_endpoint": { - "description": "文本转图像服务 API 地址", - "type": "string", - "hint": "为空时使用 AstrBot API 服务", - "condition": { - "t2i": True, - "t2i_strategy": "remote", - }, - }, - "t2i_template": { - "description": "文本转图像自定义模版", - "type": "bool", - "hint": "启用后可自定义 HTML 模板用于文转图渲染。", - "condition": { - "t2i": True, - "t2i_strategy": "remote", - }, - "_special": "t2i_template", - }, - "t2i_active_template": { - "description": "当前应用的文转图渲染模板", - "type": "string", - "hint": "此处的值由文转图模板管理页面进行维护。", - "invisible": True, - }, - }, - }, - }, - }, -} - -CONFIG_METADATA_3_SYSTEM = { - "system_group": { - "name": "系统配置", - "metadata": { - "system": { - "description": "系统配置", - "type": "object", - "items": { - "log_level": { - "description": "控制台日志级别", - "type": "string", - "hint": "控制台输出日志的级别。", - "options": ["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"], - }, - "dashboard.ssl.enable": { - "description": "启用 WebUI HTTPS", - "type": "bool", - "hint": "启用后,WebUI 将直接使用 HTTPS 提供服务。", - }, - "dashboard.trust_proxy_headers": { - "description": "信任代理请求头获取客户端 IP", - "type": "bool", - "hint": "关闭时忽略 X-Forwarded-For/X-Real-IP,仅使用连接地址。", - }, - "dashboard.auth_rate_limit.enable": { - "description": "启用登录验证速率限制", - "type": "bool", - "hint": "关闭后将不对登录、TOTP 等身份验证接口进行速率限制。", - }, - "dashboard.auth_rate_limit.average_interval": { - "description": "验证端点速率限制平均间隔(秒)", - "type": "float", - "hint": "两次身份验证请求之间的最小平均间隔时间。例如设置为 1.0 表示每秒最多处理 1 个请求。", - "condition": {"dashboard.auth_rate_limit.enable": True}, - }, - "dashboard.auth_rate_limit.max_burst": { - "description": "验证端点速率限制最大突发数", - "type": "int", - "hint": "允许的瞬时最大突发请求数。例如设置为 3 表示在短时间内最多连续处理 3 个请求。", - "condition": {"dashboard.auth_rate_limit.enable": True}, - }, - "dashboard.totp.enable": { - "description": "启用 WebUI TOTP 双因素认证", - "type": "bool", - "hint": "启用后,登录 WebUI 需要额外输入验证码。", - "_special": "dashboard_totp_manager", - }, - "dashboard.ssl.cert_file": { - "description": "SSL 证书文件路径", - "type": "string", - "hint": "证书文件路径(PEM)。支持绝对路径和相对路径(相对于当前工作目录)。", - "condition": {"dashboard.ssl.enable": True}, - }, - "dashboard.ssl.key_file": { - "description": "SSL 私钥文件路径", - "type": "string", - "hint": "私钥文件路径(PEM)。支持绝对路径和相对路径(相对于当前工作目录)。", - "condition": {"dashboard.ssl.enable": True}, - }, - "dashboard.ssl.ca_certs": { - "description": "SSL CA 证书文件路径", - "type": "string", - "hint": "可选。用于指定 CA 证书文件路径。", - "condition": {"dashboard.ssl.enable": True}, - }, - "log_file_enable": { - "description": "启用文件日志", - "type": "bool", - "hint": "开启后会将日志写入指定文件。", - }, - "log_file_path": { - "description": "日志文件路径", - "type": "string", - "hint": "相对路径以 data 目录为基准,例如 logs/astrbot.log;支持绝对路径。", - }, - "log_file_max_mb": { - "description": "日志文件大小上限 (MB)", - "type": "int", - "hint": "超过大小后自动轮转,默认 20MB。", - }, - "temp_dir_max_size": { - "description": "临时目录大小上限 (MB)", - "type": "int", - "hint": "用于限制 data/temp 目录总大小,单位为 MB。系统每 10 分钟检查一次,超限时按文件修改时间从旧到新删除,释放约 30% 当前体积。", - }, - "trace_enable": { - "description": "启用追踪记录", - "type": "bool", - "hint": "追踪用户的每次指令和 AI 调用。", - }, - "trace_db_path": { - "description": "追踪数据库路径", - "type": "string", - "hint": "相对路径以 data 目录为基准,例如 logs/traces.db;支持绝对路径。", - }, - "trace_db_max_mb": { - "description": "追踪数据库容量预算 (MB)", - "type": "int", - "hint": "默认 80 MB,最小 32 MB,低于最小值时按 32 MB 生效。超出后自动清除旧数据。", - }, - "trace_retention_days": { - "description": "追踪保留天数", - "type": "int", - "hint": "默认 7 天,期限或容量先达到者触发清理。", - }, - "pip_install_arg": { - "description": "pip 安装额外参数", - "type": "string", - "hint": "安装插件依赖时,会使用 Python 的 pip 工具。这里可以填写额外的参数,如 `--break-system-package` 等。PyPI 镜像的 TLS 证书默认会校验;若使用自签名/私有 CA 镜像,请通过 `--cert ` 指定信任的证书(推荐),或显式添加 `--trusted-host <主机名>`。", - }, - "pypi_index_url": { - "description": "PyPI 软件仓库地址", - "type": "string", - "hint": "安装 Python 依赖时请求的 PyPI 软件仓库地址。默认为 https://mirrors.aliyun.com/pypi/simple/", - }, - "callback_api_base": { - "description": "对外可达的回调接口地址", - "type": "string", - "hint": "外部服务可能会通过 AstrBot 生成的回调链接(如文件下载链接)访问 AstrBot 后端。由于 AstrBot 无法自动判断部署环境中对外可达的主机地址(host),因此需要通过此配置项显式指定 “外部服务如何访问 AstrBot” 的地址。如 http://localhost:6185,https://example.com 等。", - }, - "timezone": { - "description": "时区", - "type": "string", - "hint": "时区设置。请填写 IANA 时区名称, 如 Asia/Shanghai, 为空时使用系统默认时区。所有时区请查看: https://data.iana.org/time-zones/tzdb-2021a/zone1970.tab", - }, - "http_proxy": { - "description": "代理", - "type": "string", - "hint": "启用后,会以添加环境变量的方式设置代理。支持 http://、https://、socks5:// 格式,例如:http://127.0.0.1:7890 或 socks5://127.0.0.1:7891", - }, - "no_proxy": { - "description": "直连地址列表", - "type": "list", - "items": {"type": "string"}, - }, - }, - }, - }, - }, -} - - -DEFAULT_VALUE_MAP = { - "int": 0, - "float": 0.0, - "bool": False, - "string": "", - "text": "", - "list": [], - "file": [], - "object": {}, - "template_list": [], - "dict": {}, -} +"""如需修改配置,请在 `data/cmd_config.json` 中修改或者在管理面板中可视化修改。""" + +import os + +from astrbot import __version__ +from astrbot.core.computer.booters.cua_defaults import CUA_DEFAULT_CONFIG +from astrbot.core.utils.astrbot_path import get_astrbot_data_path + +from .agent_runner import get_agent_runner_config_default + + +def get_local_permission_defaults(system: str | None = None) -> dict: + """Return fresh Local permission defaults shared by all operating systems. + + Args: + system: Retained for callers supplying an operating system name. + + Returns: + Workspace files without execution for members and unrestricted local + execution for administrators. Neither policy requires process isolation. + """ + return { + "member": { + "allow_execution": False, + "allow_network": False, + "filesystem_scope": "workspace", + }, + "admin": { + "allow_execution": True, + "allow_network": True, + "filesystem_scope": "host", + }, + } + + +VERSION = __version__ + +DB_PATH = os.path.join(get_astrbot_data_path(), "data_v4.db") +PERSONAL_WECHAT_CONFIG_METADATA = { + "weixin_oc_base_url": { + "description": "Base URL", + "type": "string", + "hint": "默认值: https://ilinkai.weixin.qq.com", + }, + "weixin_oc_bot_type": { + "description": "扫码参数 bot_type", + "type": "string", + "hint": "默认值: 3", + "invisible": True, + }, + "weixin_oc_qr_poll_interval": { + "description": "二维码状态轮询间隔(秒)", + "type": "int", + "hint": "每隔多少秒轮询一次二维码状态。", + "invisible": True, + }, + "weixin_oc_long_poll_timeout_ms": { + "description": "getUpdates 长轮询超时时间(毫秒)", + "type": "int", + "hint": "会话消息拉取接口超时参数。", + }, + "weixin_oc_api_timeout_ms": { + "description": "HTTP 请求超时(毫秒)", + "type": "int", + "hint": "通用 API 请求超时参数。", + }, + "weixin_oc_token": { + "description": "登录后 token(可留空)", + "type": "string", + "hint": "扫码登录成功后会自动写入;高级场景可手动填写。", + "secret": True, + "invisible": True, + }, + "weixin_oc_account_id": {"invisible": True}, + "weixin_oc_sync_buf": {"invisible": True}, + "weixin_oc_context_tokens": {"invisible": True}, +} + +WEBHOOK_SUPPORTED_PLATFORMS = [ + "qq_official_webhook", + "weixin_official_account", + "wecom", + "wecom_ai_bot", + "slack", + "lark", + "line", + "mattermost", +] + +# 默认配置 +DEFAULT_CONFIG = { + "config_version": 5, + "platform_settings": { + "unique_session": False, + "rate_limit": { + "time": 60, + "count": 30, + "strategy": "stall", # stall, discard + }, + "reply_prefix": "", + "forward_threshold": 1500, + "enable_id_white_list": True, + "id_whitelist": [], + "id_whitelist_log": True, + "wl_ignore_admin_on_group": True, + "wl_ignore_admin_on_friend": True, + "reply_with_mention": False, + "reply_with_quote": False, + "path_mapping": [], + "segmented_reply": { + "enable": False, + "only_llm_result": True, + "interval_method": "random", + "interval": "1.5,3.5", + "log_base": 2.6, + "words_count_threshold": 150, + "split_mode": "regex", # regex 或 words + "regex": ".*?[。?!~…]+|.+$", + "split_words": [ + "。", + "?", + "!", + "~", + "…", + ], # 当 split_mode 为 words 时使用 + "content_cleanup_rule": "", + }, + "no_permission_reply": True, + "empty_mention_waiting": True, + "empty_mention_waiting_need_reply": True, + "friend_message_needs_wake_prefix": False, + "ignore_bot_self_message": False, + "ignore_at_all": False, + }, + "provider_sources": [], # provider sources + "provider": [], # models from provider_sources + "provider_settings": { + "enable": True, + "default_image_caption_provider_id": "", + "image_caption_prompt": "Please describe the image using Chinese.", + "provider_pool": ["*"], # "*" 表示使用所有可用的提供者 + "wake_prefix": "", + "web_search": False, + "websearch_provider": "tavily", + "websearch_tavily_key": [], + "websearch_bocha_key": [], + "websearch_brave_key": [], + "websearch_baidu_app_builder_key": "", + "websearch_firecrawl_key": [], + "websearch_exa_key": [], + "websearch_anysearch_key": [], + "websearch_deepseek_key": [], + "websearch_serpapi_key": [], + "web_search_link": False, + "display_reasoning_text": False, + "identifier": False, + "group_name_display": False, + "datetime_system_prompt": True, + "persona_pool": ["*"], + "prompt_prefix": "{{prompt}}", + "streaming_response": False, + "show_tool_use_status": False, + "show_tool_call_result": False, + "buffer_intermediate_messages": False, + "max_quoted_fallback_images": 20, + "quoted_message_parser": { + "max_component_chain_depth": 4, + "max_forward_node_depth": 6, + "max_forward_fetch": 32, + "warn_on_action_failure": False, + }, + "unsupported_streaming_strategy": "realtime_segmenting", + "reachability_check": False, + "file_extract": { + "enable": False, + "provider": "moonshotai", + "moonshotai_api_key": "", + }, + "proactive_capability": { + "add_cron_tools": True, + }, + "computer_use_runtime": "none", + "computer_use_local_permissions": get_local_permission_defaults(), + "computer_use_require_admin": True, + "sandbox": { + "booter": "shipyard_neo", + "shipyard_endpoint": "", + "shipyard_access_token": "", + "shipyard_ttl": 3600, + "shipyard_max_sessions": 10, + "shipyard_neo_endpoint": "", + "shipyard_neo_access_token": "", + "shipyard_neo_profile": "python-default", + "shipyard_neo_ttl": 3600, + "cua_image": CUA_DEFAULT_CONFIG["image"], + "cua_os_type": CUA_DEFAULT_CONFIG["os_type"], + "cua_idle_timeout": CUA_DEFAULT_CONFIG["idle_timeout"], + "cua_telemetry_enabled": CUA_DEFAULT_CONFIG["telemetry_enabled"], + "cua_local": CUA_DEFAULT_CONFIG["local"], + "cua_api_key": CUA_DEFAULT_CONFIG["api_key"], + }, + "image_compress_options": { + "max_size": 1280, + }, + }, + "agent_runner": { + "runner_type": "local", + "config": get_agent_runner_config_default("local"), + }, + # SubAgent orchestrator mode: + # - main_enable = False: disabled; main LLM mounts tools normally (persona selection). + # - main_enable = True: enabled; main LLM keeps its own tools and includes handoff + # tools (transfer_to_*). remove_main_duplicate_tools can remove tools that are + # duplicated on subagents from the main LLM toolset. + "subagent_orchestrator": { + "main_enable": False, + "remove_main_duplicate_tools": False, + "router_system_prompt": ( + "You are a task router. Your job is to chat naturally, recognize user intent, " + "and delegate work to the most suitable subagent using transfer_to_* tools. " + "Do not try to use domain tools yourself. If no subagent fits, respond directly." + ), + "agents": [], + }, + "provider_stt_settings": { + "enable": False, + "provider_id": "", + }, + "provider_tts_settings": { + "enable": False, + "provider_id": "", + "dual_output": False, + "use_file_service": False, + "trigger_probability": 1.0, + }, + "provider_ltm_settings": { + "group_icl_enable": False, + "group_message_max_cnt": 1000, + "image_caption": False, + "image_caption_provider_id": "", + "group_message_history_enable": False, + "group_message_history_max_cnt": 700, + "active_reply": { + "enable": False, + "method": "possibility_reply", + "possibility_reply": 0.1, + "whitelist": [], + }, + }, + "content_safety": { + "also_use_in_response": False, + "internal_keywords": {"enable": True, "extra_keywords": []}, + "baidu_aip": {"enable": False, "app_id": "", "api_key": "", "secret_key": ""}, + }, + "admins_id": ["astrbot"], + "t2i": False, + "t2i_word_threshold": 150, + "t2i_strategy": "remote", + "t2i_endpoint": "", + "t2i_use_file_service": False, + "t2i_active_template": "base", + "http_proxy": "", + "no_proxy": ["localhost", "127.0.0.1", "::1", "10.*", "192.168.*"], + "dashboard": { + "enable": True, + "username": "astrbot", + "password": "", + "pbkdf2_password": "", + "password_storage_upgraded": False, + "password_change_required": False, + "jwt_secret": "", + "host": "0.0.0.0", + "port": 6185, + "disable_access_log": True, + "trust_proxy_headers": False, + "auth_rate_limit": { + "enable": True, + "average_interval": 1.0, + "max_burst": 3, + }, + "totp": { + "enable": False, + "secret": "", + "recovery_code_hash": "", + }, + "ssl": { + "enable": False, + "cert_file": "", + "key_file": "", + "ca_certs": "", + }, + }, + "platform": [], + "platform_specific": { + # 平台特异配置:按平台分类,平台下按功能分组 + "lark": { + "pre_ack_emoji": {"enable": False, "emojis": ["Typing"]}, + }, + "telegram": { + "pre_ack_emoji": {"enable": False, "emojis": ["✍️"]}, + }, + "discord": { + "pre_ack_emoji": {"enable": False, "emojis": ["🤔"]}, + }, + }, + "wake_prefix": ["/"], + "log_level": "INFO", + "log_file_enable": False, + "log_file_path": "logs/astrbot.log", + "log_file_max_mb": 20, + "temp_dir_max_size": 1024, + "trace_enable": False, + "trace_db_path": "logs/traces.db", + "trace_db_max_mb": 80, + "trace_retention_days": 7, + "pip_install_arg": "", + "pypi_index_url": "https://mirrors.aliyun.com/pypi/simple/", + "persona": [], # deprecated + "timezone": "Asia/Shanghai", + "callback_api_base": "", + "default_kb_collection": "", # 默认知识库名称, 已经过时 + "plugin_set": ["*"], # "*" 表示使用所有可用的插件, 空列表表示不使用任何插件 + "kb_names": [], # 默认知识库名称列表 + "kb_fusion_top_k": 20, # 知识库检索融合阶段返回结果数量 + "kb_final_top_k": 5, # 知识库检索最终返回结果数量 + "kb_agentic_mode": False, + "disable_builtin_commands": False, + "disable_metrics": False, +} + + +""" +AstrBot v3 时代的配置元数据,目前仅承担以下功能: + +1. 保存配置时,配置项的类型验证 +2. WebUI 展示提供商和平台适配器模版 + +WebUI 的配置文件在 `CONFIG_METADATA_3` 中。 + +未来将会逐步淘汰此配置元数据。 +""" +CONFIG_METADATA_2 = { + "platform_group": { + "metadata": { + "platform": { + "description": "消息平台适配器", + "type": "list", + "config_template": { + "QQ 官方机器人(Websocket, 推荐)": { + "id": "default", + "type": "qq_official", + "enable": True, + "appid": "", + "secret": "", + "enable_group_c2c": True, + "enable_guild_direct_message": True, + "use_markdown": True, + }, + "QQ 官方机器人(Webhook)": { + "id": "default", + "type": "qq_official_webhook", + "enable": True, + "appid": "", + "secret": "", + "use_markdown": True, + "is_sandbox": False, + "unified_webhook_mode": True, + "webhook_uuid": "", + "callback_server_host": "0.0.0.0", + "port": 6196, + }, + "OneBot v11": { + "id": "default", + "type": "aiocqhttp", + "enable": True, + "ws_reverse_host": "0.0.0.0", + "ws_reverse_port": 6199, + "ws_reverse_token": "", + }, + "飞书(Lark)": { + "id": "lark", + "type": "lark", + "enable": True, + "app_id": "", + "app_secret": "", + "domain": "https://open.feishu.cn", + "lark_connection_mode": "socket", # webhook, socket + "webhook_uuid": "", + "lark_encrypt_key": "", + "lark_verification_token": "", + }, + "个人微信": { + "id": "weixin_personal", + "type": "weixin_oc", + "enable": True, + "weixin_oc_base_url": "https://ilinkai.weixin.qq.com", + "weixin_oc_bot_type": "3", + "weixin_oc_qr_poll_interval": 1, + "weixin_oc_long_poll_timeout_ms": 35_000, + "weixin_oc_api_timeout_ms": 120_000, + }, + "企业微信 (智能机器人)": { + "id": "wecom_ai_bot", + "type": "wecom_ai_bot", + "hint": "如果发现字段有异常,请重新创建", + "enable": True, + "wecom_ai_bot_connection_mode": "long_connection", # long_connection, webhook + "wecom_ai_bot_name": "", + "wecomaibot_ws_bot_id": "", + "wecomaibot_ws_secret": "", + "wecomaibot_token": "", + "wecomaibot_encoding_aes_key": "", + "wecomaibot_init_respond_text": "", + "wecomaibot_friend_message_welcome_text": "", + "msg_push_webhook_url": "", + "only_use_webhook_url_to_send": False, + "wecomaibot_ws_url": "wss://openws.work.weixin.qq.com", + "wecomaibot_heartbeat_interval": 30, + "unified_webhook_mode": True, + "webhook_uuid": "", + "callback_server_host": "0.0.0.0", + "port": 6198, + }, + "企业微信应用 & 微信客服": { + "id": "wecom", + "type": "wecom", + "enable": True, + "corpid": "", + "secret": "", + "token": "", + "encoding_aes_key": "", + "kf_name": "", + "api_base_url": "https://qyapi.weixin.qq.com/cgi-bin/", + "unified_webhook_mode": True, + "webhook_uuid": "", + "callback_server_host": "0.0.0.0", + "port": 6195, + }, + "微信公众平台": { + "id": "weixin_official_account", + "type": "weixin_official_account", + "enable": True, + "appid": "", + "secret": "", + "token": "", + "encoding_aes_key": "", + "api_base_url": "https://api.weixin.qq.com/cgi-bin/", + "unified_webhook_mode": True, + "webhook_uuid": "", + "callback_server_host": "0.0.0.0", + "port": 6194, + "active_send_mode": False, + }, + "钉钉(DingTalk)": { + "id": "dingtalk", + "type": "dingtalk", + "enable": True, + "client_id": "", + "client_secret": "", + "card_template_id": "", + }, + "Telegram": { + "id": "telegram", + "type": "telegram", + "enable": True, + "telegram_token": "", + "start_message": "Hello, I'm AstrBot!", + "telegram_api_base_url": "https://api.telegram.org/bot", + "telegram_file_base_url": "https://api.telegram.org/file/bot", + "telegram_command_register": True, + "telegram_command_auto_refresh": True, + "telegram_command_register_interval": 300, + "telegram_polling_restart_delay": 5.0, + }, + "Discord": { + "id": "discord", + "type": "discord", + "enable": True, + "discord_token": "", + "discord_proxy": "", + "discord_command_register": True, + "discord_activity_name": "", + "discord_allow_bot_messages": False, + }, + "Misskey": { + "id": "misskey", + "type": "misskey", + "enable": True, + "misskey_instance_url": "https://misskey.example", + "misskey_token": "", + "misskey_default_visibility": "public", + "misskey_local_only": False, + "misskey_enable_chat": True, + # download / security options + "misskey_allow_insecure_downloads": False, + "misskey_download_timeout": 15, + "misskey_download_chunk_size": 65536, + "misskey_max_download_bytes": None, + "misskey_enable_file_upload": True, + "misskey_upload_concurrency": 3, + "misskey_upload_folder": "", + }, + "Slack": { + "id": "slack", + "type": "slack", + "enable": True, + "bot_token": "", + "app_token": "", + "signing_secret": "", + "slack_connection_mode": "socket", # webhook, socket + "unified_webhook_mode": True, + "webhook_uuid": "", + "slack_webhook_host": "0.0.0.0", + "slack_webhook_port": 6197, + "slack_webhook_path": "/astrbot-slack-webhook/callback", + }, + "Line": { + "id": "line", + "type": "line", + "enable": True, + "channel_access_token": "", + "channel_secret": "", + "unified_webhook_mode": True, + "webhook_uuid": "", + }, + "Satori": { + "id": "satori", + "type": "satori", + "enable": True, + "satori_api_base_url": "http://localhost:5140/satori/v1", + "satori_endpoint": "ws://localhost:5140/satori/v1/events", + "satori_token": "", + "satori_auto_reconnect": True, + "satori_heartbeat_interval": 10, + "satori_reconnect_delay": 5, + }, + "KOOK": { + "id": "kook", + "type": "kook", + "enable": True, + "kook_bot_token": "", + "kook_reconnect_delay": 1, + "kook_max_reconnect_delay": 60, + "kook_max_retry_delay": 60, + "kook_heartbeat_interval": 30, + "kook_heartbeat_timeout": 6, + "kook_max_heartbeat_failures": 3, + "kook_max_consecutive_failures": 5, + }, + "Mattermost": { + "id": "mattermost", + "type": "mattermost", + "enable": True, + "mattermost_url": "https://chat.example.com", + "mattermost_bot_token": "", + "mattermost_reconnect_delay": 5.0, + "unified_webhook_mode": True, + "webhook_uuid": "", + }, + # "WebChat": { + # "id": "webchat", + # "type": "webchat", + # "enable": False, + # "webchat_link_path": "", + # "webchat_present_type": "fullscreen", + # }, + }, + "items": { + # "webchat_link_path": { + # "description": "链接路径", + # "_special": "webchat_link_path", + # "type": "string", + # }, + # "webchat_present_type": { + # "_special": "webchat_present_type", + # "description": "展现形式", + # "type": "string", + # "options": ["fullscreen", "embedded"], + # }, + "app_id": { + "description": "应用 ID", + "type": "string", + "hint": "消息平台开放平台中的应用 ID。", + "show_key": True, + }, + "app_secret": { + "description": "应用密钥", + "type": "string", + "hint": "消息平台开放平台中的应用密钥。请妥善保管,避免泄露。", + "show_key": True, + "secret": True, + }, + "domain": { + "description": "开放平台 API 地址", + "type": "string", + "hint": "开放平台 API 的基础地址。使用默认官方服务时通常无需修改。", + "show_key": True, + }, + "corpid": { + "description": "企业 ID", + "type": "string", + "hint": "企业微信后台中的企业 ID(CorpID)。", + "show_key": True, + }, + "token": { + "description": "回调 Token", + "type": "string", + "hint": "消息平台回调配置中用于验证请求的 Token。", + "show_key": True, + "secret": True, + }, + "encoding_aes_key": { + "description": "消息加密密钥", + "type": "string", + "hint": "消息平台回调配置中的 EncodingAESKey,用于加密和解密消息。", + "show_key": True, + "secret": True, + }, + "api_base_url": { + "description": "API 基础地址", + "type": "string", + "hint": "消息平台 API 的基础地址。使用默认官方服务时通常无需修改。", + "show_key": True, + }, + "client_id": { + "description": "客户端 ID", + "type": "string", + "hint": "消息平台开放平台中的客户端 ID。", + "show_key": True, + }, + "client_secret": { + "description": "客户端密钥", + "type": "string", + "hint": "消息平台开放平台中的客户端密钥。请妥善保管,避免泄露。", + "show_key": True, + "secret": True, + }, + "start_message": { + "description": "Start 命令回复", + "type": "string", + "hint": "用户向 Telegram 机器人发送 /start 命令时回复的内容。", + "show_key": True, + }, + "telegram_api_base_url": { + "description": "API 地址", + "type": "string", + "hint": "Telegram Bot API 的基础地址。使用官方服务时通常无需修改。", + "show_key": True, + }, + "telegram_file_base_url": { + "description": "文件 API 地址", + "type": "string", + "hint": "Telegram Bot API 文件下载接口的基础地址。使用官方服务时通常无需修改。", + "show_key": True, + }, + "bot_token": { + "description": "Slack Bot Token", + "type": "string", + "hint": "Slack 应用的 Bot User OAuth Token,通常以 xoxb- 开头。", + "show_key": True, + "secret": True, + }, + "app_token": { + "description": "Slack App Token", + "type": "string", + "hint": "Slack Socket Mode 使用的 App-Level Token,通常以 xapp- 开头。", + "condition": { + "slack_connection_mode": "socket", + }, + "show_key": True, + "secret": True, + }, + "signing_secret": { + "description": "Slack Signing Secret", + "type": "string", + "hint": "Slack 应用的 Signing Secret,用于验证 Webhook 请求。", + "condition": { + "slack_connection_mode": "webhook", + }, + "show_key": True, + "secret": True, + }, + "channel_access_token": { + "description": "LINE 频道访问令牌", + "type": "string", + "hint": "LINE Messaging API 频道的 Channel Access Token。", + "show_key": True, + "secret": True, + }, + "channel_secret": { + "description": "LINE 频道密钥", + "type": "string", + "hint": "LINE Messaging API 频道的 Channel Secret。", + "show_key": True, + "secret": True, + }, + "lark_connection_mode": { + "description": "订阅方式", + "type": "string", + "options": ["socket", "webhook"], + "labels": ["长连接模式", "推送至服务器模式"], + }, + "lark_encrypt_key": { + "description": "Encrypt Key", + "type": "string", + "hint": "用于解密飞书回调数据的加密密钥", + "secret": True, + "condition": { + "lark_connection_mode": "webhook", + }, + }, + "lark_verification_token": { + "description": "Verification Token", + "type": "string", + "hint": "用于验证飞书回调请求的令牌", + "secret": True, + "condition": { + "lark_connection_mode": "webhook", + }, + }, + "is_sandbox": { + "description": "沙箱模式", + "type": "bool", + }, + "satori_api_base_url": { + "description": "Satori API 终结点", + "type": "string", + "hint": "Satori API 的基础地址。", + }, + "satori_endpoint": { + "description": "Satori WebSocket 终结点", + "type": "string", + "hint": "Satori 事件的 WebSocket 端点。", + }, + "satori_token": { + "description": "Satori 令牌", + "type": "string", + "hint": "用于 Satori API 身份验证的令牌。", + "secret": True, + }, + "satori_auto_reconnect": { + "description": "启用自动重连", + "type": "bool", + "hint": "断开连接时是否自动重新连接 WebSocket。", + }, + "satori_heartbeat_interval": { + "description": "Satori 心跳间隔", + "type": "int", + "hint": "发送心跳消息的间隔(秒)。", + }, + "satori_reconnect_delay": { + "description": "Satori 重连延迟", + "type": "int", + "hint": "尝试重新连接前的延迟时间(秒)。", + }, + "slack_connection_mode": { + "description": "Slack Connection Mode", + "type": "string", + "options": ["webhook", "socket"], + "hint": "The connection mode for Slack. `webhook` uses a webhook server, `socket` uses Slack's Socket Mode.", + }, + "slack_webhook_host": { + "description": "Slack Webhook Host", + "type": "string", + "hint": "Only valid when Slack connection mode is `webhook`.", + "condition": { + "slack_connection_mode": "webhook", + "unified_webhook_mode": False, + }, + }, + "slack_webhook_port": { + "description": "Slack Webhook Port", + "type": "int", + "hint": "Only valid when Slack connection mode is `webhook`.", + "condition": { + "slack_connection_mode": "webhook", + "unified_webhook_mode": False, + }, + }, + "slack_webhook_path": { + "description": "Slack Webhook Path", + "type": "string", + "hint": "Only valid when Slack connection mode is `webhook`.", + "condition": { + "slack_connection_mode": "webhook", + "unified_webhook_mode": False, + }, + }, + "active_send_mode": { + "description": "是否换用主动发送接口", + "type": "bool", + "desc": "只有企业认证的公众号才能主动发送。主动发送接口的限制会少一些。", + }, + "wpp_active_message_poll": { + "description": "是否启用主动消息轮询", + "type": "bool", + "hint": "只有当你发现微信消息没有按时同步到 AstrBot 时,才需要启用这个功能,默认不启用。", + }, + "wpp_active_message_poll_interval": { + "description": "主动消息轮询间隔", + "type": "int", + "hint": "主动消息轮询间隔,单位为秒,默认 3 秒,最大不要超过 60 秒,否则可能被认为是旧消息。", + }, + "kf_name": { + "description": "微信客服账号名", + "type": "string", + "hint": "可选。微信客服账号名(不是 ID)。可在 https://kf.weixin.qq.com/kf/frame#/accounts 获取", + }, + "telegram_token": { + "description": "Bot Token", + "type": "string", + "hint": "如果你的网络环境为中国大陆,请在 `其他配置` 处设置代理或更改 api_base。", + "secret": True, + }, + "mattermost_url": { + "description": "Mattermost URL", + "type": "string", + "hint": "Mattermost 服务地址,例如 https://chat.example.com。", + }, + "mattermost_bot_token": { + "description": "Mattermost Bot Token", + "type": "string", + "hint": "在 Mattermost 中创建 Bot 账户后生成的访问令牌。", + "secret": True, + }, + "mattermost_reconnect_delay": { + "description": "Mattermost 重连延迟", + "type": "float", + "hint": "WebSocket 断开后的重连等待时间,单位为秒。默认 5 秒。", + }, + "misskey_instance_url": { + "description": "Misskey 实例 URL", + "type": "string", + "hint": "例如 https://misskey.example,填写 Bot 账号所在的 Misskey 实例地址", + }, + "misskey_token": { + "description": "Misskey Access Token", + "type": "string", + "hint": "连接服务设置生成的 API 鉴权访问令牌(Access token)", + "secret": True, + }, + "misskey_default_visibility": { + "description": "默认帖子可见性", + "type": "string", + "options": ["public", "home", "followers"], + "hint": "机器人发帖时的默认可见性设置。public:公开,home:主页时间线,followers:仅关注者。", + }, + "misskey_local_only": { + "description": "仅限本站(不参与联合)", + "type": "bool", + "hint": "启用后,机器人发出的帖子将仅在本实例可见,不会联合到其他实例", + }, + "misskey_enable_chat": { + "description": "启用聊天消息响应", + "type": "bool", + "hint": "启用后,机器人将会监听和响应私信聊天消息", + }, + "misskey_enable_file_upload": { + "description": "启用文件上传到 Misskey", + "type": "bool", + "hint": "启用后,适配器会尝试将消息链中的文件上传到 Misskey。URL 文件会先尝试服务器端上传,异步上传失败时会回退到下载后本地上传。", + }, + "misskey_allow_insecure_downloads": { + "description": "允许不安全下载(禁用 SSL 验证)", + "type": "bool", + "hint": "当远端服务器存在证书问题导致无法正常下载时,自动禁用 SSL 验证作为回退方案。适用于某些图床的证书配置问题。启用有安全风险,仅在必要时使用。", + }, + "misskey_download_timeout": { + "description": "远端下载超时时间(秒)", + "type": "int", + "hint": "下载远程文件时的超时时间(秒),用于异步上传回退到本地上传的场景。", + }, + "misskey_download_chunk_size": { + "description": "流式下载分块大小(字节)", + "type": "int", + "hint": "流式下载和计算 MD5 时使用的每次读取字节数,过小会增加开销,过大会占用内存。", + }, + "misskey_max_download_bytes": { + "description": "最大允许下载字节数(超出则中止)", + "type": "int", + "hint": "如果希望限制下载文件的最大大小以防止 OOM,请填写最大字节数;留空或 null 表示不限制。", + }, + "misskey_upload_concurrency": { + "description": "并发上传限制", + "type": "int", + "hint": "同时进行的文件上传任务上限(整数,默认 3)。", + }, + "misskey_upload_folder": { + "description": "上传到网盘的目标文件夹 ID", + "type": "string", + "hint": "可选:填写 Misskey 网盘中目标文件夹的 ID,上传的文件将放置到该文件夹内。留空则使用账号网盘根目录。", + }, + "card_template_id": { + "description": "卡片模板 ID", + "type": "string", + "hint": "可选。钉钉互动卡片模板 ID。启用后将使用互动卡片进行流式回复。", + }, + "telegram_command_register": { + "description": "命令注册", + "type": "bool", + "hint": "启用后,AstrBot 将会自动注册 Telegram 命令。", + "show_key": True, + }, + "telegram_command_auto_refresh": { + "description": "命令自动刷新", + "type": "bool", + "hint": "启用后,AstrBot 将会在运行时自动刷新 Telegram 命令。(单独设置此项无效)", + "show_key": True, + }, + "telegram_command_register_interval": { + "description": "命令自动刷新间隔", + "type": "int", + "hint": "Telegram 命令自动刷新间隔,单位为秒。", + "show_key": True, + }, + "telegram_polling_restart_delay": { + "description": "轮询重启延迟", + "type": "float", + "hint": "当轮询意外结束尝试自动重启时的延迟时间,理论上越短恢复越快,但过短(<0.1s)可能导致死循环针对 API 服务器的请求阻断。单位为秒。默认为 5s。", + "show_key": True, + }, + "id": { + "description": "机器人名称", + "type": "string", + "hint": "机器人名称", + }, + "type": { + "description": "适配器类型", + "type": "string", + "invisible": True, + }, + "enable": { + "description": "启用", + "type": "bool", + "hint": "是否启用该适配器。未启用的适配器对应的消息平台将不会接收到消息。", + }, + "appid": { + "description": "appid", + "type": "string", + "hint": "必填项。当前消息平台的 AppID。如何获取请参考对应平台接入文档。", + }, + "secret": { + "description": "secret", + "type": "string", + "hint": "必填项。", + "secret": True, + }, + "enable_group_c2c": { + "description": "启用消息列表单聊", + "type": "bool", + "hint": "启用后,机器人可以接收到 QQ 消息列表中的私聊消息。你可能需要在 QQ 机器人平台上通过扫描二维码的方式添加机器人为你的好友。详见文档。", + }, + "enable_guild_direct_message": { + "description": "启用频道私聊", + "type": "bool", + "hint": "启用后,机器人可以接收到频道的私聊消息。", + }, + "use_markdown": { + "description": "主动消息使用 Markdown", + "type": "bool", + "hint": "启用后,机器人主动发送消息默认以 Markdown 模式发送;插件显式调用 use_markdown() 指定行为时不受此配置影响。", + }, + "ws_reverse_host": { + "description": "反向 Websocket 主机", + "type": "string", + "hint": "AstrBot 将作为服务器端。", + }, + "ws_reverse_port": { + "description": "反向 Websocket 端口", + "type": "int", + }, + "ws_reverse_token": { + "description": "反向 Websocket Token", + "type": "string", + "hint": "反向 Websocket Token。未设置则不启用 Token 验证。", + "secret": True, + }, + "wecom_ai_bot_name": { + "description": "企业微信智能机器人的名字", + "type": "string", + "hint": "请务必填写正确,否则无法使用一些指令。", + }, + "wecom_ai_bot_connection_mode": { + "description": "企业微信智能机器人连接模式", + "type": "string", + "options": ["webhook", "long_connection"], + "labels": ["Webhook 回调", "长连接"], + "hint": "Webhook 回调模式需要配置 Token/EncodingAESKey。长连接模式需要配置 BotID/Secret。", + }, + "wecomaibot_init_respond_text": { + "description": "企业微信智能机器人初始响应文本", + "type": "string", + "hint": "当机器人收到消息时,首先回复的文本内容。留空则不设置。", + }, + "wecomaibot_friend_message_welcome_text": { + "description": "企业微信智能机器人私聊欢迎语", + "type": "string", + "hint": "当用户当天进入智能机器人单聊会话,回复欢迎语,留空则不回复。", + }, + "wecomaibot_token": { + "description": "企业微信智能机器人 Token", + "type": "string", + "hint": "用于 Webhook 回调模式的身份验证。", + "secret": True, + "condition": { + "wecom_ai_bot_connection_mode": "webhook", + }, + }, + "wecomaibot_encoding_aes_key": { + "description": "企业微信智能机器人 EncodingAESKey", + "type": "string", + "hint": "用于 Webhook 回调模式的消息加密解密。", + "secret": True, + "condition": { + "wecom_ai_bot_connection_mode": "webhook", + }, + }, + "msg_push_webhook_url": { + "description": "企业微信消息推送 Webhook URL", + "type": "string", + "hint": "用于 send_by_session 主动消息推送。格式示例: https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=xxx", + "secret": True, + }, + "only_use_webhook_url_to_send": { + "description": "仅使用 Webhook 发送消息", + "type": "bool", + "hint": "启用后,企业微信智能机器人的所有回复都改为通过消息推送 Webhook 发送。消息推送 Webhook 支持更多的消息类型(如图片、文件等)。", + }, + "wecomaibot_ws_bot_id": { + "description": "长连接 BotID", + "type": "string", + "hint": "企业微信智能机器人长连接模式凭证 BotID。", + "condition": { + "wecom_ai_bot_connection_mode": "long_connection", + }, + }, + "wecomaibot_ws_secret": { + "description": "长连接 Secret", + "type": "string", + "hint": "企业微信智能机器人长连接模式凭证 Secret。", + "secret": True, + "condition": { + "wecom_ai_bot_connection_mode": "long_connection", + }, + }, + "wecomaibot_ws_url": { + "description": "长连接 WebSocket 地址", + "type": "string", + "invisible": True, + "hint": "默认值为 wss://openws.work.weixin.qq.com,一般无需修改。", + "condition": { + "wecom_ai_bot_connection_mode": "long_connection", + }, + }, + "wecomaibot_heartbeat_interval": { + "description": "长连接心跳间隔", + "type": "int", + "invisible": True, + "hint": "长连接模式心跳间隔(秒),建议 30 秒。", + "condition": { + "wecom_ai_bot_connection_mode": "long_connection", + }, + }, + "discord_token": { + "description": "Discord Bot Token", + "type": "string", + "hint": "在此处填入你的Discord Bot Token", + "secret": True, + }, + "discord_proxy": { + "description": "Discord 代理地址", + "type": "string", + "hint": "可选的代理地址:http://ip:port", + }, + "discord_command_register": { + "description": "注册 Discord 指令", + "hint": "启用后,自动将插件指令注册为 Discord 斜杠指令", + "type": "bool", + }, + "discord_activity_name": { + "description": "Discord 活动名称", + "type": "string", + "hint": "可选的 Discord 活动名称。留空则不设置活动。", + }, + "discord_allow_bot_messages": { + "description": "允许接收机器人消息", + "type": "bool", + "hint": "启用后,AstrBot 将接收来自其他 Discord 机器人的消息。适用于机器人间通信场景(如消息转发)。默认关闭。", + }, + "port": { + "description": "回调服务器端口", + "type": "int", + "hint": "回调服务器端口。留空则不启用回调服务器。", + "condition": { + "unified_webhook_mode": False, + }, + }, + "callback_server_host": { + "description": "回调服务器主机", + "type": "string", + "hint": "回调服务器主机。留空则不启用回调服务器。", + "condition": { + "unified_webhook_mode": False, + }, + }, + "unified_webhook_mode": { + "description": "统一 Webhook 模式", + "type": "bool", + "hint": "Webhook 模式下使用 AstrBot 统一 Webhook 入口,无需单独开启端口。回调地址为 /api/platform/webhook/{webhook_uuid}。", + }, + **PERSONAL_WECHAT_CONFIG_METADATA, + "webhook_uuid": { + "invisible": True, + "description": "Webhook UUID", + "type": "string", + "hint": "统一 Webhook 模式下的唯一标识符,创建平台时自动生成。", + }, + "kook_bot_token": { + "description": "机器人 Token", + "type": "string", + "hint": "必填项。从 KOOK 开发者平台获取的机器人 Token。", + "secret": True, + }, + "kook_reconnect_delay": { + "description": "重连延迟", + "type": "int", + "hint": "重连延迟时间(秒),使用指数退避策略。", + }, + "kook_max_reconnect_delay": { + "description": "最大重连延迟", + "type": "int", + "hint": "重连延迟的最大值(秒)。", + }, + "kook_max_retry_delay": { + "description": "最大重试延迟", + "type": "int", + "hint": "重试的最大延迟时间(秒)。", + }, + "kook_heartbeat_interval": { + "description": "心跳间隔", + "type": "int", + "hint": "心跳检测间隔时间(秒)。", + }, + "kook_heartbeat_timeout": { + "description": "心跳超时时间", + "type": "int", + "hint": "心跳检测超时时间(秒)。", + }, + "kook_max_heartbeat_failures": { + "description": "最大心跳失败次数", + "type": "int", + "hint": "允许的最大心跳失败次数,超过后断开连接。", + }, + "kook_max_consecutive_failures": { + "description": "最大连续失败次数", + "type": "int", + "hint": "允许的最大连续失败次数,超过后停止重试。", + }, + }, + }, + "platform_settings": { + "type": "object", + "items": { + "unique_session": { + "type": "bool", + }, + "rate_limit": { + "type": "object", + "items": { + "time": {"type": "int"}, + "count": {"type": "int"}, + "strategy": { + "type": "string", + "options": ["stall", "discard"], + }, + }, + }, + "no_permission_reply": { + "type": "bool", + "hint": "启用后,当用户没有权限执行某个操作时,机器人会回复一条消息。", + }, + "empty_mention_waiting": { + "type": "bool", + "hint": "启用后,当消息内容只有 @ 机器人时,会触发等待,在 60 秒内的该用户的任意一条消息均会唤醒机器人。这在某些平台不支持 @ 和语音/图片等消息同时发送时特别有用。", + }, + "empty_mention_waiting_need_reply": { + "type": "bool", + "hint": "在上面一个配置项中,如果启用了触发等待,启用此项后,机器人会使用 LLM 生成一条回复。否则,将不回复而只是等待。", + }, + "friend_message_needs_wake_prefix": { + "type": "bool", + "hint": "启用后,私聊消息需要唤醒前缀才会被处理,同群聊一样。", + }, + "ignore_bot_self_message": { + "type": "bool", + "hint": "某些平台会将自身账号在其他 APP 端发送的消息也当做消息事件下发导致给自己发消息时唤醒机器人", + }, + "ignore_at_all": { + "type": "bool", + "hint": "启用后,机器人会忽略 @ 全体成员 的消息事件。", + }, + "segmented_reply": { + "type": "object", + "items": { + "enable": { + "type": "bool", + }, + "only_llm_result": { + "type": "bool", + }, + "interval_method": { + "type": "string", + "options": ["random", "log"], + }, + "interval": { + "type": "string", + }, + "log_base": { + "type": "float", + }, + "words_count_threshold": { + "type": "int", + }, + "regex": { + "type": "string", + }, + "content_cleanup_rule": { + "type": "string", + }, + }, + }, + "reply_prefix": { + "type": "string", + "hint": "机器人回复消息时带有的前缀。", + }, + "forward_threshold": { + "type": "int", + "hint": "超过一定字数后,机器人会将消息折叠成 QQ 群聊的 “转发消息”,以防止刷屏。目前仅 QQ 平台适配器适用。", + }, + "enable_id_white_list": { + "type": "bool", + }, + "id_whitelist": { + "type": "list", + "_special": "umo", + "items": {"type": "string"}, + "hint": "只处理填写的 ID 发来的消息事件,为空时不启用。可使用 /sid 指令获取在平台上的会话 ID(类似 abc:GroupMessage:123)。管理员可在 WebUI 的配置文件 -> 访问控制 -> 白名单中管理白名单。", + }, + "id_whitelist_log": { + "type": "bool", + "hint": "启用后,当一条消息没通过白名单时,会输出 INFO 级别的日志。", + }, + "wl_ignore_admin_on_group": { + "type": "bool", + }, + "wl_ignore_admin_on_friend": { + "type": "bool", + }, + "reply_with_mention": { + "type": "bool", + "hint": "启用后,机器人回复消息时会 @ 发送者。实际效果以具体的平台适配器为准。", + }, + "reply_with_quote": { + "type": "bool", + "hint": "启用后,机器人回复消息时会引用原消息。实际效果以具体的平台适配器为准。", + }, + "path_mapping": { + "type": "list", + "items": {"type": "string"}, + "hint": "此功能解决由于文件系统不一致导致路径不存在的问题。格式为 <原路径>:<映射路径>。如 `/app/.config/QQ:/var/lib/docker/volumes/xxxx/_data`。这样,当消息平台下发的事件中图片和语音路径以 `/app/.config/QQ` 开头时,开头被替换为 `/var/lib/docker/volumes/xxxx/_data`。这在 AstrBot 或者平台协议端使用 Docker 部署时特别有用。", + }, + }, + }, + "content_safety": { + "type": "object", + "items": { + "also_use_in_response": { + "type": "bool", + "hint": "启用后,大模型的响应也会通过内容安全审核。", + }, + "baidu_aip": { + "type": "object", + "items": { + "enable": { + "type": "bool", + "hint": "启用此功能前,您需要手动在设备中安装 baidu-aip 库。一般来说,安装指令如下: `pip3 install baidu-aip`", + }, + "app_id": {"description": "APP ID", "type": "string"}, + "api_key": { + "description": "API Key", + "type": "string", + "secret": True, + }, + "secret_key": { + "type": "string", + "secret": True, + }, + }, + }, + "internal_keywords": { + "type": "object", + "items": { + "enable": { + "type": "bool", + }, + "extra_keywords": { + "type": "list", + "items": {"type": "string"}, + "hint": "额外的屏蔽关键词列表,支持正则表达式。", + }, + }, + }, + }, + }, + }, + }, + "provider_group": { + "name": "服务提供商", + "metadata": { + "provider": { + "type": "list", + # provider sources templates + "config_template": { + "OpenAI Compatible": { + "id": "openai", + "provider": "openai", + "type": "openai_chat_completion", + "provider_type": "chat_completion", + "enable": True, + "key": [], + "api_base": "https://api.openai.com/v1", + "timeout": 120, + "proxy": "", + "custom_headers": {}, + }, + "OpenAI Responses": { + "id": "openai-responses", + "provider": "openai", + "type": "openai_responses", + "provider_type": "chat_completion", + "enable": True, + "key": [], + "api_base": "https://api.openai.com/v1", + "timeout": 120, + "proxy": "", + "custom_headers": {}, + }, + "Google Gemini": { + "id": "google_gemini", + "provider": "google", + "type": "googlegenai_chat_completion", + "provider_type": "chat_completion", + "enable": True, + "key": [], + "api_base": "https://generativelanguage.googleapis.com/", + "timeout": 120, + "gm_resp_image_modal": False, + "gm_native_search": False, + "gm_native_coderunner": False, + "gm_url_context": False, + "gm_safety_settings": { + "harassment": "BLOCK_MEDIUM_AND_ABOVE", + "hate_speech": "BLOCK_MEDIUM_AND_ABOVE", + "sexually_explicit": "BLOCK_MEDIUM_AND_ABOVE", + "dangerous_content": "BLOCK_MEDIUM_AND_ABOVE", + }, + "gm_thinking_config": {"budget": 0, "level": "HIGH"}, + "proxy": "", + }, + "Anthropic": { + "id": "anthropic", + "provider": "anthropic", + "type": "anthropic_chat_completion", + "provider_type": "chat_completion", + "enable": True, + "key": [], + "api_base": "https://api.anthropic.com", + "timeout": 120, + "proxy": "", + "custom_headers": {}, + "anth_thinking_config": {"type": "", "budget": 0, "effort": ""}, + }, + "Kimi Coding Plan": { + "id": "kimi-code", + "provider": "kimi-code", + "type": "kimi_code_chat_completion", + "provider_type": "chat_completion", + "enable": True, + "key": [], + "api_base": "https://api.kimi.com/coding", + "timeout": 120, + "proxy": "", + "custom_headers": {}, + "anth_thinking_config": {"type": "", "budget": 0, "effort": ""}, + }, + "Moonshot": { + "id": "moonshot", + "provider": "moonshot", + "type": "openai_chat_completion", + "provider_type": "chat_completion", + "enable": True, + "key": [], + "timeout": 120, + "api_base": "https://api.moonshot.cn/v1", + "proxy": "", + "custom_headers": {}, + }, + "MiniMax": { + "id": "minimax", + "provider": "minimax", + "type": "openai_chat_completion", + "provider_type": "chat_completion", + "enable": True, + "key": [], + "api_base": "https://api.minimaxi.com/v1", + "timeout": 120, + "proxy": "", + "custom_headers": {}, + }, + "MiniMax Token Plan": { + "id": "minimax-token-plan", + "provider": "minimax-token-plan", + "type": "minimax_token_plan", + "provider_type": "chat_completion", + "enable": True, + "key": [], + "api_base": "https://api.minimaxi.com/anthropic", + "timeout": 120, + "proxy": "", + "custom_headers": {}, + "anth_thinking_config": {"type": "", "budget": 0, "effort": ""}, + }, + "Xiaomi": { + "id": "xiaomi", + "provider": "xiaomi", + "type": "xiaomi_chat_completion", + "provider_type": "chat_completion", + "enable": True, + "key": [], + "api_base": "https://api.xiaomimimo.com/v1", + "timeout": 120, + "proxy": "", + "custom_headers": {}, + }, + "Xiaomi Token Plan": { + "id": "xiaomi-token-plan", + "provider": "xiaomi-token-plan", + "type": "xiaomi_token_plan", + "provider_type": "chat_completion", + "enable": True, + "key": [], + "api_base": "https://token-plan-cn.xiaomimimo.com/anthropic", + "timeout": 120, + "proxy": "", + "custom_headers": {}, + "anth_thinking_config": {"type": "", "budget": 0, "effort": ""}, + }, + "xAI": { + "id": "xai", + "provider": "xai", + "type": "openai_responses", + "provider_type": "chat_completion", + "enable": True, + "key": [], + "api_base": "https://api.x.ai/v1", + "timeout": 120, + "proxy": "", + "custom_headers": {}, + }, + "DeepSeek": { + "id": "deepseek", + "provider": "deepseek", + "type": "openai_chat_completion", + "provider_type": "chat_completion", + "enable": True, + "key": [], + "api_base": "https://api.deepseek.com/v1", + "timeout": 120, + "proxy": "", + "custom_headers": {}, + }, + "DeepSeek Responses": { + "id": "deepseek-responses", + "provider": "deepseek", + "type": "openai_responses", + "provider_type": "chat_completion", + "enable": True, + "key": [], + "api_base": "https://api.deepseek.com/v1", + "timeout": 120, + "proxy": "", + "custom_headers": {}, + }, + "Zhipu": { + "id": "zhipu", + "provider": "zhipu", + "type": "zhipu_chat_completion", + "provider_type": "chat_completion", + "enable": True, + "key": [], + "timeout": 120, + "api_base": "https://open.bigmodel.cn/api/paas/v4/", + "proxy": "", + "custom_headers": {}, + }, + "LongCat": { + "id": "longcat", + "provider": "longcat", + "type": "longcat_chat_completion", + "provider_type": "chat_completion", + "enable": True, + "key": [], + "api_base": "https://api.longcat.chat/openai", + "timeout": 120, + "proxy": "", + "custom_headers": {}, + }, + "AIHubMix": { + "id": "aihubmix", + "provider": "aihubmix", + "type": "aihubmix_chat_completion", + "provider_type": "chat_completion", + "enable": True, + "key": [], + "timeout": 120, + "api_base": "https://aihubmix.com/v1", + "proxy": "", + "custom_headers": {}, + }, + "MiraRouter": { + "id": "mirarouter", + "provider": "mirarouter", + "type": "mirarouter_chat_completion", + "provider_type": "chat_completion", + "enable": True, + "key": [], + "timeout": 120, + "api_base": "https://api.mirarouter.com/v1", + "proxy": "", + "custom_headers": {}, + }, + "OpenRouter": { + "id": "openrouter", + "provider": "openrouter", + "type": "openrouter_chat_completion", + "provider_type": "chat_completion", + "enable": True, + "key": [], + "timeout": 120, + "api_base": "https://openrouter.ai/api/v1", + "proxy": "", + "custom_headers": {}, + }, + "SSYCloud(胜算云)": { + "id": "ssycloud", + "provider": "ssycloud", + "type": "ssycloud_chat_completion", + "provider_type": "chat_completion", + "enable": True, + "key": [], + "timeout": 120, + "api_base": "https://router.shengsuanyun.com/api/v1", + "proxy": "", + "custom_headers": {"X-Title": "AstrBot"}, + }, + "NVIDIA": { + "id": "nvidia", + "provider": "nvidia", + "type": "openai_chat_completion", + "provider_type": "chat_completion", + "enable": True, + "key": [], + "api_base": "https://integrate.api.nvidia.com/v1", + "timeout": 120, + "proxy": "", + "custom_headers": {}, + }, + "Azure OpenAI": { + "id": "azure_openai", + "provider": "azure", + "type": "openai_chat_completion", + "provider_type": "chat_completion", + "enable": True, + "api_version": "2024-05-01-preview", + "key": [], + "api_base": "", + "timeout": 120, + "proxy": "", + "custom_headers": {}, + }, + "Ollama": { + "id": "ollama", + "provider": "ollama", + "type": "openai_chat_completion", + "provider_type": "chat_completion", + "enable": True, + "key": ["ollama"], # ollama 的 key 默认是 ollama + "api_base": "http://127.0.0.1:11434/v1", + "proxy": "", + "custom_headers": {}, + "ollama_disable_thinking": False, + }, + "LM Studio": { + "id": "lm_studio", + "provider": "lm_studio", + "type": "openai_chat_completion", + "provider_type": "chat_completion", + "enable": True, + "key": ["lmstudio"], + "api_base": "http://127.0.0.1:1234/v1", + "proxy": "", + "custom_headers": {}, + }, + "Gemini_OpenAI_API": { + "id": "google_gemini_openai", + "provider": "google", + "type": "openai_chat_completion", + "provider_type": "chat_completion", + "enable": True, + "key": [], + "api_base": "https://generativelanguage.googleapis.com/v1beta/openai/", + "timeout": 120, + "proxy": "", + "custom_headers": {}, + }, + "Groq": { + "id": "groq", + "provider": "groq", + "type": "groq_chat_completion", + "provider_type": "chat_completion", + "enable": True, + "key": [], + "api_base": "https://api.groq.com/openai/v1", + "timeout": 120, + "proxy": "", + "custom_headers": {}, + }, + "302.AI": { + "id": "302ai", + "provider": "302ai", + "type": "openai_chat_completion", + "provider_type": "chat_completion", + "enable": True, + "key": [], + "api_base": "https://api.302.ai/v1", + "timeout": 120, + "proxy": "", + "custom_headers": {}, + }, + "SiliconFlow": { + "id": "siliconflow", + "provider": "siliconflow", + "type": "openai_chat_completion", + "provider_type": "chat_completion", + "enable": True, + "key": [], + "timeout": 120, + "api_base": "https://api.siliconflow.cn/v1", + "proxy": "", + "custom_headers": {}, + }, + "PPIO": { + "id": "ppio", + "provider": "ppio", + "type": "openai_chat_completion", + "provider_type": "chat_completion", + "enable": True, + "key": [], + "api_base": "https://api.ppinfra.com/v3/openai", + "timeout": 120, + "proxy": "", + "custom_headers": {}, + }, + "TokenPony": { + "id": "tokenpony", + "provider": "tokenpony", + "type": "openai_chat_completion", + "provider_type": "chat_completion", + "enable": True, + "key": [], + "api_base": "https://api.tokenpony.cn/v1", + "timeout": 120, + "proxy": "", + "custom_headers": {}, + }, + "Compshare": { + "id": "compshare", + "provider": "compshare", + "type": "openai_chat_completion", + "provider_type": "chat_completion", + "enable": True, + "key": [], + "api_base": "https://api.modelverse.cn/v1", + "timeout": 120, + "proxy": "", + "custom_headers": {}, + }, + "ModelScope": { + "id": "modelscope", + "provider": "modelscope", + "type": "openai_chat_completion", + "provider_type": "chat_completion", + "enable": True, + "key": [], + "timeout": 120, + "api_base": "https://api-inference.modelscope.cn/v1", + "proxy": "", + "custom_headers": {}, + }, + "FastGPT": { + "id": "fastgpt", + "provider": "fastgpt", + "type": "openai_chat_completion", + "provider_type": "chat_completion", + "enable": True, + "key": [], + "api_base": "https://api.fastgpt.in/api/v1", + "timeout": 60, + "proxy": "", + "custom_headers": {}, + "custom_extra_body": {}, + }, + "Whisper(API)": { + "id": "whisper", + "provider": "openai", + "type": "openai_whisper_api", + "provider_type": "speech_to_text", + "enable": False, + "api_key": "", + "api_base": "", + "model": "whisper-1", + "proxy": "", + }, + "MiMo STT(API)": { + "id": "mimo_stt", + "provider": "mimo", + "type": "mimo_stt_api", + "provider_type": "speech_to_text", + "enable": False, + "api_key": "", + "api_base": "https://api.xiaomimimo.com/v1", + "model": "mimo-v2.5-asr", + "timeout": "20", + "proxy": "", + }, + "Whisper(Local)": { + "provider": "openai", + "type": "openai_whisper_selfhost", + "provider_type": "speech_to_text", + "enable": False, + "id": "whisper_selfhost", + "model": "tiny", + "whisper_device": "cpu", + }, + "SenseVoice(Local)": { + "type": "sensevoice_stt_selfhost", + "provider": "sensevoice", + "provider_type": "speech_to_text", + "enable": False, + "id": "sensevoice", + "stt_model": "iic/SenseVoiceSmall", + "is_emotion": False, + }, + "OpenAI TTS(API)": { + "id": "openai_tts", + "type": "openai_tts_api", + "provider": "openai", + "provider_type": "text_to_speech", + "enable": False, + "api_key": "", + "api_base": "", + "model": "tts-1", + "openai-tts-voice": "alloy", + "timeout": "20", + "proxy": "", + }, + "MiMo TTS(API)": { + "id": "mimo_tts", + "type": "mimo_tts_api", + "provider": "mimo", + "provider_type": "text_to_speech", + "enable": False, + "api_key": "", + "api_base": "https://api.xiaomimimo.com/v1", + "model": "mimo-v2.5-tts", + "mimo-tts-voice": "mimo_default", + "mimo-tts-format": "wav", + "mimo-tts-style-prompt": "", + "mimo-tts-dialect": "", + "mimo-tts-seed-text": "Hello, MiMo, have you had lunch?", + "timeout": "20", + "proxy": "", + }, + "Genie TTS": { + "id": "genie_tts", + "provider": "genie_tts", + "type": "genie_tts", + "provider_type": "text_to_speech", + "enable": False, + "genie_character_name": "mika", + "genie_onnx_model_dir": "CharacterModels/v2ProPlus/mika/tts_models", + "genie_language": "Japanese", + "genie_refer_audio_path": "", + "genie_refer_text": "", + "timeout": 20, + }, + "Edge TTS": { + "id": "edge_tts", + "provider": "microsoft", + "type": "edge_tts", + "provider_type": "text_to_speech", + "enable": False, + "edge-tts-voice": "zh-CN-XiaoxiaoNeural", + "rate": "+0%", + "volume": "+0%", + "pitch": "+0Hz", + "timeout": 20, + }, + "GSV TTS(Local)": { + "id": "gsv_tts", + "enable": False, + "provider": "gpt_sovits", + "type": "gsv_tts_selfhost", + "provider_type": "text_to_speech", + "api_base": "http://127.0.0.1:9880", + "gpt_weights_path": "", + "sovits_weights_path": "", + "timeout": 60, + "gsv_default_parms": { + "gsv_ref_audio_path": "", + "gsv_prompt_text": "", + "gsv_prompt_lang": "zh", + "gsv_aux_ref_audio_paths": "", + "gsv_text_lang": "zh", + "gsv_top_k": 5, + "gsv_top_p": 1.0, + "gsv_temperature": 1.0, + "gsv_text_split_method": "cut3", + "gsv_batch_size": 1, + "gsv_batch_threshold": 0.75, + "gsv_split_bucket": True, + "gsv_speed_factor": 1, + "gsv_fragment_interval": 0.3, + "gsv_streaming_mode": False, + "gsv_seed": -1, + "gsv_parallel_infer": True, + "gsv_repetition_penalty": 1.35, + "gsv_media_type": "wav", + }, + }, + "GSVI TTS(API)": { + "id": "gsvi_tts", + "type": "gsvi_tts_api", + "provider": "gpt_sovits_inference", + "provider_type": "text_to_speech", + "enable": False, + "api_key": "", + "api_base": "http://127.0.0.1:8000", + "version": "v4", + "character": "", + "prompt_text_lang": "中文", + "emotion": "默认", + "text_lang": "中文", + "timeout": 20, + }, + "FishAudio TTS(API)": { + "id": "fishaudio_tts", + "provider": "fishaudio", + "type": "fishaudio_tts_api", + "provider_type": "text_to_speech", + "enable": False, + "api_key": "", + "api_base": "https://api.fish.audio/v1", + "model": "s2-pro", + "fishaudio-tts-character": "可莉", + "fishaudio-tts-reference-id": "", + "timeout": "20", + "proxy": "", + }, + "阿里云百炼 TTS(API)": { + "hint": "API Key 从 https://bailian.console.aliyun.com/?tab=model#/api-key 获取。模型和音色的选择文档请参考: 阿里云百炼语音合成音色名称。具体可参考 https://help.aliyun.com/zh/model-studio/speech-synthesis-and-speech-recognition", + "id": "dashscope_tts", + "provider": "dashscope", + "type": "dashscope_tts", + "provider_type": "text_to_speech", + "enable": False, + "api_key": "", + "model": "cosyvoice-v1", + "dashscope_tts_voice": "loongstella", + "timeout": "20", + }, + "Azure TTS": { + "id": "azure_tts", + "type": "azure_tts", + "provider": "azure", + "provider_type": "text_to_speech", + "enable": True, + "azure_tts_voice": "zh-CN-YunxiaNeural", + "azure_tts_style": "cheerful", + "azure_tts_role": "Boy", + "azure_tts_rate": "1", + "azure_tts_volume": "100", + "azure_tts_subscription_key": "", + "azure_tts_region": "eastus", + "proxy": "", + }, + "MiniMax TTS(API)": { + "id": "minimax_tts", + "type": "minimax_tts_api", + "provider": "minimax", + "provider_type": "text_to_speech", + "enable": False, + "api_key": "", + "api_base": "https://api.minimax.chat/v1/t2a_v2", + "minimax-group-id": "", + "model": "speech-02-turbo", + "minimax-langboost": "auto", + "minimax-voice-speed": 1.0, + "minimax-voice-vol": 1.0, + "minimax-voice-pitch": 0, + "minimax-is-timber-weight": False, + "minimax-voice-id": "female-shaonv", + "minimax-timber-weight": '[\n {\n "voice_id": "Chinese (Mandarin)_Warm_Girl",\n "weight": 25\n },\n {\n "voice_id": "Chinese (Mandarin)_BashfulGirl",\n "weight": 50\n }\n]', + "minimax-voice-emotion": "auto", + "minimax-voice-latex": False, + "minimax-voice-english-normalization": False, + "timeout": 20, + "proxy": "", + }, + "火山引擎_TTS(API)": { + "id": "volcengine_tts", + "type": "volcengine_tts", + "provider": "volcengine", + "provider_type": "text_to_speech", + "enable": False, + "api_key": "", + "appid": "", + "volcengine_cluster": "volcano_tts", + "volcengine_voice_type": "", + "volcengine_speed_ratio": 1.0, + "api_base": "https://openspeech.bytedance.com/api/v1/tts", + "timeout": 20, + "proxy": "", + }, + "Gemini TTS": { + "id": "gemini_tts", + "type": "gemini_tts", + "provider": "google", + "provider_type": "text_to_speech", + "enable": False, + "gemini_tts_api_key": "", + "gemini_tts_api_base": "", + "gemini_tts_timeout": 20, + "gemini_tts_model": "gemini-3.8-flash-tts", + "gemini_tts_prefix": "", + "gemini_tts_voice_name": "Leda", + "proxy": "", + }, + "ElevenLabs TTS(API)": { + "hint": "API Key 从 https://elevenlabs.io/app/settings/api-keys 获取。Voice ID 可在 https://elevenlabs.io/app/voice-library 浏览选择。", + "id": "elevenlabs_tts", + "type": "elevenlabs_tts_api", + "provider": "elevenlabs", + "provider_type": "text_to_speech", + "enable": False, + "api_key": "", + "api_base": "https://api.elevenlabs.io/v1", + "model": "eleven_multilingual_v2", + "elevenlabs-tts-voice-id": "JBFqnCBsd6RMkjVDRZzb", + "elevenlabs-tts-output-format": "mp3_44100_128", + "elevenlabs-tts-stability": "", + "elevenlabs-tts-similarity-boost": "", + "elevenlabs-tts-style": "", + "elevenlabs-tts-use-speaker-boost": True, + "timeout": "20", + "proxy": "", + }, + "OpenAI Embedding": { + "id": "openai_embedding", + "type": "openai_embedding", + "provider": "openai", + "provider_type": "embedding", + "hint": "provider_group.provider.openai_embedding.hint", + "enable": True, + "embedding_api_key": "", + "embedding_api_base": "", + "embedding_model": "", + "embedding_dimensions": 1024, + "embedding_dimensions_mode": "auto", + "timeout": 20, + "proxy": "", + }, + "Gemini Embedding": { + "id": "gemini_embedding", + "type": "gemini_embedding", + "provider": "google", + "provider_type": "embedding", + "hint": "provider_group.provider.gemini_embedding.hint", + "enable": True, + "embedding_api_key": "", + "embedding_api_base": "", + "embedding_model": "gemini-embedding-001", + "embedding_dimensions": 768, + "embedding_task_type_mode": "auto", + "embedding_query_task_type": "RETRIEVAL_QUERY", + "embedding_document_task_type": "RETRIEVAL_DOCUMENT", + "embedding_query_task_name": "search result", + "embedding_document_title": "", + "timeout": 20, + "proxy": "", + }, + "NVIDIA Embedding": { + "id": "nvidia_embedding", + "type": "nvidia_embedding", + "provider": "nvidia", + "provider_type": "embedding", + "hint": "provider_group.provider.nvidia_embedding.hint", + "enable": True, + "embedding_api_key": "", + "embedding_api_base": "https://integrate.api.nvidia.com/v1", + "embedding_model": "nvidia/nemotron-3-embed-1b", + "input_type": "passage", + "query_input_type": "query", + "embedding_dimensions": 2048, + "timeout": 20, + "proxy": "", + }, + "Ollama Embedding": { + "id": "ollama_embedding", + "type": "ollama_embedding", + "provider": "ollama", + "provider_type": "embedding", + "hint": "provider_group.provider.ollama_embedding.hint", + "enable": True, + "embedding_api_base": "http://localhost:11434", + "embedding_model": "nomic-embed-text", + "embedding_dimensions": 768, + "timeout": 60, + "proxy": "", + }, + "DashScope Embedding": { + "id": "dashscope_embedding", + "type": "dashscope_embedding", + "provider": "dashscope", + "provider_type": "embedding", + "hint": "provider_group.provider.dashscope_embedding.hint", + "enable": True, + "embedding_api_key": "", + "embedding_api_base": "https://dashscope.aliyuncs.com/api/v1", + "embedding_model": "text-embedding-v4", + "embedding_text_type_mode": "auto", + "embedding_dimensions": 1024, + "timeout": 60, + "proxy": "", + }, + "vLLM Rerank": { + "id": "vllm_rerank", + "type": "vllm_rerank", + "provider": "vllm", + "provider_type": "rerank", + "enable": True, + "rerank_api_key": "", + "rerank_api_base": "http://127.0.0.1:8000", + "rerank_api_suffix": "/v1/rerank", + "rerank_model": "BAAI/bge-reranker-base", + "timeout": 20, + }, + "Xinference Rerank": { + "id": "xinference_rerank", + "type": "xinference_rerank", + "provider": "xinference", + "provider_type": "rerank", + "enable": True, + "rerank_api_key": "", + "rerank_api_base": "http://127.0.0.1:9997", + "rerank_model": "BAAI/bge-reranker-base", + "timeout": 20, + "launch_model_if_not_running": False, + }, + "阿里云百炼重排序": { + "id": "bailian_rerank", + "type": "bailian_rerank", + "provider": "bailian", + "provider_type": "rerank", + "enable": True, + "rerank_api_key": "", + "rerank_api_base": "https://dashscope.aliyuncs.com/api/v1/services/rerank/text-rerank/text-rerank", + "rerank_model": "qwen3-rerank", + "timeout": 30, + "return_documents": False, + "instruct": "", + }, + "NVIDIA Rerank": { + "id": "nvidia_rerank", + "type": "nvidia_rerank", + "provider": "nvidia", + "provider_type": "rerank", + "enable": True, + "nvidia_rerank_api_key": "", + "nvidia_rerank_api_base": "https://ai.api.nvidia.com/v1/retrieval", + "nvidia_rerank_model": "nvidia/llama-nemotron-rerank-vl-1b-v2", + "nvidia_rerank_model_endpoint": "/reranking", + "timeout": 20, + "nvidia_rerank_truncate": "", + }, + "TEI Rerank": { + "id": "tei_rerank", + "type": "tei_rerank", + "provider": "huggingface", + "provider_type": "rerank", + "enable": True, + "rerank_api_key": "", + "rerank_api_base": "http://127.0.0.1:8080", + "timeout": 20, + "tei_rerank_truncate": False, + "tei_rerank_truncation_direction": "Right", + "tei_rerank_raw_scores": False, + "tei_rerank_return_text": False, + }, + "TypeSafe System One": { + "id": "typesafe_decision", + "type": "system_one_decision", + "provider": "typesafe", + "provider_type": "decision", + "enable": True, + "key": "", + "api_base": "https://api.typesafe.ai/v1/systemone", + "model": "jev-latest", + "timeout": 2, + "total_timeout": 5, + "max_concurrency": 4, + "proxy": "", + "custom_headers": {}, + }, + "OpenRouter System One": { + "id": "openrouter_decision", + "type": "system_one_decision", + "provider": "openrouter", + "provider_type": "decision", + "enable": True, + "key": "", + "api_base": "https://openrouter.ai/api/v1/systemone", + "model": "jev-latest", + "timeout": 2, + "total_timeout": 5, + "max_concurrency": 4, + "proxy": "", + "custom_headers": {}, + }, + "Vercel System One": { + "id": "vercel_decision", + "type": "system_one_decision", + "provider": "vercel", + "provider_type": "decision", + "enable": True, + "key": "", + "api_base": "https://ai-gateway.vercel.sh/typesafe/v1/systemone", + "model": "typesafe-ai/jev", + "timeout": 2, + "total_timeout": 5, + "max_concurrency": 4, + "proxy": "", + "custom_headers": {}, + }, + "Custom System One": { + "id": "custom_decision", + "type": "system_one_decision", + "provider": "custom", + "provider_type": "decision", + "enable": True, + "key": "", + "api_base": "", + "model": "", + "timeout": 2, + "total_timeout": 5, + "max_concurrency": 4, + "proxy": "", + "custom_headers": {}, + }, + "Xinference STT": { + "id": "xinference_stt", + "type": "xinference_stt", + "provider": "xinference", + "provider_type": "speech_to_text", + "enable": False, + "api_key": "", + "api_base": "http://127.0.0.1:9997", + "model": "whisper-large-v3", + "timeout": 180, + "launch_model_if_not_running": False, + }, + }, + "items": { + "genie_onnx_model_dir": { + "description": "ONNX Model Directory", + "type": "string", + "hint": "The directory path containing the ONNX model files", + }, + "genie_language": { + "description": "Language", + "type": "string", + "options": ["Japanese", "English", "Chinese"], + }, + "provider_source_id": { + "invisible": True, + "type": "string", + }, + "api_key": { + "description": "API Key", + "type": "string", + "secret": True, + }, + "dashscope_api_key": { + "description": "DashScope API Key", + "type": "string", + "secret": True, + }, + "gemini_tts_api_key": { + "description": "Gemini API Key", + "type": "string", + "secret": True, + }, + "xai_native_search": { + "description": "启用原生搜索功能", + "type": "bool", + "hint": "启用后,将通过 xAI 的 Chat Completions 原生 Live Search 进行联网检索(按需计费)。仅对 xAI 提供商生效。", + "condition": { + "provider": "xai", + "type": "xai_chat_completion", + }, + }, + "rerank_api_base": { + "description": "重排序模型 API Base URL", + "type": "string", + "hint": "最终请求路径由 Base URL 和路径后缀拼接而成(默认为 /v1/rerank)。", + }, + "rerank_api_suffix": { + "description": "API URL 路径后缀", + "type": "string", + "hint": "追加到 base_url 后的路径,如 /v1/rerank。留空则不追加。", + }, + "rerank_api_key": { + "description": "API Key", + "type": "string", + "hint": "如果不需要 API Key, 请留空。", + "secret": True, + }, + "rerank_model": { + "description": "重排序模型名称", + "type": "string", + }, + "return_documents": { + "description": "是否在排序结果中返回文档原文", + "type": "bool", + "hint": "默认值false,以减少网络传输开销。", + }, + "instruct": { + "description": "自定义排序任务类型说明", + "type": "string", + "hint": "仅在使用 qwen3-rerank 模型时生效。建议使用英文撰写。", + }, + "launch_model_if_not_running": { + "description": "模型未运行时自动启动", + "type": "bool", + "hint": "如果模型当前未在 Xinference 服务中运行,是否尝试自动启动它。在生产环境中建议关闭。", + }, + "nvidia_rerank_api_base": { + "description": "API Base URL", + "type": "string", + }, + "nvidia_rerank_api_key": { + "description": "API Key", + "type": "string", + "secret": True, + }, + "nvidia_rerank_model": { + "description": "重排序模型名称", + "type": "string", + "hint": "请参照NVIDIA Docs中模型名称填写。", + }, + "nvidia_rerank_model_endpoint": { + "description": "自定义模型端点", + "type": "string", + "hint": "自定义URL末尾端点,默认为 /reranking", + }, + "nvidia_rerank_truncate": { + "description": "文本截断策略", + "type": "string", + "hint": "当输入文本过长时,是否截断输入以适应模型的最大上下文长度。", + "options": [ + "", + "NONE", + "END", + ], + }, + "tei_rerank_truncate": { + "description": "截断超长文本", + "type": "bool", + "hint": "当输入超过模型最大上下文长度时,是否自动截断。启用后需配合 截断方向 使用。", + }, + "tei_rerank_truncation_direction": { + "description": "截断方向", + "type": "string", + "options": ["left", "right"], + "hint": "选择从文本的左侧(left)还是右侧(right)开始截断。仅在 截断超长文本 为 True 时生效。", + }, + "tei_rerank_raw_scores": { + "description": "返回原始分数", + "type": "bool", + "hint": "如果为 True,返回模型原始 logit 分数(可能为负值),不经过 sigmoid 归一化。默认 False。", + }, + "tei_rerank_return_text": { + "description": "返回排序结果中的文档原文", + "type": "bool", + "hint": "如果为 True,每个排序结果将附带原始文本。默认 False 以减少网络传输。", + }, + "modalities": { + "description": "模型能力", + "type": "list", + "items": {"type": "string"}, + "options": ["text", "image", "audio", "tool_use"], + "labels": ["文本", "图像", "音频", "工具使用"], + "render_type": "checkbox", + "hint": "模型支持的模态及能力。", + }, + "custom_headers": { + "description": "自定义请求头", + "type": "dict", + "items": {}, + "hint": "此处添加的键值对将作为自定义 HTTP 请求头,附加到 AstrBot 发往模型服务商的请求中。值必须为字符串。", + }, + "ollama_disable_thinking": { + "description": "关闭思考模式", + "type": "bool", + "hint": "关闭 Ollama 思考模式。", + }, + "custom_extra_body": { + "description": "自定义请求体参数", + "type": "dict", + "items": {}, + "hint": "用于在请求时添加额外的参数,如 temperature, top_p, max_tokens, reasoning_effort 等。", + "template_schema": { + "temperature": { + "name": "Temperature", + "description": "温度参数", + "hint": "控制输出的随机性,范围通常为 0-2。值越高越随机。", + "type": "float", + "default": 0.6, + "slider": {"min": 0, "max": 2, "step": 0.1}, + }, + "top_p": { + "name": "Top-p", + "description": "Top-p 采样", + "hint": "核采样参数,范围通常为 0-1。控制模型考虑的概率质量。", + "type": "float", + "default": 1.0, + "slider": {"min": 0, "max": 1, "step": 0.01}, + }, + "max_tokens": { + "name": "Max Tokens", + "description": "最大词元(Tokens)数", + "hint": "生成的最大词元(Tokens)数。", + "type": "int", + "default": 8192, + }, + "reasoning_effort": { + "name": "Reasoning Effort", + "description": "推理强度", + "hint": "控制推理模型的推理强度,支持的值取决于具体模型。", + "type": "string", + "default": "high", + }, + }, + }, + "provider": { + "type": "string", + "invisible": True, + }, + "gpt_weights_path": { + "description": "GPT模型文件路径", + "type": "string", + "hint": "即“.ckpt”后缀的文件,请使用绝对路径,路径两端不要带双引号,不填则默认用GPT_SoVITS内置的SoVITS模型(建议直接在GPT_SoVITS中改默认模型)", + }, + "sovits_weights_path": { + "description": "SoVITS模型文件路径", + "type": "string", + "hint": "即“.pth”后缀的文件,请使用绝对路径,路径两端不要带双引号,不填则默认用GPT_SoVITS内置的SoVITS模型(建议直接在GPT_SoVITS中改默认模型)", + }, + "gsv_default_parms": { + "description": "GPT_SoVITS默认参数", + "hint": "参考音频文件路径、参考音频文本必填,其他参数根据个人爱好自行填写", + "type": "object", + "items": { + "gsv_ref_audio_path": { + "description": "参考音频文件路径", + "type": "string", + "hint": "必填!请使用绝对路径!路径两端不要带双引号!", + }, + "gsv_prompt_text": { + "description": "参考音频文本", + "type": "string", + "hint": "必填!请填写参考音频讲述的文本", + }, + "gsv_prompt_lang": { + "description": "参考音频文本语言", + "type": "string", + "hint": "请填写参考音频讲述的文本的语言,默认为中文", + }, + "gsv_aux_ref_audio_paths": { + "description": "辅助参考音频文件路径", + "type": "string", + "hint": "辅助参考音频文件,可不填", + }, + "gsv_text_lang": { + "description": "文本语言", + "type": "string", + "hint": "默认为中文", + }, + "gsv_top_k": { + "description": "生成语音的多样性", + "type": "int", + "hint": "", + }, + "gsv_top_p": { + "description": "核采样的阈值", + "type": "float", + "hint": "", + }, + "gsv_temperature": { + "description": "生成语音的随机性", + "type": "float", + "hint": "", + }, + "gsv_text_split_method": { + "description": "切分文本的方法", + "type": "string", + "hint": "可选值: `cut0`:不切分 `cut1`:四句一切 `cut2`:50字一切 `cut3`:按中文句号切 `cut4`:按英文句号切 `cut5`:按标点符号切", + "options": [ + "cut0", + "cut1", + "cut2", + "cut3", + "cut4", + "cut5", + ], + }, + "gsv_batch_size": { + "description": "批处理大小", + "type": "int", + "hint": "", + }, + "gsv_batch_threshold": { + "description": "批处理阈值", + "type": "float", + "hint": "", + }, + "gsv_split_bucket": { + "description": "将文本分割成桶以便并行处理", + "type": "bool", + "hint": "", + }, + "gsv_speed_factor": { + "description": "语音播放速度", + "type": "float", + "hint": "1为原始语速", + }, + "gsv_fragment_interval": { + "description": "语音片段之间的间隔时间", + "type": "float", + "hint": "", + }, + "gsv_streaming_mode": { + "description": "启用流模式", + "type": "bool", + "hint": "", + }, + "gsv_seed": { + "description": "随机种子", + "type": "int", + "hint": "用于结果的可重复性", + }, + "gsv_parallel_infer": { + "description": "并行执行推理", + "type": "bool", + "hint": "", + }, + "gsv_repetition_penalty": { + "description": "重复惩罚因子", + "type": "float", + "hint": "", + }, + "gsv_media_type": { + "description": "输出媒体的类型", + "type": "string", + "hint": "建议用wav", + }, + }, + }, + "embedding_dimensions": { + "description": "嵌入维度", + "type": "int", + "hint": "嵌入向量的维度。根据模型不同,可能需要调整,请参考具体模型的文档。此配置项请务必填写正确,否则将导致向量数据库无法正常工作。", + "_special": "get_embedding_dim", + }, + "embedding_dimensions_mode": { + "description": "嵌入维度参数发送模式", + "type": "string", + "options": ["auto", "always", "never"], + "hint": "控制是否在 OpenAI 兼容 Embedding 请求中发送 dimensions 参数。auto 会仅对官方 OpenAI embedding-3 模型自动发送;第三方兼容 API 如需该参数可改为 always,报错时改为 never。", + }, + "embedding_model": { + "description": "嵌入模型", + "type": "string", + "hint": "嵌入模型名称。", + }, + "embedding_api_key": { + "description": "API Key", + "type": "string", + "secret": True, + }, + "embedding_api_base": { + "description": "API Base URL", + "type": "string", + }, + "volcengine_cluster": { + "type": "string", + "description": "火山引擎集群", + "hint": "若使用语音复刻大模型,可选volcano_icl或volcano_icl_concurr,默认使用volcano_tts", + }, + "volcengine_voice_type": { + "type": "string", + "description": "火山引擎音色", + "hint": "输入声音id(Voice_type)", + }, + "volcengine_speed_ratio": { + "type": "float", + "description": "语速设置", + "hint": "语速设置,范围为 0.2 到 3.0,默认值为 1.0", + }, + "volcengine_volume_ratio": { + "type": "float", + "description": "音量设置", + "hint": "音量设置,范围为 0.0 到 2.0,默认值为 1.0", + }, + "azure_tts_voice": { + "type": "string", + "description": "音色设置", + "hint": "API 音色", + }, + "azure_tts_style": { + "type": "string", + "description": "风格设置", + "hint": "声音特定的讲话风格。 可以表达快乐、同情和平静等情绪。", + }, + "azure_tts_role": { + "type": "string", + "description": "模仿设置(可选)", + "hint": "讲话角色扮演。 声音可以模仿不同的年龄和性别,但声音名称不会更改。 例如,男性语音可以提高音调和改变语调来模拟女性语音,但语音名称不会更改。 如果角色缺失或不受声音的支持,则会忽略此属性。", + "options": [ + "Boy", + "Girl", + "YoungAdultFemale", + "YoungAdultMale", + "OlderAdultFemale", + "OlderAdultMale", + "SeniorFemale", + "SeniorMale", + "禁用", + ], + }, + "azure_tts_rate": { + "type": "string", + "description": "语速设置", + "hint": "指示文本的讲出速率。可在字词或句子层面应用语速。 速率变化应为原始音频的 0.5 到 2 倍。", + }, + "azure_tts_volume": { + "type": "string", + "description": "语音音量设置", + "hint": "指示语音的音量级别。 可在句子层面应用音量的变化。以从 0.0 到 100.0(从最安静到最大声,例如 75)的数字表示。 默认值为 100.0。", + }, + "azure_tts_region": { + "type": "string", + "description": "API 地区", + "hint": "Azure_TTS 处理数据所在区域,具体参考 https://learn.microsoft.com/zh-cn/azure/ai-services/speech-service/regions", + "options": [ + "southafricanorth", + "eastasia", + "southeastasia", + "australiaeast", + "centralindia", + "japaneast", + "japanwest", + "koreacentral", + "canadacentral", + "northeurope", + "westeurope", + "francecentral", + "germanywestcentral", + "norwayeast", + "swedencentral", + "switzerlandnorth", + "switzerlandwest", + "uksouth", + "uaenorth", + "brazilsouth", + "qatarcentral", + "centralus", + "eastus", + "eastus2", + "northcentralus", + "southcentralus", + "westcentralus", + "westus", + "westus2", + "westus3", + ], + }, + "azure_tts_subscription_key": { + "type": "string", + "description": "服务订阅密钥", + "hint": "Azure_TTS 服务的订阅密钥(注意不是令牌)", + "secret": True, + }, + "dashscope_tts_voice": {"description": "音色", "type": "string"}, + "gm_resp_image_modal": { + "description": "启用图片模态", + "type": "bool", + "hint": "启用后,将支持返回图片内容。需要模型支持,否则会报错。具体支持模型请查看 Google Gemini 官方网站。温馨提示,如果您需要生成图片,请关闭 `启用群员识别` 配置获得更好的效果。", + }, + "gm_native_search": { + "description": "启用原生搜索功能", + "type": "bool", + "hint": "仅 Gemini 3 及以上模型支持与函数工具同时使用;Gemini 3 及以上模型的原生搜索仅限付费层级,计费规则请查阅官方文档", + }, + "gm_native_coderunner": { + "description": "启用原生代码执行器", + "type": "bool", + "hint": "仅 Gemini 3 及以上模型支持与函数工具同时使用", + }, + "gm_url_context": { + "description": "启用URL上下文功能", + "type": "bool", + "hint": "仅 Gemini 3 及以上模型支持与函数工具同时使用", + }, + "gm_safety_settings": { + "description": "安全过滤器", + "type": "object", + "hint": "设置模型输入的内容安全过滤级别。过滤级别分类为NONE(不屏蔽)、HIGH(高风险时屏蔽)、MEDIUM_AND_ABOVE(中等风险及以上屏蔽)、LOW_AND_ABOVE(低风险及以上时屏蔽),具体参见Gemini API文档。", + "items": { + "harassment": { + "description": "骚扰内容", + "type": "string", + "hint": "负面或有害评论", + "options": [ + "BLOCK_NONE", + "BLOCK_ONLY_HIGH", + "BLOCK_MEDIUM_AND_ABOVE", + "BLOCK_LOW_AND_ABOVE", + ], + }, + "hate_speech": { + "description": "仇恨言论", + "type": "string", + "hint": "粗鲁、无礼或亵渎性质内容", + "options": [ + "BLOCK_NONE", + "BLOCK_ONLY_HIGH", + "BLOCK_MEDIUM_AND_ABOVE", + "BLOCK_LOW_AND_ABOVE", + ], + }, + "sexually_explicit": { + "description": "露骨色情内容", + "type": "string", + "hint": "包含性行为或其他淫秽内容的引用", + "options": [ + "BLOCK_NONE", + "BLOCK_ONLY_HIGH", + "BLOCK_MEDIUM_AND_ABOVE", + "BLOCK_LOW_AND_ABOVE", + ], + }, + "dangerous_content": { + "description": "危险内容", + "type": "string", + "hint": "宣扬、助长或鼓励有害行为的信息", + "options": [ + "BLOCK_NONE", + "BLOCK_ONLY_HIGH", + "BLOCK_MEDIUM_AND_ABOVE", + "BLOCK_LOW_AND_ABOVE", + ], + }, + }, + }, + "gm_thinking_config": { + "description": "Thinking Config", + "type": "object", + "items": { + "budget": { + "description": "Thinking Budget", + "type": "int", + "hint": "Guides the model on the specific number of thinking tokens to use for reasoning. See: https://ai.google.dev/gemini-api/docs/thinking#set-budget", + }, + "level": { + "description": "Thinking Level", + "type": "string", + "hint": "Recommended for Gemini 3 models and onwards, lets you control reasoning behavior.See: https://ai.google.dev/gemini-api/docs/thinking#thinking-levels", + "options": [ + "MINIMAL", + "LOW", + "MEDIUM", + "HIGH", + ], + }, + }, + }, + "anth_thinking_config": { + "description": "思考配置", + "type": "object", + "items": { + "type": { + "description": "思考类型", + "type": "string", + "options": ["", "adaptive"], + "hint": "Opus 4.6+ / Sonnet 4.6+ 推荐设为 'adaptive'。留空则使用手动 budget 模式。参见: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking", + }, + "budget": { + "description": "思考预算", + "type": "int", + "hint": "手动 budget_tokens,需 >= 1024。仅在 type 为空时生效。Opus 4.6 / Sonnet 4.6 上已弃用。参见: https://platform.claude.com/docs/en/build-with-claude/extended-thinking", + }, + "effort": { + "description": "思考深度", + "type": "string", + "options": ["", "low", "medium", "high", "max"], + "hint": "type 为 'adaptive' 时控制思考深度。默认 'high'。'max' 仅限 Opus 4.6。参见: https://platform.claude.com/docs/en/build-with-claude/effort", + }, + }, + }, + "minimax-group-id": { + "type": "string", + "description": "用户组", + "hint": "于账户管理->基本信息中可见", + }, + "minimax-langboost": { + "type": "string", + "description": "指定语言/方言", + "hint": "增强对指定的小语种和方言的识别能力,设置后可以提升在指定小语种/方言场景下的语音表现", + "options": [ + "Chinese", + "Chinese,Yue", + "English", + "Arabic", + "Russian", + "Spanish", + "French", + "Portuguese", + "German", + "Turkish", + "Dutch", + "Ukrainian", + "Vietnamese", + "Indonesian", + "Japanese", + "Italian", + "Korean", + "Thai", + "Polish", + "Romanian", + "Greek", + "Czech", + "Finnish", + "Hindi", + "auto", + ], + }, + "minimax-voice-speed": { + "type": "float", + "description": "语速", + "hint": "生成声音的语速, 取值[0.5, 2], 默认为1.0, 取值越大,语速越快", + }, + "minimax-voice-vol": { + "type": "float", + "description": "音量", + "hint": "生成声音的音量, 取值(0, 10], 默认为1.0, 取值越大,音量越高", + }, + "minimax-voice-pitch": { + "type": "int", + "description": "语调", + "hint": "生成声音的语调, 取值[-12, 12], 默认为0", + }, + "minimax-is-timber-weight": { + "type": "bool", + "description": "启用混合音色", + "hint": "启用混合音色, 支持以自定义权重混合最多四种音色, 启用后自动忽略单一音色设置", + }, + "minimax-timber-weight": { + "type": "string", + "description": "混合音色", + "editor_mode": True, + "hint": "混合音色及其权重, 最多支持四种音色, 权重为整数, 取值[1, 100]. 可在官网API语音调试台预览代码获得预设以及编写模板, 需要严格按照json字符串格式编写, 可以查看控制台判断是否解析成功. 具体结构可参照默认值以及官网代码预览.", + }, + "minimax-voice-id": { + "type": "string", + "description": "单一音色", + "hint": "单一音色编号, 详见官网文档", + }, + "minimax-voice-emotion": { + "type": "string", + "description": "情绪", + "hint": "控制合成语音的情绪。当为 auto 时,将根据文本内容自动选择情绪。", + "options": [ + "auto", + "happy", + "sad", + "angry", + "fearful", + "disgusted", + "surprised", + "calm", + "fluent", + "whisper", + ], + }, + "minimax-voice-latex": { + "type": "bool", + "description": "支持朗读latex公式", + "hint": "朗读latex公式, 但是需要确保输入文本按官网要求格式化", + }, + "minimax-voice-english-normalization": { + "type": "bool", + "description": "支持英语文本规范化", + "hint": "可提升数字阅读场景的性能,但会略微增加延迟", + }, + "rag_options": { + "description": "RAG 选项", + "type": "object", + "hint": "检索知识库设置, 非必填。仅 Agent 应用类型支持(智能体应用, 包括 RAG 应用)。阿里云百炼应用开启此功能后将无法多轮对话。", + "items": { + "pipeline_ids": { + "description": "知识库 ID 列表", + "type": "list", + "items": {"type": "string"}, + "hint": "对指定知识库内所有文档进行检索, 前往 https://bailian.console.aliyun.com/ 数据应用->知识索引创建和获取 ID。", + }, + "file_ids": { + "description": "非结构化文档 ID, 传入该参数将对指定非结构化文档进行检索。", + "type": "list", + "items": {"type": "string"}, + "hint": "对指定非结构化文档进行检索。前往 https://bailian.console.aliyun.com/ 数据管理创建和获取 ID。", + }, + "output_reference": { + "description": "是否输出知识库/文档的引用", + "type": "bool", + "hint": "在每次回答尾部加上引用源。默认为 False。", + }, + }, + }, + "sensevoice_hint": { + "description": "部署SenseVoice", + "type": "string", + "hint": "启用前请 pip 安装 funasr、funasr_onnx、torchaudio、torch、modelscope、jieba 库(默认使用CPU,大约下载 1 GB),并且安装 ffmpeg。否则将无法正常转文字。", + }, + "is_emotion": { + "description": "情绪识别", + "type": "bool", + "hint": "是否开启情绪识别。happy|sad|angry|neutral|fearful|disgusted|surprised|unknown", + }, + "stt_model": { + "description": "模型名称", + "type": "string", + "hint": "modelscope 上的模型名称。默认:iic/SenseVoiceSmall。", + }, + "variables": { + "description": "工作流固定输入变量", + "type": "object", + "items": {}, + "hint": "可选。工作流固定输入变量,将会作为工作流的输入。也可以在对话时使用 /set 指令动态设置变量。如果变量名冲突,优先使用动态设置的变量。", + "invisible": True, + }, + "dashscope_app_type": { + "description": "应用类型", + "type": "string", + "hint": "百炼应用的应用类型。", + "options": [ + "agent", + "agent-arrange", + "dialog-workflow", + "task-workflow", + ], + }, + "timeout": { + "description": "超时时间", + "type": "int", + "hint": "超时时间,单位为秒。", + }, + "total_timeout": { + "description": "总超时时间", + "type": "float", + "hint": "单次决策请求的总超时时间(秒),包含等待并发名额、重试与退避;默认 5 秒。", + "condition": {"type": "system_one_decision"}, + }, + "max_concurrency": { + "description": "最大并发数", + "type": "int", + "hint": "该提供商同时进行的决策请求上限;默认 4。", + "condition": {"type": "system_one_decision"}, + }, + "openai-tts-voice": { + "description": "voice", + "type": "string", + "hint": "OpenAI TTS 的声音。OpenAI 默认支持:'alloy', 'echo', 'fable', 'onyx', 'nova', 'shimmer'", + }, + "mimo-tts-voice": { + "description": "音色", + "type": "string", + "hint": "MiMo TTS 的音色名称。可选值包括 'mimo_default'、'default_en'、'default_zh'。", + }, + "mimo-tts-format": { + "description": "输出格式", + "type": "string", + "hint": "MiMo TTS 生成音频的格式。支持 'wav'、'mp3'、'pcm'。", + }, + "mimo-tts-style-prompt": { + "description": "风格提示词", + "type": "string", + "hint": "会以 标签形式添加到待合成文本开头,用于控制语速、情绪、角色或风格,例如 开心、变快、孙悟空、悄悄话。可留空。", + }, + "mimo-tts-dialect": { + "description": "方言", + "type": "string", + "hint": "会与风格提示词一起写入开头的 标签中,例如 东北话、四川话、河南话、粤语。可留空。", + }, + "mimo-tts-seed-text": { + "description": "种子文本", + "type": "string", + "hint": "作为可选的 user 消息发送,用于辅助调节语气和风格,不会拼接到待合成文本中。", + }, + "fishaudio-tts-character": { + "description": "character", + "type": "string", + "hint": "fishaudio TTS 的角色。默认为可莉。更多角色请访问:https://fish.audio/zh-CN/discovery", + }, + "fishaudio-tts-reference-id": { + "description": "reference_id", + "type": "string", + "hint": "fishaudio TTS 的参考模型ID(可选)。如果填入此字段,将直接使用模型ID而不通过角色名称查询。例如:626bb6d3f3364c9cbc3aa6a67300a664。更多模型请访问:https://fish.audio/zh-CN/discovery,进入模型详情界面后可复制模型ID", + }, + "whisper_hint": { + "description": "本地部署 Whisper 模型须知", + "type": "string", + "hint": "启用前请 pip 安装 openai-whisper 库(N卡用户大约下载 2GB,主要是 torch 和 cuda,CPU 用户大约下载 1 GB),并且安装 ffmpeg。否则将无法正常转文字。", + }, + "whisper_device": { + "description": "推理设备", + "type": "string", + "hint": "Whisper 推理设备。Apple Silicon 可选 mps;其他环境建议使用 cpu。若指定 mps 但当前环境不可用,将自动回退到 cpu。", + "options": ["cpu", "mps"], + }, + "id": { + "description": "ID", + "type": "string", + }, + "type": { + "description": "模型提供商种类", + "type": "string", + "invisible": True, + }, + "provider_type": { + "description": "模型提供商能力种类", + "type": "string", + "invisible": True, + }, + "enable": { + "description": "启用", + "type": "bool", + }, + "key": { + "description": "API Key", + "type": "list", + "items": {"type": "string"}, + "secret": True, + }, + "api_base": { + "description": "API Base URL", + "type": "string", + }, + "proxy": { + "description": "provider_group.provider.proxy.description", + "type": "string", + "hint": "provider_group.provider.proxy.hint", + }, + "model": { + "description": "模型 ID", + "type": "string", + "hint": "模型名称,如 gpt-4o-mini, deepseek-chat。", + }, + "max_context_tokens": { + "description": "模型上下文窗口大小", + "type": "int", + "hint": "模型最大上下文 Token 大小。如果为 0,则会自动从模型元数据填充(如有)", + }, + "dify_api_key": { + "description": "API Key", + "type": "string", + "hint": "Dify API Key。此项必填。", + "secret": True, + }, + "dify_api_base": { + "description": "API Base URL", + "type": "string", + "hint": "Dify API Base URL。默认为 https://api.dify.ai/v1", + }, + "dify_api_type": { + "description": "Dify 应用类型", + "type": "string", + "hint": "Dify API 类型。根据 Dify 官网,目前支持 chat, chatflow, agent, workflow 三种应用类型。", + "options": ["chat", "chatflow", "agent", "workflow"], + }, + "dify_workflow_output_key": { + "description": "Dify Workflow 输出变量名", + "type": "string", + "hint": "Dify Workflow 输出变量名。当应用类型为 workflow 时才使用。默认为 astrbot_wf_output。", + }, + "dify_query_input_key": { + "description": "Prompt 输入变量名", + "type": "string", + "hint": "发送的消息文本内容对应的输入变量名。默认为 astrbot_text_query。", + "obvious": True, + }, + "coze_api_key": { + "description": "Coze API Key", + "type": "string", + "hint": "Coze API 密钥,用于访问 Coze 服务。", + "secret": True, + }, + "bot_id": { + "description": "Bot ID", + "type": "string", + "hint": "Coze 机器人的 ID,在 Coze 平台上创建机器人后获得。", + }, + "coze_api_base": { + "description": "API Base URL", + "type": "string", + "hint": "Coze API 的基础 URL 地址,默认为 https://api.coze.cn", + }, + "deerflow_api_base": { + "description": "API Base URL", + "type": "string", + "hint": "DeerFlow API 网关地址,默认为 http://127.0.0.1:2026", + }, + "deerflow_api_key": { + "description": "DeerFlow API Key", + "type": "string", + "hint": "可选。若 DeerFlow 网关配置了 Bearer 鉴权,则在此填写。", + "secret": True, + }, + "deerflow_auth_header": { + "description": "Authorization Header", + "type": "string", + "hint": "可选。自定义 Authorization 请求头,优先级高于 DeerFlow API Key。", + "secret": True, + }, + "deerflow_assistant_id": { + "description": "Assistant ID", + "type": "string", + "hint": "DeerFlow 2.0 LangGraph assistant_id,默认为 lead_agent。", + }, + "deerflow_model_name": { + "description": "模型名称覆盖", + "type": "string", + "hint": "可选。覆盖 DeerFlow 默认模型(对应运行时 configurable 的 model_name)。", + }, + "deerflow_thinking_enabled": { + "description": "启用思考模式", + "type": "bool", + }, + "deerflow_plan_mode": { + "description": "启用计划模式", + "type": "bool", + "hint": "对应 DeerFlow 2.0 运行时 configurable 的 is_plan_mode。", + }, + "deerflow_subagent_enabled": { + "description": "启用子智能体", + "type": "bool", + "hint": "对应 DeerFlow 2.0 运行时 configurable 的 subagent_enabled。", + }, + "deerflow_max_concurrent_subagents": { + "description": "子智能体最大并发数", + "type": "int", + "hint": "对应 DeerFlow 2.0 运行时 configurable 的 max_concurrent_subagents。仅在启用子智能体时生效,默认 3。", + }, + "deerflow_recursion_limit": { + "description": "递归深度上限", + "type": "int", + "hint": "对应 LangGraph recursion_limit。", + }, + "auto_save_history": { + "description": "由 Coze 管理对话记录", + "type": "bool", + "hint": "启用后,将由 Coze 进行对话历史记录管理, 此时 AstrBot 本地保存的上下文不会生效(仅供浏览), 对 AstrBot 的上下文进行的操作也不会生效。如果为禁用, 则使用 AstrBot 管理上下文。", + }, + }, + }, + "provider_settings": { + "type": "object", + "items": { + "enable": { + "type": "bool", + }, + "wake_prefix": { + "type": "string", + }, + "web_search": { + "type": "bool", + }, + "web_search_link": { + "type": "bool", + }, + "display_reasoning_text": { + "type": "bool", + }, + "identifier": { + "type": "bool", + }, + "group_name_display": { + "type": "bool", + }, + "datetime_system_prompt": { + "type": "bool", + }, + "prompt_prefix": { + "type": "string", + }, + "streaming_response": { + "type": "bool", + }, + "show_tool_use_status": { + "type": "bool", + }, + "show_tool_call_result": { + "type": "bool", + }, + "buffer_intermediate_messages": { + "type": "bool", + }, + "unsupported_streaming_strategy": { + "type": "string", + }, + "file_extract": { + "type": "object", + "items": { + "enable": { + "type": "bool", + }, + "provider": { + "type": "string", + }, + "moonshotai_api_key": { + "type": "string", + "secret": True, + }, + }, + }, + "proactive_capability": { + "type": "object", + "items": { + "add_cron_tools": { + "type": "bool", + }, + }, + }, + }, + }, + "agent_runner": { + "type": "object", + "items": { + "runner_type": {"type": "string"}, + "config": {"type": "dict"}, + }, + }, + "provider_stt_settings": { + "type": "object", + "items": { + "enable": { + "type": "bool", + }, + "provider_id": { + "type": "string", + }, + }, + }, + "provider_tts_settings": { + "type": "object", + "items": { + "enable": { + "type": "bool", + }, + "provider_id": { + "type": "string", + }, + "dual_output": { + "type": "bool", + }, + "use_file_service": { + "type": "bool", + }, + "trigger_probability": { + "type": "float", + }, + }, + }, + "provider_ltm_settings": { + "type": "object", + "items": { + "group_icl_enable": { + "type": "bool", + }, + "group_message_max_cnt": { + "type": "int", + }, + "image_caption": { + "type": "bool", + }, + "image_caption_provider_id": { + "type": "string", + }, + "image_caption_prompt": { + "type": "string", + }, + "group_message_history_enable": { + "type": "bool", + }, + "group_message_history_max_cnt": { + "type": "int", + }, + "active_reply": { + "type": "object", + "items": { + "enable": { + "type": "bool", + }, + "whitelist": { + "type": "list", + "items": {"type": "string"}, + }, + "method": { + "type": "string", + "options": ["possibility_reply"], + }, + "possibility_reply": { + "type": "float", + }, + }, + }, + }, + }, + }, + }, + "misc_config_group": { + "metadata": { + "wake_prefix": { + "type": "list", + "items": {"type": "string"}, + }, + "t2i": { + "type": "bool", + }, + "t2i_word_threshold": { + "type": "int", + }, + "admins_id": { + "type": "list", + "_special": "sender_id", + "items": {"type": "string"}, + }, + "http_proxy": { + "type": "string", + }, + "no_proxy": { + "description": "直连地址列表", + "type": "list", + "items": {"type": "string"}, + "hint": "在此处添加不希望通过代理访问的地址,例如内部服务地址。回车添加,可添加多个,如未设置代理请忽略此配置", + }, + "timezone": { + "type": "string", + }, + "callback_api_base": { + "type": "string", + }, + "disable_metrics": { + "description": "禁用匿名使用统计", + "type": "bool", + "hint": "禁用后,AstrBot 将不再上传匿名使用统计数据。", + }, + "log_level": { + "type": "string", + "options": ["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"], + }, + "dashboard.ssl.enable": {"type": "bool"}, + "dashboard.trust_proxy_headers": {"type": "bool"}, + "dashboard.auth_rate_limit.enable": {"type": "bool"}, + "dashboard.auth_rate_limit.average_interval": {"type": "float"}, + "dashboard.auth_rate_limit.max_burst": {"type": "int"}, + "dashboard.ssl.cert_file": { + "type": "string", + "condition": {"dashboard.ssl.enable": True}, + }, + "dashboard.ssl.key_file": { + "type": "string", + "condition": {"dashboard.ssl.enable": True}, + }, + "dashboard.ssl.ca_certs": { + "type": "string", + "condition": {"dashboard.ssl.enable": True}, + }, + "log_file_enable": {"type": "bool"}, + "log_file_path": {"type": "string", "condition": {"log_file_enable": True}}, + "log_file_max_mb": {"type": "int", "condition": {"log_file_enable": True}}, + "temp_dir_max_size": {"type": "int"}, + "trace_enable": {"type": "bool"}, + "trace_db_path": {"type": "string"}, + "trace_db_max_mb": {"type": "int"}, + "trace_retention_days": {"type": "int"}, + "t2i_strategy": { + "type": "string", + "options": ["remote", "local"], + }, + "t2i_endpoint": { + "type": "string", + }, + "t2i_use_file_service": { + "type": "bool", + }, + "pip_install_arg": { + "type": "string", + }, + "pypi_index_url": { + "type": "string", + }, + "default_kb_collection": { + "type": "string", + }, + "kb_names": {"type": "list", "items": {"type": "string"}}, + "kb_fusion_top_k": {"type": "int", "default": 20}, + "kb_final_top_k": {"type": "int", "default": 5}, + "kb_agentic_mode": {"type": "bool"}, + }, + }, +} + + +""" +Since v4.7.0, fields such as name, description, and hint support i18n. +Their resources are stored in: + +- dashboard/src/i18n/locales//features/config-metadata.json + +When adding configuration fields here, update this file for every supported +Dashboard locale. +""" +CONFIG_METADATA_3 = { + "ai_group": { + "name": "AI", + "metadata": { + "agent_runner": { + "description": "Agent 执行方式", + "hint": "选择 AI 对话的执行器。切换执行器会使用新类型的默认配置,不保留上一类型的参数。", + "type": "object", + "items": { + "provider_settings.enable": { + "description": "启用", + "type": "bool", + "hint": "AI 对话总开关", + }, + "agent_runner.runner_type": { + "description": "执行器", + "type": "string", + "options": ["local", "dify", "coze", "dashscope", "deerflow"], + "labels": [ + "内置 Agent", + "Dify", + "Coze", + "阿里云百炼应用", + "DeerFlow", + ], + "_special": "agent_runner_type", + "runner_defaults": { + runner_type: get_agent_runner_config_default(runner_type) + for runner_type in ( + "local", + "dify", + "coze", + "dashscope", + "deerflow", + ) + }, + "condition": { + "provider_settings.enable": True, + }, + }, + }, + }, + "dify_runner": { + "description": "Dify 配置", + "type": "object", + "condition": { + "provider_settings.enable": True, + "agent_runner.runner_type": "dify", + }, + "items": { + "agent_runner.config.dify_api_type": { + "description": "应用类型", + "type": "string", + "options": ["chat", "chatflow", "agent", "workflow"], + }, + "agent_runner.config.dify_api_key": { + "description": "API Key", + "type": "string", + "secret": True, + }, + "agent_runner.config.dify_api_base": { + "description": "API Base URL", + "type": "string", + }, + "agent_runner.config.dify_workflow_output_key": { + "description": "Workflow 输出变量名", + "type": "string", + }, + "agent_runner.config.dify_query_input_key": { + "description": "Prompt 输入变量名", + "type": "string", + }, + "agent_runner.config.variables": { + "description": "变量", + "type": "dict", + }, + "agent_runner.config.timeout": { + "description": "超时时间(秒)", + "type": "int", + }, + "agent_runner.config.proxy": { + "description": "代理地址", + "type": "string", + }, + }, + }, + "coze_runner": { + "description": "Coze 配置", + "type": "object", + "condition": { + "provider_settings.enable": True, + "agent_runner.runner_type": "coze", + }, + "items": { + "agent_runner.config.coze_api_key": { + "description": "API Key", + "type": "string", + "secret": True, + }, + "agent_runner.config.bot_id": { + "description": "Bot ID", + "type": "string", + }, + "agent_runner.config.coze_api_base": { + "description": "API Base URL", + "type": "string", + }, + "agent_runner.config.auto_save_history": { + "description": "由 Coze 管理对话记录", + "type": "bool", + }, + "agent_runner.config.timeout": { + "description": "超时时间(秒)", + "type": "int", + }, + "agent_runner.config.proxy": { + "description": "代理地址", + "type": "string", + }, + }, + }, + "dashscope_runner": { + "description": "阿里云百炼应用配置", + "type": "object", + "condition": { + "provider_settings.enable": True, + "agent_runner.runner_type": "dashscope", + }, + "items": { + "agent_runner.config.dashscope_app_type": { + "description": "应用类型", + "type": "string", + "options": ["agent", "workflow"], + }, + "agent_runner.config.dashscope_api_key": { + "description": "API Key", + "type": "string", + "secret": True, + }, + "agent_runner.config.dashscope_app_id": { + "description": "应用 ID", + "type": "string", + }, + "agent_runner.config.rag_options.pipeline_ids": { + "description": "知识库 Pipeline ID", + "type": "list", + "items": {"type": "string"}, + }, + "agent_runner.config.rag_options.file_ids": { + "description": "文件 ID", + "type": "list", + "items": {"type": "string"}, + }, + "agent_runner.config.rag_options.output_reference": { + "description": "输出引用", + "type": "bool", + }, + "agent_runner.config.variables": { + "description": "变量", + "type": "dict", + }, + "agent_runner.config.timeout": { + "description": "超时时间(秒)", + "type": "int", + }, + "agent_runner.config.proxy": { + "description": "代理地址", + "type": "string", + }, + }, + }, + "deerflow_runner": { + "description": "DeerFlow 配置", + "type": "object", + "condition": { + "provider_settings.enable": True, + "agent_runner.runner_type": "deerflow", + }, + "items": { + "agent_runner.config.deerflow_api_base": { + "description": "API Base URL", + "type": "string", + }, + "agent_runner.config.deerflow_api_key": { + "description": "API Key", + "type": "string", + "secret": True, + }, + "agent_runner.config.deerflow_auth_header": { + "description": "Authorization Header", + "type": "string", + "secret": True, + }, + "agent_runner.config.deerflow_assistant_id": { + "description": "Assistant ID", + "type": "string", + }, + "agent_runner.config.deerflow_model_name": { + "description": "模型名称覆盖", + "type": "string", + }, + "agent_runner.config.deerflow_thinking_enabled": { + "description": "启用思考模式", + "type": "bool", + }, + "agent_runner.config.deerflow_plan_mode": { + "description": "启用计划模式", + "type": "bool", + }, + "agent_runner.config.deerflow_subagent_enabled": { + "description": "启用子智能体", + "type": "bool", + }, + "agent_runner.config.deerflow_max_concurrent_subagents": { + "description": "子智能体最大并发数", + "type": "int", + }, + "agent_runner.config.deerflow_recursion_limit": { + "description": "递归深度上限", + "type": "int", + }, + "agent_runner.config.timeout": { + "description": "超时时间(秒)", + "type": "int", + }, + "agent_runner.config.proxy": { + "description": "代理地址", + "type": "string", + }, + }, + }, + "ai": { + "description": "模型", + "hint": "配置内置 Agent 使用的对话模型,以及通用的图片转述、语音模型。", + "type": "object", + "items": { + "agent_runner.config.model.provider_id": { + "description": "对话模型", + "type": "string", + "_special": "select_provider", + "hint": "留空时使用第一个模型", + "condition": { + "agent_runner.runner_type": "local", + }, + }, + "agent_runner.config.model.fallback_provider_ids": { + "description": "回退对话模型", + "type": "list", + "items": {"type": "string"}, + "_special": "select_providers", + "hint": "主聊天模型请求失败时,按顺序切换到这些模型。", + "condition": { + "agent_runner.runner_type": "local", + }, + }, + "agent_runner.config.model.request_max_retries": { + "description": "异常重试次数", + "type": "int", + "hint": "单次模型请求遇到可重试错误时的最大尝试次数。", + "condition": { + "agent_runner.runner_type": "local", + }, + }, + "provider_settings.default_image_caption_provider_id": { + "description": "图片转述模型", + "type": "string", + "_special": "select_provider", + "hint": "当对话模型不支持图片输入时,调用图片转述模型来获得图片描述。留空代表不使用。", + }, + "provider_stt_settings.enable": { + "description": "语音识别", + "type": "bool", + "hint": "使用语音转文字模型将用户语音转述为文本,方便模型理解。", + }, + "provider_stt_settings.provider_id": { + "description": "默认语音转文本模型", + "type": "string", + "hint": "也可使用 /provider 指令单独选择会话的模型。", + "_special": "select_provider_stt", + "condition": { + "provider_stt_settings.enable": True, + }, + }, + "provider_tts_settings.enable": { + "description": "语音回复", + "type": "bool", + "hint": "使用文字转语音模型将文字转为语音回复。", + }, + "provider_tts_settings.provider_id": { + "description": "默认文本转语音模型", + "hint": "也可使用 /provider 指令单独选择会话的模型。", + "type": "string", + "_special": "select_provider_tts", + "condition": { + "provider_tts_settings.enable": True, + }, + }, + "provider_tts_settings.trigger_probability": { + "description": "TTS 触发概率", + "hint": "采用随机概率触发语音回复。", + "type": "float", + "slider": {"min": 0, "max": 1, "step": 0.05}, + "condition": { + "provider_tts_settings.enable": True, + }, + }, + "provider_settings.image_caption_prompt": { + "description": "图片转述提示词", + "hint": "用于图片转述模型的提示词。", + "type": "text", + "collapsed": True, + }, + }, + "condition": { + "provider_settings.enable": True, + }, + }, + "persona": { + "description": "人格", + "hint": "", + "type": "object", + "items": { + "agent_runner.config.persona.persona_id": { + "description": "默认采用的人格", + "type": "string", + "_special": "select_persona", + }, + "agent_runner.config.persona.safety_mode": { + "description": "健康模式", + "type": "bool", + "hint": "引导模型输出健康、安全的内容,避免有害或敏感话题。", + }, + "agent_runner.config.persona.safety_mode_strategy": { + "description": "健康模式策略", + "type": "string", + "invisible": True, + "options": ["system_prompt"], + "hint": "选择健康模式的实现策略。", + "condition": { + "agent_runner.config.persona.safety_mode": True, + }, + }, + }, + "condition": { + "agent_runner.runner_type": "local", + "provider_settings.enable": True, + }, + }, + "knowledgebase": { + "description": "知识库", + "hint": "", + "type": "object", + "items": { + "kb_names": { + "description": "知识库列表", + "type": "list", + "items": {"type": "string"}, + "_special": "select_knowledgebase", + "hint": "支持多选", + }, + "kb_fusion_top_k": { + "description": "融合检索结果数", + "type": "int", + "hint": "多个知识库检索结果融合后的返回结果数量", + }, + "kb_final_top_k": { + "description": "最终返回结果数", + "type": "int", + "hint": "从知识库中检索到的结果数量,越大可能获得越多相关信息,但也可能引入噪音。建议根据实际需求调整", + }, + "kb_agentic_mode": { + "description": "Agentic 知识库检索", + "type": "bool", + "hint": "启用后,知识库检索将作为 LLM Tool,由模型自主决定何时调用知识库进行查询。需要模型支持函数调用能力。", + }, + }, + "condition": { + "agent_runner.runner_type": "local", + "provider_settings.enable": True, + }, + }, + "websearch": { + "description": "网页搜索", + "hint": "", + "type": "object", + "items": { + "provider_settings.web_search": { + "description": "启用网页搜索", + "type": "bool", + }, + "provider_settings.websearch_provider": { + "description": "网页搜索提供商", + "type": "string", + "options": [ + "serpapi", + "deepseek", + "tavily", + "baidu_ai_search", + "bocha", + "brave", + "firecrawl", + "exa", + "anysearch", + ], + "labels": [ + "SerpApi", + "DeepSeek Search API", + "Tavily", + "Baidu AI Search", + "Bocha", + "Brave", + "Firecrawl", + "Exa", + "AnySearch", + ], + "subtitles": [ + "Google 网页、新闻、图片、学术和财经搜索", + "DeepSeek 官方搜索接口", + "", + "", + "", + "", + "", + "", + "", + ], + "condition": { + "provider_settings.web_search": True, + }, + }, + "provider_settings.websearch_tavily_key": { + "description": "Tavily API Key", + "type": "list", + "items": {"type": "string"}, + "hint": "可添加多个 Key 进行轮询。", + "secret": True, + "condition": { + "provider_settings.websearch_provider": "tavily", + "provider_settings.web_search": True, + }, + }, + "provider_settings.websearch_bocha_key": { + "description": "BoCha API Key", + "type": "list", + "items": {"type": "string"}, + "hint": "可添加多个 Key 进行轮询。", + "secret": True, + "condition": { + "provider_settings.websearch_provider": "bocha", + "provider_settings.web_search": True, + }, + }, + "provider_settings.websearch_brave_key": { + "description": "Brave Search API Key", + "type": "list", + "items": {"type": "string"}, + "hint": "可添加多个 Key 进行轮询。", + "secret": True, + "condition": { + "provider_settings.websearch_provider": "brave", + "provider_settings.web_search": True, + }, + }, + "provider_settings.websearch_firecrawl_key": { + "description": "Firecrawl API Key", + "type": "list", + "items": {"type": "string"}, + "hint": "可添加多个 Key 进行轮询。", + "secret": True, + "condition": { + "provider_settings.websearch_provider": "firecrawl", + "provider_settings.web_search": True, + }, + }, + "provider_settings.websearch_baidu_app_builder_key": { + "description": "百度千帆智能云 APP Builder API Key", + "type": "string", + "hint": "参考:https://console.bce.baidu.com/iam/#/iam/apikey/list", + "secret": True, + "condition": { + "provider_settings.websearch_provider": "baidu_ai_search", + "provider_settings.web_search": True, + }, + }, + "provider_settings.websearch_exa_key": { + "description": "Exa API Key", + "type": "list", + "items": {"type": "string"}, + "hint": "可添加多个 Key 进行轮询。Get a key at https://dashboard.exa.ai", + "secret": True, + "condition": { + "provider_settings.websearch_provider": "exa", + "provider_settings.web_search": True, + }, + }, + "provider_settings.websearch_anysearch_key": { + "description": "AnySearch API Key", + "type": "list", + "items": {"type": "string"}, + "hint": "可添加多个 Key 进行轮询。留空则使用匿名模式(每日免费额度)。申请地址:https://anysearch.com/console/api-keys", + "condition": { + "provider_settings.websearch_provider": "anysearch", + "provider_settings.web_search": True, + }, + }, + "provider_settings.websearch_deepseek_key": { + "description": "DeepSeek API Key", + "type": "list", + "items": {"type": "string"}, + "hint": "Configure a DeepSeek API key for search and page extraction. Multiple keys rotate. Get a key: [https://platform.deepseek.com/api_keys](https://platform.deepseek.com/api_keys)", + "secret": True, + "condition": { + "provider_settings.websearch_provider": "deepseek", + "provider_settings.web_search": True, + }, + }, + "provider_settings.websearch_serpapi_key": { + "description": "SerpApi API Key", + "type": "list", + "items": {"type": "string"}, + "hint": "支持 Google 网页、新闻、图片、学术和财经搜索。可添加多个 Key 轮询。获取 Key:[https://serpapi.com/manage-api-key](https://serpapi.com/manage-api-key)", + "secret": True, + "condition": { + "provider_settings.websearch_provider": "serpapi", + "provider_settings.web_search": True, + }, + }, + "provider_settings.web_search_link": { + "description": "显示来源引用", + "type": "bool", + "condition": { + "provider_settings.web_search": True, + }, + }, + }, + "condition": { + "agent_runner.runner_type": "local", + "provider_settings.enable": True, + }, + }, + "agent_computer_use": { + "description": "Agent Computer Use", + "hint": "", + "type": "object", + "items": { + "provider_settings.computer_use_runtime": { + "description": "Computer Use Runtime", + "type": "string", + "options": ["none", "local", "sandbox"], + "labels": [ + "不允许任何环境", + "本机环境", + "第三方沙箱环境", + ], + "hint": "选择 Computer Use 运行环境。", + }, + "provider_settings.computer_use_local_permissions": { + "description": "本地权限策略", + "type": "object", + "_special": "local_permission_matrix", + "full_width": True, + "items": { + "member": { + "type": "object", + "items": { + "allow_execution": {"type": "bool"}, + "allow_network": {"type": "bool"}, + "filesystem_scope": { + "type": "string", + "options": ["none", "workspace", "host"], + }, + }, + }, + "admin": { + "type": "object", + "items": { + "allow_execution": {"type": "bool"}, + "allow_network": {"type": "bool"}, + "filesystem_scope": { + "type": "string", + "options": ["none", "workspace", "host"], + }, + }, + }, + }, + "condition": { + "provider_settings.computer_use_runtime": "local", + }, + }, + "provider_settings.computer_use_require_admin": { + "description": "沙箱能力需要 AstrBot 管理员权限", + "type": "bool", + "hint": "开启后,需要 AstrBot 管理员权限才能调用远程沙箱能力。在配置文件 -> 访问控制 -> 管理员 -> 管理员 ID 中可添加管理员。给机器人发送 /sid 指令以获取 ID。", + "condition": { + "provider_settings.computer_use_runtime": "sandbox", + }, + }, + "provider_settings.sandbox.booter": { + "description": "沙箱环境驱动器", + "type": "string", + "options": ["shipyard_neo", "shipyard", "cua"], + "labels": ["Shipyard Neo", "Shipyard", "CUA"], + "condition": { + "provider_settings.computer_use_runtime": "sandbox", + }, + }, + "provider_settings.sandbox.shipyard_neo_endpoint": { + "description": "Shipyard Neo API Endpoint", + "type": "string", + "hint": "Shipyard Neo(Bay) 服务的 API 地址,默认 http://127.0.0.1:8114。", + "condition": { + "provider_settings.computer_use_runtime": "sandbox", + "provider_settings.sandbox.booter": "shipyard_neo", + }, + }, + "provider_settings.sandbox.shipyard_neo_access_token": { + "description": "Shipyard Neo Access Token", + "type": "string", + "hint": "Bay 的 API Key(sk-bay-...)。留空时自动从 credentials.json 发现。", + "secret": True, + "condition": { + "provider_settings.computer_use_runtime": "sandbox", + "provider_settings.sandbox.booter": "shipyard_neo", + }, + }, + "provider_settings.sandbox.shipyard_neo_profile": { + "description": "Shipyard Neo Profile", + "type": "string", + "hint": "Shipyard Neo 沙箱 profile,如 python-default。留空时自动选择能力更完整的 profile。", + "condition": { + "provider_settings.computer_use_runtime": "sandbox", + "provider_settings.sandbox.booter": "shipyard_neo", + }, + }, + "provider_settings.sandbox.shipyard_neo_ttl": { + "description": "Shipyard Neo Sandbox TTL", + "type": "int", + "hint": "Shipyard Neo 沙箱生存时间(秒)。", + "condition": { + "provider_settings.computer_use_runtime": "sandbox", + "provider_settings.sandbox.booter": "shipyard_neo", + }, + }, + "provider_settings.sandbox.cua_image": { + "description": "CUA Image", + "type": "string", + "hint": "CUA 沙箱镜像/系统类型,默认 linux。可填写 linux、macos、windows、android,具体取决于 CUA SDK 支持。", + "condition": { + "provider_settings.computer_use_runtime": "sandbox", + "provider_settings.sandbox.booter": "cua", + }, + }, + "provider_settings.sandbox.cua_os_type": { + "description": "CUA OS Type", + "type": "string", + "options": ["linux", "macos", "windows", "android"], + "labels": ["Linux", "macOS", "Windows", "Android"], + "hint": "CUA 沙箱操作系统类型,默认 linux。", + "condition": { + "provider_settings.computer_use_runtime": "sandbox", + "provider_settings.sandbox.booter": "cua", + }, + }, + "provider_settings.sandbox.cua_idle_timeout": { + "description": "CUA Idle Timeout", + "type": "int", + "hint": "Idle timeout for CUA sandbox sessions in seconds. When greater than 0, AstrBot proactively shuts down an idle CUA sandbox after that amount of inactivity; 0 disables it.", + "condition": { + "provider_settings.computer_use_runtime": "sandbox", + "provider_settings.sandbox.booter": "cua", + }, + }, + "provider_settings.sandbox.cua_telemetry_enabled": { + "description": "CUA Telemetry", + "type": "bool", + "hint": "是否允许 CUA SDK 发送遥测数据。默认关闭。", + "condition": { + "provider_settings.computer_use_runtime": "sandbox", + "provider_settings.sandbox.booter": "cua", + }, + }, + "provider_settings.sandbox.cua_local": { + "description": "CUA Local Sandbox", + "type": "bool", + "hint": "是否优先使用 CUA 本地沙箱。默认开启,避免云端沙箱要求 CUA_API_KEY。关闭后可使用 CUA 云端沙箱。", + "condition": { + "provider_settings.computer_use_runtime": "sandbox", + "provider_settings.sandbox.booter": "cua", + }, + }, + "provider_settings.sandbox.cua_api_key": { + "description": "CUA API Key", + "type": "string", + "hint": "CUA 云端沙箱 API Key。仅在关闭本地沙箱时需要。也可以通过 CUA_API_KEY 环境变量提供。", + "obvious_hint": True, + "secret": True, + "condition": { + "provider_settings.computer_use_runtime": "sandbox", + "provider_settings.sandbox.booter": "cua", + "provider_settings.sandbox.cua_local": False, + }, + }, + "provider_settings.sandbox.shipyard_endpoint": { + "description": "Shipyard API Endpoint", + "type": "string", + "hint": "Shipyard 服务的 API 访问地址。", + "condition": { + "provider_settings.computer_use_runtime": "sandbox", + "provider_settings.sandbox.booter": "shipyard", + }, + "_special": "check_shipyard_connection", + }, + "provider_settings.sandbox.shipyard_access_token": { + "description": "Shipyard Access Token", + "type": "string", + "hint": "用于访问 Shipyard 服务的访问令牌。", + "secret": True, + "condition": { + "provider_settings.computer_use_runtime": "sandbox", + "provider_settings.sandbox.booter": "shipyard", + }, + }, + "provider_settings.sandbox.shipyard_ttl": { + "description": "Shipyard Session TTL", + "type": "int", + "hint": "Shipyard 会话的生存时间(秒)。", + "condition": { + "provider_settings.computer_use_runtime": "sandbox", + "provider_settings.sandbox.booter": "shipyard", + }, + }, + "provider_settings.sandbox.shipyard_max_sessions": { + "description": "Shipyard Max Sessions", + "type": "int", + "hint": "Shipyard 最大会话数量。", + "condition": { + "provider_settings.computer_use_runtime": "sandbox", + "provider_settings.sandbox.booter": "shipyard", + }, + }, + }, + "condition": { + "agent_runner.runner_type": "local", + "provider_settings.enable": True, + }, + }, + # "file_extract": { + # "description": "文档解析能力 [beta]", + # "type": "object", + # "items": { + # "provider_settings.file_extract.enable": { + # "description": "启用文档解析能力", + # "type": "bool", + # }, + # "provider_settings.file_extract.provider": { + # "description": "文档解析提供商", + # "type": "string", + # "options": ["moonshotai"], + # "condition": { + # "provider_settings.file_extract.enable": True, + # }, + # }, + # "provider_settings.file_extract.moonshotai_api_key": { + # "description": "Moonshot AI API Key", + # "type": "string", + # "condition": { + # "provider_settings.file_extract.provider": "moonshotai", + # "provider_settings.file_extract.enable": True, + # }, + # }, + # }, + # "condition": { + # "agent_runner.runner_type": "local", + # "provider_settings.enable": True, + # }, + # }, + "proactive_capability": { + "description": "主动型 Agent", + "hint": "https://docs.astrbot.app/use/proactive-agent.html", + "type": "object", + "items": { + "provider_settings.proactive_capability.add_cron_tools": { + "description": "启用", + "type": "bool", + "hint": "启用后,将会传递给 Agent 相关工具来实现主动型 Agent。你可以告诉 AstrBot 未来某个时间要做的事情,它将被定时触发然后执行任务。", + }, + }, + "condition": { + "agent_runner.runner_type": "local", + "provider_settings.enable": True, + }, + }, + "truncate_and_compress": { + "hint": "", + "description": "上下文管理策略", + "type": "object", + "items": { + "agent_runner.config.compression.max_turns": { + "description": "压缩前最多保留对话轮数", + "type": "int", + "collapsed": True, + "hint": "普通会话历史超过该轮数后,才会按下方策略进行持久化截断或 LLM 压缩;请求发送前也会先按该值约束上下文。-1 表示不按轮数限制。", + "condition": { + "agent_runner.runner_type": "local", + }, + }, + "agent_runner.config.compression.trim_turns": { + "description": "轮次超限时一次丢弃轮数", + "type": "int", + "collapsed": True, + "hint": "当超过“压缩前最多保留对话轮数”且无法使用 LLM 压缩时,一次丢弃多少轮旧对话;请求期截断也会复用该值。", + "condition": { + "agent_runner.runner_type": "local", + }, + }, + "agent_runner.config.compression.overflow_strategy": { + "description": "压缩策略", + "type": "string", + "options": ["truncate_by_turns", "llm_compress"], + "labels": ["按对话轮数截断", "由 LLM 压缩上下文"], + "condition": { + "agent_runner.runner_type": "local", + }, + "hint": "模型上下文超限时的处理策略。", + }, + "agent_runner.config.compression.instruction": { + "description": "上下文压缩提示词", + "type": "text", + "collapsed": True, + "hint": "如果为空则使用默认提示词。", + "condition": { + "agent_runner.config.compression.overflow_strategy": "llm_compress", + "agent_runner.runner_type": "local", + }, + }, + "agent_runner.config.compression.keep_recent_ratio": { + "description": "压缩时保留最近上下文比例", + "type": "float", + "collapsed": True, + "slider": {"min": 0, "max": 0.3, "step": 0.01}, + "hint": "按当前上下文 token 数保留最近内容,范围 0-0.3。0.15 表示保留 15%;比例大于 0 时至少保留最后一轮。", + "condition": { + "agent_runner.config.compression.overflow_strategy": "llm_compress", + "agent_runner.runner_type": "local", + }, + }, + "agent_runner.config.compression.provider_id": { + "description": "压缩模型", + "type": "string", + "_special": "select_provider", + "hint": "用于上下文压缩的模型。默认选择当前的对话模型。", + "condition": { + "agent_runner.config.compression.overflow_strategy": "llm_compress", + "agent_runner.runner_type": "local", + }, + }, + "agent_runner.config.compression.fallback_max_tokens": { + "description": "上下文窗口兜底值", + "type": "int", + "collapsed": True, + "hint": "当 max_context_tokens 为 0 且模型不在内置元数据中时,使用此值作为上下文窗口大小。默认 128000。", + "condition": { + "agent_runner.runner_type": "local", + }, + }, + }, + "condition": { + "agent_runner.runner_type": "local", + "provider_settings.enable": True, + }, + }, + "others": { + "description": "其他配置", + "type": "object", + "items": { + "provider_settings.display_reasoning_text": { + "description": "显示思考内容", + "hint": "显示模型的思维链信息到最终回复中。", + "type": "bool", + "condition": { + "agent_runner.runner_type": "local", + }, + }, + "provider_settings.streaming_response": { + "description": "流式输出", + "hint": "在受支持的聊天平台中以打字机的形式输出响应。", + "type": "bool", + }, + "provider_settings.unsupported_streaming_strategy": { + "description": "不支持流式回复的平台", + "type": "string", + "options": ["realtime_segmenting", "turn_off"], + "hint": "选择在不支持流式回复的平台上的处理方式。实时分段回复会在系统接收流式响应检测到诸如标点符号等分段点时,立即发送当前已接收的内容", + "labels": ["实时分段回复", "关闭流式回复"], + "condition": { + "provider_settings.streaming_response": True, + }, + }, + "provider_settings.identifier": { + "description": "用户识别", + "type": "bool", + "hint": "在用户提示词前带上用户 ID 信息。", + }, + "provider_settings.group_name_display": { + "description": "显示群名称", + "type": "bool", + "hint": "在受支持的消息平台的群聊中的用户提示词前带上群名称信息。", + }, + "provider_settings.datetime_system_prompt": { + "description": "现实世界时间感知", + "type": "bool", + "hint": "在用户提示词中带上当前的时间信息。", + "condition": { + "agent_runner.runner_type": "local", + }, + }, + "provider_settings.show_tool_use_status": { + "description": "输出工具调用信息", + "hint": "有工具调用时,同时发送带有工具调用名字的消息。", + "type": "bool", + "condition": { + "agent_runner.runner_type": "local", + }, + }, + "provider_settings.show_tool_call_result": { + "description": "输出工具调用结果", + "type": "bool", + "hint": "仅在输出工具调用信息启用时生效,展示结果前 70 个字符。", + "condition": { + "agent_runner.runner_type": "local", + "provider_settings.show_tool_use_status": True, + }, + }, + "provider_settings.buffer_intermediate_messages": { + "description": "合并 Agent 中间消息", + "type": "bool", + "hint": "开启后,非流式模式下多步工具调用过程中产生的中间文本将缓冲,待 Agent 完成后合并为一条回复发送。", + "condition": { + "agent_runner.runner_type": "local", + "provider_settings.streaming_response": False, + }, + }, + "agent_runner.config.misc.sanitize_context_by_modalities": { + "description": "按模型能力清理历史上下文", + "type": "bool", + "hint": "开启后,在每次请求 LLM 前会按当前模型提供商中所选择的模型能力删除对话中不支持的图片/工具调用结构(会改变模型看到的历史)", + "condition": { + "agent_runner.runner_type": "local", + }, + }, + "agent_runner.config.misc.max_steps": { + "description": "工具调用轮数上限", + "type": "int", + "condition": { + "agent_runner.runner_type": "local", + }, + }, + "agent_runner.config.misc.tool_call_timeout": { + "description": "工具调用超时时间(秒)", + "type": "int", + "condition": { + "agent_runner.runner_type": "local", + }, + }, + "agent_runner.config.misc.tool_schema_mode": { + "description": "工具调用模式", + "type": "string", + "options": ["skills_like", "full"], + "labels": ["Skills-like(两阶段)", "Full(完整参数)"], + "hint": "skills-like 先下发工具名称与描述,再下发参数;full 一次性下发完整参数。", + "condition": { + "agent_runner.runner_type": "local", + }, + }, + "provider_settings.wake_prefix": { + "description": "额外唤醒前缀", + "type": "string", + "hint": "如果唤醒前缀为 /, 额外聊天唤醒前缀为 chat,则需要 /chat 才会触发 LLM 请求", + }, + "provider_settings.image_compress_options.max_size": { + "description": "输入图片最大边长", + "type": "int", + "hint": "发送给模型的图片最长边(像素),系统会在必要时进一步压缩。", + "slider": {"min": 256, "max": 4096, "step": 64}, + }, + "provider_settings.prompt_prefix": { + "description": "用户提示词", + "type": "string", + "hint": "可使用 {{prompt}} 作为用户输入的占位符。如果不输入占位符则代表添加在用户输入的前面。", + "collapsed": True, + }, + "provider_tts_settings.dual_output": { + "description": "开启 TTS 时同时输出语音和文字内容", + "type": "bool", + "collapsed": True, + }, + "provider_settings.reachability_check": { + "description": "提供商可达性检测", + "type": "bool", + "hint": "/provider 命令列出模型时是否并发检测连通性。开启后会主动调用模型测试连通性,可能产生额外 token 消耗。", + "collapsed": True, + }, + "provider_settings.max_quoted_fallback_images": { + "description": "引用图片回退解析上限", + "type": "int", + "hint": "引用/转发消息回退解析图片时的最大注入数量,超出会截断。", + "condition": { + "agent_runner.runner_type": "local", + }, + "collapsed": True, + }, + "provider_settings.quoted_message_parser.max_component_chain_depth": { + "description": "引用解析组件链深度", + "type": "int", + "hint": "解析 Reply 组件链时允许的最大递归深度。", + "condition": { + "agent_runner.runner_type": "local", + }, + "collapsed": True, + }, + "provider_settings.quoted_message_parser.max_forward_node_depth": { + "description": "引用解析转发节点深度", + "type": "int", + "hint": "解析合并转发节点时允许的最大递归深度。", + "condition": { + "agent_runner.runner_type": "local", + }, + "collapsed": True, + }, + "provider_settings.quoted_message_parser.max_forward_fetch": { + "description": "引用解析转发拉取上限", + "type": "int", + "hint": "递归拉取 get_forward_msg 的最大次数。", + "condition": { + "agent_runner.runner_type": "local", + }, + "collapsed": True, + }, + "provider_settings.quoted_message_parser.warn_on_action_failure": { + "description": "引用解析 action 失败告警", + "type": "bool", + "hint": "开启后,get_msg/get_forward_msg 全部尝试失败时输出 warning 日志。", + "condition": { + "agent_runner.runner_type": "local", + }, + "collapsed": True, + }, + }, + "condition": { + "provider_settings.enable": True, + }, + }, + }, + }, + "platform_group": { + "name": "平台与消息", + "metadata": { + "general": { + "description": "基本", + "type": "object", + "items": { + "platform_settings.unique_session": { + "description": "隔离对话", + "type": "bool", + "hint": "启用后,支持隔离的渠道会为每位群成员使用独立上下文。指令权限请在「管理行为 → 指令」中设置。", + }, + "wake_prefix": { + "description": "唤醒词", + "hint": "唤醒机器人的消息前缀的列表,也可以通过 @ 机器人来唤醒。\n\n内置指令(如 `/help`、`/sid`)也依赖唤醒词:群聊中不带唤醒词直接输入将无法触发;私聊在未启用「私聊消息需要唤醒词」时无需前缀,可直接输入指令触发。", + "type": "list", + "items": {"type": "string"}, + }, + "platform_settings.friend_message_needs_wake_prefix": { + "description": "私聊消息需要唤醒词", + "hint": "私聊消息也必须带上唤醒前缀才能唤醒机器人。", + "type": "bool", + }, + "platform_settings.reply_prefix": { + "description": "回复时的文本前缀", + "hint": "回复中附带的文本前缀。", + "type": "string", + }, + "platform_settings.reply_with_mention": { + "description": "回复时 @ 发送人", + "hint": "回复时提及发送人。", + "type": "bool", + }, + "platform_settings.reply_with_quote": { + "description": "回复时引用发送人消息", + "hint": "回复时引用发送人的对应消息。", + "type": "bool", + }, + "platform_settings.forward_threshold": { + "description": "转发消息的字数阈值", + "hint": "在受支持的平台上,当回复消息过长时,采用 “合并消息转发” 的方式发送消息。", + "type": "int", + }, + "platform_settings.empty_mention_waiting": { + "description": "只 @ 机器人是否触发等待", + "hint": "当发送一条只有提及机器人的消息时,是否在接下来的 1 分钟内保持唤醒状态等待用户的第二条消息。", + "type": "bool", + }, + "disable_builtin_commands": { + "description": "禁用自带指令", + "type": "bool", + "hint": "禁用所有 AstrBot 的自带指令,如 help, sid, new 等。", + }, + }, + }, + "rate_limit": { + "description": "速率限制", + "type": "object", + "items": { + "platform_settings.rate_limit.time": { + "description": "消息速率限制时间(秒)", + "type": "int", + }, + "platform_settings.rate_limit.count": { + "description": "消息速率限制计数", + "type": "int", + }, + "platform_settings.rate_limit.strategy": { + "description": "速率限制策略", + "type": "string", + "options": ["stall", "discard"], + }, + }, + }, + "content_safety": { + "description": "内容安全", + "type": "object", + "items": { + "content_safety.also_use_in_response": { + "description": "同时检查模型的响应内容", + "type": "bool", + }, + "content_safety.baidu_aip.enable": { + "description": "使用百度内容安全审核", + "type": "bool", + "hint": "您需要手动安装 baidu-aip 库。", + }, + "content_safety.baidu_aip.app_id": { + "description": "App ID", + "type": "string", + "condition": { + "content_safety.baidu_aip.enable": True, + }, + }, + "content_safety.baidu_aip.api_key": { + "description": "API Key", + "type": "string", + "secret": True, + "condition": { + "content_safety.baidu_aip.enable": True, + }, + }, + "content_safety.baidu_aip.secret_key": { + "description": "Secret Key", + "type": "string", + "secret": True, + "condition": { + "content_safety.baidu_aip.enable": True, + }, + }, + "content_safety.internal_keywords.enable": { + "description": "关键词检查", + "type": "bool", + }, + "content_safety.internal_keywords.extra_keywords": { + "description": "额外关键词", + "type": "list", + "items": {"type": "string"}, + "hint": "额外的屏蔽关键词列表,支持正则表达式。", + }, + }, + }, + "others": { + "description": "其他配置", + "type": "object", + "items": { + "platform_settings.ignore_bot_self_message": { + "description": "是否忽略机器人自身的消息", + "type": "bool", + }, + "platform_settings.ignore_at_all": { + "description": "是否忽略 @ 全体成员事件", + "type": "bool", + }, + "platform_settings.no_permission_reply": { + "description": "用户权限不足时是否回复", + "type": "bool", + }, + "platform_specific.lark.pre_ack_emoji.enable": { + "description": "[飞书] 启用预回应表情", + "type": "bool", + }, + "platform_specific.lark.pre_ack_emoji.emojis": { + "description": "表情列表(飞书表情枚举名)", + "type": "list", + "items": {"type": "string"}, + "hint": "表情枚举名参考:https://open.feishu.cn/document/server-docs/im-v1/message-reaction/emojis-introduce", + "condition": { + "platform_specific.lark.pre_ack_emoji.enable": True, + }, + }, + "platform_specific.telegram.pre_ack_emoji.enable": { + "description": "[Telegram] 启用预回应表情", + "type": "bool", + }, + "platform_specific.telegram.pre_ack_emoji.emojis": { + "description": "表情列表(Unicode)", + "type": "list", + "items": {"type": "string"}, + "hint": "Telegram 仅支持固定反应集合,参考:https://gist.github.com/Soulter/3f22c8e5f9c7e152e967e8bc28c97fc9", + "condition": { + "platform_specific.telegram.pre_ack_emoji.enable": True, + }, + }, + "platform_specific.discord.pre_ack_emoji.enable": { + "description": "[Discord] 启用预回应表情", + "type": "bool", + }, + "platform_specific.discord.pre_ack_emoji.emojis": { + "description": "表情列表(Unicode 或自定义表情名)", + "type": "list", + "items": {"type": "string"}, + "hint": "填写 Unicode 表情符号,例如:👍、🤔、⏳", + "condition": { + "platform_specific.discord.pre_ack_emoji.enable": True, + }, + }, + }, + }, + }, + }, + "access_group": { + "name": "访问控制", + "metadata": { + "admins": { + "description": "管理员", + "type": "object", + "items": { + "admins_id": { + "description": "管理员 ID", + "type": "list", + "_special": "sender_id", + "items": {"type": "string"}, + "hint": "给机器人发送 /sid 指令以获取 ID。", + }, + }, + }, + "whitelist": { + "description": "白名单", + "type": "object", + "items": { + "platform_settings.enable_id_white_list": { + "description": "启用白名单", + "type": "bool", + "hint": "启用后,只有在白名单内的会话会被响应。", + }, + "platform_settings.id_whitelist": { + "description": "白名单 ID 列表", + "type": "list", + "_special": "umo", + "items": {"type": "string"}, + "hint": "给机器人发送 /sid 指令以获取 ID。为空时代表不启用白名单功能。", + }, + "platform_settings.id_whitelist_log": { + "description": "输出拦截日志", + "type": "bool", + "hint": "输出未通过白名单校验的消息的日志。", + }, + "platform_settings.wl_ignore_admin_on_group": { + "description": "管理员群组消息无视 ID 白名单", + "type": "bool", + }, + "platform_settings.wl_ignore_admin_on_friend": { + "description": "管理员私聊消息无视 ID 白名单", + "type": "bool", + }, + }, + }, + }, + }, + "plugin_group": { + "name": "插件", + "metadata": { + "plugin": { + "description": "插件", + "type": "object", + "items": { + "plugin_set": { + "description": "可用插件", + "type": "bool", + "hint": "默认启用全部未被禁用的插件。若插件在插件页面被禁用,则此处的选择不会生效。", + "_special": "select_plugin_set", + }, + }, + }, + }, + }, + "ext_group": { + "name": "扩展功能", + "metadata": { + "segmented_reply": { + "description": "分段回复", + "type": "object", + "items": { + "platform_settings.segmented_reply.enable": { + "description": "启用分段回复", + "hint": "以分段输出的方式发送回复消息。", + "type": "bool", + }, + "platform_settings.segmented_reply.only_llm_result": { + "description": "仅对 LLM 结果分段", + "type": "bool", + "condition": { + "platform_settings.segmented_reply.enable": True, + }, + }, + "platform_settings.segmented_reply.interval_method": { + "description": "间隔方法。", + "hint": "random 为随机时间,log 为根据消息长度计算,$y=log_(x)$,x为字数,y的单位为秒。", + "type": "string", + "options": ["random", "log"], + "condition": { + "platform_settings.segmented_reply.enable": True, + }, + }, + "platform_settings.segmented_reply.interval": { + "description": "随机间隔时间", + "type": "string", + "hint": "格式:最小值,最大值(如:1.5,3.5)", + "condition": { + "platform_settings.segmented_reply.enable": True, + "platform_settings.segmented_reply.interval_method": "random", + }, + }, + "platform_settings.segmented_reply.log_base": { + "description": "对数底数", + "type": "float", + "hint": "对数间隔的底数,默认为 2.6。取值范围为 1.0-10.0。", + "condition": { + "platform_settings.segmented_reply.enable": True, + "platform_settings.segmented_reply.interval_method": "log", + }, + }, + "platform_settings.segmented_reply.words_count_threshold": { + "description": "分段回复字数阈值", + "hint": "分段回复的字数上限。只有字数小于此值的消息才会被分段,超过此值的长消息将直接发送(不分段)。默认为 150", + "type": "int", + "condition": { + "platform_settings.segmented_reply.enable": True, + }, + }, + "platform_settings.segmented_reply.split_mode": { + "description": "分段模式", + "type": "string", + "options": ["regex", "words"], + "labels": ["正则表达式", "分段词列表"], + "condition": { + "platform_settings.segmented_reply.enable": True, + }, + }, + "platform_settings.segmented_reply.regex": { + "description": "分段正则表达式", + "hint": "用于分隔一段消息。默认情况下会根据句号、问号等标点符号分隔。如填写 `[。?!]` 将移除所有的句号、问号、感叹号。re.findall(r'', text)", + "type": "string", + "condition": { + "platform_settings.segmented_reply.enable": True, + "platform_settings.segmented_reply.split_mode": "regex", + }, + }, + "platform_settings.segmented_reply.split_words": { + "description": "分段词列表", + "type": "list", + "hint": "检测到列表中的任意词时进行分段,如:。、?、!等", + "condition": { + "platform_settings.segmented_reply.enable": True, + "platform_settings.segmented_reply.split_mode": "words", + }, + }, + "platform_settings.segmented_reply.content_cleanup_rule": { + "description": "内容过滤正则表达式", + "type": "string", + "hint": "移除分段后内容中的指定内容。如填写 `[。?!]` 将移除所有的句号、问号、感叹号。", + "condition": { + "platform_settings.segmented_reply.enable": True, + }, + }, + }, + }, + "ltm": { + "description": "群聊上下文感知", + "type": "object", + "items": { + "provider_ltm_settings.group_icl_enable": { + "description": "群聊消息记录注入上下文", + "hint": "是否记录群聊非唤醒机器人的消息,并在唤醒机器人时将消息传给模型。", + "type": "bool", + }, + "provider_ltm_settings.group_message_max_cnt": { + "description": "注入上下文最大消息数量", + "hint": "传给模型的消息的最大数量。", + "type": "int", + "condition": { + "provider_ltm_settings.group_icl_enable": True, + }, + }, + "provider_ltm_settings.image_caption": { + "description": "自动理解图片", + "type": "bool", + "hint": "对非唤醒机器人的图片消息启用图片转述,转换成图片描述文本。对于图片消息频繁的群聊,此功能可能造成较大的开销,请慎用。", + "condition": { + "provider_ltm_settings.group_icl_enable": True, + }, + }, + "provider_ltm_settings.image_caption_provider_id": { + "description": "群聊图片转述模型", + "type": "string", + "_special": "select_provider", + "hint": "用于群聊记录注入上下文的图片理解,与图片转述模型分开配置。", + "condition": { + "provider_ltm_settings.group_icl_enable": True, + "provider_ltm_settings.image_caption": True, + }, + }, + "provider_ltm_settings.group_message_history_enable": { + "description": "持久化群聊消息记录", + "type": "bool", + "hint": "将群内的所有消息都持久化保存,并允许模型通过工具来查询群内消息。", + }, + "provider_ltm_settings.group_message_history_max_cnt": { + "description": "持久化最大消息数量", + "hint": "持久化保存的消息的最大数量,超过后抛弃旧的消息。", + "type": "int", + "condition": { + "provider_ltm_settings.group_message_history_enable": True, + }, + }, + "provider_ltm_settings.active_reply.enable": { + "description": "主动回复", + "hint": "是否在合适的时机主动发消息。", + "type": "bool", + }, + "provider_ltm_settings.active_reply.method": { + "description": "主动回复方法", + "type": "string", + "options": ["possibility_reply"], + "condition": { + "provider_ltm_settings.active_reply.enable": True, + }, + }, + "provider_ltm_settings.active_reply.possibility_reply": { + "description": "回复概率", + "type": "float", + "hint": "0.0-1.0 之间的数值", + "slider": {"min": 0, "max": 1, "step": 0.05}, + "condition": { + "provider_ltm_settings.active_reply.enable": True, + }, + }, + "provider_ltm_settings.active_reply.whitelist": { + "description": "主动回复白名单", + "type": "list", + "items": {"type": "string"}, + "hint": "为空时不启用白名单过滤。使用 /sid 获取 ID。", + "condition": { + "provider_ltm_settings.active_reply.enable": True, + }, + }, + }, + }, + "t2i": { + "description": "文本转图像", + "type": "object", + "items": { + "t2i": { + "description": "文本转图像输出", + "hint": "将模型回复转换成图片后再发送,防止刷屏。", + "type": "bool", + }, + "t2i_word_threshold": { + "description": "文本转图像字数阈值", + "type": "int", + "condition": { + "t2i": True, + }, + }, + "t2i_strategy": { + "description": "文本转图像策略", + "type": "string", + "hint": "文本转图像策略。`remote` 为使用远程基于 HTML 的渲染服务,`local` 为使用 PIL 本地渲染。当使用 local 时,将 ttf 字体命名为 'font.ttf' 放在 data/ 目录下可自定义字体。", + "options": ["remote", "local"], + "condition": { + "t2i": True, + }, + }, + "t2i_endpoint": { + "description": "文本转图像服务 API 地址", + "type": "string", + "hint": "为空时使用 AstrBot API 服务", + "condition": { + "t2i": True, + "t2i_strategy": "remote", + }, + }, + "t2i_template": { + "description": "文本转图像自定义模版", + "type": "bool", + "hint": "启用后可自定义 HTML 模板用于文转图渲染。", + "condition": { + "t2i": True, + "t2i_strategy": "remote", + }, + "_special": "t2i_template", + }, + "t2i_active_template": { + "description": "当前应用的文转图渲染模板", + "type": "string", + "hint": "此处的值由文转图模板管理页面进行维护。", + "invisible": True, + }, + }, + }, + }, + }, +} + +CONFIG_METADATA_3_SYSTEM = { + "system_group": { + "name": "系统配置", + "metadata": { + "system": { + "description": "系统配置", + "type": "object", + "items": { + "log_level": { + "description": "控制台日志级别", + "type": "string", + "hint": "控制台输出日志的级别。", + "options": ["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"], + }, + "dashboard.ssl.enable": { + "description": "启用 WebUI HTTPS", + "type": "bool", + "hint": "启用后,WebUI 将直接使用 HTTPS 提供服务。", + }, + "dashboard.trust_proxy_headers": { + "description": "信任代理请求头获取客户端 IP", + "type": "bool", + "hint": "关闭时忽略 X-Forwarded-For/X-Real-IP,仅使用连接地址。", + }, + "dashboard.auth_rate_limit.enable": { + "description": "启用登录验证速率限制", + "type": "bool", + "hint": "关闭后将不对登录、TOTP 等身份验证接口进行速率限制。", + }, + "dashboard.auth_rate_limit.average_interval": { + "description": "验证端点速率限制平均间隔(秒)", + "type": "float", + "hint": "两次身份验证请求之间的最小平均间隔时间。例如设置为 1.0 表示每秒最多处理 1 个请求。", + "condition": {"dashboard.auth_rate_limit.enable": True}, + }, + "dashboard.auth_rate_limit.max_burst": { + "description": "验证端点速率限制最大突发数", + "type": "int", + "hint": "允许的瞬时最大突发请求数。例如设置为 3 表示在短时间内最多连续处理 3 个请求。", + "condition": {"dashboard.auth_rate_limit.enable": True}, + }, + "dashboard.totp.enable": { + "description": "启用 WebUI TOTP 双因素认证", + "type": "bool", + "hint": "启用后,登录 WebUI 需要额外输入验证码。", + "_special": "dashboard_totp_manager", + }, + "dashboard.ssl.cert_file": { + "description": "SSL 证书文件路径", + "type": "string", + "hint": "证书文件路径(PEM)。支持绝对路径和相对路径(相对于当前工作目录)。", + "condition": {"dashboard.ssl.enable": True}, + }, + "dashboard.ssl.key_file": { + "description": "SSL 私钥文件路径", + "type": "string", + "hint": "私钥文件路径(PEM)。支持绝对路径和相对路径(相对于当前工作目录)。", + "condition": {"dashboard.ssl.enable": True}, + }, + "dashboard.ssl.ca_certs": { + "description": "SSL CA 证书文件路径", + "type": "string", + "hint": "可选。用于指定 CA 证书文件路径。", + "condition": {"dashboard.ssl.enable": True}, + }, + "log_file_enable": { + "description": "启用文件日志", + "type": "bool", + "hint": "开启后会将日志写入指定文件。", + }, + "log_file_path": { + "description": "日志文件路径", + "type": "string", + "hint": "相对路径以 data 目录为基准,例如 logs/astrbot.log;支持绝对路径。", + }, + "log_file_max_mb": { + "description": "日志文件大小上限 (MB)", + "type": "int", + "hint": "超过大小后自动轮转,默认 20MB。", + }, + "temp_dir_max_size": { + "description": "临时目录大小上限 (MB)", + "type": "int", + "hint": "用于限制 data/temp 目录总大小,单位为 MB。系统每 10 分钟检查一次,超限时按文件修改时间从旧到新删除,释放约 30% 当前体积。", + }, + "trace_enable": { + "description": "启用追踪记录", + "type": "bool", + "hint": "追踪用户的每次指令和 AI 调用。", + }, + "trace_db_path": { + "description": "追踪数据库路径", + "type": "string", + "hint": "相对路径以 data 目录为基准,例如 logs/traces.db;支持绝对路径。", + }, + "trace_db_max_mb": { + "description": "追踪数据库容量预算 (MB)", + "type": "int", + "hint": "默认 80 MB,最小 32 MB,低于最小值时按 32 MB 生效。超出后自动清除旧数据。", + }, + "trace_retention_days": { + "description": "追踪保留天数", + "type": "int", + "hint": "默认 7 天,期限或容量先达到者触发清理。", + }, + "pip_install_arg": { + "description": "pip 安装额外参数", + "type": "string", + "hint": "安装插件依赖时,会使用 Python 的 pip 工具。这里可以填写额外的参数,如 `--break-system-package` 等。PyPI 镜像的 TLS 证书默认会校验;若使用自签名/私有 CA 镜像,请通过 `--cert ` 指定信任的证书(推荐),或显式添加 `--trusted-host <主机名>`。", + }, + "pypi_index_url": { + "description": "PyPI 软件仓库地址", + "type": "string", + "hint": "安装 Python 依赖时请求的 PyPI 软件仓库地址。默认为 https://mirrors.aliyun.com/pypi/simple/", + }, + "callback_api_base": { + "description": "对外可达的回调接口地址", + "type": "string", + "hint": "外部服务可能会通过 AstrBot 生成的回调链接(如文件下载链接)访问 AstrBot 后端。由于 AstrBot 无法自动判断部署环境中对外可达的主机地址(host),因此需要通过此配置项显式指定 “外部服务如何访问 AstrBot” 的地址。如 http://localhost:6185,https://example.com 等。", + }, + "timezone": { + "description": "时区", + "type": "string", + "hint": "时区设置。请填写 IANA 时区名称, 如 Asia/Shanghai, 为空时使用系统默认时区。所有时区请查看: https://data.iana.org/time-zones/tzdb-2021a/zone1970.tab", + }, + "http_proxy": { + "description": "代理", + "type": "string", + "hint": "启用后,会以添加环境变量的方式设置代理。支持 http://、https://、socks5:// 格式,例如:http://127.0.0.1:7890 或 socks5://127.0.0.1:7891", + }, + "no_proxy": { + "description": "直连地址列表", + "type": "list", + "items": {"type": "string"}, + }, + }, + }, + }, + }, +} + + +DEFAULT_VALUE_MAP = { + "int": 0, + "float": 0.0, + "bool": False, + "string": "", + "text": "", + "list": [], + "file": [], + "object": {}, + "template_list": [], + "dict": {}, +} diff --git a/astrbot/core/provider/sources/dashscope_embedding_source.py b/astrbot/core/provider/sources/dashscope_embedding_source.py index 56fd14fb382..3d1b121e465 100644 --- a/astrbot/core/provider/sources/dashscope_embedding_source.py +++ b/astrbot/core/provider/sources/dashscope_embedding_source.py @@ -13,6 +13,9 @@ _DEFAULT_API_BASE = "https://dashscope.aliyuncs.com/api/v1" _DEFAULT_MODEL = "text-embedding-v4" +#: ``text_type`` 的合法取值。多模态端点不接受该参数。 +_TEXT_TYPES = {"query", "document"} + @register_provider_adapter( "dashscope_embedding", @@ -26,6 +29,10 @@ class DashScopeEmbeddingProvider(EmbeddingProvider): multimodal embedding models (qwen*-vl-embedding, multimodal-embedding-*, tongyi-embedding-vision-*) through MultiModalEmbedding, so that models unavailable in the OpenAI-compatible mode can be used. + + 检索场景下 ``text_type`` 区分查询与文档:``query`` 生成针对信息检索优化 + 的向量,``document`` 生成针对"被检索"优化的向量。两者不区分时查询与文档 + 落在同一编码模式里,检索区分度会下降。 """ def __init__(self, provider_config: dict, provider_settings: dict) -> None: @@ -41,6 +48,17 @@ def __init__(self, provider_config: dict, provider_settings: dict) -> None: self.base_url = provider_config.get("embedding_api_base", _DEFAULT_API_BASE) self.model = provider_config.get("embedding_model", _DEFAULT_MODEL) + # 是否发送 text_type。默认开启——检索是知识库的主要用途。 + self.text_type_mode = ( + str(provider_config.get("embedding_text_type_mode", "auto")).strip().lower() + ) + if self.text_type_mode not in {"auto", "never"}: + logger.warning( + f"[DashScope Embedding] 未知的 embedding_text_type_mode: " + f"{self.text_type_mode!r},回退为 'auto'。", + ) + self.text_type_mode = "auto" + provider_id = provider_config.get("id", "unknown_id") logger.info( f"[DashScope Embedding] {provider_id} Initialized via native SDK, " @@ -48,13 +66,43 @@ def __init__(self, provider_config: dict, provider_settings: dict) -> None: ) self.set_model(self.model) + def _is_multimodal(self) -> bool: + return ( + "vl-embedding" in self.model + or self.model.startswith("multimodal-embedding") + or self.model.startswith("tongyi-embedding-vision") + ) + + def _should_send_text_type(self) -> bool: + """多模态端点不接受 text_type;旧版模型也不支持。""" + if self.text_type_mode == "never": + return False + return not self._is_multimodal() + async def get_embedding(self, text: str) -> list[float]: - """Get the embedding vector for a single text.""" - embeddings = await self.get_embeddings([text]) + """Get the embedding vector for a single text. + + 按文档侧语义嵌入,保持与既有调用方(入库、连通性测试)的兼容性。 + 检索查询请使用 :meth:`get_query_embedding`。 + """ + embeddings = await self._get_embeddings_with_type([text], "document") + return embeddings[0] if embeddings else [] + + async def get_query_embedding(self, text: str) -> list[float]: + """Get the embedding vector for a retrieval query.""" + embeddings = await self._get_embeddings_with_type([text], "query") return embeddings[0] if embeddings else [] async def get_embeddings(self, text: list[str]) -> list[list[float]]: - """Get the embedding vectors for a batch of texts via the dashscope SDK. + """Get the embedding vectors for a batch of documents.""" + return await self._get_embeddings_with_type(text, "document") + + async def _get_embeddings_with_type( + self, + text: list[str], + text_type: str, + ) -> list[list[float]]: + """Get embedding vectors, optionally tagging the input role. Multimodal models (e.g. qwen3-vl-embedding) use the multimodal-embedding endpoint and accept text wrapped in content dicts; @@ -63,11 +111,7 @@ async def get_embeddings(self, text: list[str]) -> list[list[float]]: if not text: return [] - is_multimodal = ( - "vl-embedding" in self.model - or self.model.startswith("multimodal-embedding") - or self.model.startswith("tongyi-embedding-vision") - ) + is_multimodal = self._is_multimodal() kwargs: dict = { "base_address": self.base_url, @@ -84,6 +128,11 @@ async def get_embeddings(self, text: list[str]) -> list[list[float]]: f"'{self.provider_config['embedding_dimensions']}', ignored." ) + if self._should_send_text_type(): + if text_type not in _TEXT_TYPES: + text_type = "document" + kwargs["text_type"] = text_type + # The dashscope SDK is synchronous; run it in a worker thread. # base_address is passed per-call to avoid racing on the module-level # dashscope.base_http_api_url global under concurrent usage. diff --git a/astrbot/core/provider/sources/nvidia_embedding_source.py b/astrbot/core/provider/sources/nvidia_embedding_source.py index d650c68b4a1..ed3357661cb 100644 --- a/astrbot/core/provider/sources/nvidia_embedding_source.py +++ b/astrbot/core/provider/sources/nvidia_embedding_source.py @@ -30,7 +30,11 @@ def __init__(self, provider_config: dict, provider_settings: dict) -> None: self.model = provider_config.get( "embedding_model", "nvidia/nemotron-3-embed-1b" ) + # 文档侧 input_type。索引阶段用 passage。 self.input_type = provider_config.get("input_type", "passage") + # 查询侧 input_type。NV-Embed-QA / E5 / nemotron 这类模型必须区分 + # passage 与 query,混用会显著降低检索准确率。 + self.query_input_type = provider_config.get("query_input_type") or "query" proxy = provider_config.get("proxy", "") self.proxy = proxy @@ -54,7 +58,11 @@ async def _get_client(self): ) return self.client - def _build_payload(self, text: str | list[str]) -> dict: + def _build_payload( + self, + text: str | list[str], + input_type: str | None = None, + ) -> dict: if isinstance(text, str): input_text = [text] else: @@ -63,7 +71,7 @@ def _build_payload(self, text: str | list[str]) -> dict: return { "input": input_text, "model": self.model, - "input_type": self.input_type, + "input_type": input_type or self.input_type, "encoding_format": "float", } @@ -76,15 +84,33 @@ def _parse_response(self, response_data: dict) -> list[list[float]]: return embeddings async def get_embedding(self, text: str) -> list[float]: + """单条文本按文档侧(passage)语义嵌入。""" embeddings = await self.get_embeddings([text]) return embeddings[0] if embeddings else [] + async def get_query_embedding(self, text: str) -> list[float]: + """检索查询按 query 侧语义嵌入。 + + NVIDIA 文档明确要求检索查询使用 ``input_type=query``,混用 passage + 会显著降低检索准确率。 + """ + embeddings = await self._get_embeddings_with_type([text], self.query_input_type) + return embeddings[0] if embeddings else [] + async def get_embeddings(self, text: list[str]) -> list[list[float]]: + """批量按文档侧(passage)语义嵌入。""" + return await self._get_embeddings_with_type(text, self.input_type) + + async def _get_embeddings_with_type( + self, + text: list[str], + input_type: str, + ) -> list[list[float]]: client = await self._get_client() if not client or client.closed: raise Exception("[NVIDIA Embedding] Client session not initialized") - payload = self._build_payload(text) + payload = self._build_payload(text, input_type=input_type) request_url = f"{self.base_url}/embeddings" try: diff --git a/dashboard/src/i18n/locales/en-US/features/config-metadata.json b/dashboard/src/i18n/locales/en-US/features/config-metadata.json index 66405d7c380..59fb0963b39 100644 --- a/dashboard/src/i18n/locales/en-US/features/config-metadata.json +++ b/dashboard/src/i18n/locales/en-US/features/config-metadata.json @@ -1,2094 +1,2109 @@ -{ - "ai_group": { - "name": "AI", - "agent_runner": { - "description": "Agent Runner", - "hint": "Select the runner for AI conversations. Switching runners resets the configuration to the new type's defaults.", - "provider_settings": { - "enable": { - "description": "Enable", - "hint": "Master switch for AI conversations" - } - }, - "agent_runner": { - "runner_type": { - "description": "Runner", - "labels": [ - "Built-in Agent", - "Dify", - "Coze", - "Alibaba Cloud Bailian Application", - "DeerFlow" - ] - } - } - }, - "dify_runner": { - "description": "Dify Configuration", - "agent_runner": { "config": { - "dify_api_type": { "description": "Application Type" }, - "dify_api_key": { "description": "API Key" }, - "dify_api_base": { "description": "API Base URL" }, - "dify_workflow_output_key": { "description": "Workflow Output Variable" }, - "dify_query_input_key": { "description": "Prompt Input Variable" }, - "variables": { "description": "Variables" }, - "timeout": { "description": "Timeout (seconds)" }, - "proxy": { "description": "Proxy URL" } - } } - }, - "coze_runner": { - "description": "Coze Configuration", - "agent_runner": { "config": { - "coze_api_key": { "description": "API Key" }, - "bot_id": { "description": "Bot ID" }, - "coze_api_base": { "description": "API Base URL" }, - "auto_save_history": { "description": "Let Coze Manage Conversation History" }, - "timeout": { "description": "Timeout (seconds)" }, - "proxy": { "description": "Proxy URL" } - } } - }, - "dashscope_runner": { - "description": "Alibaba Cloud Bailian Application Configuration", - "agent_runner": { "config": { - "dashscope_app_type": { "description": "Application Type" }, - "dashscope_api_key": { "description": "API Key" }, - "dashscope_app_id": { "description": "Application ID" }, - "rag_options": { - "pipeline_ids": { "description": "Knowledge Base Pipeline IDs" }, - "file_ids": { "description": "File IDs" }, - "output_reference": { "description": "Include References" } - }, - "variables": { "description": "Variables" }, - "timeout": { "description": "Timeout (seconds)" }, - "proxy": { "description": "Proxy URL" } - } } - }, - "deerflow_runner": { - "description": "DeerFlow Configuration", - "agent_runner": { "config": { - "deerflow_api_base": { "description": "API Base URL" }, - "deerflow_api_key": { "description": "API Key" }, - "deerflow_auth_header": { "description": "Authorization Header" }, - "deerflow_assistant_id": { "description": "Assistant ID" }, - "deerflow_model_name": { "description": "Model Name Override" }, - "deerflow_thinking_enabled": { "description": "Enable Thinking Mode" }, - "deerflow_plan_mode": { "description": "Enable Plan Mode" }, - "deerflow_subagent_enabled": { "description": "Enable Subagents" }, - "deerflow_max_concurrent_subagents": { "description": "Maximum Concurrent Subagents" }, - "deerflow_recursion_limit": { "description": "Recursion Limit" }, - "timeout": { "description": "Timeout (seconds)" }, - "proxy": { "description": "Proxy URL" } - } } - }, - "ai": { - "description": "Model", - "hint": "Configure the built-in Agent's chat models and shared image caption and speech models.", - "agent_runner": { "config": { "model": { - "provider_id": { - "description": "Chat Model", - "hint": "Uses the first model when left empty" - }, - "fallback_provider_ids": { - "description": "Fallback Chat Models", - "hint": "Try these chat models in order when the primary model request fails." - }, - "request_max_retries": { - "description": "Retries on Error", - "hint": "Maximum attempts for a single model request when retryable errors occur." - } - } } }, - "provider_settings": { - "default_image_caption_provider_id": { - "description": "Image Caption Model", - "hint": "When the chat model does not support image input, use the image captioning model to describe images. Leave blank to disable." - }, - "image_caption_prompt": { - "description": "Image Caption Prompt", - "hint": "The prompt used by the image captioning model." - } - }, - "provider_stt_settings": { - "enable": { - "description": "Speech Recognition", - "hint": "Use a speech-to-text model to transcribe user voice messages into text for the model to understand." - }, - "provider_id": { - "description": "Default Speech-to-Text Model", - "hint": "You can also use /provider to select a model for an individual conversation." - } - }, - "provider_tts_settings": { - "enable": { - "description": "Voice Replies", - "hint": "Use a text-to-speech model to turn text into voice replies." - }, - "provider_id": { - "description": "Default Text-to-Speech Model", - "hint": "You can also use /provider to select a model for an individual conversation." - }, - "trigger_probability": { - "description": "TTS Trigger Probability", - "hint": "Trigger voice replies based on a random probability." - } - } - }, - "persona": { - "description": "Persona", - "hint": "Set the default persona for AI conversations. Personas can be managed in the Persona tab.", - "agent_runner": { "config": { "persona": { - "persona_id": { "description": "Default Persona" }, - "safety_mode": { - "description": "Safety Mode", - "hint": "Guide the model toward safe content and away from harmful or sensitive topics." - }, - "safety_mode_strategy": { - "description": "Safety Mode Strategy", - "hint": "Select how safety mode is applied." - } - } } } - }, - "knowledgebase": { - "description": "Knowledge Base", - "hint": "AstrBot's \"external brain\".", - "kb_names": { - "description": "Knowledge Base List", - "hint": "Supports multiple selections" - }, - "kb_fusion_top_k": { - "description": "Fusion Search Results Count", - "hint": "Number of results returned after fusing search results from multiple knowledge bases" - }, - "kb_final_top_k": { - "description": "Final Results Count", - "hint": "Number of results retrieved from the knowledge base. Higher values may provide more relevant information but could also introduce noise. Adjust based on actual needs" - }, - "kb_agentic_mode": { - "description": "Agentic Knowledge Base Retrieval", - "hint": "When enabled, knowledge base retrieval becomes an LLM Tool, allowing the model to autonomously decide when to query the knowledge base. Requires the model to support function calling." - } - }, - "websearch": { - "description": "Web Search", - "hint": "Enables AstrBot to access the internet and stay up to date.", - "provider_settings": { - "web_search": { - "description": "Enable Web Search" - }, - "websearch_provider": { - "description": "Web Search Provider", - "labels": [ - "SerpApi", - "DeepSeek Search API", - "Tavily", - "Baidu AI Search", - "Bocha", - "Brave", - "Firecrawl", - "Exa", - "AnySearch" - ], - "subtitles": [ - "Google web, news, image, scholar, and finance search", - "Official DeepSeek search API", - "", - "", - "", - "", - "", - "", - "" - ] - }, - "websearch_tavily_key": { - "description": "Tavily API Key", - "hint": "Multiple keys can be added for rotation." - }, - "websearch_bocha_key": { - "description": "BoCha API Key", - "hint": "Multiple keys can be added for rotation." - }, - "websearch_brave_key": { - "description": "Brave Search API Key", - "hint": "Multiple keys can be added for rotation." - }, - "websearch_firecrawl_key": { - "description": "Firecrawl API Key", - "hint": "Multiple keys can be added for rotation." - }, - "websearch_baidu_app_builder_key": { - "description": "Baidu Qianfan Smart Cloud APP Builder API Key", - "hint": "Reference: [https://console.bce.baidu.com/iam/#/iam/apikey/list](https://console.bce.baidu.com/iam/#/iam/apikey/list)" - }, - "web_search_link": { - "description": "Display Source Citations" - }, - "websearch_exa_key": { - "description": "Exa API Key", - "hint": "Multiple keys can be added for rotation. Get a key at https://dashboard.exa.ai" - }, - "websearch_anysearch_key": { - "description": "AnySearch API Key", - "hint": "Multiple keys can be added for rotation. Leave empty to use anonymous mode with a daily free quota." - }, - "websearch_serpapi_key": { - "description": "SerpApi API Key", - "hint": "Supports Google web, news, image, scholar, and finance search. Multiple keys can be added for rotation. Get a key: [https://serpapi.com/manage-api-key](https://serpapi.com/manage-api-key)" - }, - "websearch_deepseek_key": { - "description": "DeepSeek API Key", - "hint": "Enter your DeepSeek API key. Can use the same key as the chat model (must be entered separately). Supports multiple keys for rotation. Get a key: [https://platform.deepseek.com/api_keys](https://platform.deepseek.com/api_keys)" - } - } - }, - "file_extract": { - "description": "File Extract", - "provider_settings": { - "file_extract": { - "enable": { - "description": "Enable File Extract" - }, - "provider": { - "description": "File Extract Provider" - }, - "moonshotai_api_key": { - "description": "Moonshot AI API Key" - } - } - } - }, - "agent_computer_use": { - "description": "Agent Computer Use", - "hint": "Allows the AstrBot to access and use your computer or an sandbox environment to perform more complex tasks. See: [Agent Sandbox Environment](https://docs.astrbot.app/en/use/astrbot-agent-sandbox.html).", - "provider_settings": { - "computer_use_runtime": { - "description": "Computer Use Runtime", - "hint": "Environment the Agent is allowed to access.", - "labels": ["No environment", "Local machine", "Third-party sandbox"] - }, - "computer_use_local_permissions": { - "description": "Local Permission Policies" - }, - "computer_use_require_admin": { - "description": "Require Admin Permission for Sandbox", - "hint": "When enabled, AstrBot admin permission is required to use remote sandbox capabilities. Add admins under Config -> Access Control -> Administrators -> Administrator IDs. Send /sid to the bot to get the ID." - }, - "sandbox": { - "booter": { - "description": "Sandbox Environment Driver" - }, - "shipyard_neo_endpoint": { - "description": "Shipyard Neo API Endpoint", - "hint": "Bay API address, default http://127.0.0.1:8114." - }, - "shipyard_neo_access_token": { - "description": "Shipyard Neo Access Token", - "hint": "Bay API Key (sk-bay-...). Leave empty for auto-discovery from credentials.json." - }, - "shipyard_neo_profile": { - "description": "Shipyard Neo Profile", - "hint": "Sandbox profile for Shipyard Neo, e.g. python-default. Leave empty to auto-select the most capable profile." - }, - "shipyard_neo_ttl": { - "description": "Shipyard Neo Sandbox TTL", - "hint": "Sandbox time-to-live in seconds." - }, - "cua_image": { - "description": "CUA Image", - "hint": "CUA sandbox image or OS type. Defaults to linux. Supported values depend on the installed CUA SDK." - }, - "cua_os_type": { - "description": "CUA OS Type", - "hint": "CUA sandbox operating system type. Defaults to linux." - }, - "cua_idle_timeout": { - "description": "CUA Idle Timeout", - "hint": "Idle timeout for CUA sandbox sessions in seconds. When greater than 0, AstrBot proactively shuts down an idle CUA sandbox after that amount of inactivity; 0 disables it." - }, - "cua_telemetry_enabled": { - "description": "CUA Telemetry", - "hint": "Allow the CUA SDK to send telemetry data. Disabled by default." - }, - "cua_local": { - "description": "CUA Local Sandbox", - "hint": "Prefer a local CUA sandbox. Enabled by default to avoid requiring CUA_API_KEY for cloud sandboxes. Disable this to use CUA cloud sandboxes." - }, - "cua_api_key": { - "description": "CUA API Key", - "hint": "CUA cloud sandbox API key. Required only when local sandbox is disabled. You can also provide it via the CUA_API_KEY environment variable." - }, - "shipyard_endpoint": { - "description": "Shipyard API Endpoint", - "hint": "API access address for Shipyard service." - }, - "shipyard_access_token": { - "description": "Shipyard Access Token", - "hint": "Access token for accessing Shipyard service." - }, - "shipyard_ttl": { - "description": "Shipyard Session TTL", - "hint": "Session time-to-live in seconds." - }, - "shipyard_max_sessions": { - "description": "Shipyard Max Sessions", - "hint": "Maximum number of Shipyard sessions an instance can handle." - } - } - }, - "local_permissions": { - "role": "Role", - "execution": "Allow code execution", - "network": "Allow execution network access", - "filesystem": "File access scope", - "scopes": { - "workspace": "Workspace", - "host": "Entire environment" - }, - "scopeHints": { - "none": "No file access allowed", - "workspace": "Restricted workspace, temporary directories, and skill files.", - "workspaceUnsupported": "Restricted workspace file access is unavailable on this platform.", - "host": "All files in the environment where AstrBot runs." - }, - "scopeDetails": { - "account": "1. Access is limited to files permitted by the account running AstrBot.", - "docker": "2. If deployed through Docker, only files inside the container and mounted files are accessible, not all files on the Docker host." - }, - "roles": { - "member": "Member", - "admin": "Administrator" - }, - "modes": { - "none": "Disabled" - }, - "networkAlwaysOn": "Always on", - "windowsHostNetworkHint": "Windows cannot disable networking while executing code with entire-environment access. Switch to workspace access to disable networking.", - "runtimeUnknown": "Runtime information is unavailable.", - "memberWarning": "Members have network access or file access across the entire environment.", - "executionInactive": "Inactive", - "executionInactiveHelp": "Why execution is inactive", - "executionBlocked": "Code execution is enabled for {role}, but the configured isolation requirements cannot currently be met. {reason}", - "runtime": { - "os": "OS", - "arch": "Architecture", - "sandbox": "Local isolation", - "windowsUnavailable": "{backend} · Not ready", - "windowsSetupHint": "Save the configuration and restart AstrBot. If prompted for administrator approval, allow it to initialize the sandbox.", - "errorDetails": "View diagnostic details", - "unavailableHint": "Sandbox startup failed, affecting restricted Shell/Python execution and workspace file search. Use the error below to check system security policies (such as Linux AppArmor and user namespace restrictions) or container restrictions, then restart AstrBot to check again.", - "dialog": { - "intro": "Using Seatbelt on macOS or bubblewrap (bwrap) on Linux, AstrBot provides security isolation for Agent execution, restricting file access scope and network permissions for different users of AstrBot Agent to improve security.", - "startupError": "View startup error", - "documentation": "View detailed setup documentation" - }, - "close": "Close", - "setupHint": { - "missing": "Install {dependency} to enable all local isolation features.", - "unavailable": "Configure {backend} to enable all local isolation features.", - "unsupported": "Learn about local isolation support." - }, - "isolationFailure": { - "missing": "Missing {dependency}.", - "unavailable": "{backend} failed its startup probe.", - "unsupported": "Local process isolation is not supported on this platform." - }, - "executionUnavailable": { - "missing": "Missing {dependency}; code execution cannot be enabled when File access scope is set to Workspace.", - "unavailable": "{backend} cannot start; code execution cannot be enabled when File access scope is set to Workspace.", - "unsupported": "Local isolation is unsupported on this platform; code execution cannot be enabled when File access scope is set to Workspace." - }, - "status": { - "detected": "{backend}", - "missing": "Missing {dependency}", - "unavailable": "{backend} · Installed but cannot start", - "unsupported": "Unsupported" - } - } - } - }, - "proactive_capability": { - "description": "Proactive Agent", - "hint": "AstrBot will wake up, run your tasks, and deliver the results to you. See [Proactive Agent](https://docs.astrbot.app/en/use/proactive-agent.html)", - "provider_settings": { - "proactive_capability": { - "add_cron_tools": { - "description": "Enable", - "hint": "When enabled, related tools will be passed to the Agent to implement proactive Agent capabilities. You can tell AstrBot what to do at a future time, and it will be triggered on schedule to execute the task, and report the result back to you." - } - } - } - }, - "truncate_and_compress": { - "hint": "[Context Management](https://docs.astrbot.app/en/use/context-compress.html)", - "description": "Context Management Strategy", - "agent_runner": { "config": { "compression": { - "max_turns": { - "description": "Max Turns Before Compression", - "hint": "Persistent conversation history is truncated or LLM-compressed by the strategy below only after it exceeds this many turns. Request-time contexts are also constrained by this value before sending. -1 means no turn-based limit." - }, - "trim_turns": { - "description": "Turns to Discard When Limit Exceeded", - "hint": "When history exceeds 'Max Turns Before Compression' and LLM compression is unavailable, discard this many oldest turns at once. Request-time truncation also reuses this value." - }, - "overflow_strategy": { - "description": "Compression Strategy", - "labels": [ - "Truncate by Turns", - "Compress by LLM" - ], - "hint": "Strategy for handling model context limits." - }, - "instruction": { - "description": "Context Compression Instruction", - "hint": "If empty, the default prompt will be used." - }, - "keep_recent_ratio": { - "description": "Recent Context Token Ratio to Keep", - "hint": "Keep recent exact context by current context token ratio, from 0-0.3. 0.15 means keeping 15%; values above 0 keep at least the latest round." - }, - "provider_id": { - "description": "Compression Model", - "hint": "The model used for context compression. Defaults to the current chat model." - }, - "fallback_max_tokens": { - "description": "Fallback context window size", - "hint": "When max_context_tokens is 0 and the model is not in built-in metadata, use this value as the context window size. Default: 128000." - } - } } } - }, - "others": { - "description": "Other Settings", - "agent_runner": { "config": { "misc": { - "max_steps": { "description": "Maximum Tool Call Rounds" }, - "tool_schema_mode": { - "description": "Tool Schema Mode", - "hint": "Skills-like sends name/description first and re-queries for parameters; Full sends the complete schema in one step.", - "labels": ["Skills-like (two-stage)", "Full schema"] - }, - "tool_call_timeout": { - "description": "Tool Call Timeout (seconds)" - }, - "sanitize_context_by_modalities": { - "description": "Sanitize History by Modalities", - "hint": "When enabled, sanitizes contexts before each LLM request by removing image blocks and tool-call structures that the current provider's modalities do not support (this changes what the model sees)." - } - } } }, - "provider_settings": { - "display_reasoning_text": { - "description": "Display Reasoning Content", - "hint": "Include the model's chain-of-thought information in the final reply." - }, - "identifier": { - "description": "User Identification", - "hint": "Prepend the user ID to the user prompt." - }, - "group_name_display": { - "description": "Display Group Name", - "hint": "Prepend the group name to user prompts in group chats on supported messaging platforms." - }, - "datetime_system_prompt": { - "description": "Real-world Time Awareness", - "hint": "Include the current time in the user prompt." - }, - "show_tool_use_status": { - "description": "Show Tool Call Information", - "hint": "When a tool is called, also send a message containing the tool name." - }, - "show_tool_call_result": { - "description": "Output Tool Call Results", - "hint": "Only takes effect when \"Show Tool Call Information\" is enabled, and shows at most 70 characters." - }, - "buffer_intermediate_messages": { - "description": "Merge Agent Intermediate Messages", - "hint": "When enabled, intermediate text generated during multi-step tool calls in non-streaming mode will be buffered and sent as a single merged reply after the Agent finishes." - }, - "max_quoted_fallback_images": { - "description": "Forwarded Image Fetch Limit", - "hint": "Maximum number of images injected from forwarded-message parsing; extra images are truncated." - }, - "quoted_message_parser": { - "max_component_chain_depth": { - "description": "Forwarded Rich-Text Parse Depth", - "hint": "Maximum recursive depth when parsing rich-text component chains inside forwarded messages." - }, - "max_forward_node_depth": { - "description": "Forward Nesting Parse Depth", - "hint": "Maximum recursive depth when parsing nested forwarded nodes." - }, - "max_forward_fetch": { - "description": "Forward Recursive Fetch Limit", - "hint": "Maximum number of recursive get_forward_msg fetch operations." - }, - "warn_on_action_failure": { - "description": "Warn on Forward Parse Failure", - "hint": "When enabled, log warnings when all get_msg/get_forward_msg attempts fail." - } - }, - "streaming_response": { - "description": "Streaming Output", - "hint": "Display responses with a typewriter effect on supported chat platforms." - }, - "unsupported_streaming_strategy": { - "description": "Platforms Without Streaming Support", - "hint": "Select the handling method for platforms that don't support streaming responses. Real-time segmented reply sends content immediately when the system detects segment points like punctuation during streaming reception", - "labels": [ - "Real-time Segmented Reply", - "Disable Streaming Response" - ] - }, - "wake_prefix": { - "description": "Additional Wake Prefix", - "hint": "If the wake prefix is / and the additional chat wake prefix is chat, then /chat is required to trigger LLM requests" - }, - "prompt_prefix": { - "description": "User Prompt", - "hint": "You can use {{prompt}} as a placeholder for user input. If no placeholder is provided, it will be added before the user input." - }, - "image_compress_options": { - "description": "Model input image settings", - "hint": "Images are always prepared as JPEG/PNG below 512 KiB. Original attachments are preserved.", - "max_size": { - "description": "Input image maximum edge length", - "hint": "Longest edge sent to the model, in pixels. Images may be reduced further to stay below 512 KiB; original attachment paths are unchanged." - } - }, - "reachability_check": { - "description": "Provider Reachability Check", - "hint": "When running the /provider command, test provider connectivity in parallel. This actively pings models and may consume extra tokens." - } - }, - "provider_tts_settings": { - "dual_output": { - "description": "Output Both Voice and Text When TTS is Enabled" - } - } - } - }, - "platform_group": { - "name": "Platforms & Messages", - "platform": { - "description": "Message Platform Adapters", - "app_id": { - "description": "Application ID", - "hint": "The application ID from the messaging platform's developer console." - }, - "app_secret": { - "description": "Application secret", - "hint": "The application secret from the messaging platform's developer console. Keep it secure." - }, - "domain": { - "description": "Open platform API URL", - "hint": "The base URL of the open platform API. The default normally does not need to be changed." - }, - "corpid": { - "description": "Enterprise ID", - "hint": "The enterprise ID (CorpID) from the WeCom administration console." - }, - "token": { - "description": "Callback token", - "hint": "The token used to verify requests in the messaging platform's callback settings." - }, - "encoding_aes_key": { - "description": "Message encryption key", - "hint": "The EncodingAESKey from the callback settings, used to encrypt and decrypt messages." - }, - "api_base_url": { - "description": "API base URL", - "hint": "The messaging platform API base URL. The default normally does not need to be changed." - }, - "client_id": { - "description": "Client ID", - "hint": "The client ID from the messaging platform's developer console." - }, - "client_secret": { - "description": "Client secret", - "hint": "The client secret from the messaging platform's developer console. Keep it secure." - }, - "start_message": { - "description": "Start command reply", - "hint": "The message sent when a user sends the /start command to the Telegram bot." - }, - "telegram_api_base_url": { - "description": "API URL", - "hint": "The Telegram Bot API base URL. The official default normally does not need to be changed." - }, - "telegram_file_base_url": { - "description": "File API URL", - "hint": "The base URL used to download files from the Telegram Bot API. The official default normally does not need to be changed." - }, - "bot_token": { - "description": "Slack Bot Token", - "hint": "The Slack application's Bot User OAuth Token, usually beginning with xoxb-." - }, - "app_token": { - "description": "Slack App Token", - "hint": "The App-Level Token used by Slack Socket Mode, usually beginning with xapp-." - }, - "signing_secret": { - "description": "Slack Signing Secret", - "hint": "The Slack application's Signing Secret, used to verify webhook requests." - }, - "channel_access_token": { - "description": "LINE Channel Access Token", - "hint": "The Channel Access Token for the LINE Messaging API channel." - }, - "channel_secret": { - "description": "LINE Channel Secret", - "hint": "The Channel Secret for the LINE Messaging API channel." - }, - "active_send_mode": { - "description": "Use Proactive Send API" - }, - "appid": { - "description": "App ID", - "hint": "Required. App ID for the current messaging platform. See the platform integration docs for how to obtain it." - }, - "callback_server_host": { - "description": "Callback Server Host", - "hint": "Callback server host. Leave empty to disable the callback server." - }, - "card_template_id": { - "description": "Card Template ID", - "hint": "Optional. DingTalk interactive card template ID. When enabled, streaming replies will use interactive cards." - }, - "discord_activity_name": { - "description": "Discord Activity Name", - "hint": "Optional Discord activity name. Leave empty to disable." - }, - "discord_allow_bot_messages": { - "description": "Allow Bot Messages", - "hint": "When enabled, AstrBot will receive messages from other Discord bots. Useful for bot-to-bot communication scenarios (e.g., message forwarding). Disabled by default." - }, - "discord_command_register": { - "description": "Register Discord slash commands", - "hint": "When enabled, AstrBot will automatically register plugin commands as Discord slash commands" - }, - "discord_proxy": { - "description": "Discord Proxy URL", - "hint": "Optional proxy URL: http://ip:port" - }, - "discord_token": { - "description": "Discord Bot Token", - "hint": "Enter your Discord Bot Token here." - }, - "enable": { - "description": "Enable", - "hint": "Whether to enable this adapter. Disabled adapters will not receive messages." - }, - "enable_group_c2c": { - "description": "Enable Message List Private Chat", - "hint": "When enabled, the bot can receive private chats from QQ message list. You may need to add the bot as a friend by scanning a QR code in the QQ bot platform. See docs." - }, - "enable_guild_direct_message": { - "description": "Enable Guild Direct Messages", - "hint": "When enabled, the bot can receive guild direct messages." - }, - "id": { - "description": "Bot Name", - "hint": "Bot name" - }, - "is_sandbox": { - "description": "Sandbox Mode" - }, - "kf_name": { - "description": "WeChat Customer Service Account Name", - "hint": "Optional. Customer service account name (not ID). Get it at https://kf.weixin.qq.com/kf/frame#/accounts" - }, - "lark_connection_mode": { - "description": "Subscription Mode", - "labels": [ - "Long Connection Mode", - "Webhook Server Mode" - ] - }, - "lark_encrypt_key": { - "description": "Encrypt Key", - "hint": "Encryption key for decrypting Lark callback data." - }, - "lark_verification_token": { - "description": "Verification Token", - "hint": "Token for verifying Lark callback requests." - }, - "misskey_allow_insecure_downloads": { - "description": "Allow Insecure Downloads (Disable SSL Verification)", - "hint": "If remote servers have certificate issues, SSL verification will be disabled as a fallback. Use only when necessary due to security risks." - }, - "misskey_default_visibility": { - "description": "Default Post Visibility", - "hint": "Default visibility for bot posts. public: public, home: home timeline, followers: followers only." - }, - "misskey_download_chunk_size": { - "description": "Stream Download Chunk Size (bytes)", - "hint": "Bytes read per chunk during streaming download and MD5 calculation. Too small increases overhead; too large uses more memory." - }, - "misskey_download_timeout": { - "description": "Remote Download Timeout (seconds)", - "hint": "Timeout for downloading remote files (seconds), used when falling back to local upload." - }, - "misskey_enable_chat": { - "description": "Enable Chat Message Responses", - "hint": "When enabled, the bot listens and responds to private chat messages." - }, - "misskey_enable_file_upload": { - "description": "Enable File Upload to Misskey", - "hint": "When enabled, the adapter uploads files in message chains to Misskey. URL files try server-side upload first; if async upload fails, it falls back to local download and upload." - }, - "misskey_instance_url": { - "description": "Misskey Instance URL", - "hint": "e.g. https://misskey.example. The Misskey instance where the bot account lives." - }, - "misskey_local_only": { - "description": "Local Only (No Federation)", - "hint": "When enabled, bot posts are visible only on this instance and are not federated." - }, - "misskey_max_download_bytes": { - "description": "Max Download Size (bytes)", - "hint": "To limit download size to prevent OOM, set the maximum bytes; empty or null means no limit." - }, - "misskey_token": { - "description": "Misskey Access Token", - "hint": "API access token generated in the connection service settings." - }, - "misskey_upload_concurrency": { - "description": "Upload Concurrency Limit", - "hint": "Max number of concurrent upload tasks (integer, default 3)." - }, - "misskey_upload_folder": { - "description": "Target Drive Folder ID", - "hint": "Optional: ID of the target folder in Misskey drive. Leave empty to use the root folder." - }, - "port": { - "description": "Callback Server Port", - "hint": "Callback server port. Leave empty to disable the callback server." - }, - "satori_api_base_url": { - "description": "Satori API Endpoint", - "hint": "Base URL for the Satori API." - }, - "satori_auto_reconnect": { - "description": "Enable Auto Reconnect", - "hint": "Automatically reconnect the WebSocket when disconnected." - }, - "satori_endpoint": { - "description": "Satori WebSocket Endpoint", - "hint": "WebSocket endpoint for Satori events." - }, - "satori_heartbeat_interval": { - "description": "Satori Heartbeat Interval", - "hint": "Interval in seconds between heartbeat messages." - }, - "satori_reconnect_delay": { - "description": "Satori Reconnect Delay", - "hint": "Delay before attempting to reconnect (seconds)." - }, - "satori_token": { - "description": "Satori Token", - "hint": "Token for Satori API authentication." - }, - "secret": { - "description": "Secret", - "hint": "Required." - }, - "slack_connection_mode": { - "description": "Slack Connection Mode", - "hint": "The connection mode for Slack. `webhook` uses a webhook server, `socket` uses Slack's Socket Mode." - }, - "slack_webhook_host": { - "description": "Slack Webhook Host", - "hint": "Only valid when Slack connection mode is `webhook`." - }, - "slack_webhook_path": { - "description": "Slack Webhook Path", - "hint": "Only valid when Slack connection mode is `webhook`." - }, - "slack_webhook_port": { - "description": "Slack Webhook Port", - "hint": "Only valid when Slack connection mode is `webhook`." - }, - "telegram_command_auto_refresh": { - "description": "Command Auto Refresh", - "hint": "When enabled, AstrBot automatically refreshes Telegram commands at runtime. (Setting this alone has no effect)" - }, - "telegram_command_register": { - "description": "Command Registration", - "hint": "When enabled, AstrBot automatically registers Telegram commands." - }, - "telegram_command_register_interval": { - "description": "Command Auto Refresh Interval", - "hint": "Telegram command auto-refresh interval in seconds." - }, - "telegram_polling_restart_delay": { - "description": "Polling Restart Delay", - "hint": "Waiting time in seconds when the polling loop needs to restart after unexpected exits. Defaults to 5s." - }, - "telegram_token": { - "description": "Bot Token", - "hint": "If you are in mainland China, set a proxy or change api_base in Other Settings." - }, - "mattermost_url": { - "description": "Mattermost URL", - "hint": "Mattermost service URL, for example https://chat.example.com." - }, - "mattermost_bot_token": { - "description": "Mattermost Bot Token", - "hint": "The access token generated after creating a bot account in Mattermost." - }, - "mattermost_reconnect_delay": { - "description": "Mattermost Reconnect Delay", - "hint": "Delay in seconds before reconnecting after the WebSocket disconnects. Defaults to 5 seconds." - }, - "type": { - "description": "Adapter Type" - }, - "unified_webhook_mode": { - "description": "Unified Webhook Mode", - "hint": "When enabled, use AstrBot unified webhook entry without opening a separate port. Callback URL is /api/v1/webhooks/platforms/{webhook_uuid}." - }, - "use_markdown": { - "description": "Use Markdown for Proactive Messages", - "hint": "When enabled, proactive messages are sent in Markdown mode by default; an explicit use_markdown() call from a plugin takes precedence over this option." - }, - "webhook_uuid": { - "description": "Webhook UUID", - "hint": "Unique identifier for unified webhook mode; generated when creating the platform." - }, - "wecom_ai_bot_name": { - "description": "WeCom AI Bot Name", - "hint": "Must be correct; otherwise some commands won't work." - }, - "wecom_ai_bot_connection_mode": { - "description": "WeCom AI Bot Connection Mode", - "hint": "Webhook mode requires Token/EncodingAESKey; long_connection mode requires BotID/Secret." - }, - "wecomaibot_friend_message_welcome_text": { - "description": "WeCom AI Bot DM Welcome Message", - "hint": "When a user enters a DM session on that day, reply with a welcome message. Leave empty to disable." - }, - "wecomaibot_init_respond_text": { - "description": "WeCom AI Bot Initial Response Text", - "hint": "First reply when the bot receives a message. Leave empty to disable." - }, - "wecomaibot_token": { - "description": "WeCom AI Bot Token", - "hint": "Used for authentication in webhook callback mode." - }, - "wecomaibot_encoding_aes_key": { - "description": "WeCom AI Bot EncodingAESKey", - "hint": "Used for message encryption/decryption in webhook callback mode." - }, - "wecomaibot_ws_bot_id": { - "description": "Long Connection BotID", - "hint": "BotID credential for WeCom AI Bot long connection mode." - }, - "wecomaibot_ws_secret": { - "description": "Long Connection Secret", - "hint": "Secret credential for WeCom AI Bot long connection mode." - }, - "wecomaibot_ws_url": { - "description": "Long Connection WebSocket URL", - "hint": "Default is wss://openws.work.weixin.qq.com and usually does not need changes." - }, - "wecomaibot_heartbeat_interval": { - "description": "Long Connection Heartbeat Interval", - "hint": "Heartbeat interval (seconds) in long connection mode. 30 seconds is recommended." - }, - "wpp_active_message_poll": { - "description": "Enable Proactive Message Polling", - "hint": "Only enable if WeChat messages are not syncing to AstrBot on time. Disabled by default." - }, - "wpp_active_message_poll_interval": { - "description": "Proactive Message Poll Interval", - "hint": "Interval in seconds, default 3, should not exceed 60 or it may be considered old messages." - }, - "ws_reverse_host": { - "description": "Reverse WebSocket Host", - "hint": "AstrBot acts as the server." - }, - "ws_reverse_port": { - "description": "Reverse WebSocket Port" - }, - "ws_reverse_token": { - "description": "Reverse WebSocket Token", - "hint": "Reverse WebSocket token. If not set, token verification is disabled." - }, - "msg_push_webhook_url": { - "description": "WeCom Message Push Webhook URL", - "hint": "Used for proactive message push. It is strongly recommended to set this for a better message sending experience." - }, - "only_use_webhook_url_to_send": { - "description": "Send Replies via Webhook Only", - "hint": "When enabled, all WeCom AI Bot replies are sent through msg_push_webhook_url. The message push webhook supports more message types (such as images, files, etc.). If you do not need the typing effect, it is strongly recommended to use this option. " - }, - "weixin_oc_base_url": { - "description": "API Base URL", - "hint": "Default: https://ilinkai.weixin.qq.com" - }, - "weixin_oc_bot_type": { - "description": "bot_type (QR login parameter)", - "hint": "Default: 3" - }, - "weixin_oc_qr_poll_interval": { - "description": "QR status poll interval (seconds)", - "hint": "Polling interval in seconds for QR code status." - }, - "weixin_oc_long_poll_timeout_ms": { - "description": "getUpdates long-poll timeout (ms)", - "hint": "Timeout parameter for polling messages." - }, - "weixin_oc_api_timeout_ms": { - "description": "HTTP timeout (ms)", - "hint": "Generic API request timeout." - }, - "weixin_oc_token": { - "description": "Token after login (optional)", - "hint": "Automatically written after QR login; can be filled manually for advanced scenarios." - }, - "kook_bot_token": { - "description": "Bot Token", - "type": "string", - "hint": "Required. The Bot Token obtained from the KOOK Developer Platform." - }, - "kook_reconnect_delay": { - "description": "Reconnect Delay", - "type": "int", - "hint": "Delay time for reconnection (seconds), using an exponential backoff strategy." - }, - "kook_max_reconnect_delay": { - "description": "Max Reconnect Delay", - "type": "int", - "hint": "The maximum value for reconnection delay (seconds)." - }, - "kook_max_retry_delay": { - "description": "Max Retry Delay", - "type": "int", - "hint": "The maximum delay time for retries (seconds)." - }, - "kook_heartbeat_interval": { - "description": "Heartbeat Interval", - "type": "int", - "hint": "The interval time for heartbeat detection (seconds)." - }, - "kook_heartbeat_timeout": { - "description": "Heartbeat Timeout", - "type": "int", - "hint": "The timeout duration for heartbeat detection (seconds)." - }, - "kook_max_heartbeat_failures": { - "description": "Max Heartbeat Failures", - "type": "int", - "hint": "Maximum allowed heartbeat failures; the connection will be dropped if exceeded." - }, - "kook_max_consecutive_failures": { - "description": "Max Consecutive Failures", - "type": "int", - "hint": "Maximum allowed consecutive failures; retries will stop if exceeded." - } - }, - "general": { - "description": "General", - "platform_settings": { - "unique_session": { - "description": "Isolate Conversation", - "hint": "On supported platforms, each group member has a separate conversation context when enabled. Manage command permissions under Handlers → Command." - }, - "friend_message_needs_wake_prefix": { - "description": "Private Messages Require Wake Word", - "hint": "Private messages must also include a wake prefix to activate the bot." - }, - "reply_prefix": { - "description": "Reply Text Prefix", - "hint": "The text prefix added to replies." - }, - "reply_with_mention": { - "description": "Mention Sender in Reply", - "hint": "Mention the sender when replying." - }, - "reply_with_quote": { - "description": "Quote Sender's Message in Reply", - "hint": "Quote the sender's corresponding message when replying." - }, - "forward_threshold": { - "description": "Forward Message Word Count Threshold", - "hint": "On supported platforms, send overly long replies as merged forwarded messages." - }, - "empty_mention_waiting": { - "description": "Trigger Waiting on Mention-only Messages", - "hint": "After a message that only mentions the bot, stay awake for one minute to wait for the user's next message." - } - }, - "wake_prefix": { - "description": "Wake Word", - "hint": "A list of message prefixes that wake the bot. You can also wake it by mentioning it.\n\nBuilt-in commands such as `/help` and `/sid` also depend on the wake word: in group chats they do not trigger unless the message starts with a wake word; in private chats they trigger without a prefix unless \"Private Messages Require Wake Word\" is enabled." - }, - "disable_builtin_commands": { - "description": "Disable Built-in Commands", - "hint": "Disable all built-in AstrBot commands such as help, sid, new, etc." - } - }, - "rate_limit": { - "description": "Rate Limiting", - "platform_settings": { - "rate_limit": { - "time": { - "description": "Message Rate Limit Time (seconds)" - }, - "count": { - "description": "Message Rate Limit Count" - }, - "strategy": { - "description": "Rate Limit Strategy" - } - } - } - }, - "content_safety": { - "description": "Content Safety", - "content_safety": { - "also_use_in_response": { - "description": "Also Check Model Response Content" - }, - "baidu_aip": { - "enable": { - "description": "Use Baidu Content Safety Moderation", - "hint": "You need to manually install the baidu-aip library." - }, - "app_id": { - "description": "App ID" - }, - "api_key": { - "description": "API Key" - }, - "secret_key": { - "description": "Secret Key" - } - }, - "internal_keywords": { - "enable": { - "description": "Keyword Check" - }, - "extra_keywords": { - "description": "Additional Keywords", - "hint": "Additional keyword blocklist, supports regular expressions." - } - } - } - }, - "others": { - "description": "Other Settings", - "platform_settings": { - "ignore_bot_self_message": { - "description": "Ignore Bot's Own Messages" - }, - "ignore_at_all": { - "description": "Ignore @All Events" - }, - "no_permission_reply": { - "description": "Reply When User Has Insufficient Permissions" - } - }, - "platform_specific": { - "lark": { - "pre_ack_emoji": { - "enable": { - "description": "[Lark] Enable Pre-acknowledgment Emoji" - }, - "emojis": { - "description": "Emoji List (Lark Emoji Enum Names)", - "hint": "Emoji enum names reference: [https://open.feishu.cn/document/server-docs/im-v1/message-reaction/emojis-introduce](https://open.feishu.cn/document/server-docs/im-v1/message-reaction/emojis-introduce)" - } - } - }, - "telegram": { - "pre_ack_emoji": { - "enable": { - "description": "[Telegram] Enable Pre-acknowledgment Emoji" - }, - "emojis": { - "description": "Emoji List (Unicode)", - "hint": "Telegram only supports a fixed reaction set, reference: [https://gist.github.com/Soulter/3f22c8e5f9c7e152e967e8bc28c97fc9](https://gist.github.com/Soulter/3f22c8e5f9c7e152e967e8bc28c97fc9)" - } - } - }, - "discord": { - "pre_ack_emoji": { - "enable": { - "description": "[Discord] Enable Pre-acknowledgment Emoji" - }, - "emojis": { - "description": "Emoji List (Unicode or Custom Emoji Name)", - "hint": "Enter Unicode emoji symbols, e.g., 👍, 🤔, ⏳" - } - } - } - } - } - }, - "access_group": { - "name": "Access Control", - "admins": { - "description": "Administrators", - "admins_id": { - "description": "Administrator IDs", - "hint": "Send the /sid command to the bot to get the ID." - } - }, - "whitelist": { - "description": "Whitelist", - "platform_settings": { - "enable_id_white_list": { - "description": "Enable Whitelist", - "hint": "When enabled, only sessions in the whitelist will be responded to." - }, - "id_whitelist": { - "description": "Whitelist ID List", - "hint": "Send the /sid command to the bot to get the ID. An empty list disables the whitelist." - }, - "id_whitelist_log": { - "description": "Log Blocked Messages", - "hint": "Log messages that fail whitelist checks." - }, - "wl_ignore_admin_on_group": { - "description": "Administrator Group Messages Bypass ID Whitelist" - }, - "wl_ignore_admin_on_friend": { - "description": "Administrator Private Messages Bypass ID Whitelist" - } - } - } - }, - "plugin_group": { - "name": "Plugin", - "plugin": { - "description": "Plugins", - "plugin_set": { - "description": "Available Plugins", - "hint": "All non-disabled plugins are enabled by default. If a plugin is disabled on the plugins page, selections here will not take effect." - } - } - }, - "ext_group": { - "name": "Ext.", - "segmented_reply": { - "description": "Segmented Reply", - "platform_settings": { - "segmented_reply": { - "enable": { - "description": "Enable Segmented Reply", - "hint": "Send replies in multiple segments." - }, - "only_llm_result": { - "description": "Segment Only LLM Results" - }, - "interval_method": { - "description": "Interval Method", - "hint": "random uses a random delay. log calculates delay by message length: $y=log_{log\\_base}(x)$, where x is word count and y is in seconds." - }, - "interval": { - "description": "Random Interval Time", - "hint": "Format: minimum,maximum (e.g., 1.5,3.5)" - }, - "log_base": { - "description": "Logarithm Base", - "hint": "Base for logarithmic intervals, defaults to 2.6. Value range: 1.0-10.0." - }, - "words_count_threshold": { - "description": "Segmented Reply Word Count Threshold", - "hint": "Segmented reply word count threshold. Only messages with less than this number of words will be segmented, and messages with more than this number of words will be sent directly (not segmented)." - }, - "split_mode": { - "description": "Split Mode", - "hint": "Used to segment a message. By default, it will be separated by punctuation marks like period, question mark, etc. For example, filling `[。?!]` will remove all periods, question marks, and exclamation marks. re.findall(r'', text)", - "labels": [ - "Regex", - "Words List" - ] - }, - "regex": { - "description": "Segmentation Regular Expression", - "hint": "Used to identify split points with a regular expression. Prefer patterns that match separators." - }, - "split_words": { - "description": "Split Word List", - "hint": "Split when any word in the list is detected" - }, - "content_cleanup_rule": { - "description": "Content Filtering Regular Expression", - "hint": "Remove specified content from segmented content. For example, `[。?!]` will remove all periods, question marks, and exclamation marks." - } - } - } - }, - "ltm": { - "description": "Group Chat Context Awareness", - "provider_ltm_settings": { - "group_icl_enable": { - "description": "Inject Group Chat Records into Context", - "hint": "Record group messages that do not wake the bot and pass them to the model when the bot is activated." - }, - "group_message_max_cnt": { - "description": "Maximum Messages Injected into Context", - "hint": "The maximum number of messages passed to the model." - }, - "image_caption": { - "description": "Auto-understand Images", - "hint": "Convert image messages that do not wake the bot into text descriptions. Use with care in image-heavy group chats, as this can incur substantial costs." - }, - "image_caption_provider_id": { - "description": "Group Chat Image Caption Model", - "hint": "Used to understand images injected from group chat records, configured separately from the default image caption model." - }, - "group_message_history_enable": { - "description": "Persist Group Chat Messages", - "hint": "Persist all group messages and allow the model to query them using tools." - }, - "group_message_history_max_cnt": { - "description": "Maximum Persisted Messages", - "hint": "The maximum number of persisted messages. Older messages are discarded when the limit is exceeded." - }, - "active_reply": { - "enable": { - "description": "Active Reply", - "hint": "Send messages proactively at suitable times." - }, - "method": { - "description": "Active Reply Method" - }, - "possibility_reply": { - "description": "Reply Probability", - "hint": "Value between 0.0-1.0" - }, - "whitelist": { - "description": "Active Reply Whitelist", - "hint": "Whitelist filtering is disabled when empty. Use /sid to get IDs." - } - } - } - }, - "t2i": { - "description": "Text-to-Image", - "t2i": { - "description": "Text-to-Image Output", - "hint": "Convert model replies to images before sending to avoid flooding the chat." - }, - "t2i_word_threshold": { - "description": "Text-to-Image Word Count Threshold" - }, - "t2i_strategy": { - "description": "Text-to-Image Strategy", - "hint": "Text-to-image strategy. `remote` uses a remote HTML-based rendering service, `local` uses PIL for local rendering. When using local, place a TTF font named 'font.ttf' in the data/ directory to customize the font." - }, - "t2i_endpoint": { - "description": "Text-to-Image Service API Endpoint", - "hint": "Uses AstrBot API service when empty" - }, - "t2i_template": { - "description": "Text-to-Image Custom Template", - "hint": "When enabled, you can customize HTML templates for text-to-image rendering." - }, - "t2i_active_template": { - "description": "Currently Active Text-to-Image Rendering Template", - "hint": "This value is maintained by the text-to-image template management page." - } - } - }, - "system_group": { - "name": "System", - "system": { - "description": "System Settings", - "log_level": { - "description": "Console Log Level", - "hint": "Log level for console output." - }, - "log_file_enable": { - "description": "Enable File Logging", - "hint": "Write logs to a file in addition to the console." - }, - "log_file_path": { - "description": "Log File Path", - "hint": "Relative paths are resolved under the data directory, e.g. logs/astrbot.log; absolute paths are supported." - }, - "log_file_max_mb": { - "description": "Log File Max Size (MB)", - "hint": "Rotate when exceeding this size; default 20MB." - }, - "temp_dir_max_size": { - "description": "Temp Directory Size Limit (MB)", - "hint": "Limits total size of data/temp in MB. The system checks every 10 minutes, and when exceeded, deletes oldest files first to release about 30% of current size." - }, - "trace_enable": { - "description": "Enable Trace Recording", - "hint": "Trace each user command and AI call." - }, - "trace_db_path": { - "description": "Trace Database Path", - "hint": "Relative paths start from the data directory, for example logs/traces.db. Absolute paths are also supported." - }, - "trace_db_max_mb": { - "description": "Trace Database Capacity Budget (MB)", - "hint": "Default: 80 MB. Values below 32 MB use 32 MB. Old data is automatically cleared when this size is exceeded." - }, - "trace_retention_days": { - "description": "Trace Retention Days", - "hint": "Default: 7 days. Old data is cleared when either the retention period or capacity is reached." - }, - "pip_install_arg": { - "description": "Additional pip Installation Arguments", - "hint": "When installing plugin dependencies, Python's pip tool will be used. Additional arguments can be provided here, such as `--break-system-package`. TLS certificates of the PyPI index are verified by default; for self-signed/private-CA mirrors, pass `--cert ` (recommended) or explicitly add `--trusted-host `." - }, - "pypi_index_url": { - "description": "PyPI Repository URL", - "hint": "PyPI repository URL for installing Python dependencies. Defaults to [https://mirrors.aliyun.com/pypi/simple/](https://mirrors.aliyun.com/pypi/simple/)" - }, - "callback_api_base": { - "description": "Externally Accessible Callback API Address", - "hint": "External services may access AstrBot's backend through callback links generated by AstrBot (such as file download links). Since AstrBot cannot automatically determine the externally accessible host address in the deployment environment, this configuration item is needed to explicitly specify how external services should access AstrBot's address. Examples: [http://localhost:6185](http://localhost:6185), [https://example.com](https://example.com), etc." - }, - "disable_metrics": { - "description": "Disable Anonymous Usage Statistics", - "hint": "When disabled, AstrBot will not upload anonymous usage statistics." - }, - "dashboard": { - "trust_proxy_headers": { - "description": "Trust Proxy Headers for Client IP", - "hint": "When disabled, ignore X-Forwarded-For/X-Real-IP and use the connection address only." - }, - "auth_rate_limit": { - "enable": { - "description": "Enable Login Rate Limiting", - "hint": "When disabled, authentication endpoints (login, TOTP, etc.) will not be rate-limited." - }, - "average_interval": { - "description": "Endpoint Rate Limit Average Interval (seconds)", - "hint": "Minimum average interval between authentication requests. For example, 1.0 means at most 1 request per second." - }, - "max_burst": { - "description": "Endpoint Rate Limit Max Burst", - "hint": "Maximum number of consecutive burst requests allowed. For example, 3 allows up to 3 requests in a short burst." - } - }, - "ssl": { - "enable": { - "description": "Enable WebUI HTTPS", - "hint": "When enabled, WebUI serves directly over HTTPS." - }, - "cert_file": { - "description": "SSL Certificate File Path", - "hint": "Certificate file path (PEM). Supports absolute and relative paths (relative to current working directory)." - }, - "key_file": { - "description": "SSL Private Key File Path", - "hint": "Private key file path (PEM). Supports absolute and relative paths (relative to current working directory)." - }, - "ca_certs": { - "description": "SSL CA Certificate File Path", - "hint": "Optional. Path to CA certificate file." - } - }, - "totp": { - "enable": { - "description": "Enable WebUI TOTP", - "hint": "When enabled, a TOTP code is required during dashboard login." - }, - "manage": "Manage", - "configuration": "TOTP", - "statusPending": "Setup required", - "statusEnabled": "Enabled", - "setupRequiredHint": "TOTP is enabled but not yet configured. Click Manage to complete setup.", - "setupTitle": "Set up TOTP", - "setupSubtitle": "Scan this QR code in your authenticator app, then enter a verification code.", - "setupConfirm": "Verify and continue", - "activeSubtitle": "Use this QR code or secret to add another authenticator device.", - "rotateTitle": "Rotate TOTP Secret", - "rotateSubtitle": "Generate a new secret, then enter a code from your authenticator to confirm the replacement.", - "rotate": "Rotate", - "rotateRecovery": "Rotate Recovery Code", - "rotateConfirm": "Confirm Rotation", - "rotateCancel": "Cancel", - "rotateCode": "Verification Code", - "rotateCodeHint": "Enter the code from your authenticator app to confirm the new key.", - "rotateError": "Invalid code, please try again.", - "recoveryTitle": "Recovery Codes", - "recoverySubtitle": "This recovery code is shown once. Save it before continuing.", - "recoveryWarning": "If lost, account access cannot be restored through normal means.", - "recoveryAcknowledge": "I have saved my recovery codes", - "recoveryClose": "Done", - "disableTitle": "Disable TOTP", - "disableSubtitle": "Enter a verification code to disable two-factor authentication.", - "disableRecoverySubtitle": "Enter a recovery code to disable two-factor authentication.", - "disableCode": "Verification Code", - "disableRecoveryCode": "Recovery Code", - "disableConfirm": "Disable", - "disableCancel": "Cancel", - "disableError": "Verification failed. Please try again.", - "disableUseRecovery": "Can't use TOTP?", - "disableUseCode": "Use verification code", - "configSaveTitle": "Two-Factor Verification", - "configSaveSubtitle": "Enter a verification code to change protected configuration.", - "configSaveRotationHint": "When rotating TOTP keys, both the old and new verification codes are accepted (allowed once per rotation operation).", - "configSaveCode": "Verification Code", - "configSaveConfirm": "Continue", - "configSaveCancel": "Cancel", - "configSaveError": "Verification failed. Please try again." - } - }, - "timezone": { - "description": "Timezone", - "hint": "Timezone setting. Please enter an IANA timezone name, such as Asia/Shanghai. Uses system default timezone when empty. For all timezones, see: [https://data.iana.org/time-zones/tzdb-2021a/zone1970.tab](https://data.iana.org/time-zones/tzdb-2021a/zone1970.tab)" - }, - "http_proxy": { - "description": "HTTP Proxy", - "hint": "When enabled, proxy will be set by adding environment variables. Format: `http://ip:port`" - }, - "no_proxy": { - "description": "Direct Connection Address List" - } - } - }, - "provider_group": { - "provider": { - "api_key": { - "description": "API Key" - }, - "dashscope_api_key": { - "description": "DashScope API Key" - }, - "gemini_tts_api_key": { - "description": "Gemini API Key" - }, - "genie_onnx_model_dir": { - "description": "ONNX Model Directory", - "hint": "The directory path containing the ONNX model files" - }, - "genie_language": { - "description": "Language" - }, - "xai_native_search": { - "description": "Enable native search", - "hint": "When enabled, uses xAI Chat Completions native Live Search for web queries (billed on demand). Only applies to xAI providers." - }, - "rerank_api_base": { - "description": "Rerank Model API Base URL", - "hint": "The full request URL is formed by combining the Base URL and a path suffix (defaults to /v1/rerank)." - }, - "rerank_api_suffix": { - "description": "API URL path suffix", - "hint": "Path appended to base_url, e.g. /v1/rerank. Leave empty to disable auto-append." - }, - "rerank_api_key": { - "description": "API Key", - "hint": "Leave empty if no API key is required." - }, - "rerank_model": { - "description": "Rerank model name" - }, - "return_documents": { - "description": "Return source documents in rerank results", - "hint": "Default is false to reduce network overhead." - }, - "instruct": { - "description": "Custom rerank task description", - "hint": "Only effective for qwen3-rerank models. Recommended to write in English." - }, - "nvidia_rerank_api_base": { - "description": "API Base URL" - }, - "nvidia_rerank_api_key": { - "description": "API Key" - }, - "nvidia_rerank_model": { - "description": "Rerank Model Name", - "hint": "Please refer to the NVIDIA Docs for the model name." - }, - "nvidia_rerank_model_endpoint": { - "description": "Custom Model Endpoint", - "hint": "Custom URL suffix endpoint, defaults to /reranking." - }, - "nvidia_rerank_truncate": { - "description": "Text Truncation Strategy", - "hint": "Whether to truncate the input to fit the model's maximum context length when the input text is too long." - }, - "tei_rerank_truncate": { - "description": "Truncate Long Text", - "hint": "Whether to automatically truncate input when it exceeds the model's maximum context length. Requires Truncation Direction when enabled." - }, - "tei_rerank_truncation_direction": { - "description": "Truncation Direction", - "hint": "Choose to truncate from the left or right side of the text. Only takes effect when Truncate Long Text is True." - }, - "tei_rerank_raw_scores": { - "description": "Return Raw Scores", - "hint": "If True, returns raw model logit scores (which may be negative) without sigmoid normalization. Default is False." - }, - "tei_rerank_return_text": { - "description": "Return Document Text in Results", - "hint": "If True, each result will include the original document text. Default is False to reduce network overhead." - }, - "launch_model_if_not_running": { - "description": "Auto-start model if not running", - "hint": "If the model is not running in Xinference, attempt to start it automatically. Recommended to disable in production." - }, - "modalities": { - "description": "Model capabilities", - "hint": "Modalities supported by the model. If the model does not support images, uncheck image.", - "labels": [ - "Text", - "Image", - "Audio", - "Tool use" - ] - }, - - "custom_headers": { - "description": "Custom request headers", - "hint": "Key/value pairs added here are sent by AstrBot as custom HTTP headers to the provider. Values must be strings." - }, - "ollama_disable_thinking": { - "description": "Disable thinking mode", - "hint": "Close Ollama thinking mode." - }, - "custom_extra_body": { - "description": "Custom request body parameters", - "hint": "Add extra parameters to requests, such as temperature, top_p, max_tokens, etc.", - "template_schema": { - "temperature": { - "description": "Temperature", - "hint": "Controls randomness, typically 0-2. Higher is more random.", - "name": "Temperature" - }, - "top_p": { - "description": "Top-p sampling", - "hint": "Nucleus sampling parameter, usually 0-1. Controls probability mass considered.", - "name": "Top-p" - }, - "max_tokens": { - "description": "Max tokens", - "hint": "Maximum number of generated tokens.", - "name": "Max Tokens" - }, - "max_output_tokens": { - "description": "Max output tokens", - "hint": "Maximum number of generated tokens.", - "name": "Max Output Tokens" - }, - "reasoning_effort": { - "description": "Reasoning effort", - "hint": "Controls the effort used by reasoning models. Supported values depend on the model.", - "name": "Reasoning Effort" - } - } - }, - "gpt_weights_path": { - "description": "GPT model file path", - "hint": "The .ckpt file. Use an absolute path without quotes. Leave empty to use the GPT_SoVITS built-in SoVITS model (recommended to change defaults in GPT_SoVITS)." - }, - "sovits_weights_path": { - "description": "SoVITS model file path", - "hint": "The .pth file. Use an absolute path without quotes. Leave empty to use the GPT_SoVITS built-in SoVITS model (recommended to change defaults in GPT_SoVITS)." - }, - "gsv_default_parms": { - "description": "GPT_SoVITS default parameters", - "hint": "Reference audio file path and text are required; other parameters are optional.", - "gsv_ref_audio_path": { - "description": "Reference audio file path", - "hint": "Required! Use an absolute path without quotes." - }, - "gsv_prompt_text": { - "description": "Reference audio text", - "hint": "Required! Provide the transcript of the reference audio." - }, - "gsv_prompt_lang": { - "description": "Reference audio text language", - "hint": "Language of the reference audio text; default is Chinese." - }, - "gsv_aux_ref_audio_paths": { - "description": "Auxiliary reference audio file paths", - "hint": "Auxiliary reference audio files; optional." - }, - "gsv_text_lang": { - "description": "Text language", - "hint": "Default is Chinese." - }, - "gsv_top_k": { - "description": "Speech diversity", - "hint": "" - }, - "gsv_top_p": { - "description": "Nucleus sampling threshold", - "hint": "" - }, - "gsv_temperature": { - "description": "Speech randomness", - "hint": "" - }, - "gsv_text_split_method": { - "description": "Text splitting method", - "hint": "Options: `cut0` no split, `cut1` split every 4 sentences, `cut2` split every 50 chars, `cut3` split by Chinese period, `cut4` split by English period, `cut5` split by punctuation." - }, - "gsv_batch_size": { - "description": "Batch size", - "hint": "" - }, - "gsv_batch_threshold": { - "description": "Batch threshold", - "hint": "" - }, - "gsv_split_bucket": { - "description": "Split text into buckets for parallel processing", - "hint": "" - }, - "gsv_speed_factor": { - "description": "Speech playback speed", - "hint": "1 is the original speed." - }, - "gsv_fragment_interval": { - "description": "Interval between speech segments", - "hint": "" - }, - "gsv_streaming_mode": { - "description": "Enable streaming mode", - "hint": "" - }, - "gsv_seed": { - "description": "Random seed", - "hint": "For reproducible results." - }, - "gsv_parallel_infer": { - "description": "Run inference in parallel", - "hint": "" - }, - "gsv_repetition_penalty": { - "description": "Repetition penalty", - "hint": "" - }, - "gsv_media_type": { - "description": "Output media type", - "hint": "Recommended: wav" - } - }, - "embedding_dimensions": { - "description": "Embedding dimensions", - "hint": "Embedding vector dimensions. May need adjustment per model; see model documentation. This must be correct or the vector database will not work." - }, - "embedding_dimensions_mode": { - "description": "Embedding dimensions mode", - "hint": "Controls whether to send the dimensions parameter in OpenAI-compatible embedding requests. auto sends it only for official OpenAI embedding-3 models; use always when a compatible API supports it, or never when it rejects the parameter." - }, - "embedding_model": { - "description": "Embedding model", - "hint": "Embedding model name." - }, - "embedding_api_key": { - "description": "API Key" - }, - "embedding_api_base": { - "description": "API Base URL" - }, - "openai_embedding": { - "hint": "If testing fails, try adding /v1 at the end for some OpenAI API versions." - }, - "gemini_embedding": { - "hint": "Gemini Embedding does not require manually adding /v1beta.", - "embedding_task_type_mode": { - "description": "Task type delivery mode", - "hint": "auto: pick by model generation (gemini-embedding-001 uses the task_type parameter, gemini-embedding-2 uses text prefixes); never: always use task_type; always: always use text prefixes." - }, - "embedding_query_task_type": { - "description": "Query-side task_type", - "hint": "Only applies in task_type mode. Use RETRIEVAL_QUERY for retrieval queries, CODE_RETRIEVAL_QUERY for code search." - }, - "embedding_document_task_type": { - "description": "Document-side task_type", - "hint": "Only applies in task_type mode. Use RETRIEVAL_DOCUMENT for stored documents, optionally with a title." - }, - "embedding_query_task_name": { - "description": "Query-side task prefix (gemini-embedding-2)", - "hint": "Only applies in text-prefix mode. One of: search result / question answering / fact checking / code retrieval. Invalid values fall back to search result." - }, - "embedding_document_title": { - "description": "Document title (gemini-embedding-2)", - "hint": "Falls back to title: none when empty. Note that knowledge base ingestion already prepends the document title to the text, so setting this repeats the title; usually leave empty." - } - }, - "dashscope_embedding": { - "hint": "Aliyun DashScope Embedding. Default base URL: https://dashscope.aliyuncs.com/api/v1." - }, - "volcengine_cluster": { - "description": "Volcengine cluster", - "hint": "For voice cloning models, choose volcano_icl or volcano_icl_concurr; default is volcano_tts." - }, - "volcengine_voice_type": { - "description": "Volcengine voice", - "hint": "Enter voice id (Voice_type)." - }, - "volcengine_speed_ratio": { - "description": "Speech rate", - "hint": "Speech rate, range 0.2 to 3.0, default 1.0." - }, - "volcengine_volume_ratio": { - "description": "Volume", - "hint": "Volume, range 0.0 to 2.0, default 1.0." - }, - "azure_tts_voice": { - "description": "Voice style", - "hint": "API voice name" - }, - "azure_tts_style": { - "description": "Style", - "hint": "A voice-specific speaking style. Can express emotions like happy, sympathetic, and calm." - }, - "azure_tts_role": { - "description": "Role (optional)", - "hint": "Speaking role-play. The voice can emulate different ages and genders without changing the voice name. For example, a male voice can raise pitch to simulate a female voice, but the voice name does not change. If the role is missing or unsupported, this attribute is ignored." - }, - "azure_tts_rate": { - "description": "Speech rate", - "hint": "Controls speaking rate. You can apply the rate at word or sentence level. Rate should be 0.5x to 2x of original audio." - }, - "azure_tts_volume": { - "description": "Speech volume", - "hint": "Controls volume level. You can apply changes at sentence level. Use 0.0 to 100.0 (quiet to loud, e.g., 75). Default is 100.0." - }, - "azure_tts_region": { - "description": "API region", - "hint": "Region where Azure TTS processes data. See https://learn.microsoft.com/zh-cn/azure/ai-services/speech-service/regions" - }, - "azure_tts_subscription_key": { - "description": "Service subscription key", - "hint": "Azure TTS subscription key (not a token)." - }, - "dashscope_tts_voice": { - "description": "Voice" - }, - "gm_resp_image_modal": { - "description": "Enable image modality", - "hint": "When enabled, responses can include images. Requires model support or it will error. See the Google Gemini website for supported models. Tip: if you need image generation, disable the `Enable member recognition` setting for better results." - }, - "gm_native_search": { - "description": "Enable native search", - "hint": "Only Gemini 3 and later models support using this together with function tools. For Gemini 3 and later, native search is only available on the paid tier; see the official docs for pricing." - }, - "gm_native_coderunner": { - "description": "Enable native code runner", - "hint": "Only Gemini 3 and later models support using this together with function tools." - }, - "gm_url_context": { - "description": "Enable URL context", - "hint": "Only Gemini 3 and later models support using this together with function tools." - }, - "gm_safety_settings": { - "description": "Safety filters", - "hint": "Set the safety filtering level for model input. Levels: NONE (no blocking), HIGH (block high risk), MEDIUM_AND_ABOVE (block medium risk and above), LOW_AND_ABOVE (block low risk and above). See Gemini API docs.", - "harassment": { - "description": "Harassment", - "hint": "Negative or harmful comments" - }, - "hate_speech": { - "description": "Hate speech", - "hint": "Rude, disrespectful, or profane content" - }, - "sexually_explicit": { - "description": "Sexually explicit content", - "hint": "References to sexual acts or other obscene content" - }, - "dangerous_content": { - "description": "Dangerous content", - "hint": "Content that promotes, encourages, or assists harmful behavior" - } - }, - "gm_thinking_config": { - "description": "Thinking Config", - "budget": { - "description": "Thinking Budget", - "hint": "Guides the model on the specific number of thinking tokens to use for reasoning. See: https://ai.google.dev/gemini-api/docs/thinking#set-budget" - }, - "level": { - "description": "Thinking Level", - "hint": "Recommended for Gemini 3 models and onwards, lets you control reasoning behavior.See: https://ai.google.dev/gemini-api/docs/thinking#thinking-levels" - } - }, - "anth_thinking_config": { - "description": "Thinking Config", - "type": { - "description": "Thinking Type", - "hint": "Set 'adaptive' for Opus 4.6+ / Sonnet 4.6+ (recommended). Leave empty to use manual budget mode. See: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking" - }, - "budget": { - "description": "Thinking Budget", - "hint": "Anthropic thinking.budget_tokens param. Must >= 1024. Only used when type is empty. Deprecated on Opus 4.6 / Sonnet 4.6. See: https://platform.claude.com/docs/en/build-with-claude/extended-thinking" - }, - "effort": { - "description": "Effort Level", - "hint": "Controls thinking depth when type is 'adaptive'. 'high' is the default. 'max' is Opus 4.6 only. See: https://platform.claude.com/docs/en/build-with-claude/effort" - } - }, - "minimax-group-id": { - "description": "User group", - "hint": "Visible in Account Management -> Basic Info." - }, - "minimax-langboost": { - "description": "Target language/dialect", - "hint": "Enhances recognition for specified languages/dialects and improves speech performance in those scenarios." - }, - "minimax-voice-speed": { - "description": "Speech rate", - "hint": "Speech speed for synthesis, range [0.5, 2], default 1.0. Higher is faster." - }, - "minimax-voice-vol": { - "description": "Volume", - "hint": "Volume for synthesis, range (0, 10], default 1.0. Higher is louder." - }, - "minimax-voice-pitch": { - "description": "Pitch", - "hint": "Pitch for synthesis, range [-12, 12], default 0." - }, - "minimax-is-timber-weight": { - "description": "Enable mixed voices", - "hint": "Enable mixing up to four voices with custom weights. When enabled, single voice settings are ignored." - }, - "minimax-timber-weight": { - "description": "Mixed voices", - "hint": "Mixed voices and their weights. Up to four voices, integer weights in [1, 100]. Get presets and templates from the official API TTS debug console. Must be a JSON string; check the console to confirm parsing. See defaults and the official code preview for structure." - }, - "minimax-voice-id": { - "description": "Single voice", - "hint": "Single voice ID; see the official documentation." - }, - "minimax-voice-emotion": { - "description": "Emotion", - "hint": "Controls emotion of synthesized speech. When set to auto, it selects emotion based on text." - }, - "minimax-voice-latex": { - "description": "Read LaTeX formulas", - "hint": "Read LaTeX formulas, but ensure input text is formatted per the official requirements." - }, - "minimax-voice-english-normalization": { - "description": "English text normalization", - "hint": "Improves number-reading performance but slightly increases latency." - }, - "rag_options": { - "description": "RAG options", - "hint": "Knowledge base retrieval settings, optional. Only supported for Agent app types (agent apps, including RAG apps). For Bailian apps, enabling this disables multi-turn conversations.", - "pipeline_ids": { - "description": "Knowledge base ID list", - "hint": "Retrieve all documents in the specified knowledge bases. Go to https://bailian.console.aliyun.com/ Data Apps -> Knowledge Index to create and get IDs." - }, - "file_ids": { - "description": "Unstructured document IDs", - "hint": "Retrieve specified unstructured documents. Go to https://bailian.console.aliyun.com/ Data Management to create and get IDs." - }, - "output_reference": { - "description": "Output knowledge base/document references", - "hint": "Append reference sources to the end of each answer. Default is False." - } - }, - "sensevoice_hint": { - "description": "Deploy SenseVoice", - "hint": "Before enabling, install funasr, funasr_onnx, torchaudio, torch, modelscope, and jieba (CPU by default, about 1 GB download), and install ffmpeg. Otherwise STT will not work." - }, - "is_emotion": { - "description": "Emotion recognition", - "hint": "Enable emotion recognition. happy?sad?angry?neutral?fearful?disgusted?surprised?unknown" - }, - "stt_model": { - "description": "Model name", - "hint": "Model name on modelscope. Default: iic/SenseVoiceSmall." - }, - "variables": { - "description": "Workflow fixed input variables", - "hint": "Optional. Fixed workflow input variables are used as workflow inputs. You can also set variables dynamically with /set during a chat. If names conflict, dynamic settings take precedence." - }, - "dashscope_app_type": { - "description": "App type", - "hint": "Bailian app type." - }, - "timeout": { - "description": "Timeout", - "hint": "Timeout in seconds." - }, - "openai-tts-voice": { - "description": "voice", - "hint": "OpenAI TTS voice. OpenAI defaults: 'alloy', 'echo', 'fable', 'onyx', 'nova', 'shimmer'." - }, - "elevenlabs-tts-voice-id": { - "description": "Voice ID", - "hint": "ElevenLabs voice ID. Browse and copy voice IDs at https://elevenlabs.io/app/voice-library. Default 'JBFqnCBsd6RMkjVDRZzb' (George)." - }, - "elevenlabs-tts-output-format": { - "description": "Output format", - "hint": "Audio output format, e.g. 'mp3_44100_128', 'mp3_22050_32', 'wav_44100', or 'opus_48000_128'. Raw PCM/u-law/a-law formats are not supported. Default 'mp3_44100_128'." - }, - "elevenlabs-tts-stability": { - "description": "Stability", - "hint": "Voice stability, range [0, 1]. Higher is more consistent, lower is more expressive. Leave empty to use the server default." - }, - "elevenlabs-tts-similarity-boost": { - "description": "Similarity boost", - "hint": "How closely the output matches the original voice, range [0, 1]. Leave empty to use the server default." - }, - "elevenlabs-tts-style": { - "description": "Style exaggeration", - "hint": "Style exaggeration of the voice, range [0, 1]. Higher values increase latency. Leave empty to use the server default." - }, - "elevenlabs-tts-use-speaker-boost": { - "description": "Speaker boost", - "hint": "Boost similarity to the original speaker. May slightly increase latency." - }, - "mimo-tts-voice": { - "description": "Voice", - "hint": "MiMo TTS voice name. Supported values include 'mimo_default', 'default_en', and 'default_zh'." - }, - "mimo-tts-format": { - "description": "Output format", - "hint": "Audio format generated by MiMo TTS. Supported values: 'wav', 'mp3', and 'pcm'." - }, - "mimo-tts-style-prompt": { - "description": "Style prompt", - "hint": "Prepended to the synthesis target text as a tag to control speed, emotion, character, or style, such as happy, faster, Sun Wukong, or whispering. Optional." - }, - "mimo-tts-dialect": { - "description": "Dialect", - "hint": "Combined with the style prompt inside the leading tag, for example Northeastern Mandarin, Sichuan dialect, Henan dialect, or Cantonese. Optional." - }, - "mimo-tts-seed-text": { - "description": "Seed text", - "hint": "Sent as an optional user message to help guide tone and speaking style. It is not appended to the synthesis target text." - }, - "fishaudio-tts-character": { - "description": "character", - "hint": "Fishaudio TTS character. Default is Klee. More roles: https://fish.audio/zh-CN/discovery" - }, - "fishaudio-tts-reference-id": { - "description": "reference_id", - "hint": "Fishaudio TTS reference model ID (optional). If set, the model ID is used directly instead of looking up by role name. Example: 626bb6d3f3364c9cbc3aa6a67300a664. More models: https://fish.audio/zh-CN/discovery; open a model detail page to copy the model ID." - }, - "whisper_hint": { - "description": "Notes for local Whisper deployment", - "hint": "Before enabling, install the openai-whisper library (NVIDIA users download ~2GB mainly for torch and cuda; CPU users download ~1GB), and install ffmpeg. Otherwise STT will not work." - }, - "whisper_device": { - "description": "Inference device", - "hint": "Whisper inference device. Apple Silicon can use mps; other environments should use cpu. If mps is selected but unavailable, AstrBot will fall back to cpu." - }, - "id": { - "description": "ID" - }, - "type": { - "description": "Provider category" - }, - "provider_type": { - "description": "Provider capability type" - }, - "enable": { - "description": "Enable" - }, - "key": { - "description": "API Key" - }, - "api_base": { - "description": "API Base URL" - }, - "total_timeout": { - "description": "Total timeout", - "hint": "Total timeout in seconds for one decision request, including concurrency-slot wait, retries, and backoff; default 5 seconds." - }, - "max_concurrency": { - "description": "Maximum concurrency", - "hint": "Maximum number of simultaneous decision requests for this provider; default 4." - }, - "proxy": { - "description": "Proxy address", - "hint": "HTTP/HTTPS proxy URL, e.g. http://127.0.0.1:7890. Applies only to this provider's API requests and does not affect Docker internal networking." - }, - "model": { - "description": "Model ID", - "hint": "Model name, e.g., gpt-4o-mini, deepseek-chat." - }, - "max_context_tokens": { - "description": "Model context window size", - "hint": "Maximum context tokens. If 0, it auto-fills from model metadata (if available); you can also edit manually." - }, - "dify_api_key": { - "description": "API Key", - "hint": "Dify API Key. This field is required." - }, - "dify_api_base": { - "description": "API Base URL", - "hint": "Dify API Base URL. Default: https://api.dify.ai/v1" - }, - "dify_api_type": { - "description": "Dify app type", - "hint": "Dify API type. According to Dify docs, supported types are chat, chatflow, agent, workflow." - }, - "dify_workflow_output_key": { - "description": "Dify workflow output variable name", - "hint": "Dify workflow output variable name. Only used when app type is workflow. Default: astrbot_wf_output." - }, - "dify_query_input_key": { - "description": "Prompt input variable name", - "hint": "Input variable name for the message text. Default: astrbot_text_query." - }, - "coze_api_key": { - "description": "Coze API Key", - "hint": "Coze API key for accessing Coze services." - }, - "bot_id": { - "description": "Bot ID", - "hint": "Coze bot ID, obtained after creating a bot on the Coze platform." - }, - "coze_api_base": { - "description": "API Base URL", - "hint": "Base URL for the Coze API. Default: https://api.coze.cn" - }, - "deerflow_api_base": { - "description": "API Base URL", - "hint": "DeerFlow API gateway URL. Default: http://127.0.0.1:2026" - }, - "deerflow_api_key": { - "description": "DeerFlow API Key", - "hint": "Optional. Fill this if your DeerFlow gateway is protected by Bearer auth." - }, - "deerflow_auth_header": { - "description": "Authorization Header", - "hint": "Optional. Custom Authorization header value; takes precedence over DeerFlow API Key." - }, - "deerflow_assistant_id": { - "description": "Assistant ID", - "hint": "LangGraph assistant_id, default is lead_agent." - }, - "deerflow_model_name": { - "description": "Model name override", - "hint": "Optional. Overrides DeerFlow default model (maps to runtime context model_name)." - }, - "deerflow_thinking_enabled": { - "description": "Enable thinking mode" - }, - "deerflow_plan_mode": { - "description": "Enable plan mode", - "hint": "Maps to DeerFlow is_plan_mode." - }, - "deerflow_subagent_enabled": { - "description": "Enable subagent", - "hint": "Maps to DeerFlow subagent_enabled." - }, - "deerflow_max_concurrent_subagents": { - "description": "Max concurrent subagents", - "hint": "Maps to DeerFlow max_concurrent_subagents. Effective only when subagent is enabled. Default: 3." - }, - "deerflow_recursion_limit": { - "description": "Recursion limit", - "hint": "Maps to LangGraph recursion_limit." - }, - "auto_save_history": { - "description": "Conversation history managed by Coze", - "hint": "When enabled, Coze manages conversation history. AstrBot's locally saved context will not take effect (read-only), and operations on AstrBot context will not apply. If disabled, AstrBot manages the context." - } - } - }, - "help": { - "documentation": "Official Documentation", - "support": "Join Support Group", - "helpText": "Don't understand the configuration? See {documentation} or {support}.", - "helpPrefix": "Don't understand the configuration? See", - "helpMiddle": "or", - "helpSuffix": "." - } -} +{ + "ai_group": { + "name": "AI", + "agent_runner": { + "description": "Agent Runner", + "hint": "Select the runner for AI conversations. Switching runners resets the configuration to the new type's defaults.", + "provider_settings": { + "enable": { + "description": "Enable", + "hint": "Master switch for AI conversations" + } + }, + "agent_runner": { + "runner_type": { + "description": "Runner", + "labels": [ + "Built-in Agent", + "Dify", + "Coze", + "Alibaba Cloud Bailian Application", + "DeerFlow" + ] + } + } + }, + "dify_runner": { + "description": "Dify Configuration", + "agent_runner": { "config": { + "dify_api_type": { "description": "Application Type" }, + "dify_api_key": { "description": "API Key" }, + "dify_api_base": { "description": "API Base URL" }, + "dify_workflow_output_key": { "description": "Workflow Output Variable" }, + "dify_query_input_key": { "description": "Prompt Input Variable" }, + "variables": { "description": "Variables" }, + "timeout": { "description": "Timeout (seconds)" }, + "proxy": { "description": "Proxy URL" } + } } + }, + "coze_runner": { + "description": "Coze Configuration", + "agent_runner": { "config": { + "coze_api_key": { "description": "API Key" }, + "bot_id": { "description": "Bot ID" }, + "coze_api_base": { "description": "API Base URL" }, + "auto_save_history": { "description": "Let Coze Manage Conversation History" }, + "timeout": { "description": "Timeout (seconds)" }, + "proxy": { "description": "Proxy URL" } + } } + }, + "dashscope_runner": { + "description": "Alibaba Cloud Bailian Application Configuration", + "agent_runner": { "config": { + "dashscope_app_type": { "description": "Application Type" }, + "dashscope_api_key": { "description": "API Key" }, + "dashscope_app_id": { "description": "Application ID" }, + "rag_options": { + "pipeline_ids": { "description": "Knowledge Base Pipeline IDs" }, + "file_ids": { "description": "File IDs" }, + "output_reference": { "description": "Include References" } + }, + "variables": { "description": "Variables" }, + "timeout": { "description": "Timeout (seconds)" }, + "proxy": { "description": "Proxy URL" } + } } + }, + "deerflow_runner": { + "description": "DeerFlow Configuration", + "agent_runner": { "config": { + "deerflow_api_base": { "description": "API Base URL" }, + "deerflow_api_key": { "description": "API Key" }, + "deerflow_auth_header": { "description": "Authorization Header" }, + "deerflow_assistant_id": { "description": "Assistant ID" }, + "deerflow_model_name": { "description": "Model Name Override" }, + "deerflow_thinking_enabled": { "description": "Enable Thinking Mode" }, + "deerflow_plan_mode": { "description": "Enable Plan Mode" }, + "deerflow_subagent_enabled": { "description": "Enable Subagents" }, + "deerflow_max_concurrent_subagents": { "description": "Maximum Concurrent Subagents" }, + "deerflow_recursion_limit": { "description": "Recursion Limit" }, + "timeout": { "description": "Timeout (seconds)" }, + "proxy": { "description": "Proxy URL" } + } } + }, + "ai": { + "description": "Model", + "hint": "Configure the built-in Agent's chat models and shared image caption and speech models.", + "agent_runner": { "config": { "model": { + "provider_id": { + "description": "Chat Model", + "hint": "Uses the first model when left empty" + }, + "fallback_provider_ids": { + "description": "Fallback Chat Models", + "hint": "Try these chat models in order when the primary model request fails." + }, + "request_max_retries": { + "description": "Retries on Error", + "hint": "Maximum attempts for a single model request when retryable errors occur." + } + } } }, + "provider_settings": { + "default_image_caption_provider_id": { + "description": "Image Caption Model", + "hint": "When the chat model does not support image input, use the image captioning model to describe images. Leave blank to disable." + }, + "image_caption_prompt": { + "description": "Image Caption Prompt", + "hint": "The prompt used by the image captioning model." + } + }, + "provider_stt_settings": { + "enable": { + "description": "Speech Recognition", + "hint": "Use a speech-to-text model to transcribe user voice messages into text for the model to understand." + }, + "provider_id": { + "description": "Default Speech-to-Text Model", + "hint": "You can also use /provider to select a model for an individual conversation." + } + }, + "provider_tts_settings": { + "enable": { + "description": "Voice Replies", + "hint": "Use a text-to-speech model to turn text into voice replies." + }, + "provider_id": { + "description": "Default Text-to-Speech Model", + "hint": "You can also use /provider to select a model for an individual conversation." + }, + "trigger_probability": { + "description": "TTS Trigger Probability", + "hint": "Trigger voice replies based on a random probability." + } + } + }, + "persona": { + "description": "Persona", + "hint": "Set the default persona for AI conversations. Personas can be managed in the Persona tab.", + "agent_runner": { "config": { "persona": { + "persona_id": { "description": "Default Persona" }, + "safety_mode": { + "description": "Safety Mode", + "hint": "Guide the model toward safe content and away from harmful or sensitive topics." + }, + "safety_mode_strategy": { + "description": "Safety Mode Strategy", + "hint": "Select how safety mode is applied." + } + } } } + }, + "knowledgebase": { + "description": "Knowledge Base", + "hint": "AstrBot's \"external brain\".", + "kb_names": { + "description": "Knowledge Base List", + "hint": "Supports multiple selections" + }, + "kb_fusion_top_k": { + "description": "Fusion Search Results Count", + "hint": "Number of results returned after fusing search results from multiple knowledge bases" + }, + "kb_final_top_k": { + "description": "Final Results Count", + "hint": "Number of results retrieved from the knowledge base. Higher values may provide more relevant information but could also introduce noise. Adjust based on actual needs" + }, + "kb_agentic_mode": { + "description": "Agentic Knowledge Base Retrieval", + "hint": "When enabled, knowledge base retrieval becomes an LLM Tool, allowing the model to autonomously decide when to query the knowledge base. Requires the model to support function calling." + } + }, + "websearch": { + "description": "Web Search", + "hint": "Enables AstrBot to access the internet and stay up to date.", + "provider_settings": { + "web_search": { + "description": "Enable Web Search" + }, + "websearch_provider": { + "description": "Web Search Provider", + "labels": [ + "SerpApi", + "DeepSeek Search API", + "Tavily", + "Baidu AI Search", + "Bocha", + "Brave", + "Firecrawl", + "Exa", + "AnySearch" + ], + "subtitles": [ + "Google web, news, image, scholar, and finance search", + "Official DeepSeek search API", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "websearch_tavily_key": { + "description": "Tavily API Key", + "hint": "Multiple keys can be added for rotation." + }, + "websearch_bocha_key": { + "description": "BoCha API Key", + "hint": "Multiple keys can be added for rotation." + }, + "websearch_brave_key": { + "description": "Brave Search API Key", + "hint": "Multiple keys can be added for rotation." + }, + "websearch_firecrawl_key": { + "description": "Firecrawl API Key", + "hint": "Multiple keys can be added for rotation." + }, + "websearch_baidu_app_builder_key": { + "description": "Baidu Qianfan Smart Cloud APP Builder API Key", + "hint": "Reference: [https://console.bce.baidu.com/iam/#/iam/apikey/list](https://console.bce.baidu.com/iam/#/iam/apikey/list)" + }, + "web_search_link": { + "description": "Display Source Citations" + }, + "websearch_exa_key": { + "description": "Exa API Key", + "hint": "Multiple keys can be added for rotation. Get a key at https://dashboard.exa.ai" + }, + "websearch_anysearch_key": { + "description": "AnySearch API Key", + "hint": "Multiple keys can be added for rotation. Leave empty to use anonymous mode with a daily free quota." + }, + "websearch_serpapi_key": { + "description": "SerpApi API Key", + "hint": "Supports Google web, news, image, scholar, and finance search. Multiple keys can be added for rotation. Get a key: [https://serpapi.com/manage-api-key](https://serpapi.com/manage-api-key)" + }, + "websearch_deepseek_key": { + "description": "DeepSeek API Key", + "hint": "Enter your DeepSeek API key. Can use the same key as the chat model (must be entered separately). Supports multiple keys for rotation. Get a key: [https://platform.deepseek.com/api_keys](https://platform.deepseek.com/api_keys)" + } + } + }, + "file_extract": { + "description": "File Extract", + "provider_settings": { + "file_extract": { + "enable": { + "description": "Enable File Extract" + }, + "provider": { + "description": "File Extract Provider" + }, + "moonshotai_api_key": { + "description": "Moonshot AI API Key" + } + } + } + }, + "agent_computer_use": { + "description": "Agent Computer Use", + "hint": "Allows the AstrBot to access and use your computer or an sandbox environment to perform more complex tasks. See: [Agent Sandbox Environment](https://docs.astrbot.app/en/use/astrbot-agent-sandbox.html).", + "provider_settings": { + "computer_use_runtime": { + "description": "Computer Use Runtime", + "hint": "Environment the Agent is allowed to access.", + "labels": ["No environment", "Local machine", "Third-party sandbox"] + }, + "computer_use_local_permissions": { + "description": "Local Permission Policies" + }, + "computer_use_require_admin": { + "description": "Require Admin Permission for Sandbox", + "hint": "When enabled, AstrBot admin permission is required to use remote sandbox capabilities. Add admins under Config -> Access Control -> Administrators -> Administrator IDs. Send /sid to the bot to get the ID." + }, + "sandbox": { + "booter": { + "description": "Sandbox Environment Driver" + }, + "shipyard_neo_endpoint": { + "description": "Shipyard Neo API Endpoint", + "hint": "Bay API address, default http://127.0.0.1:8114." + }, + "shipyard_neo_access_token": { + "description": "Shipyard Neo Access Token", + "hint": "Bay API Key (sk-bay-...). Leave empty for auto-discovery from credentials.json." + }, + "shipyard_neo_profile": { + "description": "Shipyard Neo Profile", + "hint": "Sandbox profile for Shipyard Neo, e.g. python-default. Leave empty to auto-select the most capable profile." + }, + "shipyard_neo_ttl": { + "description": "Shipyard Neo Sandbox TTL", + "hint": "Sandbox time-to-live in seconds." + }, + "cua_image": { + "description": "CUA Image", + "hint": "CUA sandbox image or OS type. Defaults to linux. Supported values depend on the installed CUA SDK." + }, + "cua_os_type": { + "description": "CUA OS Type", + "hint": "CUA sandbox operating system type. Defaults to linux." + }, + "cua_idle_timeout": { + "description": "CUA Idle Timeout", + "hint": "Idle timeout for CUA sandbox sessions in seconds. When greater than 0, AstrBot proactively shuts down an idle CUA sandbox after that amount of inactivity; 0 disables it." + }, + "cua_telemetry_enabled": { + "description": "CUA Telemetry", + "hint": "Allow the CUA SDK to send telemetry data. Disabled by default." + }, + "cua_local": { + "description": "CUA Local Sandbox", + "hint": "Prefer a local CUA sandbox. Enabled by default to avoid requiring CUA_API_KEY for cloud sandboxes. Disable this to use CUA cloud sandboxes." + }, + "cua_api_key": { + "description": "CUA API Key", + "hint": "CUA cloud sandbox API key. Required only when local sandbox is disabled. You can also provide it via the CUA_API_KEY environment variable." + }, + "shipyard_endpoint": { + "description": "Shipyard API Endpoint", + "hint": "API access address for Shipyard service." + }, + "shipyard_access_token": { + "description": "Shipyard Access Token", + "hint": "Access token for accessing Shipyard service." + }, + "shipyard_ttl": { + "description": "Shipyard Session TTL", + "hint": "Session time-to-live in seconds." + }, + "shipyard_max_sessions": { + "description": "Shipyard Max Sessions", + "hint": "Maximum number of Shipyard sessions an instance can handle." + } + } + }, + "local_permissions": { + "role": "Role", + "execution": "Allow code execution", + "network": "Allow execution network access", + "filesystem": "File access scope", + "scopes": { + "workspace": "Workspace", + "host": "Entire environment" + }, + "scopeHints": { + "none": "No file access allowed", + "workspace": "Restricted workspace, temporary directories, and skill files.", + "workspaceUnsupported": "Restricted workspace file access is unavailable on this platform.", + "host": "All files in the environment where AstrBot runs." + }, + "scopeDetails": { + "account": "1. Access is limited to files permitted by the account running AstrBot.", + "docker": "2. If deployed through Docker, only files inside the container and mounted files are accessible, not all files on the Docker host." + }, + "roles": { + "member": "Member", + "admin": "Administrator" + }, + "modes": { + "none": "Disabled" + }, + "networkAlwaysOn": "Always on", + "windowsHostNetworkHint": "Windows cannot disable networking while executing code with entire-environment access. Switch to workspace access to disable networking.", + "runtimeUnknown": "Runtime information is unavailable.", + "memberWarning": "Members have network access or file access across the entire environment.", + "executionInactive": "Inactive", + "executionInactiveHelp": "Why execution is inactive", + "executionBlocked": "Code execution is enabled for {role}, but the configured isolation requirements cannot currently be met. {reason}", + "runtime": { + "os": "OS", + "arch": "Architecture", + "sandbox": "Local isolation", + "windowsUnavailable": "{backend} · Not ready", + "windowsSetupHint": "Save the configuration and restart AstrBot. If prompted for administrator approval, allow it to initialize the sandbox.", + "errorDetails": "View diagnostic details", + "unavailableHint": "Sandbox startup failed, affecting restricted Shell/Python execution and workspace file search. Use the error below to check system security policies (such as Linux AppArmor and user namespace restrictions) or container restrictions, then restart AstrBot to check again.", + "dialog": { + "intro": "Using Seatbelt on macOS or bubblewrap (bwrap) on Linux, AstrBot provides security isolation for Agent execution, restricting file access scope and network permissions for different users of AstrBot Agent to improve security.", + "startupError": "View startup error", + "documentation": "View detailed setup documentation" + }, + "close": "Close", + "setupHint": { + "missing": "Install {dependency} to enable all local isolation features.", + "unavailable": "Configure {backend} to enable all local isolation features.", + "unsupported": "Learn about local isolation support." + }, + "isolationFailure": { + "missing": "Missing {dependency}.", + "unavailable": "{backend} failed its startup probe.", + "unsupported": "Local process isolation is not supported on this platform." + }, + "executionUnavailable": { + "missing": "Missing {dependency}; code execution cannot be enabled when File access scope is set to Workspace.", + "unavailable": "{backend} cannot start; code execution cannot be enabled when File access scope is set to Workspace.", + "unsupported": "Local isolation is unsupported on this platform; code execution cannot be enabled when File access scope is set to Workspace." + }, + "status": { + "detected": "{backend}", + "missing": "Missing {dependency}", + "unavailable": "{backend} · Installed but cannot start", + "unsupported": "Unsupported" + } + } + } + }, + "proactive_capability": { + "description": "Proactive Agent", + "hint": "AstrBot will wake up, run your tasks, and deliver the results to you. See [Proactive Agent](https://docs.astrbot.app/en/use/proactive-agent.html)", + "provider_settings": { + "proactive_capability": { + "add_cron_tools": { + "description": "Enable", + "hint": "When enabled, related tools will be passed to the Agent to implement proactive Agent capabilities. You can tell AstrBot what to do at a future time, and it will be triggered on schedule to execute the task, and report the result back to you." + } + } + } + }, + "truncate_and_compress": { + "hint": "[Context Management](https://docs.astrbot.app/en/use/context-compress.html)", + "description": "Context Management Strategy", + "agent_runner": { "config": { "compression": { + "max_turns": { + "description": "Max Turns Before Compression", + "hint": "Persistent conversation history is truncated or LLM-compressed by the strategy below only after it exceeds this many turns. Request-time contexts are also constrained by this value before sending. -1 means no turn-based limit." + }, + "trim_turns": { + "description": "Turns to Discard When Limit Exceeded", + "hint": "When history exceeds 'Max Turns Before Compression' and LLM compression is unavailable, discard this many oldest turns at once. Request-time truncation also reuses this value." + }, + "overflow_strategy": { + "description": "Compression Strategy", + "labels": [ + "Truncate by Turns", + "Compress by LLM" + ], + "hint": "Strategy for handling model context limits." + }, + "instruction": { + "description": "Context Compression Instruction", + "hint": "If empty, the default prompt will be used." + }, + "keep_recent_ratio": { + "description": "Recent Context Token Ratio to Keep", + "hint": "Keep recent exact context by current context token ratio, from 0-0.3. 0.15 means keeping 15%; values above 0 keep at least the latest round." + }, + "provider_id": { + "description": "Compression Model", + "hint": "The model used for context compression. Defaults to the current chat model." + }, + "fallback_max_tokens": { + "description": "Fallback context window size", + "hint": "When max_context_tokens is 0 and the model is not in built-in metadata, use this value as the context window size. Default: 128000." + } + } } } + }, + "others": { + "description": "Other Settings", + "agent_runner": { "config": { "misc": { + "max_steps": { "description": "Maximum Tool Call Rounds" }, + "tool_schema_mode": { + "description": "Tool Schema Mode", + "hint": "Skills-like sends name/description first and re-queries for parameters; Full sends the complete schema in one step.", + "labels": ["Skills-like (two-stage)", "Full schema"] + }, + "tool_call_timeout": { + "description": "Tool Call Timeout (seconds)" + }, + "sanitize_context_by_modalities": { + "description": "Sanitize History by Modalities", + "hint": "When enabled, sanitizes contexts before each LLM request by removing image blocks and tool-call structures that the current provider's modalities do not support (this changes what the model sees)." + } + } } }, + "provider_settings": { + "display_reasoning_text": { + "description": "Display Reasoning Content", + "hint": "Include the model's chain-of-thought information in the final reply." + }, + "identifier": { + "description": "User Identification", + "hint": "Prepend the user ID to the user prompt." + }, + "group_name_display": { + "description": "Display Group Name", + "hint": "Prepend the group name to user prompts in group chats on supported messaging platforms." + }, + "datetime_system_prompt": { + "description": "Real-world Time Awareness", + "hint": "Include the current time in the user prompt." + }, + "show_tool_use_status": { + "description": "Show Tool Call Information", + "hint": "When a tool is called, also send a message containing the tool name." + }, + "show_tool_call_result": { + "description": "Output Tool Call Results", + "hint": "Only takes effect when \"Show Tool Call Information\" is enabled, and shows at most 70 characters." + }, + "buffer_intermediate_messages": { + "description": "Merge Agent Intermediate Messages", + "hint": "When enabled, intermediate text generated during multi-step tool calls in non-streaming mode will be buffered and sent as a single merged reply after the Agent finishes." + }, + "max_quoted_fallback_images": { + "description": "Forwarded Image Fetch Limit", + "hint": "Maximum number of images injected from forwarded-message parsing; extra images are truncated." + }, + "quoted_message_parser": { + "max_component_chain_depth": { + "description": "Forwarded Rich-Text Parse Depth", + "hint": "Maximum recursive depth when parsing rich-text component chains inside forwarded messages." + }, + "max_forward_node_depth": { + "description": "Forward Nesting Parse Depth", + "hint": "Maximum recursive depth when parsing nested forwarded nodes." + }, + "max_forward_fetch": { + "description": "Forward Recursive Fetch Limit", + "hint": "Maximum number of recursive get_forward_msg fetch operations." + }, + "warn_on_action_failure": { + "description": "Warn on Forward Parse Failure", + "hint": "When enabled, log warnings when all get_msg/get_forward_msg attempts fail." + } + }, + "streaming_response": { + "description": "Streaming Output", + "hint": "Display responses with a typewriter effect on supported chat platforms." + }, + "unsupported_streaming_strategy": { + "description": "Platforms Without Streaming Support", + "hint": "Select the handling method for platforms that don't support streaming responses. Real-time segmented reply sends content immediately when the system detects segment points like punctuation during streaming reception", + "labels": [ + "Real-time Segmented Reply", + "Disable Streaming Response" + ] + }, + "wake_prefix": { + "description": "Additional Wake Prefix", + "hint": "If the wake prefix is / and the additional chat wake prefix is chat, then /chat is required to trigger LLM requests" + }, + "prompt_prefix": { + "description": "User Prompt", + "hint": "You can use {{prompt}} as a placeholder for user input. If no placeholder is provided, it will be added before the user input." + }, + "image_compress_options": { + "description": "Model input image settings", + "hint": "Images are always prepared as JPEG/PNG below 512 KiB. Original attachments are preserved.", + "max_size": { + "description": "Input image maximum edge length", + "hint": "Longest edge sent to the model, in pixels. Images may be reduced further to stay below 512 KiB; original attachment paths are unchanged." + } + }, + "reachability_check": { + "description": "Provider Reachability Check", + "hint": "When running the /provider command, test provider connectivity in parallel. This actively pings models and may consume extra tokens." + } + }, + "provider_tts_settings": { + "dual_output": { + "description": "Output Both Voice and Text When TTS is Enabled" + } + } + } + }, + "platform_group": { + "name": "Platforms & Messages", + "platform": { + "description": "Message Platform Adapters", + "app_id": { + "description": "Application ID", + "hint": "The application ID from the messaging platform's developer console." + }, + "app_secret": { + "description": "Application secret", + "hint": "The application secret from the messaging platform's developer console. Keep it secure." + }, + "domain": { + "description": "Open platform API URL", + "hint": "The base URL of the open platform API. The default normally does not need to be changed." + }, + "corpid": { + "description": "Enterprise ID", + "hint": "The enterprise ID (CorpID) from the WeCom administration console." + }, + "token": { + "description": "Callback token", + "hint": "The token used to verify requests in the messaging platform's callback settings." + }, + "encoding_aes_key": { + "description": "Message encryption key", + "hint": "The EncodingAESKey from the callback settings, used to encrypt and decrypt messages." + }, + "api_base_url": { + "description": "API base URL", + "hint": "The messaging platform API base URL. The default normally does not need to be changed." + }, + "client_id": { + "description": "Client ID", + "hint": "The client ID from the messaging platform's developer console." + }, + "client_secret": { + "description": "Client secret", + "hint": "The client secret from the messaging platform's developer console. Keep it secure." + }, + "start_message": { + "description": "Start command reply", + "hint": "The message sent when a user sends the /start command to the Telegram bot." + }, + "telegram_api_base_url": { + "description": "API URL", + "hint": "The Telegram Bot API base URL. The official default normally does not need to be changed." + }, + "telegram_file_base_url": { + "description": "File API URL", + "hint": "The base URL used to download files from the Telegram Bot API. The official default normally does not need to be changed." + }, + "bot_token": { + "description": "Slack Bot Token", + "hint": "The Slack application's Bot User OAuth Token, usually beginning with xoxb-." + }, + "app_token": { + "description": "Slack App Token", + "hint": "The App-Level Token used by Slack Socket Mode, usually beginning with xapp-." + }, + "signing_secret": { + "description": "Slack Signing Secret", + "hint": "The Slack application's Signing Secret, used to verify webhook requests." + }, + "channel_access_token": { + "description": "LINE Channel Access Token", + "hint": "The Channel Access Token for the LINE Messaging API channel." + }, + "channel_secret": { + "description": "LINE Channel Secret", + "hint": "The Channel Secret for the LINE Messaging API channel." + }, + "active_send_mode": { + "description": "Use Proactive Send API" + }, + "appid": { + "description": "App ID", + "hint": "Required. App ID for the current messaging platform. See the platform integration docs for how to obtain it." + }, + "callback_server_host": { + "description": "Callback Server Host", + "hint": "Callback server host. Leave empty to disable the callback server." + }, + "card_template_id": { + "description": "Card Template ID", + "hint": "Optional. DingTalk interactive card template ID. When enabled, streaming replies will use interactive cards." + }, + "discord_activity_name": { + "description": "Discord Activity Name", + "hint": "Optional Discord activity name. Leave empty to disable." + }, + "discord_allow_bot_messages": { + "description": "Allow Bot Messages", + "hint": "When enabled, AstrBot will receive messages from other Discord bots. Useful for bot-to-bot communication scenarios (e.g., message forwarding). Disabled by default." + }, + "discord_command_register": { + "description": "Register Discord slash commands", + "hint": "When enabled, AstrBot will automatically register plugin commands as Discord slash commands" + }, + "discord_proxy": { + "description": "Discord Proxy URL", + "hint": "Optional proxy URL: http://ip:port" + }, + "discord_token": { + "description": "Discord Bot Token", + "hint": "Enter your Discord Bot Token here." + }, + "enable": { + "description": "Enable", + "hint": "Whether to enable this adapter. Disabled adapters will not receive messages." + }, + "enable_group_c2c": { + "description": "Enable Message List Private Chat", + "hint": "When enabled, the bot can receive private chats from QQ message list. You may need to add the bot as a friend by scanning a QR code in the QQ bot platform. See docs." + }, + "enable_guild_direct_message": { + "description": "Enable Guild Direct Messages", + "hint": "When enabled, the bot can receive guild direct messages." + }, + "id": { + "description": "Bot Name", + "hint": "Bot name" + }, + "is_sandbox": { + "description": "Sandbox Mode" + }, + "kf_name": { + "description": "WeChat Customer Service Account Name", + "hint": "Optional. Customer service account name (not ID). Get it at https://kf.weixin.qq.com/kf/frame#/accounts" + }, + "lark_connection_mode": { + "description": "Subscription Mode", + "labels": [ + "Long Connection Mode", + "Webhook Server Mode" + ] + }, + "lark_encrypt_key": { + "description": "Encrypt Key", + "hint": "Encryption key for decrypting Lark callback data." + }, + "lark_verification_token": { + "description": "Verification Token", + "hint": "Token for verifying Lark callback requests." + }, + "misskey_allow_insecure_downloads": { + "description": "Allow Insecure Downloads (Disable SSL Verification)", + "hint": "If remote servers have certificate issues, SSL verification will be disabled as a fallback. Use only when necessary due to security risks." + }, + "misskey_default_visibility": { + "description": "Default Post Visibility", + "hint": "Default visibility for bot posts. public: public, home: home timeline, followers: followers only." + }, + "misskey_download_chunk_size": { + "description": "Stream Download Chunk Size (bytes)", + "hint": "Bytes read per chunk during streaming download and MD5 calculation. Too small increases overhead; too large uses more memory." + }, + "misskey_download_timeout": { + "description": "Remote Download Timeout (seconds)", + "hint": "Timeout for downloading remote files (seconds), used when falling back to local upload." + }, + "misskey_enable_chat": { + "description": "Enable Chat Message Responses", + "hint": "When enabled, the bot listens and responds to private chat messages." + }, + "misskey_enable_file_upload": { + "description": "Enable File Upload to Misskey", + "hint": "When enabled, the adapter uploads files in message chains to Misskey. URL files try server-side upload first; if async upload fails, it falls back to local download and upload." + }, + "misskey_instance_url": { + "description": "Misskey Instance URL", + "hint": "e.g. https://misskey.example. The Misskey instance where the bot account lives." + }, + "misskey_local_only": { + "description": "Local Only (No Federation)", + "hint": "When enabled, bot posts are visible only on this instance and are not federated." + }, + "misskey_max_download_bytes": { + "description": "Max Download Size (bytes)", + "hint": "To limit download size to prevent OOM, set the maximum bytes; empty or null means no limit." + }, + "misskey_token": { + "description": "Misskey Access Token", + "hint": "API access token generated in the connection service settings." + }, + "misskey_upload_concurrency": { + "description": "Upload Concurrency Limit", + "hint": "Max number of concurrent upload tasks (integer, default 3)." + }, + "misskey_upload_folder": { + "description": "Target Drive Folder ID", + "hint": "Optional: ID of the target folder in Misskey drive. Leave empty to use the root folder." + }, + "port": { + "description": "Callback Server Port", + "hint": "Callback server port. Leave empty to disable the callback server." + }, + "satori_api_base_url": { + "description": "Satori API Endpoint", + "hint": "Base URL for the Satori API." + }, + "satori_auto_reconnect": { + "description": "Enable Auto Reconnect", + "hint": "Automatically reconnect the WebSocket when disconnected." + }, + "satori_endpoint": { + "description": "Satori WebSocket Endpoint", + "hint": "WebSocket endpoint for Satori events." + }, + "satori_heartbeat_interval": { + "description": "Satori Heartbeat Interval", + "hint": "Interval in seconds between heartbeat messages." + }, + "satori_reconnect_delay": { + "description": "Satori Reconnect Delay", + "hint": "Delay before attempting to reconnect (seconds)." + }, + "satori_token": { + "description": "Satori Token", + "hint": "Token for Satori API authentication." + }, + "secret": { + "description": "Secret", + "hint": "Required." + }, + "slack_connection_mode": { + "description": "Slack Connection Mode", + "hint": "The connection mode for Slack. `webhook` uses a webhook server, `socket` uses Slack's Socket Mode." + }, + "slack_webhook_host": { + "description": "Slack Webhook Host", + "hint": "Only valid when Slack connection mode is `webhook`." + }, + "slack_webhook_path": { + "description": "Slack Webhook Path", + "hint": "Only valid when Slack connection mode is `webhook`." + }, + "slack_webhook_port": { + "description": "Slack Webhook Port", + "hint": "Only valid when Slack connection mode is `webhook`." + }, + "telegram_command_auto_refresh": { + "description": "Command Auto Refresh", + "hint": "When enabled, AstrBot automatically refreshes Telegram commands at runtime. (Setting this alone has no effect)" + }, + "telegram_command_register": { + "description": "Command Registration", + "hint": "When enabled, AstrBot automatically registers Telegram commands." + }, + "telegram_command_register_interval": { + "description": "Command Auto Refresh Interval", + "hint": "Telegram command auto-refresh interval in seconds." + }, + "telegram_polling_restart_delay": { + "description": "Polling Restart Delay", + "hint": "Waiting time in seconds when the polling loop needs to restart after unexpected exits. Defaults to 5s." + }, + "telegram_token": { + "description": "Bot Token", + "hint": "If you are in mainland China, set a proxy or change api_base in Other Settings." + }, + "mattermost_url": { + "description": "Mattermost URL", + "hint": "Mattermost service URL, for example https://chat.example.com." + }, + "mattermost_bot_token": { + "description": "Mattermost Bot Token", + "hint": "The access token generated after creating a bot account in Mattermost." + }, + "mattermost_reconnect_delay": { + "description": "Mattermost Reconnect Delay", + "hint": "Delay in seconds before reconnecting after the WebSocket disconnects. Defaults to 5 seconds." + }, + "type": { + "description": "Adapter Type" + }, + "unified_webhook_mode": { + "description": "Unified Webhook Mode", + "hint": "When enabled, use AstrBot unified webhook entry without opening a separate port. Callback URL is /api/v1/webhooks/platforms/{webhook_uuid}." + }, + "use_markdown": { + "description": "Use Markdown for Proactive Messages", + "hint": "When enabled, proactive messages are sent in Markdown mode by default; an explicit use_markdown() call from a plugin takes precedence over this option." + }, + "webhook_uuid": { + "description": "Webhook UUID", + "hint": "Unique identifier for unified webhook mode; generated when creating the platform." + }, + "wecom_ai_bot_name": { + "description": "WeCom AI Bot Name", + "hint": "Must be correct; otherwise some commands won't work." + }, + "wecom_ai_bot_connection_mode": { + "description": "WeCom AI Bot Connection Mode", + "hint": "Webhook mode requires Token/EncodingAESKey; long_connection mode requires BotID/Secret." + }, + "wecomaibot_friend_message_welcome_text": { + "description": "WeCom AI Bot DM Welcome Message", + "hint": "When a user enters a DM session on that day, reply with a welcome message. Leave empty to disable." + }, + "wecomaibot_init_respond_text": { + "description": "WeCom AI Bot Initial Response Text", + "hint": "First reply when the bot receives a message. Leave empty to disable." + }, + "wecomaibot_token": { + "description": "WeCom AI Bot Token", + "hint": "Used for authentication in webhook callback mode." + }, + "wecomaibot_encoding_aes_key": { + "description": "WeCom AI Bot EncodingAESKey", + "hint": "Used for message encryption/decryption in webhook callback mode." + }, + "wecomaibot_ws_bot_id": { + "description": "Long Connection BotID", + "hint": "BotID credential for WeCom AI Bot long connection mode." + }, + "wecomaibot_ws_secret": { + "description": "Long Connection Secret", + "hint": "Secret credential for WeCom AI Bot long connection mode." + }, + "wecomaibot_ws_url": { + "description": "Long Connection WebSocket URL", + "hint": "Default is wss://openws.work.weixin.qq.com and usually does not need changes." + }, + "wecomaibot_heartbeat_interval": { + "description": "Long Connection Heartbeat Interval", + "hint": "Heartbeat interval (seconds) in long connection mode. 30 seconds is recommended." + }, + "wpp_active_message_poll": { + "description": "Enable Proactive Message Polling", + "hint": "Only enable if WeChat messages are not syncing to AstrBot on time. Disabled by default." + }, + "wpp_active_message_poll_interval": { + "description": "Proactive Message Poll Interval", + "hint": "Interval in seconds, default 3, should not exceed 60 or it may be considered old messages." + }, + "ws_reverse_host": { + "description": "Reverse WebSocket Host", + "hint": "AstrBot acts as the server." + }, + "ws_reverse_port": { + "description": "Reverse WebSocket Port" + }, + "ws_reverse_token": { + "description": "Reverse WebSocket Token", + "hint": "Reverse WebSocket token. If not set, token verification is disabled." + }, + "msg_push_webhook_url": { + "description": "WeCom Message Push Webhook URL", + "hint": "Used for proactive message push. It is strongly recommended to set this for a better message sending experience." + }, + "only_use_webhook_url_to_send": { + "description": "Send Replies via Webhook Only", + "hint": "When enabled, all WeCom AI Bot replies are sent through msg_push_webhook_url. The message push webhook supports more message types (such as images, files, etc.). If you do not need the typing effect, it is strongly recommended to use this option. " + }, + "weixin_oc_base_url": { + "description": "API Base URL", + "hint": "Default: https://ilinkai.weixin.qq.com" + }, + "weixin_oc_bot_type": { + "description": "bot_type (QR login parameter)", + "hint": "Default: 3" + }, + "weixin_oc_qr_poll_interval": { + "description": "QR status poll interval (seconds)", + "hint": "Polling interval in seconds for QR code status." + }, + "weixin_oc_long_poll_timeout_ms": { + "description": "getUpdates long-poll timeout (ms)", + "hint": "Timeout parameter for polling messages." + }, + "weixin_oc_api_timeout_ms": { + "description": "HTTP timeout (ms)", + "hint": "Generic API request timeout." + }, + "weixin_oc_token": { + "description": "Token after login (optional)", + "hint": "Automatically written after QR login; can be filled manually for advanced scenarios." + }, + "kook_bot_token": { + "description": "Bot Token", + "type": "string", + "hint": "Required. The Bot Token obtained from the KOOK Developer Platform." + }, + "kook_reconnect_delay": { + "description": "Reconnect Delay", + "type": "int", + "hint": "Delay time for reconnection (seconds), using an exponential backoff strategy." + }, + "kook_max_reconnect_delay": { + "description": "Max Reconnect Delay", + "type": "int", + "hint": "The maximum value for reconnection delay (seconds)." + }, + "kook_max_retry_delay": { + "description": "Max Retry Delay", + "type": "int", + "hint": "The maximum delay time for retries (seconds)." + }, + "kook_heartbeat_interval": { + "description": "Heartbeat Interval", + "type": "int", + "hint": "The interval time for heartbeat detection (seconds)." + }, + "kook_heartbeat_timeout": { + "description": "Heartbeat Timeout", + "type": "int", + "hint": "The timeout duration for heartbeat detection (seconds)." + }, + "kook_max_heartbeat_failures": { + "description": "Max Heartbeat Failures", + "type": "int", + "hint": "Maximum allowed heartbeat failures; the connection will be dropped if exceeded." + }, + "kook_max_consecutive_failures": { + "description": "Max Consecutive Failures", + "type": "int", + "hint": "Maximum allowed consecutive failures; retries will stop if exceeded." + } + }, + "general": { + "description": "General", + "platform_settings": { + "unique_session": { + "description": "Isolate Conversation", + "hint": "On supported platforms, each group member has a separate conversation context when enabled. Manage command permissions under Handlers → Command." + }, + "friend_message_needs_wake_prefix": { + "description": "Private Messages Require Wake Word", + "hint": "Private messages must also include a wake prefix to activate the bot." + }, + "reply_prefix": { + "description": "Reply Text Prefix", + "hint": "The text prefix added to replies." + }, + "reply_with_mention": { + "description": "Mention Sender in Reply", + "hint": "Mention the sender when replying." + }, + "reply_with_quote": { + "description": "Quote Sender's Message in Reply", + "hint": "Quote the sender's corresponding message when replying." + }, + "forward_threshold": { + "description": "Forward Message Word Count Threshold", + "hint": "On supported platforms, send overly long replies as merged forwarded messages." + }, + "empty_mention_waiting": { + "description": "Trigger Waiting on Mention-only Messages", + "hint": "After a message that only mentions the bot, stay awake for one minute to wait for the user's next message." + } + }, + "wake_prefix": { + "description": "Wake Word", + "hint": "A list of message prefixes that wake the bot. You can also wake it by mentioning it.\n\nBuilt-in commands such as `/help` and `/sid` also depend on the wake word: in group chats they do not trigger unless the message starts with a wake word; in private chats they trigger without a prefix unless \"Private Messages Require Wake Word\" is enabled." + }, + "disable_builtin_commands": { + "description": "Disable Built-in Commands", + "hint": "Disable all built-in AstrBot commands such as help, sid, new, etc." + } + }, + "rate_limit": { + "description": "Rate Limiting", + "platform_settings": { + "rate_limit": { + "time": { + "description": "Message Rate Limit Time (seconds)" + }, + "count": { + "description": "Message Rate Limit Count" + }, + "strategy": { + "description": "Rate Limit Strategy" + } + } + } + }, + "content_safety": { + "description": "Content Safety", + "content_safety": { + "also_use_in_response": { + "description": "Also Check Model Response Content" + }, + "baidu_aip": { + "enable": { + "description": "Use Baidu Content Safety Moderation", + "hint": "You need to manually install the baidu-aip library." + }, + "app_id": { + "description": "App ID" + }, + "api_key": { + "description": "API Key" + }, + "secret_key": { + "description": "Secret Key" + } + }, + "internal_keywords": { + "enable": { + "description": "Keyword Check" + }, + "extra_keywords": { + "description": "Additional Keywords", + "hint": "Additional keyword blocklist, supports regular expressions." + } + } + } + }, + "others": { + "description": "Other Settings", + "platform_settings": { + "ignore_bot_self_message": { + "description": "Ignore Bot's Own Messages" + }, + "ignore_at_all": { + "description": "Ignore @All Events" + }, + "no_permission_reply": { + "description": "Reply When User Has Insufficient Permissions" + } + }, + "platform_specific": { + "lark": { + "pre_ack_emoji": { + "enable": { + "description": "[Lark] Enable Pre-acknowledgment Emoji" + }, + "emojis": { + "description": "Emoji List (Lark Emoji Enum Names)", + "hint": "Emoji enum names reference: [https://open.feishu.cn/document/server-docs/im-v1/message-reaction/emojis-introduce](https://open.feishu.cn/document/server-docs/im-v1/message-reaction/emojis-introduce)" + } + } + }, + "telegram": { + "pre_ack_emoji": { + "enable": { + "description": "[Telegram] Enable Pre-acknowledgment Emoji" + }, + "emojis": { + "description": "Emoji List (Unicode)", + "hint": "Telegram only supports a fixed reaction set, reference: [https://gist.github.com/Soulter/3f22c8e5f9c7e152e967e8bc28c97fc9](https://gist.github.com/Soulter/3f22c8e5f9c7e152e967e8bc28c97fc9)" + } + } + }, + "discord": { + "pre_ack_emoji": { + "enable": { + "description": "[Discord] Enable Pre-acknowledgment Emoji" + }, + "emojis": { + "description": "Emoji List (Unicode or Custom Emoji Name)", + "hint": "Enter Unicode emoji symbols, e.g., 👍, 🤔, ⏳" + } + } + } + } + } + }, + "access_group": { + "name": "Access Control", + "admins": { + "description": "Administrators", + "admins_id": { + "description": "Administrator IDs", + "hint": "Send the /sid command to the bot to get the ID." + } + }, + "whitelist": { + "description": "Whitelist", + "platform_settings": { + "enable_id_white_list": { + "description": "Enable Whitelist", + "hint": "When enabled, only sessions in the whitelist will be responded to." + }, + "id_whitelist": { + "description": "Whitelist ID List", + "hint": "Send the /sid command to the bot to get the ID. An empty list disables the whitelist." + }, + "id_whitelist_log": { + "description": "Log Blocked Messages", + "hint": "Log messages that fail whitelist checks." + }, + "wl_ignore_admin_on_group": { + "description": "Administrator Group Messages Bypass ID Whitelist" + }, + "wl_ignore_admin_on_friend": { + "description": "Administrator Private Messages Bypass ID Whitelist" + } + } + } + }, + "plugin_group": { + "name": "Plugin", + "plugin": { + "description": "Plugins", + "plugin_set": { + "description": "Available Plugins", + "hint": "All non-disabled plugins are enabled by default. If a plugin is disabled on the plugins page, selections here will not take effect." + } + } + }, + "ext_group": { + "name": "Ext.", + "segmented_reply": { + "description": "Segmented Reply", + "platform_settings": { + "segmented_reply": { + "enable": { + "description": "Enable Segmented Reply", + "hint": "Send replies in multiple segments." + }, + "only_llm_result": { + "description": "Segment Only LLM Results" + }, + "interval_method": { + "description": "Interval Method", + "hint": "random uses a random delay. log calculates delay by message length: $y=log_{log\\_base}(x)$, where x is word count and y is in seconds." + }, + "interval": { + "description": "Random Interval Time", + "hint": "Format: minimum,maximum (e.g., 1.5,3.5)" + }, + "log_base": { + "description": "Logarithm Base", + "hint": "Base for logarithmic intervals, defaults to 2.6. Value range: 1.0-10.0." + }, + "words_count_threshold": { + "description": "Segmented Reply Word Count Threshold", + "hint": "Segmented reply word count threshold. Only messages with less than this number of words will be segmented, and messages with more than this number of words will be sent directly (not segmented)." + }, + "split_mode": { + "description": "Split Mode", + "hint": "Used to segment a message. By default, it will be separated by punctuation marks like period, question mark, etc. For example, filling `[。?!]` will remove all periods, question marks, and exclamation marks. re.findall(r'', text)", + "labels": [ + "Regex", + "Words List" + ] + }, + "regex": { + "description": "Segmentation Regular Expression", + "hint": "Used to identify split points with a regular expression. Prefer patterns that match separators." + }, + "split_words": { + "description": "Split Word List", + "hint": "Split when any word in the list is detected" + }, + "content_cleanup_rule": { + "description": "Content Filtering Regular Expression", + "hint": "Remove specified content from segmented content. For example, `[。?!]` will remove all periods, question marks, and exclamation marks." + } + } + } + }, + "ltm": { + "description": "Group Chat Context Awareness", + "provider_ltm_settings": { + "group_icl_enable": { + "description": "Inject Group Chat Records into Context", + "hint": "Record group messages that do not wake the bot and pass them to the model when the bot is activated." + }, + "group_message_max_cnt": { + "description": "Maximum Messages Injected into Context", + "hint": "The maximum number of messages passed to the model." + }, + "image_caption": { + "description": "Auto-understand Images", + "hint": "Convert image messages that do not wake the bot into text descriptions. Use with care in image-heavy group chats, as this can incur substantial costs." + }, + "image_caption_provider_id": { + "description": "Group Chat Image Caption Model", + "hint": "Used to understand images injected from group chat records, configured separately from the default image caption model." + }, + "group_message_history_enable": { + "description": "Persist Group Chat Messages", + "hint": "Persist all group messages and allow the model to query them using tools." + }, + "group_message_history_max_cnt": { + "description": "Maximum Persisted Messages", + "hint": "The maximum number of persisted messages. Older messages are discarded when the limit is exceeded." + }, + "active_reply": { + "enable": { + "description": "Active Reply", + "hint": "Send messages proactively at suitable times." + }, + "method": { + "description": "Active Reply Method" + }, + "possibility_reply": { + "description": "Reply Probability", + "hint": "Value between 0.0-1.0" + }, + "whitelist": { + "description": "Active Reply Whitelist", + "hint": "Whitelist filtering is disabled when empty. Use /sid to get IDs." + } + } + } + }, + "t2i": { + "description": "Text-to-Image", + "t2i": { + "description": "Text-to-Image Output", + "hint": "Convert model replies to images before sending to avoid flooding the chat." + }, + "t2i_word_threshold": { + "description": "Text-to-Image Word Count Threshold" + }, + "t2i_strategy": { + "description": "Text-to-Image Strategy", + "hint": "Text-to-image strategy. `remote` uses a remote HTML-based rendering service, `local` uses PIL for local rendering. When using local, place a TTF font named 'font.ttf' in the data/ directory to customize the font." + }, + "t2i_endpoint": { + "description": "Text-to-Image Service API Endpoint", + "hint": "Uses AstrBot API service when empty" + }, + "t2i_template": { + "description": "Text-to-Image Custom Template", + "hint": "When enabled, you can customize HTML templates for text-to-image rendering." + }, + "t2i_active_template": { + "description": "Currently Active Text-to-Image Rendering Template", + "hint": "This value is maintained by the text-to-image template management page." + } + } + }, + "system_group": { + "name": "System", + "system": { + "description": "System Settings", + "log_level": { + "description": "Console Log Level", + "hint": "Log level for console output." + }, + "log_file_enable": { + "description": "Enable File Logging", + "hint": "Write logs to a file in addition to the console." + }, + "log_file_path": { + "description": "Log File Path", + "hint": "Relative paths are resolved under the data directory, e.g. logs/astrbot.log; absolute paths are supported." + }, + "log_file_max_mb": { + "description": "Log File Max Size (MB)", + "hint": "Rotate when exceeding this size; default 20MB." + }, + "temp_dir_max_size": { + "description": "Temp Directory Size Limit (MB)", + "hint": "Limits total size of data/temp in MB. The system checks every 10 minutes, and when exceeded, deletes oldest files first to release about 30% of current size." + }, + "trace_enable": { + "description": "Enable Trace Recording", + "hint": "Trace each user command and AI call." + }, + "trace_db_path": { + "description": "Trace Database Path", + "hint": "Relative paths start from the data directory, for example logs/traces.db. Absolute paths are also supported." + }, + "trace_db_max_mb": { + "description": "Trace Database Capacity Budget (MB)", + "hint": "Default: 80 MB. Values below 32 MB use 32 MB. Old data is automatically cleared when this size is exceeded." + }, + "trace_retention_days": { + "description": "Trace Retention Days", + "hint": "Default: 7 days. Old data is cleared when either the retention period or capacity is reached." + }, + "pip_install_arg": { + "description": "Additional pip Installation Arguments", + "hint": "When installing plugin dependencies, Python's pip tool will be used. Additional arguments can be provided here, such as `--break-system-package`. TLS certificates of the PyPI index are verified by default; for self-signed/private-CA mirrors, pass `--cert ` (recommended) or explicitly add `--trusted-host `." + }, + "pypi_index_url": { + "description": "PyPI Repository URL", + "hint": "PyPI repository URL for installing Python dependencies. Defaults to [https://mirrors.aliyun.com/pypi/simple/](https://mirrors.aliyun.com/pypi/simple/)" + }, + "callback_api_base": { + "description": "Externally Accessible Callback API Address", + "hint": "External services may access AstrBot's backend through callback links generated by AstrBot (such as file download links). Since AstrBot cannot automatically determine the externally accessible host address in the deployment environment, this configuration item is needed to explicitly specify how external services should access AstrBot's address. Examples: [http://localhost:6185](http://localhost:6185), [https://example.com](https://example.com), etc." + }, + "disable_metrics": { + "description": "Disable Anonymous Usage Statistics", + "hint": "When disabled, AstrBot will not upload anonymous usage statistics." + }, + "dashboard": { + "trust_proxy_headers": { + "description": "Trust Proxy Headers for Client IP", + "hint": "When disabled, ignore X-Forwarded-For/X-Real-IP and use the connection address only." + }, + "auth_rate_limit": { + "enable": { + "description": "Enable Login Rate Limiting", + "hint": "When disabled, authentication endpoints (login, TOTP, etc.) will not be rate-limited." + }, + "average_interval": { + "description": "Endpoint Rate Limit Average Interval (seconds)", + "hint": "Minimum average interval between authentication requests. For example, 1.0 means at most 1 request per second." + }, + "max_burst": { + "description": "Endpoint Rate Limit Max Burst", + "hint": "Maximum number of consecutive burst requests allowed. For example, 3 allows up to 3 requests in a short burst." + } + }, + "ssl": { + "enable": { + "description": "Enable WebUI HTTPS", + "hint": "When enabled, WebUI serves directly over HTTPS." + }, + "cert_file": { + "description": "SSL Certificate File Path", + "hint": "Certificate file path (PEM). Supports absolute and relative paths (relative to current working directory)." + }, + "key_file": { + "description": "SSL Private Key File Path", + "hint": "Private key file path (PEM). Supports absolute and relative paths (relative to current working directory)." + }, + "ca_certs": { + "description": "SSL CA Certificate File Path", + "hint": "Optional. Path to CA certificate file." + } + }, + "totp": { + "enable": { + "description": "Enable WebUI TOTP", + "hint": "When enabled, a TOTP code is required during dashboard login." + }, + "manage": "Manage", + "configuration": "TOTP", + "statusPending": "Setup required", + "statusEnabled": "Enabled", + "setupRequiredHint": "TOTP is enabled but not yet configured. Click Manage to complete setup.", + "setupTitle": "Set up TOTP", + "setupSubtitle": "Scan this QR code in your authenticator app, then enter a verification code.", + "setupConfirm": "Verify and continue", + "activeSubtitle": "Use this QR code or secret to add another authenticator device.", + "rotateTitle": "Rotate TOTP Secret", + "rotateSubtitle": "Generate a new secret, then enter a code from your authenticator to confirm the replacement.", + "rotate": "Rotate", + "rotateRecovery": "Rotate Recovery Code", + "rotateConfirm": "Confirm Rotation", + "rotateCancel": "Cancel", + "rotateCode": "Verification Code", + "rotateCodeHint": "Enter the code from your authenticator app to confirm the new key.", + "rotateError": "Invalid code, please try again.", + "recoveryTitle": "Recovery Codes", + "recoverySubtitle": "This recovery code is shown once. Save it before continuing.", + "recoveryWarning": "If lost, account access cannot be restored through normal means.", + "recoveryAcknowledge": "I have saved my recovery codes", + "recoveryClose": "Done", + "disableTitle": "Disable TOTP", + "disableSubtitle": "Enter a verification code to disable two-factor authentication.", + "disableRecoverySubtitle": "Enter a recovery code to disable two-factor authentication.", + "disableCode": "Verification Code", + "disableRecoveryCode": "Recovery Code", + "disableConfirm": "Disable", + "disableCancel": "Cancel", + "disableError": "Verification failed. Please try again.", + "disableUseRecovery": "Can't use TOTP?", + "disableUseCode": "Use verification code", + "configSaveTitle": "Two-Factor Verification", + "configSaveSubtitle": "Enter a verification code to change protected configuration.", + "configSaveRotationHint": "When rotating TOTP keys, both the old and new verification codes are accepted (allowed once per rotation operation).", + "configSaveCode": "Verification Code", + "configSaveConfirm": "Continue", + "configSaveCancel": "Cancel", + "configSaveError": "Verification failed. Please try again." + } + }, + "timezone": { + "description": "Timezone", + "hint": "Timezone setting. Please enter an IANA timezone name, such as Asia/Shanghai. Uses system default timezone when empty. For all timezones, see: [https://data.iana.org/time-zones/tzdb-2021a/zone1970.tab](https://data.iana.org/time-zones/tzdb-2021a/zone1970.tab)" + }, + "http_proxy": { + "description": "HTTP Proxy", + "hint": "When enabled, proxy will be set by adding environment variables. Format: `http://ip:port`" + }, + "no_proxy": { + "description": "Direct Connection Address List" + } + } + }, + "provider_group": { + "provider": { + "api_key": { + "description": "API Key" + }, + "dashscope_api_key": { + "description": "DashScope API Key" + }, + "gemini_tts_api_key": { + "description": "Gemini API Key" + }, + "genie_onnx_model_dir": { + "description": "ONNX Model Directory", + "hint": "The directory path containing the ONNX model files" + }, + "genie_language": { + "description": "Language" + }, + "xai_native_search": { + "description": "Enable native search", + "hint": "When enabled, uses xAI Chat Completions native Live Search for web queries (billed on demand). Only applies to xAI providers." + }, + "rerank_api_base": { + "description": "Rerank Model API Base URL", + "hint": "The full request URL is formed by combining the Base URL and a path suffix (defaults to /v1/rerank)." + }, + "rerank_api_suffix": { + "description": "API URL path suffix", + "hint": "Path appended to base_url, e.g. /v1/rerank. Leave empty to disable auto-append." + }, + "rerank_api_key": { + "description": "API Key", + "hint": "Leave empty if no API key is required." + }, + "rerank_model": { + "description": "Rerank model name" + }, + "return_documents": { + "description": "Return source documents in rerank results", + "hint": "Default is false to reduce network overhead." + }, + "instruct": { + "description": "Custom rerank task description", + "hint": "Only effective for qwen3-rerank models. Recommended to write in English." + }, + "nvidia_rerank_api_base": { + "description": "API Base URL" + }, + "nvidia_rerank_api_key": { + "description": "API Key" + }, + "nvidia_rerank_model": { + "description": "Rerank Model Name", + "hint": "Please refer to the NVIDIA Docs for the model name." + }, + "nvidia_rerank_model_endpoint": { + "description": "Custom Model Endpoint", + "hint": "Custom URL suffix endpoint, defaults to /reranking." + }, + "nvidia_rerank_truncate": { + "description": "Text Truncation Strategy", + "hint": "Whether to truncate the input to fit the model's maximum context length when the input text is too long." + }, + "nvidia_embedding": { + "hint": "NVIDIA NIM Embedding, default endpoint https://integrate.api.nvidia.com/v1.", + "input_type": { + "description": "Document-side input_type", + "hint": "Used when indexing documents. Models such as NV-Embed-QA, E5 and nemotron require distinguishing passage from query; use passage for documents." + }, + "query_input_type": { + "description": "Query-side input_type", + "hint": "Used for retrieval queries, defaults to query. NVIDIA states that a wrong value sharply lowers retrieval accuracy." + } + }, + "tei_rerank_truncate": { + "description": "Truncate Long Text", + "hint": "Whether to automatically truncate input when it exceeds the model's maximum context length. Requires Truncation Direction when enabled." + }, + "tei_rerank_truncation_direction": { + "description": "Truncation Direction", + "hint": "Choose to truncate from the left or right side of the text. Only takes effect when Truncate Long Text is True." + }, + "tei_rerank_raw_scores": { + "description": "Return Raw Scores", + "hint": "If True, returns raw model logit scores (which may be negative) without sigmoid normalization. Default is False." + }, + "tei_rerank_return_text": { + "description": "Return Document Text in Results", + "hint": "If True, each result will include the original document text. Default is False to reduce network overhead." + }, + "launch_model_if_not_running": { + "description": "Auto-start model if not running", + "hint": "If the model is not running in Xinference, attempt to start it automatically. Recommended to disable in production." + }, + "modalities": { + "description": "Model capabilities", + "hint": "Modalities supported by the model. If the model does not support images, uncheck image.", + "labels": [ + "Text", + "Image", + "Audio", + "Tool use" + ] + }, + + "custom_headers": { + "description": "Custom request headers", + "hint": "Key/value pairs added here are sent by AstrBot as custom HTTP headers to the provider. Values must be strings." + }, + "ollama_disable_thinking": { + "description": "Disable thinking mode", + "hint": "Close Ollama thinking mode." + }, + "custom_extra_body": { + "description": "Custom request body parameters", + "hint": "Add extra parameters to requests, such as temperature, top_p, max_tokens, etc.", + "template_schema": { + "temperature": { + "description": "Temperature", + "hint": "Controls randomness, typically 0-2. Higher is more random.", + "name": "Temperature" + }, + "top_p": { + "description": "Top-p sampling", + "hint": "Nucleus sampling parameter, usually 0-1. Controls probability mass considered.", + "name": "Top-p" + }, + "max_tokens": { + "description": "Max tokens", + "hint": "Maximum number of generated tokens.", + "name": "Max Tokens" + }, + "max_output_tokens": { + "description": "Max output tokens", + "hint": "Maximum number of generated tokens.", + "name": "Max Output Tokens" + }, + "reasoning_effort": { + "description": "Reasoning effort", + "hint": "Controls the effort used by reasoning models. Supported values depend on the model.", + "name": "Reasoning Effort" + } + } + }, + "gpt_weights_path": { + "description": "GPT model file path", + "hint": "The .ckpt file. Use an absolute path without quotes. Leave empty to use the GPT_SoVITS built-in SoVITS model (recommended to change defaults in GPT_SoVITS)." + }, + "sovits_weights_path": { + "description": "SoVITS model file path", + "hint": "The .pth file. Use an absolute path without quotes. Leave empty to use the GPT_SoVITS built-in SoVITS model (recommended to change defaults in GPT_SoVITS)." + }, + "gsv_default_parms": { + "description": "GPT_SoVITS default parameters", + "hint": "Reference audio file path and text are required; other parameters are optional.", + "gsv_ref_audio_path": { + "description": "Reference audio file path", + "hint": "Required! Use an absolute path without quotes." + }, + "gsv_prompt_text": { + "description": "Reference audio text", + "hint": "Required! Provide the transcript of the reference audio." + }, + "gsv_prompt_lang": { + "description": "Reference audio text language", + "hint": "Language of the reference audio text; default is Chinese." + }, + "gsv_aux_ref_audio_paths": { + "description": "Auxiliary reference audio file paths", + "hint": "Auxiliary reference audio files; optional." + }, + "gsv_text_lang": { + "description": "Text language", + "hint": "Default is Chinese." + }, + "gsv_top_k": { + "description": "Speech diversity", + "hint": "" + }, + "gsv_top_p": { + "description": "Nucleus sampling threshold", + "hint": "" + }, + "gsv_temperature": { + "description": "Speech randomness", + "hint": "" + }, + "gsv_text_split_method": { + "description": "Text splitting method", + "hint": "Options: `cut0` no split, `cut1` split every 4 sentences, `cut2` split every 50 chars, `cut3` split by Chinese period, `cut4` split by English period, `cut5` split by punctuation." + }, + "gsv_batch_size": { + "description": "Batch size", + "hint": "" + }, + "gsv_batch_threshold": { + "description": "Batch threshold", + "hint": "" + }, + "gsv_split_bucket": { + "description": "Split text into buckets for parallel processing", + "hint": "" + }, + "gsv_speed_factor": { + "description": "Speech playback speed", + "hint": "1 is the original speed." + }, + "gsv_fragment_interval": { + "description": "Interval between speech segments", + "hint": "" + }, + "gsv_streaming_mode": { + "description": "Enable streaming mode", + "hint": "" + }, + "gsv_seed": { + "description": "Random seed", + "hint": "For reproducible results." + }, + "gsv_parallel_infer": { + "description": "Run inference in parallel", + "hint": "" + }, + "gsv_repetition_penalty": { + "description": "Repetition penalty", + "hint": "" + }, + "gsv_media_type": { + "description": "Output media type", + "hint": "Recommended: wav" + } + }, + "embedding_dimensions": { + "description": "Embedding dimensions", + "hint": "Embedding vector dimensions. May need adjustment per model; see model documentation. This must be correct or the vector database will not work." + }, + "embedding_dimensions_mode": { + "description": "Embedding dimensions mode", + "hint": "Controls whether to send the dimensions parameter in OpenAI-compatible embedding requests. auto sends it only for official OpenAI embedding-3 models; use always when a compatible API supports it, or never when it rejects the parameter." + }, + "embedding_model": { + "description": "Embedding model", + "hint": "Embedding model name." + }, + "embedding_api_key": { + "description": "API Key" + }, + "embedding_api_base": { + "description": "API Base URL" + }, + "openai_embedding": { + "hint": "If testing fails, try adding /v1 at the end for some OpenAI API versions." + }, + "gemini_embedding": { + "hint": "Gemini Embedding does not require manually adding /v1beta.", + "embedding_task_type_mode": { + "description": "Task type delivery mode", + "hint": "auto: pick by model generation (gemini-embedding-001 uses the task_type parameter, gemini-embedding-2 uses text prefixes); never: always use task_type; always: always use text prefixes." + }, + "embedding_query_task_type": { + "description": "Query-side task_type", + "hint": "Only applies in task_type mode. Use RETRIEVAL_QUERY for retrieval queries, CODE_RETRIEVAL_QUERY for code search." + }, + "embedding_document_task_type": { + "description": "Document-side task_type", + "hint": "Only applies in task_type mode. Use RETRIEVAL_DOCUMENT for stored documents, optionally with a title." + }, + "embedding_query_task_name": { + "description": "Query-side task prefix (gemini-embedding-2)", + "hint": "Only applies in text-prefix mode. One of: search result / question answering / fact checking / code retrieval. Invalid values fall back to search result." + }, + "embedding_document_title": { + "description": "Document title (gemini-embedding-2)", + "hint": "Falls back to title: none when empty. Note that knowledge base ingestion already prepends the document title to the text, so setting this repeats the title; usually leave empty." + } + }, + "dashscope_embedding": { + "hint": "Aliyun DashScope Embedding. Default base URL: https://dashscope.aliyuncs.com/api/v1.", + "embedding_text_type_mode": { + "description": "Query/document distinction mode", + "hint": "auto: retrieval queries use text_type=query and stored documents use text_type=document (recommended, better retrieval); never: do not send text_type. Multimodal models ignore this switch." + } + }, + "volcengine_cluster": { + "description": "Volcengine cluster", + "hint": "For voice cloning models, choose volcano_icl or volcano_icl_concurr; default is volcano_tts." + }, + "volcengine_voice_type": { + "description": "Volcengine voice", + "hint": "Enter voice id (Voice_type)." + }, + "volcengine_speed_ratio": { + "description": "Speech rate", + "hint": "Speech rate, range 0.2 to 3.0, default 1.0." + }, + "volcengine_volume_ratio": { + "description": "Volume", + "hint": "Volume, range 0.0 to 2.0, default 1.0." + }, + "azure_tts_voice": { + "description": "Voice style", + "hint": "API voice name" + }, + "azure_tts_style": { + "description": "Style", + "hint": "A voice-specific speaking style. Can express emotions like happy, sympathetic, and calm." + }, + "azure_tts_role": { + "description": "Role (optional)", + "hint": "Speaking role-play. The voice can emulate different ages and genders without changing the voice name. For example, a male voice can raise pitch to simulate a female voice, but the voice name does not change. If the role is missing or unsupported, this attribute is ignored." + }, + "azure_tts_rate": { + "description": "Speech rate", + "hint": "Controls speaking rate. You can apply the rate at word or sentence level. Rate should be 0.5x to 2x of original audio." + }, + "azure_tts_volume": { + "description": "Speech volume", + "hint": "Controls volume level. You can apply changes at sentence level. Use 0.0 to 100.0 (quiet to loud, e.g., 75). Default is 100.0." + }, + "azure_tts_region": { + "description": "API region", + "hint": "Region where Azure TTS processes data. See https://learn.microsoft.com/zh-cn/azure/ai-services/speech-service/regions" + }, + "azure_tts_subscription_key": { + "description": "Service subscription key", + "hint": "Azure TTS subscription key (not a token)." + }, + "dashscope_tts_voice": { + "description": "Voice" + }, + "gm_resp_image_modal": { + "description": "Enable image modality", + "hint": "When enabled, responses can include images. Requires model support or it will error. See the Google Gemini website for supported models. Tip: if you need image generation, disable the `Enable member recognition` setting for better results." + }, + "gm_native_search": { + "description": "Enable native search", + "hint": "Only Gemini 3 and later models support using this together with function tools. For Gemini 3 and later, native search is only available on the paid tier; see the official docs for pricing." + }, + "gm_native_coderunner": { + "description": "Enable native code runner", + "hint": "Only Gemini 3 and later models support using this together with function tools." + }, + "gm_url_context": { + "description": "Enable URL context", + "hint": "Only Gemini 3 and later models support using this together with function tools." + }, + "gm_safety_settings": { + "description": "Safety filters", + "hint": "Set the safety filtering level for model input. Levels: NONE (no blocking), HIGH (block high risk), MEDIUM_AND_ABOVE (block medium risk and above), LOW_AND_ABOVE (block low risk and above). See Gemini API docs.", + "harassment": { + "description": "Harassment", + "hint": "Negative or harmful comments" + }, + "hate_speech": { + "description": "Hate speech", + "hint": "Rude, disrespectful, or profane content" + }, + "sexually_explicit": { + "description": "Sexually explicit content", + "hint": "References to sexual acts or other obscene content" + }, + "dangerous_content": { + "description": "Dangerous content", + "hint": "Content that promotes, encourages, or assists harmful behavior" + } + }, + "gm_thinking_config": { + "description": "Thinking Config", + "budget": { + "description": "Thinking Budget", + "hint": "Guides the model on the specific number of thinking tokens to use for reasoning. See: https://ai.google.dev/gemini-api/docs/thinking#set-budget" + }, + "level": { + "description": "Thinking Level", + "hint": "Recommended for Gemini 3 models and onwards, lets you control reasoning behavior.See: https://ai.google.dev/gemini-api/docs/thinking#thinking-levels" + } + }, + "anth_thinking_config": { + "description": "Thinking Config", + "type": { + "description": "Thinking Type", + "hint": "Set 'adaptive' for Opus 4.6+ / Sonnet 4.6+ (recommended). Leave empty to use manual budget mode. See: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking" + }, + "budget": { + "description": "Thinking Budget", + "hint": "Anthropic thinking.budget_tokens param. Must >= 1024. Only used when type is empty. Deprecated on Opus 4.6 / Sonnet 4.6. See: https://platform.claude.com/docs/en/build-with-claude/extended-thinking" + }, + "effort": { + "description": "Effort Level", + "hint": "Controls thinking depth when type is 'adaptive'. 'high' is the default. 'max' is Opus 4.6 only. See: https://platform.claude.com/docs/en/build-with-claude/effort" + } + }, + "minimax-group-id": { + "description": "User group", + "hint": "Visible in Account Management -> Basic Info." + }, + "minimax-langboost": { + "description": "Target language/dialect", + "hint": "Enhances recognition for specified languages/dialects and improves speech performance in those scenarios." + }, + "minimax-voice-speed": { + "description": "Speech rate", + "hint": "Speech speed for synthesis, range [0.5, 2], default 1.0. Higher is faster." + }, + "minimax-voice-vol": { + "description": "Volume", + "hint": "Volume for synthesis, range (0, 10], default 1.0. Higher is louder." + }, + "minimax-voice-pitch": { + "description": "Pitch", + "hint": "Pitch for synthesis, range [-12, 12], default 0." + }, + "minimax-is-timber-weight": { + "description": "Enable mixed voices", + "hint": "Enable mixing up to four voices with custom weights. When enabled, single voice settings are ignored." + }, + "minimax-timber-weight": { + "description": "Mixed voices", + "hint": "Mixed voices and their weights. Up to four voices, integer weights in [1, 100]. Get presets and templates from the official API TTS debug console. Must be a JSON string; check the console to confirm parsing. See defaults and the official code preview for structure." + }, + "minimax-voice-id": { + "description": "Single voice", + "hint": "Single voice ID; see the official documentation." + }, + "minimax-voice-emotion": { + "description": "Emotion", + "hint": "Controls emotion of synthesized speech. When set to auto, it selects emotion based on text." + }, + "minimax-voice-latex": { + "description": "Read LaTeX formulas", + "hint": "Read LaTeX formulas, but ensure input text is formatted per the official requirements." + }, + "minimax-voice-english-normalization": { + "description": "English text normalization", + "hint": "Improves number-reading performance but slightly increases latency." + }, + "rag_options": { + "description": "RAG options", + "hint": "Knowledge base retrieval settings, optional. Only supported for Agent app types (agent apps, including RAG apps). For Bailian apps, enabling this disables multi-turn conversations.", + "pipeline_ids": { + "description": "Knowledge base ID list", + "hint": "Retrieve all documents in the specified knowledge bases. Go to https://bailian.console.aliyun.com/ Data Apps -> Knowledge Index to create and get IDs." + }, + "file_ids": { + "description": "Unstructured document IDs", + "hint": "Retrieve specified unstructured documents. Go to https://bailian.console.aliyun.com/ Data Management to create and get IDs." + }, + "output_reference": { + "description": "Output knowledge base/document references", + "hint": "Append reference sources to the end of each answer. Default is False." + } + }, + "sensevoice_hint": { + "description": "Deploy SenseVoice", + "hint": "Before enabling, install funasr, funasr_onnx, torchaudio, torch, modelscope, and jieba (CPU by default, about 1 GB download), and install ffmpeg. Otherwise STT will not work." + }, + "is_emotion": { + "description": "Emotion recognition", + "hint": "Enable emotion recognition. happy?sad?angry?neutral?fearful?disgusted?surprised?unknown" + }, + "stt_model": { + "description": "Model name", + "hint": "Model name on modelscope. Default: iic/SenseVoiceSmall." + }, + "variables": { + "description": "Workflow fixed input variables", + "hint": "Optional. Fixed workflow input variables are used as workflow inputs. You can also set variables dynamically with /set during a chat. If names conflict, dynamic settings take precedence." + }, + "dashscope_app_type": { + "description": "App type", + "hint": "Bailian app type." + }, + "timeout": { + "description": "Timeout", + "hint": "Timeout in seconds." + }, + "openai-tts-voice": { + "description": "voice", + "hint": "OpenAI TTS voice. OpenAI defaults: 'alloy', 'echo', 'fable', 'onyx', 'nova', 'shimmer'." + }, + "elevenlabs-tts-voice-id": { + "description": "Voice ID", + "hint": "ElevenLabs voice ID. Browse and copy voice IDs at https://elevenlabs.io/app/voice-library. Default 'JBFqnCBsd6RMkjVDRZzb' (George)." + }, + "elevenlabs-tts-output-format": { + "description": "Output format", + "hint": "Audio output format, e.g. 'mp3_44100_128', 'mp3_22050_32', 'wav_44100', or 'opus_48000_128'. Raw PCM/u-law/a-law formats are not supported. Default 'mp3_44100_128'." + }, + "elevenlabs-tts-stability": { + "description": "Stability", + "hint": "Voice stability, range [0, 1]. Higher is more consistent, lower is more expressive. Leave empty to use the server default." + }, + "elevenlabs-tts-similarity-boost": { + "description": "Similarity boost", + "hint": "How closely the output matches the original voice, range [0, 1]. Leave empty to use the server default." + }, + "elevenlabs-tts-style": { + "description": "Style exaggeration", + "hint": "Style exaggeration of the voice, range [0, 1]. Higher values increase latency. Leave empty to use the server default." + }, + "elevenlabs-tts-use-speaker-boost": { + "description": "Speaker boost", + "hint": "Boost similarity to the original speaker. May slightly increase latency." + }, + "mimo-tts-voice": { + "description": "Voice", + "hint": "MiMo TTS voice name. Supported values include 'mimo_default', 'default_en', and 'default_zh'." + }, + "mimo-tts-format": { + "description": "Output format", + "hint": "Audio format generated by MiMo TTS. Supported values: 'wav', 'mp3', and 'pcm'." + }, + "mimo-tts-style-prompt": { + "description": "Style prompt", + "hint": "Prepended to the synthesis target text as a tag to control speed, emotion, character, or style, such as happy, faster, Sun Wukong, or whispering. Optional." + }, + "mimo-tts-dialect": { + "description": "Dialect", + "hint": "Combined with the style prompt inside the leading tag, for example Northeastern Mandarin, Sichuan dialect, Henan dialect, or Cantonese. Optional." + }, + "mimo-tts-seed-text": { + "description": "Seed text", + "hint": "Sent as an optional user message to help guide tone and speaking style. It is not appended to the synthesis target text." + }, + "fishaudio-tts-character": { + "description": "character", + "hint": "Fishaudio TTS character. Default is Klee. More roles: https://fish.audio/zh-CN/discovery" + }, + "fishaudio-tts-reference-id": { + "description": "reference_id", + "hint": "Fishaudio TTS reference model ID (optional). If set, the model ID is used directly instead of looking up by role name. Example: 626bb6d3f3364c9cbc3aa6a67300a664. More models: https://fish.audio/zh-CN/discovery; open a model detail page to copy the model ID." + }, + "whisper_hint": { + "description": "Notes for local Whisper deployment", + "hint": "Before enabling, install the openai-whisper library (NVIDIA users download ~2GB mainly for torch and cuda; CPU users download ~1GB), and install ffmpeg. Otherwise STT will not work." + }, + "whisper_device": { + "description": "Inference device", + "hint": "Whisper inference device. Apple Silicon can use mps; other environments should use cpu. If mps is selected but unavailable, AstrBot will fall back to cpu." + }, + "id": { + "description": "ID" + }, + "type": { + "description": "Provider category" + }, + "provider_type": { + "description": "Provider capability type" + }, + "enable": { + "description": "Enable" + }, + "key": { + "description": "API Key" + }, + "api_base": { + "description": "API Base URL" + }, + "total_timeout": { + "description": "Total timeout", + "hint": "Total timeout in seconds for one decision request, including concurrency-slot wait, retries, and backoff; default 5 seconds." + }, + "max_concurrency": { + "description": "Maximum concurrency", + "hint": "Maximum number of simultaneous decision requests for this provider; default 4." + }, + "proxy": { + "description": "Proxy address", + "hint": "HTTP/HTTPS proxy URL, e.g. http://127.0.0.1:7890. Applies only to this provider's API requests and does not affect Docker internal networking." + }, + "model": { + "description": "Model ID", + "hint": "Model name, e.g., gpt-4o-mini, deepseek-chat." + }, + "max_context_tokens": { + "description": "Model context window size", + "hint": "Maximum context tokens. If 0, it auto-fills from model metadata (if available); you can also edit manually." + }, + "dify_api_key": { + "description": "API Key", + "hint": "Dify API Key. This field is required." + }, + "dify_api_base": { + "description": "API Base URL", + "hint": "Dify API Base URL. Default: https://api.dify.ai/v1" + }, + "dify_api_type": { + "description": "Dify app type", + "hint": "Dify API type. According to Dify docs, supported types are chat, chatflow, agent, workflow." + }, + "dify_workflow_output_key": { + "description": "Dify workflow output variable name", + "hint": "Dify workflow output variable name. Only used when app type is workflow. Default: astrbot_wf_output." + }, + "dify_query_input_key": { + "description": "Prompt input variable name", + "hint": "Input variable name for the message text. Default: astrbot_text_query." + }, + "coze_api_key": { + "description": "Coze API Key", + "hint": "Coze API key for accessing Coze services." + }, + "bot_id": { + "description": "Bot ID", + "hint": "Coze bot ID, obtained after creating a bot on the Coze platform." + }, + "coze_api_base": { + "description": "API Base URL", + "hint": "Base URL for the Coze API. Default: https://api.coze.cn" + }, + "deerflow_api_base": { + "description": "API Base URL", + "hint": "DeerFlow API gateway URL. Default: http://127.0.0.1:2026" + }, + "deerflow_api_key": { + "description": "DeerFlow API Key", + "hint": "Optional. Fill this if your DeerFlow gateway is protected by Bearer auth." + }, + "deerflow_auth_header": { + "description": "Authorization Header", + "hint": "Optional. Custom Authorization header value; takes precedence over DeerFlow API Key." + }, + "deerflow_assistant_id": { + "description": "Assistant ID", + "hint": "LangGraph assistant_id, default is lead_agent." + }, + "deerflow_model_name": { + "description": "Model name override", + "hint": "Optional. Overrides DeerFlow default model (maps to runtime context model_name)." + }, + "deerflow_thinking_enabled": { + "description": "Enable thinking mode" + }, + "deerflow_plan_mode": { + "description": "Enable plan mode", + "hint": "Maps to DeerFlow is_plan_mode." + }, + "deerflow_subagent_enabled": { + "description": "Enable subagent", + "hint": "Maps to DeerFlow subagent_enabled." + }, + "deerflow_max_concurrent_subagents": { + "description": "Max concurrent subagents", + "hint": "Maps to DeerFlow max_concurrent_subagents. Effective only when subagent is enabled. Default: 3." + }, + "deerflow_recursion_limit": { + "description": "Recursion limit", + "hint": "Maps to LangGraph recursion_limit." + }, + "auto_save_history": { + "description": "Conversation history managed by Coze", + "hint": "When enabled, Coze manages conversation history. AstrBot's locally saved context will not take effect (read-only), and operations on AstrBot context will not apply. If disabled, AstrBot manages the context." + } + } + }, + "help": { + "documentation": "Official Documentation", + "support": "Join Support Group", + "helpText": "Don't understand the configuration? See {documentation} or {support}.", + "helpPrefix": "Don't understand the configuration? See", + "helpMiddle": "or", + "helpSuffix": "." + } +} diff --git a/dashboard/src/i18n/locales/zh-CN/features/config-metadata.json b/dashboard/src/i18n/locales/zh-CN/features/config-metadata.json index bb07afc86e9..ac9a86763c7 100644 --- a/dashboard/src/i18n/locales/zh-CN/features/config-metadata.json +++ b/dashboard/src/i18n/locales/zh-CN/features/config-metadata.json @@ -1,2115 +1,2130 @@ -{ - "ai_group": { - "name": "AI", - "agent_runner": { - "description": "Agent 执行方式", - "hint": "选择 AI 对话的执行器。切换执行器会使用新类型的默认配置,不保留上一类型的参数。", - "provider_settings": { - "enable": { - "description": "启用", - "hint": "AI 对话总开关" - } - }, - "agent_runner": { - "runner_type": { - "description": "执行器", - "labels": [ - "内置 Agent", - "Dify", - "Coze", - "阿里云百炼应用", - "DeerFlow" - ] - } - } - }, - "dify_runner": { - "description": "Dify 配置", - "agent_runner": { - "config": { - "dify_api_type": { "description": "应用类型" }, - "dify_api_key": { "description": "API Key" }, - "dify_api_base": { "description": "API Base URL" }, - "dify_workflow_output_key": { "description": "Workflow 输出变量名" }, - "dify_query_input_key": { "description": "Prompt 输入变量名" }, - "variables": { "description": "变量" }, - "timeout": { "description": "超时时间(秒)" }, - "proxy": { "description": "代理地址" } - } - } - }, - "coze_runner": { - "description": "Coze 配置", - "agent_runner": { - "config": { - "coze_api_key": { "description": "API Key" }, - "bot_id": { "description": "Bot ID" }, - "coze_api_base": { "description": "API Base URL" }, - "auto_save_history": { "description": "由 Coze 管理对话记录" }, - "timeout": { "description": "超时时间(秒)" }, - "proxy": { "description": "代理地址" } - } - } - }, - "dashscope_runner": { - "description": "阿里云百炼应用配置", - "agent_runner": { - "config": { - "dashscope_app_type": { "description": "应用类型" }, - "dashscope_api_key": { "description": "API Key" }, - "dashscope_app_id": { "description": "应用 ID" }, - "rag_options": { - "pipeline_ids": { "description": "知识库 Pipeline ID" }, - "file_ids": { "description": "文件 ID" }, - "output_reference": { "description": "输出引用" } - }, - "variables": { "description": "变量" }, - "timeout": { "description": "超时时间(秒)" }, - "proxy": { "description": "代理地址" } - } - } - }, - "deerflow_runner": { - "description": "DeerFlow 配置", - "agent_runner": { - "config": { - "deerflow_api_base": { "description": "API Base URL" }, - "deerflow_api_key": { "description": "API Key" }, - "deerflow_auth_header": { "description": "Authorization Header" }, - "deerflow_assistant_id": { "description": "Assistant ID" }, - "deerflow_model_name": { "description": "模型名称覆盖" }, - "deerflow_thinking_enabled": { "description": "启用思考模式" }, - "deerflow_plan_mode": { "description": "启用计划模式" }, - "deerflow_subagent_enabled": { "description": "启用子智能体" }, - "deerflow_max_concurrent_subagents": { "description": "子智能体最大并发数" }, - "deerflow_recursion_limit": { "description": "递归深度上限" }, - "timeout": { "description": "超时时间(秒)" }, - "proxy": { "description": "代理地址" } - } - } - }, - "ai": { - "description": "模型", - "hint": "配置内置 Agent 使用的对话模型,以及通用的图片转述、语音模型。", - "agent_runner": { - "config": { - "model": { - "provider_id": { - "description": "对话模型", - "hint": "留空时使用第一个模型" - }, - "fallback_provider_ids": { - "description": "回退对话模型", - "hint": "主对话模型请求失败时,按顺序切换到这些对话模型。" - }, - "request_max_retries": { - "description": "异常重试次数", - "hint": "单次模型请求遇到可重试错误时的最大尝试次数。" - } - } - } - }, - "provider_settings": { - "default_image_caption_provider_id": { - "description": "图片转述模型", - "hint": "当对话模型不支持图片输入时,调用图片转述模型来获得图片描述。留空代表不使用。" - }, - "image_caption_prompt": { - "description": "图片转述提示词", - "hint": "用于图片转述模型的提示词。" - } - }, - "provider_stt_settings": { - "enable": { - "description": "语音识别", - "hint": "使用语音转文字模型将用户语音转述为文本,方便模型理解。" - }, - "provider_id": { - "description": "默认语音转文本模型", - "hint": "也可使用 /provider 指令单独选择会话的模型。" - } - }, - "provider_tts_settings": { - "enable": { - "description": "语音回复", - "hint": "使用文字转语音模型将文字转为语音回复。" - }, - "provider_id": { - "description": "默认文本转语音模型", - "hint": "也可使用 /provider 指令单独选择会话的模型。" - }, - "trigger_probability": { - "description": "TTS 触发概率", - "hint": "采用随机概率触发语音回复。" - } - } - }, - "persona": { - "description": "人格", - "hint": "赋予 AstrBot 人格。", - "agent_runner": { - "config": { - "persona": { - "persona_id": { "description": "默认采用的人格" }, - "safety_mode": { - "description": "健康模式", - "hint": "引导模型输出健康、安全的内容,避免有害或敏感话题。" - }, - "safety_mode_strategy": { - "description": "健康模式策略", - "hint": "选择健康模式的实现策略。" - } - } - } - } - }, - "knowledgebase": { - "description": "知识库", - "hint": "AstrBot 的 “外置大脑”。", - "kb_names": { - "description": "知识库列表", - "hint": "支持多选" - }, - "kb_fusion_top_k": { - "description": "融合检索结果数", - "hint": "多个知识库检索结果融合后的返回结果数量" - }, - "kb_final_top_k": { - "description": "最终返回结果数", - "hint": "从知识库中检索到的结果数量,越大可能获得越多相关信息,但也可能引入噪音。建议根据实际需求调整" - }, - "kb_agentic_mode": { - "description": "Agentic 知识库检索", - "hint": "启用后,知识库检索将作为 LLM Tool,由模型自主决定何时调用知识库进行查询。需要模型支持函数调用能力。" - } - }, - "websearch": { - "description": "网页搜索", - "hint": "让 AstrBot 能够访问互联网,获悉时讯。", - "provider_settings": { - "web_search": { - "description": "启用网页搜索" - }, - "websearch_provider": { - "description": "网页搜索提供商", - "labels": [ - "SerpApi", - "DeepSeek Search API", - "Tavily", - "Baidu AI Search", - "Bocha", - "Brave", - "Firecrawl", - "Exa", - "AnySearch" - ], - "subtitles": [ - "Google 网页、新闻、图片、学术和财经搜索", - "DeepSeek 官方搜索接口", - "", - "", - "", - "", - "", - "", - "" - ] - }, - "websearch_tavily_key": { - "description": "Tavily API Key", - "hint": "可添加多个 Key 进行轮询。" - }, - "websearch_bocha_key": { - "description": "BoCha API Key", - "hint": "可添加多个 Key 进行轮询。" - }, - "websearch_brave_key": { - "description": "Brave Search API Key", - "hint": "可添加多个 Key 进行轮询。" - }, - "websearch_firecrawl_key": { - "description": "Firecrawl API Key", - "hint": "可添加多个 Key 进行轮询。" - }, - "websearch_baidu_app_builder_key": { - "description": "百度千帆智能云 APP Builder API Key", - "hint": "参考:[https://console.bce.baidu.com/iam/#/iam/apikey/list](https://console.bce.baidu.com/iam/#/iam/apikey/list)" - }, - "web_search_link": { - "description": "显示来源引用" - }, - "websearch_exa_key": { - "description": "Exa API Key", - "hint": "可添加多个 Key 进行轮询。获取 Key: https://dashboard.exa.ai" - }, - "websearch_anysearch_key": { - "description": "AnySearch API Key", - "hint": "可添加多个 Key 进行轮询。留空则使用匿名模式(每日免费额度)。" - }, - "websearch_serpapi_key": { - "description": "SerpApi API Key", - "hint": "支持 Google 网页、新闻、图片、学术和财经搜索。可添加多个 Key 轮询。获取 Key:[https://serpapi.com/manage-api-key](https://serpapi.com/manage-api-key)" - }, - "websearch_deepseek_key": { - "description": "DeepSeek API Key", - "hint": "填入 DeepSeek API Key。可使用与对话模型相同的 Key(需独立填写)。可添加多个 Key 轮询。 获取 Key: [https://platform.deepseek.com/api_keys](https://platform.deepseek.com/api_keys)" - } - } - }, - "file_extract": { - "description": "文档解析能力", - "provider_settings": { - "file_extract": { - "enable": { - "description": "启用文档解析能力" - }, - "provider": { - "description": "文档解析提供商" - }, - "moonshotai_api_key": { - "description": "Moonshot AI API Key" - } - } - } - }, - "agent_computer_use": { - "description": "使用电脑能力", - "hint": "让 AstrBot 访问和使用本机环境或者隔离的沙盒环境,以执行更复杂的任务。详见: [Agent 沙盒环境](https://docs.astrbot.app/use/astrbot-agent-sandbox.html)。", - "provider_settings": { - "computer_use_runtime": { - "description": "运行环境", - "hint": "允许 Agent 访问的环境。", - "labels": ["不允许任何环境", "本机环境", "第三方沙箱环境"] - }, - "computer_use_local_permissions": { - "description": "本地权限策略" - }, - "computer_use_require_admin": { - "description": "沙箱能力需要 AstrBot 管理员权限", - "hint": "开启后,需要 AstrBot 管理员权限才能调用远程沙箱能力。在配置文件 -> 访问控制 -> 管理员 -> 管理员 ID 中可添加管理员。给机器人发送 /sid 指令以获取 ID。" - }, - "sandbox": { - "booter": { - "description": "沙箱环境驱动器" - }, - "shipyard_neo_endpoint": { - "description": "Shipyard Neo API Endpoint", - "hint": "Shipyard Neo(Bay) 服务的 API 地址,默认 http://127.0.0.1:8114。" - }, - "shipyard_neo_access_token": { - "description": "Shipyard Neo 访问令牌", - "hint": "Bay 的 API Key(sk-bay-...)。留空时自动从 credentials.json 发现。" - }, - "shipyard_neo_profile": { - "description": "Shipyard Neo Profile", - "hint": "Shipyard Neo 沙箱 profile,例如 python-default。留空时自动选择能力更完整的 profile。" - }, - "shipyard_neo_ttl": { - "description": "Shipyard Neo Sandbox 存活时间(秒)", - "hint": "Shipyard Neo 沙箱的生存时间(秒)。" - }, - "cua_image": { - "description": "CUA 镜像", - "hint": "CUA 沙箱镜像/系统类型,默认 linux。可填写 linux、macos、windows、android,具体取决于 CUA SDK 支持。" - }, - "cua_os_type": { - "description": "CUA 操作系统类型", - "hint": "CUA 沙箱操作系统类型,默认 linux。" - }, - "cua_idle_timeout": { - "description": "CUA 空闲超时(秒)", - "hint": "CUA 沙箱空闲超时时间(秒)。大于 0 时,AstrBot 会在会话空闲达到该时长后主动关闭 CUA 沙箱;0 表示禁用。" - }, - "cua_telemetry_enabled": { - "description": "CUA 遥测", - "hint": "是否允许 CUA SDK 发送遥测数据。默认关闭。" - }, - "cua_local": { - "description": "CUA 本地沙箱", - "hint": "是否优先使用 CUA 本地沙箱。默认开启,避免云端沙箱要求 CUA_API_KEY。关闭后可使用 CUA 云端沙箱。" - }, - "cua_api_key": { - "description": "CUA API Key", - "hint": "CUA 云端沙箱 API Key。仅在关闭本地沙箱时需要。也可以通过 CUA_API_KEY 环境变量提供。" - }, - "shipyard_endpoint": { - "description": "Shipyard API Endpoint", - "hint": "Shipyard 服务的 API 访问地址。" - }, - "shipyard_access_token": { - "description": "Shipyard 访问令牌", - "hint": "用于访问 Shipyard 服务的访问令牌。" - }, - "shipyard_ttl": { - "description": "Shipyard Ship 存活时间(秒)", - "hint": "Shipyard 会话的生存时间(秒)。" - }, - "shipyard_max_sessions": { - "description": "Shipyard Ship 会话复用上限", - "hint": "决定了一个实例承载的最大会话数量。" - } - } - }, - "local_permissions": { - "role": "用户身份", - "execution": "允许执行代码", - "network": "允许执行环境联网", - "filesystem": "文件访问范围", - "scopes": { - "workspace": "工作区", - "host": "整个环境" - }, - "scopeHints": { - "none": "不允许访问任何文件", - "workspace": "受限的工作区、临时目录和技能文件。", - "workspaceUnsupported": "当前系统不支持受限工作区文件访问。", - "host": "AstrBot 所在运行环境的所有文件。" - }, - "scopeDetails": { - "account": "1. 可访问 AstrBot 运行账户有权限访问的文件。", - "docker": "2. 如果通过 Docker 部署,则仅可访问容器内及挂载的文件,并非宿主机全部文件。" - }, - "roles": { - "member": "普通成员", - "admin": "管理员" - }, - "modes": { - "none": "关闭" - }, - "networkAlwaysOn": "始终开启", - "windowsHostNetworkHint": "Windows 暂不支持在“整个环境”执行代码时单独禁网。切换到“工作区”后可关闭联网。", - "runtimeUnknown": "运行环境信息不可用。", - "memberWarning": "普通成员已获得联网或整个环境访问权限。", - "executionInactive": "未生效", - "executionInactiveHelp": "查看未生效原因", - "executionBlocked": "{role}已开启代码执行,但当前无法满足所配置的隔离限制。原因:{reason}", - "runtime": { - "os": "操作系统", - "arch": "架构", - "sandbox": "本地隔离", - "windowsUnavailable": "{backend} · 尚未就绪", - "windowsSetupHint": "请保存配置并重启 AstrBot;如出现管理员授权提示,请允许以完成沙盒初始化。", - "errorDetails": "查看诊断详情", - "unavailableHint": "沙箱启动失败,受限 Shell/Python 执行及工作区文件搜索会受到影响。请根据下方错误检查系统安全策略(如 Linux 的 AppArmor、用户命名空间限制)或容器限制,修复后重启 AstrBot 重新检测。", - "dialog": { - "intro": "利用 macOS 的 Seatbelt 或 Linux 的 bubblewrap(bwrap)技术,为 AstrBot Agent 的执行提供安全隔离,以限制不同用户使用 AstrBot Agent 时的文件访问范围和联网权限,获得更高的安全性。", - "startupError": "查看启动错误", - "documentation": "查看详细配置文档" - }, - "close": "关闭", - "setupHint": { - "missing": "安装 {dependency} 以获得完整的本地隔离功能。", - "unavailable": "配置 {backend},启用完整的本地隔离功能。", - "unsupported": "了解本地隔离支持情况。" - }, - "isolationFailure": { - "missing": "缺少 {dependency}。", - "unavailable": "{backend} 启动探测失败。", - "unsupported": "当前系统不支持本地进程隔离。" - }, - "executionUnavailable": { - "missing": "缺少 {dependency},无法在“文件访问范围”选择“工作区”时允许执行代码。", - "unavailable": "{backend} 无法启动,无法在“文件访问范围”选择“工作区”时允许执行代码。", - "unsupported": "当前系统不支持本地隔离,无法在“文件访问范围”选择“工作区”时允许执行代码。" - }, - "status": { - "detected": "{backend}", - "missing": "缺少 {dependency}", - "unavailable": "{backend} · 已安装但无法启动", - "unsupported": "暂不支持" - } - } - } - }, - "proactive_capability": { - "description": "主动型能力", - "hint": "让 AstrBot 能够在某一时刻自动唤醒,帮你完成任务。详见: [主动型 Agent](https://docs.astrbot.app/use/proactive-agent.html)。", - "provider_settings": { - "proactive_capability": { - "add_cron_tools": { - "description": "启用", - "hint": "启用后,将会传递给 Agent 相关工具来实现主动型 Agent。你可以告诉 AstrBot 未来某个时间要做的事情,它将被定时触发然后执行任务,然后将结果发送给你。" - } - } - } - }, - "truncate_and_compress": { - "hint": "AstrBot 如何管理工作记忆。详见: [上下文管理策略](https://docs.astrbot.app/use/context-compress.html)。", - "description": "上下文管理策略", - "agent_runner": { - "config": { - "compression": { - "max_turns": { - "description": "压缩前最多保留对话轮数", - "hint": "普通会话历史超过该轮数后,才会按下方策略进行持久化截断或 LLM 压缩;请求发送前也会先按该值约束上下文。-1 表示不按轮数限制。" - }, - "trim_turns": { - "description": "轮次超限时一次丢弃轮数", - "hint": "当超过\"压缩前最多保留对话轮数\"且无法使用 LLM 压缩时,一次丢弃多少轮旧对话;请求期截断也会复用该值。" - }, - "overflow_strategy": { - "description": "压缩策略", - "labels": ["按对话轮数截断", "由 LLM 压缩上下文"], - "hint": "模型上下文超限时的处理策略。" - }, - "instruction": { - "description": "上下文压缩提示词", - "hint": "如果为空则使用默认提示词。" - }, - "keep_recent_ratio": { - "description": "压缩时保留最近上下文比例", - "hint": "按当前上下文 token 数保留最近内容,范围 0-0.3。0.15 表示保留 15%;比例大于 0 时至少保留最后一轮。" - }, - "provider_id": { - "description": "压缩模型", - "hint": "用于上下文压缩的模型。默认选择当前的对话模型。" - }, - "fallback_max_tokens": { - "description": "上下文窗口兜底值", - "hint": "当 max_context_tokens 为 0 且模型不在内置元数据中时,使用此值作为上下文窗口大小。默认 128000。" - } - } - } - } - }, - "others": { - "description": "其他配置", - "agent_runner": { - "config": { - "misc": { - "max_steps": { "description": "工具调用轮数上限" }, - "tool_schema_mode": { - "description": "工具调用模式", - "hint": "skills-like 先下发工具名称与描述,再下发参数;full 一次性下发完整参数。", - "labels": ["Skills-like(两阶段)", "Full(完整参数)"] - }, - "tool_call_timeout": { - "description": "工具调用超时时间(秒)" - }, - "sanitize_context_by_modalities": { - "description": "按模型能力清理历史上下文", - "hint": "开启后,在每次请求 LLM 前会按当前模型提供商中所选择的模型能力删除对话中不支持的图片/工具调用结构(会改变模型看到的历史)" - } - } - } - }, - "provider_settings": { - "display_reasoning_text": { - "description": "显示思考内容", - "hint": "显示模型的思维链信息到最终回复中。" - }, - "identifier": { - "description": "用户识别", - "hint": "在用户提示词前带上用户 ID 信息。" - }, - "group_name_display": { - "description": "显示群名称", - "hint": "在受支持的消息平台的群聊中的用户提示词前带上群名称信息。" - }, - "datetime_system_prompt": { - "description": "现实世界时间感知", - "hint": "在用户提示词中带上当前的时间信息。" - }, - "show_tool_use_status": { - "description": "输出工具调用信息", - "hint": "有工具调用时,同时发送带有工具调用名字的消息。" - }, - "show_tool_call_result": { - "description": "输出工具调用结果", - "hint": "仅在启用“输出工具调用信息”时生效,且最多展示 70 个字符。" - }, - "buffer_intermediate_messages": { - "description": "合并 Agent 中间消息", - "hint": "开启后,非流式模式下多步工具调用过程中产生的中间文本将缓冲,待 Agent 完成后合并为一条回复发送。" - }, - "max_quoted_fallback_images": { - "description": "转发消息中图片获取上限", - "hint": "转发消息解析到的图片最多注入数量,超出部分会截断。" - }, - "quoted_message_parser": { - "max_component_chain_depth": { - "description": "转发消息富文本解析深度", - "hint": "解析转发消息中的富文本组件链时允许的最大递归深度。" - }, - "max_forward_node_depth": { - "description": "转发消息嵌套解析深度", - "hint": "解析嵌套转发节点时允许的最大递归深度。" - }, - "max_forward_fetch": { - "description": "转发消息递归拉取上限", - "hint": "递归调用 get_forward_msg 拉取转发内容的最大次数。" - }, - "warn_on_action_failure": { - "description": "转发消息解析失败告警", - "hint": "开启后,get_msg/get_forward_msg 全部尝试失败时输出 warning 日志。" - } - }, - "streaming_response": { - "description": "流式输出", - "hint": "在受支持的聊天平台中以打字机的形式输出响应。" - }, - "unsupported_streaming_strategy": { - "description": "不支持流式回复的平台", - "hint": "选择在不支持流式回复的平台上的处理方式。实时分段回复会在系统接收流式响应检测到诸如标点符号等分段点时,立即发送当前已接收的内容", - "labels": [ - "实时分段回复", - "关闭流式回复" - ] - }, - "wake_prefix": { - "description": "额外唤醒前缀", - "hint": "如果唤醒前缀为 /, 额外聊天唤醒前缀为 chat,则需要 /chat 才会触发 LLM 请求" - }, - "prompt_prefix": { - "description": "用户提示词", - "hint": "可使用 {{prompt}} 作为用户输入的占位符。如果不输入占位符则代表添加在用户输入的前面。" - }, - "image_compress_options": { - "description": "模型输入图片设置", - "hint": "图片始终处理为严格小于 512 KiB 的 JPEG/PNG,原始附件保留。", - "max_size": { - "description": "输入图片最大边长", - "hint": "发送给模型的图片最长边(像素),系统会在必要时进一步压缩。" - } - }, - "reachability_check": { - "description": "提供商可达性检测", - "hint": "/provider 命令列出模型时并发检测连通性。开启后会主动调用模型测试连通性,可能产生额外 token 消耗。" - } - }, - "provider_tts_settings": { - "dual_output": { - "description": "开启 TTS 时同时输出语音和文字内容" - } - } - } - }, - "platform_group": { - "name": "平台与消息", - "platform": { - "description": "消息平台适配器", - "app_id": { - "description": "应用 ID", - "hint": "消息平台开放平台中的应用 ID。" - }, - "app_secret": { - "description": "应用密钥", - "hint": "消息平台开放平台中的应用密钥。请妥善保管,避免泄露。" - }, - "domain": { - "description": "开放平台 API 地址", - "hint": "开放平台 API 的基础地址。使用默认官方服务时通常无需修改。" - }, - "corpid": { - "description": "企业 ID", - "hint": "企业微信后台中的企业 ID(CorpID)。" - }, - "token": { - "description": "回调 Token", - "hint": "消息平台回调配置中用于验证请求的 Token。" - }, - "encoding_aes_key": { - "description": "消息加密密钥", - "hint": "消息平台回调配置中的 EncodingAESKey,用于加密和解密消息。" - }, - "api_base_url": { - "description": "API 基础地址", - "hint": "消息平台 API 的基础地址。使用默认官方服务时通常无需修改。" - }, - "client_id": { - "description": "客户端 ID", - "hint": "消息平台开放平台中的客户端 ID。" - }, - "client_secret": { - "description": "客户端密钥", - "hint": "消息平台开放平台中的客户端密钥。请妥善保管,避免泄露。" - }, - "start_message": { - "description": "Start 命令回复", - "hint": "用户向 Telegram 机器人发送 /start 命令时回复的内容。" - }, - "telegram_api_base_url": { - "description": "API 地址", - "hint": "Telegram Bot API 的基础地址。使用官方服务时通常无需修改。" - }, - "telegram_file_base_url": { - "description": "文件 API 地址", - "hint": "Telegram Bot API 文件下载接口的基础地址。使用官方服务时通常无需修改。" - }, - "bot_token": { - "description": "Slack Bot Token", - "hint": "Slack 应用的 Bot User OAuth Token,通常以 xoxb- 开头。" - }, - "app_token": { - "description": "Slack App Token", - "hint": "Slack Socket Mode 使用的 App-Level Token,通常以 xapp- 开头。" - }, - "signing_secret": { - "description": "Slack Signing Secret", - "hint": "Slack 应用的 Signing Secret,用于验证 Webhook 请求。" - }, - "channel_access_token": { - "description": "LINE 频道访问令牌", - "hint": "LINE Messaging API 频道的 Channel Access Token。" - }, - "channel_secret": { - "description": "LINE 频道密钥", - "hint": "LINE Messaging API 频道的 Channel Secret。" - }, - "active_send_mode": { - "description": "是否换用主动发送接口" - }, - "appid": { - "description": "appid", - "hint": "必填项。当前消息平台的 AppID。如何获取请参考对应平台接入文档。" - }, - "callback_server_host": { - "description": "回调服务器主机", - "hint": "回调服务器主机。留空则不启用回调服务器。" - }, - "card_template_id": { - "description": "卡片模板 ID", - "hint": "可选。钉钉互动卡片模板 ID。启用后将使用互动卡片进行流式回复。" - }, - "discord_activity_name": { - "description": "Discord 活动名称", - "hint": "可选的 Discord 活动名称。留空则不设置活动。" - }, - "discord_allow_bot_messages": { - "description": "允许接收机器人消息", - "hint": "启用后,AstrBot 将接收来自其他 Discord 机器人的消息。适用于机器人间通信场景(如消息转发)。默认关闭。" - }, - "discord_command_register": { - "description": "注册 Discord 指令", - "hint": "启用后,自动将插件指令注册为 Discord 斜杠指令" - }, - "discord_proxy": { - "description": "Discord 代理地址", - "hint": "可选的代理地址:http://ip:port" - }, - "discord_token": { - "description": "Discord Bot Token", - "hint": "在此处填入你的 Discord Bot Token" - }, - "enable": { - "description": "启用", - "hint": "是否启用该适配器。未启用的适配器对应的消息平台将不会接收到消息。" - }, - "enable_group_c2c": { - "description": "启用消息列表单聊", - "hint": "启用后,机器人可以接收到 QQ 消息列表中的私聊消息。你可能需要在 QQ 机器人平台上通过扫描二维码的方式添加机器人为你的好友。详见文档。" - }, - "enable_guild_direct_message": { - "description": "启用频道私聊", - "hint": "启用后,机器人可以接收到频道的私聊消息。" - }, - "id": { - "description": "机器人名称", - "hint": "机器人名称" - }, - "is_sandbox": { - "description": "沙箱模式" - }, - "kf_name": { - "description": "微信客服账号名", - "hint": "如果填写此项,即代表你将使用企业微信客服,而不是企业微信应用。可在 https://kf.weixin.qq.com/kf/frame#/accounts 获取。" - }, - "lark_connection_mode": { - "description": "订阅方式", - "labels": [ - "长连接模式", - "推送至服务器模式" - ] - }, - "lark_encrypt_key": { - "description": "Encrypt Key", - "hint": "用于解密飞书回调数据的加密密钥" - }, - "lark_verification_token": { - "description": "Verification Token", - "hint": "用于验证飞书回调请求的令牌" - }, - "misskey_allow_insecure_downloads": { - "description": "允许不安全下载(禁用 SSL 验证)", - "hint": "当远端服务器存在证书问题导致无法正常下载时,自动禁用 SSL 验证作为回退方案。适用于某些图床的证书配置问题。启用有安全风险,仅在必要时使用。" - }, - "misskey_default_visibility": { - "description": "默认帖子可见性", - "hint": "机器人发帖时的默认可见性设置。public:公开,home:主页时间线,followers:仅关注者。" - }, - "misskey_download_chunk_size": { - "description": "流式下载分块大小(字节)", - "hint": "流式下载和计算 MD5 时使用的每次读取字节数,过小会增加开销,过大会占用内存。" - }, - "misskey_download_timeout": { - "description": "远端下载超时时间(秒)", - "hint": "下载远程文件时的超时时间(秒),用于异步上传回退到本地上传的场景。" - }, - "misskey_enable_chat": { - "description": "启用聊天消息响应", - "hint": "启用后,机器人将会监听和响应私信聊天消息" - }, - "misskey_enable_file_upload": { - "description": "启用文件上传到 Misskey", - "hint": "启用后,适配器会尝试将消息链中的文件上传到 Misskey。URL 文件会先尝试服务器端上传,异步上传失败时会回退到下载后本地上传。" - }, - "misskey_instance_url": { - "description": "Misskey 实例 URL", - "hint": "例如 https://misskey.example,填写 Bot 账号所在的 Misskey 实例地址" - }, - "misskey_local_only": { - "description": "仅限本站(不参与联合)", - "hint": "启用后,机器人发出的帖子将仅在本实例可见,不会联合到其他实例" - }, - "misskey_max_download_bytes": { - "description": "最大允许下载字节数(超出则中止)", - "hint": "如果希望限制下载文件的最大大小以防止 OOM,请填写最大字节数;留空或 null 表示不限制。" - }, - "misskey_token": { - "description": "Misskey Access Token", - "hint": "连接服务设置生成的 API 鉴权访问令牌(Access token)" - }, - "misskey_upload_concurrency": { - "description": "并发上传限制", - "hint": "同时进行的文件上传任务上限(整数,默认 3)。" - }, - "misskey_upload_folder": { - "description": "上传到网盘的目标文件夹 ID", - "hint": "可选:填写 Misskey 网盘中目标文件夹的 ID,上传的文件将放置到该文件夹内。留空则使用账号网盘根目录。" - }, - "port": { - "description": "回调服务器端口", - "hint": "回调服务器端口。留空则不启用回调服务器。" - }, - "satori_api_base_url": { - "description": "Satori API 终结点", - "hint": "Satori API 的基础地址。" - }, - "satori_auto_reconnect": { - "description": "启用自动重连", - "hint": "断开连接时是否自动重新连接 WebSocket。" - }, - "satori_endpoint": { - "description": "Satori WebSocket 终结点", - "hint": "Satori 事件的 WebSocket 端点。" - }, - "satori_heartbeat_interval": { - "description": "Satori 心跳间隔", - "hint": "发送心跳消息的间隔(秒)。" - }, - "satori_reconnect_delay": { - "description": "Satori 重连延迟", - "hint": "尝试重新连接前的延迟时间(秒)。" - }, - "satori_token": { - "description": "Satori 令牌", - "hint": "用于 Satori API 身份验证的令牌。" - }, - "secret": { - "description": "secret", - "hint": "必填项。" - }, - "slack_connection_mode": { - "description": "Slack Connection Mode", - "hint": "The connection mode for Slack. `webhook` uses a webhook server, `socket` uses Slack's Socket Mode." - }, - "slack_webhook_host": { - "description": "Slack Webhook Host", - "hint": "Only valid when Slack connection mode is `webhook`." - }, - "slack_webhook_path": { - "description": "Slack Webhook Path", - "hint": "Only valid when Slack connection mode is `webhook`." - }, - "slack_webhook_port": { - "description": "Slack Webhook Port", - "hint": "Only valid when Slack connection mode is `webhook`." - }, - "telegram_command_auto_refresh": { - "description": "命令自动刷新", - "hint": "启用后,AstrBot 将会在运行时自动刷新 Telegram 命令。(单独设置此项无效)" - }, - "telegram_command_register": { - "description": "命令注册", - "hint": "启用后,AstrBot 将会自动注册 Telegram 命令。" - }, - "telegram_command_register_interval": { - "description": "命令自动刷新间隔", - "hint": "Telegram 命令自动刷新间隔,单位为秒。" - }, - "telegram_polling_restart_delay": { - "description": "轮询重启延迟", - "hint": "当轮询意外结束尝试自动重启时的延迟时间,单位为秒。默认为 5s。" - }, - "telegram_token": { - "description": "Bot Token", - "hint": "如果你的网络环境为中国大陆,请在 `其他配置` 处设置代理或更改 api_base。" - }, - "mattermost_url": { - "description": "Mattermost URL", - "hint": "Mattermost 服务地址,例如 https://chat.example.com。" - }, - "mattermost_bot_token": { - "description": "Mattermost Bot Token", - "hint": "在 Mattermost 中创建 Bot 账户后生成的访问令牌。" - }, - "mattermost_reconnect_delay": { - "description": "Mattermost 重连延迟", - "hint": "WebSocket 断开后的重连等待时间,单位为秒。默认 5 秒。" - }, - "type": { - "description": "适配器类型" - }, - "unified_webhook_mode": { - "description": "统一 Webhook 模式", - "hint": "Webhook 模式下使用 AstrBot 统一 Webhook 入口,无需单独开启端口。回调地址为 /api/v1/webhooks/platforms/{webhook_uuid}。" - }, - "use_markdown": { - "description": "主动消息使用 Markdown", - "hint": "启用后,机器人主动发送消息默认以 Markdown 模式发送;插件显式调用 use_markdown() 指定行为时不受此配置影响。" - }, - "webhook_uuid": { - "description": "Webhook UUID", - "hint": "统一 Webhook 模式下的唯一标识符,创建平台时自动生成。" - }, - "wecom_ai_bot_name": { - "description": "企业微信智能机器人的名字", - "hint": "请务必填写正确,否则无法使用一些指令。" - }, - "wecom_ai_bot_connection_mode": { - "description": "企业微信智能机器人连接模式", - "hint": "Webhook 回调模式需要配置 Token/EncodingAESKey;长连接模式需要配置 BotID/Secret。" - }, - "wecomaibot_friend_message_welcome_text": { - "description": "企业微信智能机器人私聊欢迎语", - "hint": "可选。当用户当天进入智能机器人单聊会话,回复欢迎语,如 “💭 思考中...”。留空则不回复。" - }, - "wecomaibot_init_respond_text": { - "description": "企业微信智能机器人初始响应文本", - "hint": "可选。当机器人收到消息时,首先回复的文本内容。留空则不设置。" - }, - "wecomaibot_token": { - "description": "企业微信智能机器人 Token", - "hint": "用于 Webhook 回调模式的身份验证。" - }, - "wecomaibot_encoding_aes_key": { - "description": "企业微信智能机器人 EncodingAESKey", - "hint": "用于 Webhook 回调模式的消息加密解密。" - }, - "wecomaibot_ws_bot_id": { - "description": "长连接 BotID", - "hint": "企业微信智能机器人长连接模式凭证 BotID。" - }, - "wecomaibot_ws_secret": { - "description": "长连接 Secret", - "hint": "企业微信智能机器人长连接模式凭证 Secret。" - }, - "wecomaibot_ws_url": { - "description": "长连接 WebSocket 地址", - "hint": "默认值为 wss://openws.work.weixin.qq.com,一般无需修改。" - }, - "wecomaibot_heartbeat_interval": { - "description": "长连接心跳间隔", - "hint": "长连接模式心跳间隔(秒),建议 30 秒。" - }, - "wpp_active_message_poll": { - "description": "是否启用主动消息轮询", - "hint": "只有当你发现微信消息没有按时同步到 AstrBot 时,才需要启用这个功能,默认不启用。" - }, - "wpp_active_message_poll_interval": { - "description": "主动消息轮询间隔", - "hint": "主动消息轮询间隔,单位为秒,默认 3 秒,最大不要超过 60 秒,否则可能被认为是旧消息。" - }, - "ws_reverse_host": { - "description": "反向 Websocket 主机", - "hint": "AstrBot 将作为服务器端。" - }, - "ws_reverse_port": { - "description": "反向 Websocket 端口" - }, - "ws_reverse_token": { - "description": "反向 Websocket Token", - "hint": "反向 Websocket Token。未设置则不启用 Token 验证。" - }, - "msg_push_webhook_url": { - "description": "企业微信消息推送 Webhook URL", - "hint": "可选。用于主动消息推送,请在企微群->消息推送得到 URL。建议设置此项以带来更好的消息发送体验。" - }, - "only_use_webhook_url_to_send": { - "description": "仅使用 Webhook 发送消息", - "hint": "可选。启用后,企业微信智能机器人的所有回复都改为通过消息推送 Webhook 发送。消息推送 Webhook 支持更多的消息类型(如图片、文件等)。如果不需要打字机效果,强烈建议使用此选项。" - }, - "weixin_oc_base_url": { - "description": "Base URL 地址", - "hint": "默认值: https://ilinkai.weixin.qq.com" - }, - "weixin_oc_bot_type": { - "description": "扫码参数 bot_type", - "hint": "默认值: 3" - }, - "weixin_oc_qr_poll_interval": { - "description": "二维码状态轮询间隔(秒)", - "hint": "每隔多少秒轮询一次二维码状态。" - }, - "weixin_oc_long_poll_timeout_ms": { - "description": "getUpdates 长轮询超时时间(毫秒)", - "hint": "会话消息拉取接口超时参数。" - }, - "weixin_oc_api_timeout_ms": { - "description": "HTTP 请求超时(毫秒)", - "hint": "通用 API 请求超时参数。" - }, - "weixin_oc_token": { - "description": "登录后 token(可留空)", - "hint": "扫码登录成功后会自动写入;高级场景可手动填写。" - }, - "kook_bot_token": { - "description": "机器人 Token", - "type": "string", - "hint": "必填项。从 KOOK 开发者平台获取的机器人 Token" - }, - "kook_reconnect_delay": { - "description": "重连延迟", - "type": "int", - "hint": "重连延迟时间(秒),使用指数退避策略" - }, - "kook_max_reconnect_delay": { - "description": "最大重连延迟", - "type": "int", - "hint": "重连延迟的最大值(秒)" - }, - "kook_max_retry_delay": { - "description": "最大重试延迟", - "type": "int", - "hint": "重试的最大延迟时间(秒)" - }, - "kook_heartbeat_interval": { - "description": "心跳间隔", - "type": "int", - "hint": "心跳检测间隔时间(秒)" - }, - "kook_heartbeat_timeout": { - "description": "心跳超时时间", - "type": "int", - "hint": "心跳检测超时时间(秒)" - }, - "kook_max_heartbeat_failures": { - "description": "最大心跳失败次数", - "type": "int", - "hint": "允许的最大心跳失败次数,超过后断开连接" - }, - "kook_max_consecutive_failures": { - "description": "最大连续失败次数", - "type": "int", - "hint": "允许的最大连续失败次数,超过后停止重试" - } - }, - "general": { - "description": "基本", - "platform_settings": { - "unique_session": { - "description": "隔离对话", - "hint": "启用后,支持隔离的渠道会为每位群成员使用独立上下文。指令权限请在「管理行为 → 指令」中设置。" - }, - "friend_message_needs_wake_prefix": { - "description": "私聊消息需要唤醒词", - "hint": "私聊消息也必须带上唤醒前缀才能唤醒机器人。" - }, - "reply_prefix": { - "description": "回复时的文本前缀", - "hint": "回复中附带的文本前缀。" - }, - "reply_with_mention": { - "description": "回复时 @ 发送人", - "hint": "回复时提及发送人。" - }, - "reply_with_quote": { - "description": "回复时引用发送人消息", - "hint": "回复时引用发送人的对应消息。" - }, - "forward_threshold": { - "description": "转发消息的字数阈值", - "hint": "在受支持的平台上,当回复消息过长时,采用 “合并消息转发” 的方式发送消息。" - }, - "empty_mention_waiting": { - "description": "只 @ 机器人是否触发等待", - "hint": "当发送一条只有提及机器人的消息时,是否在接下来的 1 分钟内保持唤醒状态等待用户的第二条消息。" - } - }, - "wake_prefix": { - "description": "唤醒词", - "hint": "唤醒机器人的消息前缀的列表,也可以通过 @ 机器人来唤醒。\n\n内置指令(如 `/help`、`/sid`)也依赖唤醒词:群聊中不带唤醒词直接输入将无法触发;私聊在未启用「私聊消息需要唤醒词」时无需前缀,可直接输入指令触发。" - }, - "disable_builtin_commands": { - "description": "禁用自带指令", - "hint": "禁用所有 AstrBot 自带指令,如 help, sid, new 等" - } - }, - "rate_limit": { - "description": "速率限制", - "platform_settings": { - "rate_limit": { - "time": { - "description": "消息速率限制时间(秒)" - }, - "count": { - "description": "消息速率限制计数" - }, - "strategy": { - "description": "速率限制策略" - } - } - } - }, - "content_safety": { - "description": "内容安全", - "content_safety": { - "also_use_in_response": { - "description": "同时检查模型的响应内容" - }, - "baidu_aip": { - "enable": { - "description": "使用百度内容安全审核", - "hint": "您需要手动安装 baidu-aip 库。" - }, - "app_id": { - "description": "App ID" - }, - "api_key": { - "description": "API Key" - }, - "secret_key": { - "description": "Secret Key" - } - }, - "internal_keywords": { - "enable": { - "description": "关键词检查" - }, - "extra_keywords": { - "description": "额外关键词", - "hint": "额外的屏蔽关键词列表,支持正则表达式。" - } - } - } - }, - "others": { - "description": "其他配置", - "platform_settings": { - "ignore_bot_self_message": { - "description": "是否忽略机器人自身的消息" - }, - "ignore_at_all": { - "description": "是否忽略 @ 全体成员事件" - }, - "no_permission_reply": { - "description": "用户权限不足时是否回复" - } - }, - "platform_specific": { - "lark": { - "pre_ack_emoji": { - "enable": { - "description": "[飞书] 启用预回应表情" - }, - "emojis": { - "description": "表情列表(飞书表情枚举名)", - "hint": "表情枚举名参考:[https://open.feishu.cn/document/server-docs/im-v1/message-reaction/emojis-introduce](https://open.feishu.cn/document/server-docs/im-v1/message-reaction/emojis-introduce)" - } - } - }, - "telegram": { - "pre_ack_emoji": { - "enable": { - "description": "[Telegram] 启用预回应表情" - }, - "emojis": { - "description": "表情列表(Unicode)", - "hint": "Telegram 仅支持固定反应集合,参考:[https://gist.github.com/Soulter/3f22c8e5f9c7e152e967e8bc28c97fc9](https://gist.github.com/Soulter/3f22c8e5f9c7e152e967e8bc28c97fc9)" - } - } - }, - "discord": { - "pre_ack_emoji": { - "enable": { - "description": "[Discord] 启用预回应表情" - }, - "emojis": { - "description": "表情列表(Unicode 或自定义表情名)", - "hint": "填写 Unicode 表情符号,例如:👍、🤔、⏳" - } - } - } - } - } - }, - "access_group": { - "name": "访问控制", - "admins": { - "description": "管理员", - "admins_id": { - "description": "管理员 ID", - "hint": "给机器人发送 /sid 指令以获取 ID。" - } - }, - "whitelist": { - "description": "白名单", - "platform_settings": { - "enable_id_white_list": { - "description": "启用白名单", - "hint": "启用后,只有在白名单内的会话会被响应。" - }, - "id_whitelist": { - "description": "白名单 ID 列表", - "hint": "给机器人发送 /sid 指令以获取 ID。为空时代表不启用白名单功能。" - }, - "id_whitelist_log": { - "description": "输出拦截日志", - "hint": "输出未通过白名单校验的消息的日志。" - }, - "wl_ignore_admin_on_group": { - "description": "管理员群组消息无视 ID 白名单" - }, - "wl_ignore_admin_on_friend": { - "description": "管理员私聊消息无视 ID 白名单" - } - } - } - }, - "plugin_group": { - "name": "插件", - "plugin": { - "description": "插件", - "plugin_set": { - "description": "可用插件", - "hint": "默认启用全部未被禁用的插件。若插件在插件管理页被禁用,则此处的选择不会生效。" - } - } - }, - "ext_group": { - "name": "扩展功能", - "segmented_reply": { - "description": "分段回复", - "platform_settings": { - "segmented_reply": { - "enable": { - "description": "启用分段回复", - "hint": "以分段输出的方式发送回复消息。" - }, - "only_llm_result": { - "description": "仅对 LLM 结果分段" - }, - "interval_method": { - "description": "间隔方法", - "hint": "random 为随机时间,log 为根据消息长度计算,$y=log_(x)$,x为字数,y的单位为秒。" - }, - "interval": { - "description": "随机间隔时间", - "hint": "格式:最小值,最大值(如:1.5,3.5)" - }, - "log_base": { - "description": "对数底数", - "hint": "对数间隔的底数,默认为 2.6。取值范围为 1.0-10.0。" - }, - "words_count_threshold": { - "description": "分段回复字数阈值", - "hint": "分段回复的字数上限。只有字数小于此值的消息才会被分段,超过此值的长消息将直接发送(不分段),默认为 150。" - }, - "split_mode": { - "description": "分段模式", - "hint": "用于分隔一段消息。默认情况下会根据句号、问号等标点符号分隔。如填写 `[。?!]` 将移除所有的句号、问号、感叹号。re.findall(r'', text)", - "labels": [ - "正则表达式", - "分段词列表" - ] - }, - "regex": { - "description": "分段正则表达式", - "hint": "用于按正则规则识别分段点。建议使用能匹配分隔符的表达式。" - }, - "split_words": { - "description": "分段词列表", - "hint": "检测到列表中的任意词时进行分段" - }, - "content_cleanup_rule": { - "description": "内容过滤正则表达式", - "hint": "移除分段后内容中的指定内容。如填写 `[。?!]` 将移除所有的句号、问号、感叹号。" - } - } - } - }, - "ltm": { - "description": "群聊上下文感知", - "provider_ltm_settings": { - "group_icl_enable": { - "description": "群聊消息记录注入上下文", - "hint": "是否记录群聊非唤醒机器人的消息,并在唤醒机器人时将消息传给模型。" - }, - "group_message_max_cnt": { - "description": "注入上下文最大消息数量", - "hint": "传给模型的消息的最大数量。" - }, - "image_caption": { - "description": "自动理解图片", - "hint": "对非唤醒机器人的图片消息启用图片转述,转换成图片描述文本。对于图片消息频繁的群聊,此功能可能造成较大的开销,请慎用。" - }, - "image_caption_provider_id": { - "description": "群聊图片转述模型", - "hint": "用于群聊记录注入上下文的图片理解,与图片转述模型分开配置。" - }, - "group_message_history_enable": { - "description": "持久化群聊消息记录", - "hint": "将群内的所有消息都持久化保存,并允许模型通过工具来查询群内消息。" - }, - "group_message_history_max_cnt": { - "description": "持久化最大消息数量", - "hint": "持久化保存的消息的最大数量,超过后抛弃旧的消息。" - }, - "active_reply": { - "enable": { - "description": "主动回复", - "hint": "是否在合适的时机主动发消息。" - }, - "method": { - "description": "主动回复方法" - }, - "possibility_reply": { - "description": "回复概率", - "hint": "0.0-1.0 之间的数值" - }, - "whitelist": { - "description": "主动回复白名单", - "hint": "为空时不启用白名单过滤。使用 /sid 获取 ID。" - } - } - } - }, - "t2i": { - "description": "文本转图像", - "t2i": { - "description": "文本转图像输出", - "hint": "将模型回复转换成图片后再发送,防止刷屏。" - }, - "t2i_word_threshold": { - "description": "文本转图像字数阈值" - }, - "t2i_strategy": { - "description": "文本转图像策略", - "hint": "文本转图像策略。`remote` 为使用远程基于 HTML 的渲染服务,`local` 为使用 PIL 本地渲染。当使用 local 时,将 ttf 字体命名为 'font.ttf' 放在 data/ 目录下可自定义字体。" - }, - "t2i_endpoint": { - "description": "文本转图像服务 API 地址", - "hint": "为空时使用 AstrBot API 服务" - }, - "t2i_template": { - "description": "文本转图像自定义模版", - "hint": "启用后可自定义 HTML 模板用于文转图渲染。" - }, - "t2i_active_template": { - "description": "当前应用的文转图渲染模板", - "hint": "此处的值由文转图模板管理页面进行维护。" - } - } - }, - "system_group": { - "name": "系统配置", - "system": { - "description": "系统配置", - "log_level": { - "description": "控制台日志级别", - "hint": "控制台输出日志的级别。" - }, - "log_file_enable": { - "description": "启用文件日志", - "hint": "在控制台输出的同时,将日志写入文件。" - }, - "log_file_path": { - "description": "日志文件路径", - "hint": "相对路径以 data 目录为基准,例如 logs/astrbot.log;支持绝对路径。" - }, - "log_file_max_mb": { - "description": "日志文件大小上限 (MB)", - "hint": "超过大小后自动轮转,默认 20MB。" - }, - "temp_dir_max_size": { - "description": "临时目录大小上限 (MB)", - "hint": "用于限制 data/temp 目录总大小,单位为 MB。系统每 10 分钟检查一次,超限时按文件修改时间从旧到新删除,释放约 30% 当前体积。" - }, - "trace_enable": { - "description": "启用追踪记录", - "hint": "追踪用户的每次指令和 AI 调用。" - }, - "trace_db_path": { - "description": "追踪数据库路径", - "hint": "相对路径以 data 目录为基准,例如 logs/traces.db;支持绝对路径。" - }, - "trace_db_max_mb": { - "description": "追踪数据库容量预算 (MB)", - "hint": "默认 80 MB,最小 32 MB,低于最小值时按 32 MB 生效。超出后自动清除旧数据。" - }, - "trace_retention_days": { - "description": "追踪保留天数", - "hint": "默认 7 天,期限或容量先达到者触发清理。" - }, - "pip_install_arg": { - "description": "pip 安装额外参数", - "hint": "安装插件依赖时,会使用 Python 的 pip 工具。这里可以填写额外的参数,如 `--break-system-package` 等。PyPI 镜像的 TLS 证书默认会校验;若使用自签名/私有 CA 镜像,请通过 `--cert ` 指定信任的证书(推荐),或显式添加 `--trusted-host <主机名>`。" - }, - "pypi_index_url": { - "description": "PyPI 软件仓库地址", - "hint": "安装 Python 依赖时请求的 PyPI 软件仓库地址。默认为 [https://mirrors.aliyun.com/pypi/simple/](https://mirrors.aliyun.com/pypi/simple/)" - }, - "callback_api_base": { - "description": "对外可达的回调接口地址", - "hint": "外部服务可能会通过 AstrBot 生成的回调链接(如文件下载链接)访问 AstrBot 后端。由于 AstrBot 无法自动判断部署环境中对外可达的主机地址(host),因此需要通过此配置项显式指定外部服务如何访问 AstrBot 的地址。如 [http://localhost:6185](http://localhost:6185),[https://example.com](https://example.com) 等。" - }, - "disable_metrics": { - "description": "禁用匿名使用统计", - "hint": "禁用后,AstrBot 将不再上传匿名使用统计数据。" - }, - "dashboard": { - "trust_proxy_headers": { - "description": "信任代理请求头获取客户端 IP", - "hint": "关闭时忽略 X-Forwarded-For/X-Real-IP,仅使用连接地址。" - }, - "auth_rate_limit": { - "enable": { - "description": "启用登录验证速率限制", - "hint": "关闭后将不对登录、TOTP 等身份验证接口进行速率限制。" - }, - "average_interval": { - "description": "验证端点速率限制平均间隔(秒)", - "hint": "两次身份验证请求之间的最小平均间隔时间。例如设置为 1.0 表示每秒最多处理 1 个请求。" - }, - "max_burst": { - "description": "验证端点速率限制最大突发数", - "hint": "允许的瞬时最大突发请求数。例如设置为 3 表示在短时间内最多连续处理 3 个请求。" - } - }, - "ssl": { - "enable": { - "description": "启用 WebUI HTTPS", - "hint": "启用后,WebUI 将直接使用 HTTPS 提供服务。" - }, - "cert_file": { - "description": "SSL 证书文件路径", - "hint": "证书文件路径(PEM)。支持绝对路径和相对路径(相对于当前工作目录)。" - }, - "key_file": { - "description": "SSL 私钥文件路径", - "hint": "私钥文件路径(PEM)。支持绝对路径和相对路径(相对于当前工作目录)。" - }, - "ca_certs": { - "description": "SSL CA 证书文件路径", - "hint": "可选。用于指定 CA 证书文件路径。" - } - }, - "totp": { - "enable": { - "description": "启用 WebUI TOTP 双因素认证", - "hint": "启用后,登录 WebUI 需要额外输入验证码。" - }, - "manage": "管理", - "configuration": "TOTP", - "statusPending": "需完成设置", - "statusEnabled": "已启用", - "setupRequiredHint": "TOTP 已开启但尚未完成配置,请点击“管理”完成初始化。", - "setupTitle": "设置 TOTP", - "setupSubtitle": "请使用认证器应用扫描二维码,然后输入验证码。", - "setupConfirm": "验证并继续", - "activeSubtitle": "可使用此二维码和密钥添加新的认证器设备。", - "rotateTitle": "更换 TOTP 密钥", - "rotateSubtitle": "生成新密钥并完成验证后,将替换当前密钥。", - "rotate": "更换密钥", - "rotateRecovery": "更换恢复码", - "rotateConfirm": "确认更换", - "rotateCancel": "取消", - "rotateCode": "验证码", - "rotateCodeHint": "输入认证器应用中的验证码以确认新密钥。", - "rotateError": "验证码无效,请重试。", - "recoveryTitle": "恢复码", - "recoverySubtitle": "恢复码仅展示一次,请在继续前妥善保存。", - "recoveryWarning": "若恢复码丢失将无法通过常规途径恢复账户访问权限。", - "recoveryAcknowledge": "我已保存恢复码", - "recoveryClose": "完成", - "disableTitle": "关闭 TOTP", - "disableSubtitle": "输入验证码以确认关闭双因素认证。", - "disableRecoverySubtitle": "输入恢复码以确认关闭双因素认证。", - "disableCode": "验证码", - "disableRecoveryCode": "恢复码", - "disableConfirm": "确认关闭", - "disableCancel": "取消", - "disableError": "验证失败,请重试。", - "disableUseRecovery": "无法使用TOTP?", - "disableUseCode": "使用验证码", - "configSaveTitle": "两步验证", - "configSaveSubtitle": "输入验证码以更改受保护的配置。", - "configSaveRotationHint": "轮换 TOTP 密钥时,轮换前和轮换后的验证码均可用(仅轮换操作中单次允许)。", - "configSaveCode": "验证码", - "configSaveConfirm": "继续", - "configSaveCancel": "取消", - "configSaveError": "验证失败,请重试。" - } - }, - "timezone": { - "description": "时区", - "hint": "时区设置。请填写 IANA 时区名称, 如 Asia/Shanghai, 为空时使用系统默认时区。所有时区请查看: [https://data.iana.org/time-zones/tzdb-2021a/zone1970.tab](https://data.iana.org/time-zones/tzdb-2021a/zone1970.tab)" - }, - "http_proxy": { - "description": "HTTP 代理", - "hint": "启用后,会以添加环境变量的方式设置代理。格式为 `http://ip:port`" - }, - "no_proxy": { - "description": "直连地址列表" - } - } - }, - "provider_group": { - "provider": { - "api_key": { - "description": "API Key" - }, - "dashscope_api_key": { - "description": "DashScope API Key" - }, - "gemini_tts_api_key": { - "description": "Gemini API Key" - }, - "genie_onnx_model_dir": { - "description": "ONNX Model Directory", - "hint": "The directory path containing the ONNX model files" - }, - "genie_language": { - "description": "Language" - }, - "xai_native_search": { - "description": "启用原生搜索功能", - "hint": "启用后,将通过 xAI 的 Chat Completions 原生 Live Search 进行联网检索(按需计费)。仅对 xAI 提供商生效。" - }, - "rerank_api_base": { - "description": "重排序模型 API Base URL", - "hint": "最终请求路径由 Base URL 和路径后缀拼接而成(默认为 /v1/rerank)。" - }, - "rerank_api_suffix": { - "description": "API URL 路径后缀", - "hint": "追加到 base_url 后的路径后缀,如 /v1/rerank。留空则不追加。" - }, - "rerank_api_key": { - "description": "API Key", - "hint": "如果不需要 API Key, 请留空。" - }, - "rerank_model": { - "description": "重排序模型名称" - }, - "return_documents": { - "description": "是否在排序结果中返回文档原文", - "hint": "默认值false,以减少网络传输开销。" - }, - "instruct": { - "description": "自定义排序任务类型说明", - "hint": "仅在使用 qwen3-rerank 模型时生效。建议使用英文撰写。" - }, - "nvidia_rerank_api_base": { - "description": "API Base URL" - }, - "nvidia_rerank_api_key": { - "description": "API Key" - }, - "nvidia_rerank_model": { - "description": "重排序模型名称", - "hint": "请参照NVIDIA Docs中模型名称填写。" - }, - "nvidia_rerank_model_endpoint": { - "description": "自定义模型端点", - "hint": "自定义URL末尾端点,默认为 /reranking" - }, - "nvidia_rerank_truncate": { - "description": "文本截断策略", - "hint": "当输入文本过长时,是否截断输入以适应模型的最大上下文长度。" - }, - "tei_rerank_truncate": { - "description": "截断超长文本", - "hint": "当输入超过模型最大上下文长度时,是否自动截断。启用后需配合 截断方向 使用。" - }, - "tei_rerank_truncation_direction": { - "description": "截断方向", - "hint": "选择从文本的左侧(left)还是右侧(right)开始截断。仅在 截断超长文本 为 True 时生效。" - }, - "tei_rerank_raw_scores": { - "description": "返回原始分数", - "hint": "如果为 True,返回模型原始 logit 分数(可能为负值),不经过 sigmoid 归一化。默认 False。" - }, - "tei_rerank_return_text": { - "description": "返回排序结果中的文档原文", - "hint": "如果为 True,每个排序结果将附带原始文本。默认 False 以减少网络传输。" - }, - "launch_model_if_not_running": { - "description": "模型未运行时自动启动", - "hint": "如果模型当前未在 Xinference 服务中运行,是否尝试自动启动它。在生产环境中建议关闭。" - }, - "modalities": { - "description": "模型能力", - "hint": "模型支持的模态及能力。", - "labels": [ - "文本", - "图像", - "音频", - "工具使用" - ] - }, - - "custom_headers": { - "description": "自定义请求头", - "hint": "此处添加的键值对将作为自定义 HTTP 请求头,附加到 AstrBot 发往模型服务商的请求中。值必须为字符串。" - }, - "ollama_disable_thinking": { - "description": "关闭思考模式", - "hint": "关闭 Ollama 思考模式。" - }, - "custom_extra_body": { - "description": "自定义请求体参数", - "hint": "用于在请求时添加额外的参数,如 temperature, top_p, max_tokens, reasoning_effort 等。", - "template_schema": { - "temperature": { - "description": "温度参数", - "hint": "控制输出的随机性,范围通常为 0-2。值越高越随机。", - "name": "Temperature" - }, - "top_p": { - "description": "Top-p 采样", - "hint": "核采样参数,范围通常为 0-1。控制模型考虑的概率质量。", - "name": "Top-p" - }, - "max_tokens": { - "description": "最大词元(Tokens)数", - "hint": "生成的最大词元(Tokens)数。", - "name": "Max Tokens" - }, - "max_output_tokens": { - "description": "最大输出词元(Tokens)数", - "hint": "生成的最大词元(Tokens)数。", - "name": "Max Output Tokens" - }, - "reasoning_effort": { - "description": "推理强度", - "hint": "控制推理模型的推理强度,支持的值取决于具体模型。", - "name": "Reasoning Effort" - } - } - }, - "gpt_weights_path": { - "description": "GPT模型文件路径", - "hint": "即“.ckpt”后缀的文件,请使用绝对路径,路径两端不要带双引号,不填则默认用GPT_SoVITS内置的SoVITS模型(建议直接在GPT_SoVITS中改默认模型)" - }, - "sovits_weights_path": { - "description": "SoVITS模型文件路径", - "hint": "即“.pth”后缀的文件,请使用绝对路径,路径两端不要带双引号,不填则默认用GPT_SoVITS内置的SoVITS模型(建议直接在GPT_SoVITS中改默认模型)" - }, - "gsv_default_parms": { - "description": "GPT_SoVITS默认参数", - "hint": "参考音频文件路径、参考音频文本必填,其他参数根据个人爱好自行填写", - "gsv_ref_audio_path": { - "description": "参考音频文件路径", - "hint": "必填!请使用绝对路径!路径两端不要带双引号!" - }, - "gsv_prompt_text": { - "description": "参考音频文本", - "hint": "必填!请填写参考音频讲述的文本" - }, - "gsv_prompt_lang": { - "description": "参考音频文本语言", - "hint": "请填写参考音频讲述的文本的语言,默认为中文" - }, - "gsv_aux_ref_audio_paths": { - "description": "辅助参考音频文件路径", - "hint": "辅助参考音频文件,可不填" - }, - "gsv_text_lang": { - "description": "文本语言", - "hint": "默认为中文" - }, - "gsv_top_k": { - "description": "生成语音的多样性", - "hint": "" - }, - "gsv_top_p": { - "description": "核采样的阈值", - "hint": "" - }, - "gsv_temperature": { - "description": "生成语音的随机性", - "hint": "" - }, - "gsv_text_split_method": { - "description": "切分文本的方法", - "hint": "可选值: `cut0`:不切分 `cut1`:四句一切 `cut2`:50字一切 `cut3`:按中文句号切 `cut4`:按英文句号切 `cut5`:按标点符号切" - }, - "gsv_batch_size": { - "description": "批处理大小", - "hint": "" - }, - "gsv_batch_threshold": { - "description": "批处理阈值", - "hint": "" - }, - "gsv_split_bucket": { - "description": "将文本分割成桶以便并行处理", - "hint": "" - }, - "gsv_speed_factor": { - "description": "语音播放速度", - "hint": "1为原始语速" - }, - "gsv_fragment_interval": { - "description": "语音片段之间的间隔时间", - "hint": "" - }, - "gsv_streaming_mode": { - "description": "启用流模式", - "hint": "" - }, - "gsv_seed": { - "description": "随机种子", - "hint": "用于结果的可重复性" - }, - "gsv_parallel_infer": { - "description": "并行执行推理", - "hint": "" - }, - "gsv_repetition_penalty": { - "description": "重复惩罚因子", - "hint": "" - }, - "gsv_media_type": { - "description": "输出媒体的类型", - "hint": "建议用wav" - } - }, - "embedding_dimensions": { - "description": "嵌入维度", - "hint": "嵌入向量的维度。根据模型不同,可能需要调整,请参考具体模型的文档。此配置项请务必填写正确,否则将导致向量数据库无法正常工作。" - }, - "embedding_dimensions_mode": { - "description": "嵌入维度参数发送模式", - "hint": "控制是否在 OpenAI 兼容 Embedding 请求中发送 dimensions 参数。auto 会仅对官方 OpenAI embedding-3 模型自动发送;第三方兼容 API 如需该参数可改为 always,报错时改为 never。" - }, - "embedding_model": { - "description": "嵌入模型", - "hint": "嵌入模型名称。" - }, - "embedding_api_key": { - "description": "API Key" - }, - "embedding_api_base": { - "description": "API Base URL" - }, - "openai_embedding": { - "hint": "如果测试不通过,可以尝试添加 /v1 在末尾以兼容部分 OpenAI API 版本。" - }, - "gemini_embedding": { - "hint": "Gemini Embedding 无需手动添加 /v1beta。", - "embedding_task_type_mode": { - "description": "任务类型传递方式", - "hint": "auto:按模型代际自动选择(gemini-embedding-001 走 task_type 参数,gemini-embedding-2 走文本前缀);never:强制走 task_type;always:强制走文本前缀。" - }, - "embedding_query_task_type": { - "description": "查询侧 task_type", - "hint": "仅 task_type 模式生效。检索查询用 RETRIEVAL_QUERY,代码检索可用 CODE_RETRIEVAL_QUERY。" - }, - "embedding_document_task_type": { - "description": "文档侧 task_type", - "hint": "仅 task_type 模式生效。入库文档用 RETRIEVAL_DOCUMENT,可配合 title 提升效果。" - }, - "embedding_query_task_name": { - "description": "查询侧任务前缀(gemini-embedding-2)", - "hint": "仅文本前缀模式生效,可选:search result / question answering / fact checking / code retrieval。填错会自动回退为 search result。" - }, - "embedding_document_title": { - "description": "文档标题(gemini-embedding-2)", - "hint": "留空时使用 title: none。注意知识库入库时已把文档标题拼进正文,这里再填会让标题重复两遍,一般保持留空。" - } - }, - "dashscope_embedding": { - "hint": "阿里云百炼 Embedding,默认地址为 https://dashscope.aliyuncs.com/api/v1。" - }, - "volcengine_cluster": { - "description": "火山引擎集群", - "hint": "若使用语音复刻大模型,可选volcano_icl或volcano_icl_concurr,默认使用volcano_tts" - }, - "volcengine_voice_type": { - "description": "火山引擎音色", - "hint": "输入声音id(Voice_type)" - }, - "volcengine_speed_ratio": { - "description": "语速设置", - "hint": "语速设置,范围为 0.2 到 3.0,默认值为 1.0" - }, - "volcengine_volume_ratio": { - "description": "音量设置", - "hint": "音量设置,范围为 0.0 到 2.0,默认值为 1.0" - }, - "azure_tts_voice": { - "description": "音色设置", - "hint": "API 音色" - }, - "azure_tts_style": { - "description": "风格设置", - "hint": "声音特定的讲话风格。 可以表达快乐、同情和平静等情绪。" - }, - "azure_tts_role": { - "description": "模仿设置(可选)", - "hint": "讲话角色扮演。 声音可以模仿不同的年龄和性别,但声音名称不会更改。 例如,男性语音可以提高音调和改变语调来模拟女性语音,但语音名称不会更改。 如果角色缺失或不受声音的支持,则会忽略此属性。" - }, - "azure_tts_rate": { - "description": "语速设置", - "hint": "指示文本的讲出速率。可在字词或句子层面应用语速。 速率变化应为原始音频的 0.5 到 2 倍。" - }, - "azure_tts_volume": { - "description": "语音音量设置", - "hint": "指示语音的音量级别。 可在句子层面应用音量的变化。以从 0.0 到 100.0(从最安静到最大声,例如 75)的数字表示。 默认值为 100.0。" - }, - "azure_tts_region": { - "description": "API 地区", - "hint": "Azure_TTS 处理数据所在区域,具体参考 https://learn.microsoft.com/zh-cn/azure/ai-services/speech-service/regions" - }, - "azure_tts_subscription_key": { - "description": "服务订阅密钥", - "hint": "Azure_TTS 服务的订阅密钥(注意不是令牌)" - }, - "dashscope_tts_voice": { - "description": "音色" - }, - "gm_resp_image_modal": { - "description": "启用图片模态", - "hint": "启用后,将支持返回图片内容。需要模型支持,否则会报错。具体支持模型请查看 Google Gemini 官方网站。温馨提示,如果您需要生成图片,请关闭 `启用群员识别` 配置获得更好的效果。" - }, - "gm_native_search": { - "description": "启用原生搜索功能", - "hint": "仅 Gemini 3 及以上模型支持与函数工具同时使用;Gemini 3 及以上模型的原生搜索仅限付费层级,计费规则请查阅官方文档" - }, - "gm_native_coderunner": { - "description": "启用原生代码执行器", - "hint": "仅 Gemini 3 及以上模型支持与函数工具同时使用" - }, - "gm_url_context": { - "description": "启用URL上下文功能", - "hint": "仅 Gemini 3 及以上模型支持与函数工具同时使用" - }, - "gm_safety_settings": { - "description": "安全过滤器", - "hint": "设置模型输入的内容安全过滤级别。过滤级别分类为NONE(不屏蔽)、HIGH(高风险时屏蔽)、MEDIUM_AND_ABOVE(中等风险及以上屏蔽)、LOW_AND_ABOVE(低风险及以上时屏蔽),具体参见Gemini API文档。", - "harassment": { - "description": "骚扰内容", - "hint": "负面或有害评论" - }, - "hate_speech": { - "description": "仇恨言论", - "hint": "粗鲁、无礼或亵渎性质内容" - }, - "sexually_explicit": { - "description": "露骨色情内容", - "hint": "包含性行为或其他淫秽内容的引用" - }, - "dangerous_content": { - "description": "危险内容", - "hint": "宣扬、助长或鼓励有害行为的信息" - } - }, - "gm_thinking_config": { - "description": "思考配置", - "budget": { - "description": "思考预算", - "hint": "用于指定模型推理时使用的思考 token 数量上限。参见: https://ai.google.dev/gemini-api/docs/thinking#set-budget" - }, - "level": { - "description": "思考级别", - "hint": "推荐用于 Gemini 3 及以上模型,可控制推理行为。参见: https://ai.google.dev/gemini-api/docs/thinking#thinking-levels" - } - }, - "anth_thinking_config": { - "description": "思考配置", - "type": { - "description": "思考类型", - "hint": "设为 'adaptive' 以使用自适应思考(推荐 Opus 4.6+ / Sonnet 4.6+)。留空则使用手动预算模式。参见: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking" - }, - "budget": { - "description": "思考预算", - "hint": "Anthropic thinking.budget_tokens 参数。必须 >= 1024。仅在思考类型为空时生效。Opus 4.6 / Sonnet 4.6 已弃用。参见: https://platform.claude.com/docs/en/build-with-claude/extended-thinking" - }, - "effort": { - "description": "思考深度", - "hint": "当思考类型为 'adaptive' 时控制思考深度。'high' 为默认值。'max' 仅限 Opus 4.6。参见: https://platform.claude.com/docs/en/build-with-claude/effort" - } - }, - "minimax-group-id": { - "description": "用户组", - "hint": "于账户管理->基本信息中可见" - }, - "minimax-langboost": { - "description": "指定语言/方言", - "hint": "增强对指定的小语种和方言的识别能力,设置后可以提升在指定小语种/方言场景下的语音表现" - }, - "minimax-voice-speed": { - "description": "语速", - "hint": "生成声音的语速, 取值[0.5, 2], 默认为1.0, 取值越大,语速越快" - }, - "minimax-voice-vol": { - "description": "音量", - "hint": "生成声音的音量, 取值(0, 10], 默认为1.0, 取值越大,音量越高" - }, - "minimax-voice-pitch": { - "description": "语调", - "hint": "生成声音的语调, 取值[-12, 12], 默认为0" - }, - "minimax-is-timber-weight": { - "description": "启用混合音色", - "hint": "启用混合音色, 支持以自定义权重混合最多四种音色, 启用后自动忽略单一音色设置" - }, - "minimax-timber-weight": { - "description": "混合音色", - "hint": "混合音色及其权重, 最多支持四种音色, 权重为整数, 取值[1, 100]. 可在官网API语音调试台预览代码获得预设以及编写模板, 需要严格按照json字符串格式编写, 可以查看控制台判断是否解析成功. 具体结构可参照默认值以及官网代码预览." - }, - "minimax-voice-id": { - "description": "单一音色", - "hint": "单一音色编号, 详见官网文档" - }, - "minimax-voice-emotion": { - "description": "情绪", - "hint": "控制合成语音的情绪。当为 auto 时,将根据文本内容自动选择情绪。" - }, - "minimax-voice-latex": { - "description": "支持朗读latex公式", - "hint": "朗读latex公式, 但是需要确保输入文本按官网要求格式化" - }, - "minimax-voice-english-normalization": { - "description": "支持英语文本规范化", - "hint": "可提升数字阅读场景的性能,但会略微增加延迟" - }, - "rag_options": { - "description": "RAG 选项", - "hint": "检索知识库设置, 非必填。仅 Agent 应用类型支持(智能体应用, 包括 RAG 应用)。阿里云百炼应用开启此功能后将无法多轮对话。", - "pipeline_ids": { - "description": "知识库 ID 列表", - "hint": "对指定知识库内所有文档进行检索, 前往 https://bailian.console.aliyun.com/ 数据应用->知识索引创建和获取 ID。" - }, - "file_ids": { - "description": "非结构化文档 ID, 传入该参数将对指定非结构化文档进行检索。", - "hint": "对指定非结构化文档进行检索。前往 https://bailian.console.aliyun.com/ 数据管理创建和获取 ID。" - }, - "output_reference": { - "description": "是否输出知识库/文档的引用", - "hint": "在每次回答尾部加上引用源。默认为 False。" - } - }, - "sensevoice_hint": { - "description": "部署SenseVoice", - "hint": "启用前请 pip 安装 funasr、funasr_onnx、torchaudio、torch、modelscope、jieba 库(默认使用CPU,大约下载 1 GB),并且安装 ffmpeg。否则将无法正常转文字。" - }, - "is_emotion": { - "description": "情绪识别", - "hint": "是否开启情绪识别。happy|sad|angry|neutral|fearful|disgusted|surprised|unknown" - }, - "stt_model": { - "description": "模型名称", - "hint": "modelscope 上的模型名称。默认:iic/SenseVoiceSmall。" - }, - "variables": { - "description": "工作流固定输入变量", - "hint": "可选。工作流固定输入变量,将会作为工作流的输入。也可以在对话时使用 /set 指令动态设置变量。如果变量名冲突,优先使用动态设置的变量。" - }, - "dashscope_app_type": { - "description": "应用类型", - "hint": "百炼应用的应用类型。" - }, - "timeout": { - "description": "超时时间", - "hint": "超时时间,单位为秒。" - }, - "openai-tts-voice": { - "description": "voice", - "hint": "OpenAI TTS 的声音。OpenAI 默认支持:'alloy', 'echo', 'fable', 'onyx', 'nova', 'shimmer'" - }, - "elevenlabs-tts-voice-id": { - "description": "音色 ID", - "hint": "ElevenLabs 音色 ID。可在 https://elevenlabs.io/app/voice-library 浏览并复制音色 ID。默认 'JBFqnCBsd6RMkjVDRZzb'(George)。" - }, - "elevenlabs-tts-output-format": { - "description": "输出格式", - "hint": "音频输出格式,例如 'mp3_44100_128'、'mp3_22050_32'、'wav_44100'、'opus_48000_128'。不支持裸 PCM/u-law/a-law 格式。默认 'mp3_44100_128'。" - }, - "elevenlabs-tts-stability": { - "description": "稳定性", - "hint": "音色稳定性,范围 [0, 1]。值越高越稳定,越低越富有表现力。留空则使用服务端默认值。" - }, - "elevenlabs-tts-similarity-boost": { - "description": "相似度增强", - "hint": "输出与原始音色的接近程度,范围 [0, 1]。留空则使用服务端默认值。" - }, - "elevenlabs-tts-style": { - "description": "风格夸张度", - "hint": "音色风格的夸张程度,范围 [0, 1]。值越高延迟越大。留空则使用服务端默认值。" - }, - "elevenlabs-tts-use-speaker-boost": { - "description": "说话人增强", - "hint": "增强与原始说话人的相似度,可能略微增加延迟。" - }, - "mimo-tts-voice": { - "description": "音色", - "hint": "MiMo TTS 的音色名称。可选值包括 'mimo_default'、'default_en'、'default_zh'。" - }, - "mimo-tts-format": { - "description": "输出格式", - "hint": "MiMo TTS 生成音频的格式。支持 'wav'、'mp3'、'pcm'。" - }, - "mimo-tts-style-prompt": { - "description": "风格提示词", - "hint": "会以 标签形式添加到待合成文本开头,用于控制语速、情绪、角色或风格,例如 开心、变快、孙悟空、悄悄话。可留空。" - }, - "mimo-tts-dialect": { - "description": "方言", - "hint": "会与风格提示词一起写入开头的 标签中,例如 东北话、四川话、河南话、粤语。可留空。" - }, - "mimo-tts-seed-text": { - "description": "种子文本", - "hint": "作为可选的 user 消息发送,用于辅助调节语气和风格,不会拼接到待合成文本中。" - }, - "fishaudio-tts-character": { - "description": "character", - "hint": "fishaudio TTS 的角色。默认为可莉。更多角色请访问:https://fish.audio/zh-CN/discovery" - }, - "fishaudio-tts-reference-id": { - "description": "reference_id", - "hint": "fishaudio TTS 的参考模型ID(可选)。如果填入此字段,将直接使用模型ID而不通过角色名称查询。例如:626bb6d3f3364c9cbc3aa6a67300a664。更多模型请访问:https://fish.audio/zh-CN/discovery,进入模型详情界面后可复制模型ID" - }, - "whisper_hint": { - "description": "本地部署 Whisper 模型须知", - "hint": "启用前请 pip 安装 openai-whisper 库(N卡用户大约下载 2GB,主要是 torch 和 cuda,CPU 用户大约下载 1 GB),并且安装 ffmpeg。否则将无法正常转文字。" - }, - "whisper_device": { - "description": "推理设备", - "hint": "Whisper 推理设备。Apple Silicon 可选 mps;其他环境建议使用 cpu。若指定 mps 但当前环境不可用,将自动回退到 cpu。" - }, - "id": { - "description": "ID" - }, - "type": { - "description": "模型提供商种类" - }, - "provider_type": { - "description": "模型提供商能力种类" - }, - "enable": { - "description": "启用" - }, - "key": { - "description": "API Key" - }, - "api_base": { - "description": "API Base URL" - }, - "total_timeout": { - "description": "总超时时间", - "hint": "单次决策请求的总超时时间(秒),包含等待并发名额、重试与退避;默认 5 秒。" - }, - "max_concurrency": { - "description": "最大并发数", - "hint": "该提供商同时进行的决策请求上限;默认 4。" - }, - "proxy": { - "description": "代理地址", - "hint": "HTTP/HTTPS 代理地址,格式如 http://127.0.0.1:7890。仅对该提供商的 API 请求生效,不影响 Docker 内网通信。" - }, - "model": { - "description": "模型 ID", - "hint": "模型名称,如 gpt-4o-mini, deepseek-chat。" - }, - "max_context_tokens": { - "description": "模型上下文窗口大小", - "hint": "模型最大上下文 Token 大小。如果为 0,则会自动从模型元数据填充(如有)。" - }, - "dify_api_key": { - "description": "API Key", - "hint": "Dify API Key。此项必填。" - }, - "dify_api_base": { - "description": "API Base URL", - "hint": "Dify API Base URL。默认为 https://api.dify.ai/v1" - }, - "dify_api_type": { - "description": "Dify 应用类型", - "hint": "Dify API 类型。根据 Dify 官网,目前支持 chat, chatflow, agent, workflow 三种应用类型。" - }, - "dify_workflow_output_key": { - "description": "Dify Workflow 输出变量名", - "hint": "Dify Workflow 输出变量名。当应用类型为 workflow 时才使用。默认为 astrbot_wf_output。" - }, - "dify_query_input_key": { - "description": "Prompt 输入变量名", - "hint": "发送的消息文本内容对应的输入变量名。默认为 astrbot_text_query。" - }, - "coze_api_key": { - "description": "Coze API Key", - "hint": "Coze API 密钥,用于访问 Coze 服务。" - }, - "bot_id": { - "description": "Bot ID", - "hint": "Coze 机器人的 ID,在 Coze 平台上创建机器人后获得。" - }, - "coze_api_base": { - "description": "API Base URL", - "hint": "Coze API 的基础 URL 地址,默认为 https://api.coze.cn" - }, - "deerflow_api_base": { - "description": "API Base URL", - "hint": "DeerFlow API 网关地址,默认为 http://127.0.0.1:2026" - }, - "deerflow_api_key": { - "description": "DeerFlow API Key", - "hint": "可选。若 DeerFlow 网关配置了 Bearer 鉴权,则在此填写。" - }, - "deerflow_auth_header": { - "description": "Authorization Header", - "hint": "可选。自定义 Authorization 请求头,优先级高于 DeerFlow API Key。" - }, - "deerflow_assistant_id": { - "description": "Assistant ID", - "hint": "DeerFlow 2.0 LangGraph assistant_id,默认为 lead_agent。" - }, - "deerflow_model_name": { - "description": "模型名称覆盖", - "hint": "可选。覆盖 DeerFlow 默认模型(对应运行时 configurable 的 model_name)。" - }, - "deerflow_thinking_enabled": { - "description": "启用思考模式" - }, - "deerflow_plan_mode": { - "description": "启用计划模式", - "hint": "对应 DeerFlow 2.0 运行时 configurable 的 is_plan_mode。" - }, - "deerflow_subagent_enabled": { - "description": "启用子智能体", - "hint": "对应 DeerFlow 2.0 运行时 configurable 的 subagent_enabled。" - }, - "deerflow_max_concurrent_subagents": { - "description": "子智能体最大并发数", - "hint": "对应 DeerFlow 2.0 运行时 configurable 的 max_concurrent_subagents。仅在启用子智能体时生效,默认 3。" - }, - "deerflow_recursion_limit": { - "description": "递归深度上限", - "hint": "对应 LangGraph recursion_limit。" - }, - "auto_save_history": { - "description": "由 Coze 管理对话记录", - "hint": "启用后,将由 Coze 进行对话历史记录管理, 此时 AstrBot 本地保存的上下文不会生效(仅供浏览), 对 AstrBot 的上下文进行的操作也不会生效。如果为禁用, 则使用 AstrBot 管理上下文。" - } - } - }, - "help": { - "documentation": "官方文档", - "support": "加群询问", - "helpText": "不了解配置?请见 {documentation} 或 {support}。", - "helpPrefix": "不了解配置?请见", - "helpMiddle": "或", - "helpSuffix": "。" - } -} +{ + "ai_group": { + "name": "AI", + "agent_runner": { + "description": "Agent 执行方式", + "hint": "选择 AI 对话的执行器。切换执行器会使用新类型的默认配置,不保留上一类型的参数。", + "provider_settings": { + "enable": { + "description": "启用", + "hint": "AI 对话总开关" + } + }, + "agent_runner": { + "runner_type": { + "description": "执行器", + "labels": [ + "内置 Agent", + "Dify", + "Coze", + "阿里云百炼应用", + "DeerFlow" + ] + } + } + }, + "dify_runner": { + "description": "Dify 配置", + "agent_runner": { + "config": { + "dify_api_type": { "description": "应用类型" }, + "dify_api_key": { "description": "API Key" }, + "dify_api_base": { "description": "API Base URL" }, + "dify_workflow_output_key": { "description": "Workflow 输出变量名" }, + "dify_query_input_key": { "description": "Prompt 输入变量名" }, + "variables": { "description": "变量" }, + "timeout": { "description": "超时时间(秒)" }, + "proxy": { "description": "代理地址" } + } + } + }, + "coze_runner": { + "description": "Coze 配置", + "agent_runner": { + "config": { + "coze_api_key": { "description": "API Key" }, + "bot_id": { "description": "Bot ID" }, + "coze_api_base": { "description": "API Base URL" }, + "auto_save_history": { "description": "由 Coze 管理对话记录" }, + "timeout": { "description": "超时时间(秒)" }, + "proxy": { "description": "代理地址" } + } + } + }, + "dashscope_runner": { + "description": "阿里云百炼应用配置", + "agent_runner": { + "config": { + "dashscope_app_type": { "description": "应用类型" }, + "dashscope_api_key": { "description": "API Key" }, + "dashscope_app_id": { "description": "应用 ID" }, + "rag_options": { + "pipeline_ids": { "description": "知识库 Pipeline ID" }, + "file_ids": { "description": "文件 ID" }, + "output_reference": { "description": "输出引用" } + }, + "variables": { "description": "变量" }, + "timeout": { "description": "超时时间(秒)" }, + "proxy": { "description": "代理地址" } + } + } + }, + "deerflow_runner": { + "description": "DeerFlow 配置", + "agent_runner": { + "config": { + "deerflow_api_base": { "description": "API Base URL" }, + "deerflow_api_key": { "description": "API Key" }, + "deerflow_auth_header": { "description": "Authorization Header" }, + "deerflow_assistant_id": { "description": "Assistant ID" }, + "deerflow_model_name": { "description": "模型名称覆盖" }, + "deerflow_thinking_enabled": { "description": "启用思考模式" }, + "deerflow_plan_mode": { "description": "启用计划模式" }, + "deerflow_subagent_enabled": { "description": "启用子智能体" }, + "deerflow_max_concurrent_subagents": { "description": "子智能体最大并发数" }, + "deerflow_recursion_limit": { "description": "递归深度上限" }, + "timeout": { "description": "超时时间(秒)" }, + "proxy": { "description": "代理地址" } + } + } + }, + "ai": { + "description": "模型", + "hint": "配置内置 Agent 使用的对话模型,以及通用的图片转述、语音模型。", + "agent_runner": { + "config": { + "model": { + "provider_id": { + "description": "对话模型", + "hint": "留空时使用第一个模型" + }, + "fallback_provider_ids": { + "description": "回退对话模型", + "hint": "主对话模型请求失败时,按顺序切换到这些对话模型。" + }, + "request_max_retries": { + "description": "异常重试次数", + "hint": "单次模型请求遇到可重试错误时的最大尝试次数。" + } + } + } + }, + "provider_settings": { + "default_image_caption_provider_id": { + "description": "图片转述模型", + "hint": "当对话模型不支持图片输入时,调用图片转述模型来获得图片描述。留空代表不使用。" + }, + "image_caption_prompt": { + "description": "图片转述提示词", + "hint": "用于图片转述模型的提示词。" + } + }, + "provider_stt_settings": { + "enable": { + "description": "语音识别", + "hint": "使用语音转文字模型将用户语音转述为文本,方便模型理解。" + }, + "provider_id": { + "description": "默认语音转文本模型", + "hint": "也可使用 /provider 指令单独选择会话的模型。" + } + }, + "provider_tts_settings": { + "enable": { + "description": "语音回复", + "hint": "使用文字转语音模型将文字转为语音回复。" + }, + "provider_id": { + "description": "默认文本转语音模型", + "hint": "也可使用 /provider 指令单独选择会话的模型。" + }, + "trigger_probability": { + "description": "TTS 触发概率", + "hint": "采用随机概率触发语音回复。" + } + } + }, + "persona": { + "description": "人格", + "hint": "赋予 AstrBot 人格。", + "agent_runner": { + "config": { + "persona": { + "persona_id": { "description": "默认采用的人格" }, + "safety_mode": { + "description": "健康模式", + "hint": "引导模型输出健康、安全的内容,避免有害或敏感话题。" + }, + "safety_mode_strategy": { + "description": "健康模式策略", + "hint": "选择健康模式的实现策略。" + } + } + } + } + }, + "knowledgebase": { + "description": "知识库", + "hint": "AstrBot 的 “外置大脑”。", + "kb_names": { + "description": "知识库列表", + "hint": "支持多选" + }, + "kb_fusion_top_k": { + "description": "融合检索结果数", + "hint": "多个知识库检索结果融合后的返回结果数量" + }, + "kb_final_top_k": { + "description": "最终返回结果数", + "hint": "从知识库中检索到的结果数量,越大可能获得越多相关信息,但也可能引入噪音。建议根据实际需求调整" + }, + "kb_agentic_mode": { + "description": "Agentic 知识库检索", + "hint": "启用后,知识库检索将作为 LLM Tool,由模型自主决定何时调用知识库进行查询。需要模型支持函数调用能力。" + } + }, + "websearch": { + "description": "网页搜索", + "hint": "让 AstrBot 能够访问互联网,获悉时讯。", + "provider_settings": { + "web_search": { + "description": "启用网页搜索" + }, + "websearch_provider": { + "description": "网页搜索提供商", + "labels": [ + "SerpApi", + "DeepSeek Search API", + "Tavily", + "Baidu AI Search", + "Bocha", + "Brave", + "Firecrawl", + "Exa", + "AnySearch" + ], + "subtitles": [ + "Google 网页、新闻、图片、学术和财经搜索", + "DeepSeek 官方搜索接口", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "websearch_tavily_key": { + "description": "Tavily API Key", + "hint": "可添加多个 Key 进行轮询。" + }, + "websearch_bocha_key": { + "description": "BoCha API Key", + "hint": "可添加多个 Key 进行轮询。" + }, + "websearch_brave_key": { + "description": "Brave Search API Key", + "hint": "可添加多个 Key 进行轮询。" + }, + "websearch_firecrawl_key": { + "description": "Firecrawl API Key", + "hint": "可添加多个 Key 进行轮询。" + }, + "websearch_baidu_app_builder_key": { + "description": "百度千帆智能云 APP Builder API Key", + "hint": "参考:[https://console.bce.baidu.com/iam/#/iam/apikey/list](https://console.bce.baidu.com/iam/#/iam/apikey/list)" + }, + "web_search_link": { + "description": "显示来源引用" + }, + "websearch_exa_key": { + "description": "Exa API Key", + "hint": "可添加多个 Key 进行轮询。获取 Key: https://dashboard.exa.ai" + }, + "websearch_anysearch_key": { + "description": "AnySearch API Key", + "hint": "可添加多个 Key 进行轮询。留空则使用匿名模式(每日免费额度)。" + }, + "websearch_serpapi_key": { + "description": "SerpApi API Key", + "hint": "支持 Google 网页、新闻、图片、学术和财经搜索。可添加多个 Key 轮询。获取 Key:[https://serpapi.com/manage-api-key](https://serpapi.com/manage-api-key)" + }, + "websearch_deepseek_key": { + "description": "DeepSeek API Key", + "hint": "填入 DeepSeek API Key。可使用与对话模型相同的 Key(需独立填写)。可添加多个 Key 轮询。 获取 Key: [https://platform.deepseek.com/api_keys](https://platform.deepseek.com/api_keys)" + } + } + }, + "file_extract": { + "description": "文档解析能力", + "provider_settings": { + "file_extract": { + "enable": { + "description": "启用文档解析能力" + }, + "provider": { + "description": "文档解析提供商" + }, + "moonshotai_api_key": { + "description": "Moonshot AI API Key" + } + } + } + }, + "agent_computer_use": { + "description": "使用电脑能力", + "hint": "让 AstrBot 访问和使用本机环境或者隔离的沙盒环境,以执行更复杂的任务。详见: [Agent 沙盒环境](https://docs.astrbot.app/use/astrbot-agent-sandbox.html)。", + "provider_settings": { + "computer_use_runtime": { + "description": "运行环境", + "hint": "允许 Agent 访问的环境。", + "labels": ["不允许任何环境", "本机环境", "第三方沙箱环境"] + }, + "computer_use_local_permissions": { + "description": "本地权限策略" + }, + "computer_use_require_admin": { + "description": "沙箱能力需要 AstrBot 管理员权限", + "hint": "开启后,需要 AstrBot 管理员权限才能调用远程沙箱能力。在配置文件 -> 访问控制 -> 管理员 -> 管理员 ID 中可添加管理员。给机器人发送 /sid 指令以获取 ID。" + }, + "sandbox": { + "booter": { + "description": "沙箱环境驱动器" + }, + "shipyard_neo_endpoint": { + "description": "Shipyard Neo API Endpoint", + "hint": "Shipyard Neo(Bay) 服务的 API 地址,默认 http://127.0.0.1:8114。" + }, + "shipyard_neo_access_token": { + "description": "Shipyard Neo 访问令牌", + "hint": "Bay 的 API Key(sk-bay-...)。留空时自动从 credentials.json 发现。" + }, + "shipyard_neo_profile": { + "description": "Shipyard Neo Profile", + "hint": "Shipyard Neo 沙箱 profile,例如 python-default。留空时自动选择能力更完整的 profile。" + }, + "shipyard_neo_ttl": { + "description": "Shipyard Neo Sandbox 存活时间(秒)", + "hint": "Shipyard Neo 沙箱的生存时间(秒)。" + }, + "cua_image": { + "description": "CUA 镜像", + "hint": "CUA 沙箱镜像/系统类型,默认 linux。可填写 linux、macos、windows、android,具体取决于 CUA SDK 支持。" + }, + "cua_os_type": { + "description": "CUA 操作系统类型", + "hint": "CUA 沙箱操作系统类型,默认 linux。" + }, + "cua_idle_timeout": { + "description": "CUA 空闲超时(秒)", + "hint": "CUA 沙箱空闲超时时间(秒)。大于 0 时,AstrBot 会在会话空闲达到该时长后主动关闭 CUA 沙箱;0 表示禁用。" + }, + "cua_telemetry_enabled": { + "description": "CUA 遥测", + "hint": "是否允许 CUA SDK 发送遥测数据。默认关闭。" + }, + "cua_local": { + "description": "CUA 本地沙箱", + "hint": "是否优先使用 CUA 本地沙箱。默认开启,避免云端沙箱要求 CUA_API_KEY。关闭后可使用 CUA 云端沙箱。" + }, + "cua_api_key": { + "description": "CUA API Key", + "hint": "CUA 云端沙箱 API Key。仅在关闭本地沙箱时需要。也可以通过 CUA_API_KEY 环境变量提供。" + }, + "shipyard_endpoint": { + "description": "Shipyard API Endpoint", + "hint": "Shipyard 服务的 API 访问地址。" + }, + "shipyard_access_token": { + "description": "Shipyard 访问令牌", + "hint": "用于访问 Shipyard 服务的访问令牌。" + }, + "shipyard_ttl": { + "description": "Shipyard Ship 存活时间(秒)", + "hint": "Shipyard 会话的生存时间(秒)。" + }, + "shipyard_max_sessions": { + "description": "Shipyard Ship 会话复用上限", + "hint": "决定了一个实例承载的最大会话数量。" + } + } + }, + "local_permissions": { + "role": "用户身份", + "execution": "允许执行代码", + "network": "允许执行环境联网", + "filesystem": "文件访问范围", + "scopes": { + "workspace": "工作区", + "host": "整个环境" + }, + "scopeHints": { + "none": "不允许访问任何文件", + "workspace": "受限的工作区、临时目录和技能文件。", + "workspaceUnsupported": "当前系统不支持受限工作区文件访问。", + "host": "AstrBot 所在运行环境的所有文件。" + }, + "scopeDetails": { + "account": "1. 可访问 AstrBot 运行账户有权限访问的文件。", + "docker": "2. 如果通过 Docker 部署,则仅可访问容器内及挂载的文件,并非宿主机全部文件。" + }, + "roles": { + "member": "普通成员", + "admin": "管理员" + }, + "modes": { + "none": "关闭" + }, + "networkAlwaysOn": "始终开启", + "windowsHostNetworkHint": "Windows 暂不支持在“整个环境”执行代码时单独禁网。切换到“工作区”后可关闭联网。", + "runtimeUnknown": "运行环境信息不可用。", + "memberWarning": "普通成员已获得联网或整个环境访问权限。", + "executionInactive": "未生效", + "executionInactiveHelp": "查看未生效原因", + "executionBlocked": "{role}已开启代码执行,但当前无法满足所配置的隔离限制。原因:{reason}", + "runtime": { + "os": "操作系统", + "arch": "架构", + "sandbox": "本地隔离", + "windowsUnavailable": "{backend} · 尚未就绪", + "windowsSetupHint": "请保存配置并重启 AstrBot;如出现管理员授权提示,请允许以完成沙盒初始化。", + "errorDetails": "查看诊断详情", + "unavailableHint": "沙箱启动失败,受限 Shell/Python 执行及工作区文件搜索会受到影响。请根据下方错误检查系统安全策略(如 Linux 的 AppArmor、用户命名空间限制)或容器限制,修复后重启 AstrBot 重新检测。", + "dialog": { + "intro": "利用 macOS 的 Seatbelt 或 Linux 的 bubblewrap(bwrap)技术,为 AstrBot Agent 的执行提供安全隔离,以限制不同用户使用 AstrBot Agent 时的文件访问范围和联网权限,获得更高的安全性。", + "startupError": "查看启动错误", + "documentation": "查看详细配置文档" + }, + "close": "关闭", + "setupHint": { + "missing": "安装 {dependency} 以获得完整的本地隔离功能。", + "unavailable": "配置 {backend},启用完整的本地隔离功能。", + "unsupported": "了解本地隔离支持情况。" + }, + "isolationFailure": { + "missing": "缺少 {dependency}。", + "unavailable": "{backend} 启动探测失败。", + "unsupported": "当前系统不支持本地进程隔离。" + }, + "executionUnavailable": { + "missing": "缺少 {dependency},无法在“文件访问范围”选择“工作区”时允许执行代码。", + "unavailable": "{backend} 无法启动,无法在“文件访问范围”选择“工作区”时允许执行代码。", + "unsupported": "当前系统不支持本地隔离,无法在“文件访问范围”选择“工作区”时允许执行代码。" + }, + "status": { + "detected": "{backend}", + "missing": "缺少 {dependency}", + "unavailable": "{backend} · 已安装但无法启动", + "unsupported": "暂不支持" + } + } + } + }, + "proactive_capability": { + "description": "主动型能力", + "hint": "让 AstrBot 能够在某一时刻自动唤醒,帮你完成任务。详见: [主动型 Agent](https://docs.astrbot.app/use/proactive-agent.html)。", + "provider_settings": { + "proactive_capability": { + "add_cron_tools": { + "description": "启用", + "hint": "启用后,将会传递给 Agent 相关工具来实现主动型 Agent。你可以告诉 AstrBot 未来某个时间要做的事情,它将被定时触发然后执行任务,然后将结果发送给你。" + } + } + } + }, + "truncate_and_compress": { + "hint": "AstrBot 如何管理工作记忆。详见: [上下文管理策略](https://docs.astrbot.app/use/context-compress.html)。", + "description": "上下文管理策略", + "agent_runner": { + "config": { + "compression": { + "max_turns": { + "description": "压缩前最多保留对话轮数", + "hint": "普通会话历史超过该轮数后,才会按下方策略进行持久化截断或 LLM 压缩;请求发送前也会先按该值约束上下文。-1 表示不按轮数限制。" + }, + "trim_turns": { + "description": "轮次超限时一次丢弃轮数", + "hint": "当超过\"压缩前最多保留对话轮数\"且无法使用 LLM 压缩时,一次丢弃多少轮旧对话;请求期截断也会复用该值。" + }, + "overflow_strategy": { + "description": "压缩策略", + "labels": ["按对话轮数截断", "由 LLM 压缩上下文"], + "hint": "模型上下文超限时的处理策略。" + }, + "instruction": { + "description": "上下文压缩提示词", + "hint": "如果为空则使用默认提示词。" + }, + "keep_recent_ratio": { + "description": "压缩时保留最近上下文比例", + "hint": "按当前上下文 token 数保留最近内容,范围 0-0.3。0.15 表示保留 15%;比例大于 0 时至少保留最后一轮。" + }, + "provider_id": { + "description": "压缩模型", + "hint": "用于上下文压缩的模型。默认选择当前的对话模型。" + }, + "fallback_max_tokens": { + "description": "上下文窗口兜底值", + "hint": "当 max_context_tokens 为 0 且模型不在内置元数据中时,使用此值作为上下文窗口大小。默认 128000。" + } + } + } + } + }, + "others": { + "description": "其他配置", + "agent_runner": { + "config": { + "misc": { + "max_steps": { "description": "工具调用轮数上限" }, + "tool_schema_mode": { + "description": "工具调用模式", + "hint": "skills-like 先下发工具名称与描述,再下发参数;full 一次性下发完整参数。", + "labels": ["Skills-like(两阶段)", "Full(完整参数)"] + }, + "tool_call_timeout": { + "description": "工具调用超时时间(秒)" + }, + "sanitize_context_by_modalities": { + "description": "按模型能力清理历史上下文", + "hint": "开启后,在每次请求 LLM 前会按当前模型提供商中所选择的模型能力删除对话中不支持的图片/工具调用结构(会改变模型看到的历史)" + } + } + } + }, + "provider_settings": { + "display_reasoning_text": { + "description": "显示思考内容", + "hint": "显示模型的思维链信息到最终回复中。" + }, + "identifier": { + "description": "用户识别", + "hint": "在用户提示词前带上用户 ID 信息。" + }, + "group_name_display": { + "description": "显示群名称", + "hint": "在受支持的消息平台的群聊中的用户提示词前带上群名称信息。" + }, + "datetime_system_prompt": { + "description": "现实世界时间感知", + "hint": "在用户提示词中带上当前的时间信息。" + }, + "show_tool_use_status": { + "description": "输出工具调用信息", + "hint": "有工具调用时,同时发送带有工具调用名字的消息。" + }, + "show_tool_call_result": { + "description": "输出工具调用结果", + "hint": "仅在启用“输出工具调用信息”时生效,且最多展示 70 个字符。" + }, + "buffer_intermediate_messages": { + "description": "合并 Agent 中间消息", + "hint": "开启后,非流式模式下多步工具调用过程中产生的中间文本将缓冲,待 Agent 完成后合并为一条回复发送。" + }, + "max_quoted_fallback_images": { + "description": "转发消息中图片获取上限", + "hint": "转发消息解析到的图片最多注入数量,超出部分会截断。" + }, + "quoted_message_parser": { + "max_component_chain_depth": { + "description": "转发消息富文本解析深度", + "hint": "解析转发消息中的富文本组件链时允许的最大递归深度。" + }, + "max_forward_node_depth": { + "description": "转发消息嵌套解析深度", + "hint": "解析嵌套转发节点时允许的最大递归深度。" + }, + "max_forward_fetch": { + "description": "转发消息递归拉取上限", + "hint": "递归调用 get_forward_msg 拉取转发内容的最大次数。" + }, + "warn_on_action_failure": { + "description": "转发消息解析失败告警", + "hint": "开启后,get_msg/get_forward_msg 全部尝试失败时输出 warning 日志。" + } + }, + "streaming_response": { + "description": "流式输出", + "hint": "在受支持的聊天平台中以打字机的形式输出响应。" + }, + "unsupported_streaming_strategy": { + "description": "不支持流式回复的平台", + "hint": "选择在不支持流式回复的平台上的处理方式。实时分段回复会在系统接收流式响应检测到诸如标点符号等分段点时,立即发送当前已接收的内容", + "labels": [ + "实时分段回复", + "关闭流式回复" + ] + }, + "wake_prefix": { + "description": "额外唤醒前缀", + "hint": "如果唤醒前缀为 /, 额外聊天唤醒前缀为 chat,则需要 /chat 才会触发 LLM 请求" + }, + "prompt_prefix": { + "description": "用户提示词", + "hint": "可使用 {{prompt}} 作为用户输入的占位符。如果不输入占位符则代表添加在用户输入的前面。" + }, + "image_compress_options": { + "description": "模型输入图片设置", + "hint": "图片始终处理为严格小于 512 KiB 的 JPEG/PNG,原始附件保留。", + "max_size": { + "description": "输入图片最大边长", + "hint": "发送给模型的图片最长边(像素),系统会在必要时进一步压缩。" + } + }, + "reachability_check": { + "description": "提供商可达性检测", + "hint": "/provider 命令列出模型时并发检测连通性。开启后会主动调用模型测试连通性,可能产生额外 token 消耗。" + } + }, + "provider_tts_settings": { + "dual_output": { + "description": "开启 TTS 时同时输出语音和文字内容" + } + } + } + }, + "platform_group": { + "name": "平台与消息", + "platform": { + "description": "消息平台适配器", + "app_id": { + "description": "应用 ID", + "hint": "消息平台开放平台中的应用 ID。" + }, + "app_secret": { + "description": "应用密钥", + "hint": "消息平台开放平台中的应用密钥。请妥善保管,避免泄露。" + }, + "domain": { + "description": "开放平台 API 地址", + "hint": "开放平台 API 的基础地址。使用默认官方服务时通常无需修改。" + }, + "corpid": { + "description": "企业 ID", + "hint": "企业微信后台中的企业 ID(CorpID)。" + }, + "token": { + "description": "回调 Token", + "hint": "消息平台回调配置中用于验证请求的 Token。" + }, + "encoding_aes_key": { + "description": "消息加密密钥", + "hint": "消息平台回调配置中的 EncodingAESKey,用于加密和解密消息。" + }, + "api_base_url": { + "description": "API 基础地址", + "hint": "消息平台 API 的基础地址。使用默认官方服务时通常无需修改。" + }, + "client_id": { + "description": "客户端 ID", + "hint": "消息平台开放平台中的客户端 ID。" + }, + "client_secret": { + "description": "客户端密钥", + "hint": "消息平台开放平台中的客户端密钥。请妥善保管,避免泄露。" + }, + "start_message": { + "description": "Start 命令回复", + "hint": "用户向 Telegram 机器人发送 /start 命令时回复的内容。" + }, + "telegram_api_base_url": { + "description": "API 地址", + "hint": "Telegram Bot API 的基础地址。使用官方服务时通常无需修改。" + }, + "telegram_file_base_url": { + "description": "文件 API 地址", + "hint": "Telegram Bot API 文件下载接口的基础地址。使用官方服务时通常无需修改。" + }, + "bot_token": { + "description": "Slack Bot Token", + "hint": "Slack 应用的 Bot User OAuth Token,通常以 xoxb- 开头。" + }, + "app_token": { + "description": "Slack App Token", + "hint": "Slack Socket Mode 使用的 App-Level Token,通常以 xapp- 开头。" + }, + "signing_secret": { + "description": "Slack Signing Secret", + "hint": "Slack 应用的 Signing Secret,用于验证 Webhook 请求。" + }, + "channel_access_token": { + "description": "LINE 频道访问令牌", + "hint": "LINE Messaging API 频道的 Channel Access Token。" + }, + "channel_secret": { + "description": "LINE 频道密钥", + "hint": "LINE Messaging API 频道的 Channel Secret。" + }, + "active_send_mode": { + "description": "是否换用主动发送接口" + }, + "appid": { + "description": "appid", + "hint": "必填项。当前消息平台的 AppID。如何获取请参考对应平台接入文档。" + }, + "callback_server_host": { + "description": "回调服务器主机", + "hint": "回调服务器主机。留空则不启用回调服务器。" + }, + "card_template_id": { + "description": "卡片模板 ID", + "hint": "可选。钉钉互动卡片模板 ID。启用后将使用互动卡片进行流式回复。" + }, + "discord_activity_name": { + "description": "Discord 活动名称", + "hint": "可选的 Discord 活动名称。留空则不设置活动。" + }, + "discord_allow_bot_messages": { + "description": "允许接收机器人消息", + "hint": "启用后,AstrBot 将接收来自其他 Discord 机器人的消息。适用于机器人间通信场景(如消息转发)。默认关闭。" + }, + "discord_command_register": { + "description": "注册 Discord 指令", + "hint": "启用后,自动将插件指令注册为 Discord 斜杠指令" + }, + "discord_proxy": { + "description": "Discord 代理地址", + "hint": "可选的代理地址:http://ip:port" + }, + "discord_token": { + "description": "Discord Bot Token", + "hint": "在此处填入你的 Discord Bot Token" + }, + "enable": { + "description": "启用", + "hint": "是否启用该适配器。未启用的适配器对应的消息平台将不会接收到消息。" + }, + "enable_group_c2c": { + "description": "启用消息列表单聊", + "hint": "启用后,机器人可以接收到 QQ 消息列表中的私聊消息。你可能需要在 QQ 机器人平台上通过扫描二维码的方式添加机器人为你的好友。详见文档。" + }, + "enable_guild_direct_message": { + "description": "启用频道私聊", + "hint": "启用后,机器人可以接收到频道的私聊消息。" + }, + "id": { + "description": "机器人名称", + "hint": "机器人名称" + }, + "is_sandbox": { + "description": "沙箱模式" + }, + "kf_name": { + "description": "微信客服账号名", + "hint": "如果填写此项,即代表你将使用企业微信客服,而不是企业微信应用。可在 https://kf.weixin.qq.com/kf/frame#/accounts 获取。" + }, + "lark_connection_mode": { + "description": "订阅方式", + "labels": [ + "长连接模式", + "推送至服务器模式" + ] + }, + "lark_encrypt_key": { + "description": "Encrypt Key", + "hint": "用于解密飞书回调数据的加密密钥" + }, + "lark_verification_token": { + "description": "Verification Token", + "hint": "用于验证飞书回调请求的令牌" + }, + "misskey_allow_insecure_downloads": { + "description": "允许不安全下载(禁用 SSL 验证)", + "hint": "当远端服务器存在证书问题导致无法正常下载时,自动禁用 SSL 验证作为回退方案。适用于某些图床的证书配置问题。启用有安全风险,仅在必要时使用。" + }, + "misskey_default_visibility": { + "description": "默认帖子可见性", + "hint": "机器人发帖时的默认可见性设置。public:公开,home:主页时间线,followers:仅关注者。" + }, + "misskey_download_chunk_size": { + "description": "流式下载分块大小(字节)", + "hint": "流式下载和计算 MD5 时使用的每次读取字节数,过小会增加开销,过大会占用内存。" + }, + "misskey_download_timeout": { + "description": "远端下载超时时间(秒)", + "hint": "下载远程文件时的超时时间(秒),用于异步上传回退到本地上传的场景。" + }, + "misskey_enable_chat": { + "description": "启用聊天消息响应", + "hint": "启用后,机器人将会监听和响应私信聊天消息" + }, + "misskey_enable_file_upload": { + "description": "启用文件上传到 Misskey", + "hint": "启用后,适配器会尝试将消息链中的文件上传到 Misskey。URL 文件会先尝试服务器端上传,异步上传失败时会回退到下载后本地上传。" + }, + "misskey_instance_url": { + "description": "Misskey 实例 URL", + "hint": "例如 https://misskey.example,填写 Bot 账号所在的 Misskey 实例地址" + }, + "misskey_local_only": { + "description": "仅限本站(不参与联合)", + "hint": "启用后,机器人发出的帖子将仅在本实例可见,不会联合到其他实例" + }, + "misskey_max_download_bytes": { + "description": "最大允许下载字节数(超出则中止)", + "hint": "如果希望限制下载文件的最大大小以防止 OOM,请填写最大字节数;留空或 null 表示不限制。" + }, + "misskey_token": { + "description": "Misskey Access Token", + "hint": "连接服务设置生成的 API 鉴权访问令牌(Access token)" + }, + "misskey_upload_concurrency": { + "description": "并发上传限制", + "hint": "同时进行的文件上传任务上限(整数,默认 3)。" + }, + "misskey_upload_folder": { + "description": "上传到网盘的目标文件夹 ID", + "hint": "可选:填写 Misskey 网盘中目标文件夹的 ID,上传的文件将放置到该文件夹内。留空则使用账号网盘根目录。" + }, + "port": { + "description": "回调服务器端口", + "hint": "回调服务器端口。留空则不启用回调服务器。" + }, + "satori_api_base_url": { + "description": "Satori API 终结点", + "hint": "Satori API 的基础地址。" + }, + "satori_auto_reconnect": { + "description": "启用自动重连", + "hint": "断开连接时是否自动重新连接 WebSocket。" + }, + "satori_endpoint": { + "description": "Satori WebSocket 终结点", + "hint": "Satori 事件的 WebSocket 端点。" + }, + "satori_heartbeat_interval": { + "description": "Satori 心跳间隔", + "hint": "发送心跳消息的间隔(秒)。" + }, + "satori_reconnect_delay": { + "description": "Satori 重连延迟", + "hint": "尝试重新连接前的延迟时间(秒)。" + }, + "satori_token": { + "description": "Satori 令牌", + "hint": "用于 Satori API 身份验证的令牌。" + }, + "secret": { + "description": "secret", + "hint": "必填项。" + }, + "slack_connection_mode": { + "description": "Slack Connection Mode", + "hint": "The connection mode for Slack. `webhook` uses a webhook server, `socket` uses Slack's Socket Mode." + }, + "slack_webhook_host": { + "description": "Slack Webhook Host", + "hint": "Only valid when Slack connection mode is `webhook`." + }, + "slack_webhook_path": { + "description": "Slack Webhook Path", + "hint": "Only valid when Slack connection mode is `webhook`." + }, + "slack_webhook_port": { + "description": "Slack Webhook Port", + "hint": "Only valid when Slack connection mode is `webhook`." + }, + "telegram_command_auto_refresh": { + "description": "命令自动刷新", + "hint": "启用后,AstrBot 将会在运行时自动刷新 Telegram 命令。(单独设置此项无效)" + }, + "telegram_command_register": { + "description": "命令注册", + "hint": "启用后,AstrBot 将会自动注册 Telegram 命令。" + }, + "telegram_command_register_interval": { + "description": "命令自动刷新间隔", + "hint": "Telegram 命令自动刷新间隔,单位为秒。" + }, + "telegram_polling_restart_delay": { + "description": "轮询重启延迟", + "hint": "当轮询意外结束尝试自动重启时的延迟时间,单位为秒。默认为 5s。" + }, + "telegram_token": { + "description": "Bot Token", + "hint": "如果你的网络环境为中国大陆,请在 `其他配置` 处设置代理或更改 api_base。" + }, + "mattermost_url": { + "description": "Mattermost URL", + "hint": "Mattermost 服务地址,例如 https://chat.example.com。" + }, + "mattermost_bot_token": { + "description": "Mattermost Bot Token", + "hint": "在 Mattermost 中创建 Bot 账户后生成的访问令牌。" + }, + "mattermost_reconnect_delay": { + "description": "Mattermost 重连延迟", + "hint": "WebSocket 断开后的重连等待时间,单位为秒。默认 5 秒。" + }, + "type": { + "description": "适配器类型" + }, + "unified_webhook_mode": { + "description": "统一 Webhook 模式", + "hint": "Webhook 模式下使用 AstrBot 统一 Webhook 入口,无需单独开启端口。回调地址为 /api/v1/webhooks/platforms/{webhook_uuid}。" + }, + "use_markdown": { + "description": "主动消息使用 Markdown", + "hint": "启用后,机器人主动发送消息默认以 Markdown 模式发送;插件显式调用 use_markdown() 指定行为时不受此配置影响。" + }, + "webhook_uuid": { + "description": "Webhook UUID", + "hint": "统一 Webhook 模式下的唯一标识符,创建平台时自动生成。" + }, + "wecom_ai_bot_name": { + "description": "企业微信智能机器人的名字", + "hint": "请务必填写正确,否则无法使用一些指令。" + }, + "wecom_ai_bot_connection_mode": { + "description": "企业微信智能机器人连接模式", + "hint": "Webhook 回调模式需要配置 Token/EncodingAESKey;长连接模式需要配置 BotID/Secret。" + }, + "wecomaibot_friend_message_welcome_text": { + "description": "企业微信智能机器人私聊欢迎语", + "hint": "可选。当用户当天进入智能机器人单聊会话,回复欢迎语,如 “💭 思考中...”。留空则不回复。" + }, + "wecomaibot_init_respond_text": { + "description": "企业微信智能机器人初始响应文本", + "hint": "可选。当机器人收到消息时,首先回复的文本内容。留空则不设置。" + }, + "wecomaibot_token": { + "description": "企业微信智能机器人 Token", + "hint": "用于 Webhook 回调模式的身份验证。" + }, + "wecomaibot_encoding_aes_key": { + "description": "企业微信智能机器人 EncodingAESKey", + "hint": "用于 Webhook 回调模式的消息加密解密。" + }, + "wecomaibot_ws_bot_id": { + "description": "长连接 BotID", + "hint": "企业微信智能机器人长连接模式凭证 BotID。" + }, + "wecomaibot_ws_secret": { + "description": "长连接 Secret", + "hint": "企业微信智能机器人长连接模式凭证 Secret。" + }, + "wecomaibot_ws_url": { + "description": "长连接 WebSocket 地址", + "hint": "默认值为 wss://openws.work.weixin.qq.com,一般无需修改。" + }, + "wecomaibot_heartbeat_interval": { + "description": "长连接心跳间隔", + "hint": "长连接模式心跳间隔(秒),建议 30 秒。" + }, + "wpp_active_message_poll": { + "description": "是否启用主动消息轮询", + "hint": "只有当你发现微信消息没有按时同步到 AstrBot 时,才需要启用这个功能,默认不启用。" + }, + "wpp_active_message_poll_interval": { + "description": "主动消息轮询间隔", + "hint": "主动消息轮询间隔,单位为秒,默认 3 秒,最大不要超过 60 秒,否则可能被认为是旧消息。" + }, + "ws_reverse_host": { + "description": "反向 Websocket 主机", + "hint": "AstrBot 将作为服务器端。" + }, + "ws_reverse_port": { + "description": "反向 Websocket 端口" + }, + "ws_reverse_token": { + "description": "反向 Websocket Token", + "hint": "反向 Websocket Token。未设置则不启用 Token 验证。" + }, + "msg_push_webhook_url": { + "description": "企业微信消息推送 Webhook URL", + "hint": "可选。用于主动消息推送,请在企微群->消息推送得到 URL。建议设置此项以带来更好的消息发送体验。" + }, + "only_use_webhook_url_to_send": { + "description": "仅使用 Webhook 发送消息", + "hint": "可选。启用后,企业微信智能机器人的所有回复都改为通过消息推送 Webhook 发送。消息推送 Webhook 支持更多的消息类型(如图片、文件等)。如果不需要打字机效果,强烈建议使用此选项。" + }, + "weixin_oc_base_url": { + "description": "Base URL 地址", + "hint": "默认值: https://ilinkai.weixin.qq.com" + }, + "weixin_oc_bot_type": { + "description": "扫码参数 bot_type", + "hint": "默认值: 3" + }, + "weixin_oc_qr_poll_interval": { + "description": "二维码状态轮询间隔(秒)", + "hint": "每隔多少秒轮询一次二维码状态。" + }, + "weixin_oc_long_poll_timeout_ms": { + "description": "getUpdates 长轮询超时时间(毫秒)", + "hint": "会话消息拉取接口超时参数。" + }, + "weixin_oc_api_timeout_ms": { + "description": "HTTP 请求超时(毫秒)", + "hint": "通用 API 请求超时参数。" + }, + "weixin_oc_token": { + "description": "登录后 token(可留空)", + "hint": "扫码登录成功后会自动写入;高级场景可手动填写。" + }, + "kook_bot_token": { + "description": "机器人 Token", + "type": "string", + "hint": "必填项。从 KOOK 开发者平台获取的机器人 Token" + }, + "kook_reconnect_delay": { + "description": "重连延迟", + "type": "int", + "hint": "重连延迟时间(秒),使用指数退避策略" + }, + "kook_max_reconnect_delay": { + "description": "最大重连延迟", + "type": "int", + "hint": "重连延迟的最大值(秒)" + }, + "kook_max_retry_delay": { + "description": "最大重试延迟", + "type": "int", + "hint": "重试的最大延迟时间(秒)" + }, + "kook_heartbeat_interval": { + "description": "心跳间隔", + "type": "int", + "hint": "心跳检测间隔时间(秒)" + }, + "kook_heartbeat_timeout": { + "description": "心跳超时时间", + "type": "int", + "hint": "心跳检测超时时间(秒)" + }, + "kook_max_heartbeat_failures": { + "description": "最大心跳失败次数", + "type": "int", + "hint": "允许的最大心跳失败次数,超过后断开连接" + }, + "kook_max_consecutive_failures": { + "description": "最大连续失败次数", + "type": "int", + "hint": "允许的最大连续失败次数,超过后停止重试" + } + }, + "general": { + "description": "基本", + "platform_settings": { + "unique_session": { + "description": "隔离对话", + "hint": "启用后,支持隔离的渠道会为每位群成员使用独立上下文。指令权限请在「管理行为 → 指令」中设置。" + }, + "friend_message_needs_wake_prefix": { + "description": "私聊消息需要唤醒词", + "hint": "私聊消息也必须带上唤醒前缀才能唤醒机器人。" + }, + "reply_prefix": { + "description": "回复时的文本前缀", + "hint": "回复中附带的文本前缀。" + }, + "reply_with_mention": { + "description": "回复时 @ 发送人", + "hint": "回复时提及发送人。" + }, + "reply_with_quote": { + "description": "回复时引用发送人消息", + "hint": "回复时引用发送人的对应消息。" + }, + "forward_threshold": { + "description": "转发消息的字数阈值", + "hint": "在受支持的平台上,当回复消息过长时,采用 “合并消息转发” 的方式发送消息。" + }, + "empty_mention_waiting": { + "description": "只 @ 机器人是否触发等待", + "hint": "当发送一条只有提及机器人的消息时,是否在接下来的 1 分钟内保持唤醒状态等待用户的第二条消息。" + } + }, + "wake_prefix": { + "description": "唤醒词", + "hint": "唤醒机器人的消息前缀的列表,也可以通过 @ 机器人来唤醒。\n\n内置指令(如 `/help`、`/sid`)也依赖唤醒词:群聊中不带唤醒词直接输入将无法触发;私聊在未启用「私聊消息需要唤醒词」时无需前缀,可直接输入指令触发。" + }, + "disable_builtin_commands": { + "description": "禁用自带指令", + "hint": "禁用所有 AstrBot 自带指令,如 help, sid, new 等" + } + }, + "rate_limit": { + "description": "速率限制", + "platform_settings": { + "rate_limit": { + "time": { + "description": "消息速率限制时间(秒)" + }, + "count": { + "description": "消息速率限制计数" + }, + "strategy": { + "description": "速率限制策略" + } + } + } + }, + "content_safety": { + "description": "内容安全", + "content_safety": { + "also_use_in_response": { + "description": "同时检查模型的响应内容" + }, + "baidu_aip": { + "enable": { + "description": "使用百度内容安全审核", + "hint": "您需要手动安装 baidu-aip 库。" + }, + "app_id": { + "description": "App ID" + }, + "api_key": { + "description": "API Key" + }, + "secret_key": { + "description": "Secret Key" + } + }, + "internal_keywords": { + "enable": { + "description": "关键词检查" + }, + "extra_keywords": { + "description": "额外关键词", + "hint": "额外的屏蔽关键词列表,支持正则表达式。" + } + } + } + }, + "others": { + "description": "其他配置", + "platform_settings": { + "ignore_bot_self_message": { + "description": "是否忽略机器人自身的消息" + }, + "ignore_at_all": { + "description": "是否忽略 @ 全体成员事件" + }, + "no_permission_reply": { + "description": "用户权限不足时是否回复" + } + }, + "platform_specific": { + "lark": { + "pre_ack_emoji": { + "enable": { + "description": "[飞书] 启用预回应表情" + }, + "emojis": { + "description": "表情列表(飞书表情枚举名)", + "hint": "表情枚举名参考:[https://open.feishu.cn/document/server-docs/im-v1/message-reaction/emojis-introduce](https://open.feishu.cn/document/server-docs/im-v1/message-reaction/emojis-introduce)" + } + } + }, + "telegram": { + "pre_ack_emoji": { + "enable": { + "description": "[Telegram] 启用预回应表情" + }, + "emojis": { + "description": "表情列表(Unicode)", + "hint": "Telegram 仅支持固定反应集合,参考:[https://gist.github.com/Soulter/3f22c8e5f9c7e152e967e8bc28c97fc9](https://gist.github.com/Soulter/3f22c8e5f9c7e152e967e8bc28c97fc9)" + } + } + }, + "discord": { + "pre_ack_emoji": { + "enable": { + "description": "[Discord] 启用预回应表情" + }, + "emojis": { + "description": "表情列表(Unicode 或自定义表情名)", + "hint": "填写 Unicode 表情符号,例如:👍、🤔、⏳" + } + } + } + } + } + }, + "access_group": { + "name": "访问控制", + "admins": { + "description": "管理员", + "admins_id": { + "description": "管理员 ID", + "hint": "给机器人发送 /sid 指令以获取 ID。" + } + }, + "whitelist": { + "description": "白名单", + "platform_settings": { + "enable_id_white_list": { + "description": "启用白名单", + "hint": "启用后,只有在白名单内的会话会被响应。" + }, + "id_whitelist": { + "description": "白名单 ID 列表", + "hint": "给机器人发送 /sid 指令以获取 ID。为空时代表不启用白名单功能。" + }, + "id_whitelist_log": { + "description": "输出拦截日志", + "hint": "输出未通过白名单校验的消息的日志。" + }, + "wl_ignore_admin_on_group": { + "description": "管理员群组消息无视 ID 白名单" + }, + "wl_ignore_admin_on_friend": { + "description": "管理员私聊消息无视 ID 白名单" + } + } + } + }, + "plugin_group": { + "name": "插件", + "plugin": { + "description": "插件", + "plugin_set": { + "description": "可用插件", + "hint": "默认启用全部未被禁用的插件。若插件在插件管理页被禁用,则此处的选择不会生效。" + } + } + }, + "ext_group": { + "name": "扩展功能", + "segmented_reply": { + "description": "分段回复", + "platform_settings": { + "segmented_reply": { + "enable": { + "description": "启用分段回复", + "hint": "以分段输出的方式发送回复消息。" + }, + "only_llm_result": { + "description": "仅对 LLM 结果分段" + }, + "interval_method": { + "description": "间隔方法", + "hint": "random 为随机时间,log 为根据消息长度计算,$y=log_(x)$,x为字数,y的单位为秒。" + }, + "interval": { + "description": "随机间隔时间", + "hint": "格式:最小值,最大值(如:1.5,3.5)" + }, + "log_base": { + "description": "对数底数", + "hint": "对数间隔的底数,默认为 2.6。取值范围为 1.0-10.0。" + }, + "words_count_threshold": { + "description": "分段回复字数阈值", + "hint": "分段回复的字数上限。只有字数小于此值的消息才会被分段,超过此值的长消息将直接发送(不分段),默认为 150。" + }, + "split_mode": { + "description": "分段模式", + "hint": "用于分隔一段消息。默认情况下会根据句号、问号等标点符号分隔。如填写 `[。?!]` 将移除所有的句号、问号、感叹号。re.findall(r'', text)", + "labels": [ + "正则表达式", + "分段词列表" + ] + }, + "regex": { + "description": "分段正则表达式", + "hint": "用于按正则规则识别分段点。建议使用能匹配分隔符的表达式。" + }, + "split_words": { + "description": "分段词列表", + "hint": "检测到列表中的任意词时进行分段" + }, + "content_cleanup_rule": { + "description": "内容过滤正则表达式", + "hint": "移除分段后内容中的指定内容。如填写 `[。?!]` 将移除所有的句号、问号、感叹号。" + } + } + } + }, + "ltm": { + "description": "群聊上下文感知", + "provider_ltm_settings": { + "group_icl_enable": { + "description": "群聊消息记录注入上下文", + "hint": "是否记录群聊非唤醒机器人的消息,并在唤醒机器人时将消息传给模型。" + }, + "group_message_max_cnt": { + "description": "注入上下文最大消息数量", + "hint": "传给模型的消息的最大数量。" + }, + "image_caption": { + "description": "自动理解图片", + "hint": "对非唤醒机器人的图片消息启用图片转述,转换成图片描述文本。对于图片消息频繁的群聊,此功能可能造成较大的开销,请慎用。" + }, + "image_caption_provider_id": { + "description": "群聊图片转述模型", + "hint": "用于群聊记录注入上下文的图片理解,与图片转述模型分开配置。" + }, + "group_message_history_enable": { + "description": "持久化群聊消息记录", + "hint": "将群内的所有消息都持久化保存,并允许模型通过工具来查询群内消息。" + }, + "group_message_history_max_cnt": { + "description": "持久化最大消息数量", + "hint": "持久化保存的消息的最大数量,超过后抛弃旧的消息。" + }, + "active_reply": { + "enable": { + "description": "主动回复", + "hint": "是否在合适的时机主动发消息。" + }, + "method": { + "description": "主动回复方法" + }, + "possibility_reply": { + "description": "回复概率", + "hint": "0.0-1.0 之间的数值" + }, + "whitelist": { + "description": "主动回复白名单", + "hint": "为空时不启用白名单过滤。使用 /sid 获取 ID。" + } + } + } + }, + "t2i": { + "description": "文本转图像", + "t2i": { + "description": "文本转图像输出", + "hint": "将模型回复转换成图片后再发送,防止刷屏。" + }, + "t2i_word_threshold": { + "description": "文本转图像字数阈值" + }, + "t2i_strategy": { + "description": "文本转图像策略", + "hint": "文本转图像策略。`remote` 为使用远程基于 HTML 的渲染服务,`local` 为使用 PIL 本地渲染。当使用 local 时,将 ttf 字体命名为 'font.ttf' 放在 data/ 目录下可自定义字体。" + }, + "t2i_endpoint": { + "description": "文本转图像服务 API 地址", + "hint": "为空时使用 AstrBot API 服务" + }, + "t2i_template": { + "description": "文本转图像自定义模版", + "hint": "启用后可自定义 HTML 模板用于文转图渲染。" + }, + "t2i_active_template": { + "description": "当前应用的文转图渲染模板", + "hint": "此处的值由文转图模板管理页面进行维护。" + } + } + }, + "system_group": { + "name": "系统配置", + "system": { + "description": "系统配置", + "log_level": { + "description": "控制台日志级别", + "hint": "控制台输出日志的级别。" + }, + "log_file_enable": { + "description": "启用文件日志", + "hint": "在控制台输出的同时,将日志写入文件。" + }, + "log_file_path": { + "description": "日志文件路径", + "hint": "相对路径以 data 目录为基准,例如 logs/astrbot.log;支持绝对路径。" + }, + "log_file_max_mb": { + "description": "日志文件大小上限 (MB)", + "hint": "超过大小后自动轮转,默认 20MB。" + }, + "temp_dir_max_size": { + "description": "临时目录大小上限 (MB)", + "hint": "用于限制 data/temp 目录总大小,单位为 MB。系统每 10 分钟检查一次,超限时按文件修改时间从旧到新删除,释放约 30% 当前体积。" + }, + "trace_enable": { + "description": "启用追踪记录", + "hint": "追踪用户的每次指令和 AI 调用。" + }, + "trace_db_path": { + "description": "追踪数据库路径", + "hint": "相对路径以 data 目录为基准,例如 logs/traces.db;支持绝对路径。" + }, + "trace_db_max_mb": { + "description": "追踪数据库容量预算 (MB)", + "hint": "默认 80 MB,最小 32 MB,低于最小值时按 32 MB 生效。超出后自动清除旧数据。" + }, + "trace_retention_days": { + "description": "追踪保留天数", + "hint": "默认 7 天,期限或容量先达到者触发清理。" + }, + "pip_install_arg": { + "description": "pip 安装额外参数", + "hint": "安装插件依赖时,会使用 Python 的 pip 工具。这里可以填写额外的参数,如 `--break-system-package` 等。PyPI 镜像的 TLS 证书默认会校验;若使用自签名/私有 CA 镜像,请通过 `--cert ` 指定信任的证书(推荐),或显式添加 `--trusted-host <主机名>`。" + }, + "pypi_index_url": { + "description": "PyPI 软件仓库地址", + "hint": "安装 Python 依赖时请求的 PyPI 软件仓库地址。默认为 [https://mirrors.aliyun.com/pypi/simple/](https://mirrors.aliyun.com/pypi/simple/)" + }, + "callback_api_base": { + "description": "对外可达的回调接口地址", + "hint": "外部服务可能会通过 AstrBot 生成的回调链接(如文件下载链接)访问 AstrBot 后端。由于 AstrBot 无法自动判断部署环境中对外可达的主机地址(host),因此需要通过此配置项显式指定外部服务如何访问 AstrBot 的地址。如 [http://localhost:6185](http://localhost:6185),[https://example.com](https://example.com) 等。" + }, + "disable_metrics": { + "description": "禁用匿名使用统计", + "hint": "禁用后,AstrBot 将不再上传匿名使用统计数据。" + }, + "dashboard": { + "trust_proxy_headers": { + "description": "信任代理请求头获取客户端 IP", + "hint": "关闭时忽略 X-Forwarded-For/X-Real-IP,仅使用连接地址。" + }, + "auth_rate_limit": { + "enable": { + "description": "启用登录验证速率限制", + "hint": "关闭后将不对登录、TOTP 等身份验证接口进行速率限制。" + }, + "average_interval": { + "description": "验证端点速率限制平均间隔(秒)", + "hint": "两次身份验证请求之间的最小平均间隔时间。例如设置为 1.0 表示每秒最多处理 1 个请求。" + }, + "max_burst": { + "description": "验证端点速率限制最大突发数", + "hint": "允许的瞬时最大突发请求数。例如设置为 3 表示在短时间内最多连续处理 3 个请求。" + } + }, + "ssl": { + "enable": { + "description": "启用 WebUI HTTPS", + "hint": "启用后,WebUI 将直接使用 HTTPS 提供服务。" + }, + "cert_file": { + "description": "SSL 证书文件路径", + "hint": "证书文件路径(PEM)。支持绝对路径和相对路径(相对于当前工作目录)。" + }, + "key_file": { + "description": "SSL 私钥文件路径", + "hint": "私钥文件路径(PEM)。支持绝对路径和相对路径(相对于当前工作目录)。" + }, + "ca_certs": { + "description": "SSL CA 证书文件路径", + "hint": "可选。用于指定 CA 证书文件路径。" + } + }, + "totp": { + "enable": { + "description": "启用 WebUI TOTP 双因素认证", + "hint": "启用后,登录 WebUI 需要额外输入验证码。" + }, + "manage": "管理", + "configuration": "TOTP", + "statusPending": "需完成设置", + "statusEnabled": "已启用", + "setupRequiredHint": "TOTP 已开启但尚未完成配置,请点击“管理”完成初始化。", + "setupTitle": "设置 TOTP", + "setupSubtitle": "请使用认证器应用扫描二维码,然后输入验证码。", + "setupConfirm": "验证并继续", + "activeSubtitle": "可使用此二维码和密钥添加新的认证器设备。", + "rotateTitle": "更换 TOTP 密钥", + "rotateSubtitle": "生成新密钥并完成验证后,将替换当前密钥。", + "rotate": "更换密钥", + "rotateRecovery": "更换恢复码", + "rotateConfirm": "确认更换", + "rotateCancel": "取消", + "rotateCode": "验证码", + "rotateCodeHint": "输入认证器应用中的验证码以确认新密钥。", + "rotateError": "验证码无效,请重试。", + "recoveryTitle": "恢复码", + "recoverySubtitle": "恢复码仅展示一次,请在继续前妥善保存。", + "recoveryWarning": "若恢复码丢失将无法通过常规途径恢复账户访问权限。", + "recoveryAcknowledge": "我已保存恢复码", + "recoveryClose": "完成", + "disableTitle": "关闭 TOTP", + "disableSubtitle": "输入验证码以确认关闭双因素认证。", + "disableRecoverySubtitle": "输入恢复码以确认关闭双因素认证。", + "disableCode": "验证码", + "disableRecoveryCode": "恢复码", + "disableConfirm": "确认关闭", + "disableCancel": "取消", + "disableError": "验证失败,请重试。", + "disableUseRecovery": "无法使用TOTP?", + "disableUseCode": "使用验证码", + "configSaveTitle": "两步验证", + "configSaveSubtitle": "输入验证码以更改受保护的配置。", + "configSaveRotationHint": "轮换 TOTP 密钥时,轮换前和轮换后的验证码均可用(仅轮换操作中单次允许)。", + "configSaveCode": "验证码", + "configSaveConfirm": "继续", + "configSaveCancel": "取消", + "configSaveError": "验证失败,请重试。" + } + }, + "timezone": { + "description": "时区", + "hint": "时区设置。请填写 IANA 时区名称, 如 Asia/Shanghai, 为空时使用系统默认时区。所有时区请查看: [https://data.iana.org/time-zones/tzdb-2021a/zone1970.tab](https://data.iana.org/time-zones/tzdb-2021a/zone1970.tab)" + }, + "http_proxy": { + "description": "HTTP 代理", + "hint": "启用后,会以添加环境变量的方式设置代理。格式为 `http://ip:port`" + }, + "no_proxy": { + "description": "直连地址列表" + } + } + }, + "provider_group": { + "provider": { + "api_key": { + "description": "API Key" + }, + "dashscope_api_key": { + "description": "DashScope API Key" + }, + "gemini_tts_api_key": { + "description": "Gemini API Key" + }, + "genie_onnx_model_dir": { + "description": "ONNX Model Directory", + "hint": "The directory path containing the ONNX model files" + }, + "genie_language": { + "description": "Language" + }, + "xai_native_search": { + "description": "启用原生搜索功能", + "hint": "启用后,将通过 xAI 的 Chat Completions 原生 Live Search 进行联网检索(按需计费)。仅对 xAI 提供商生效。" + }, + "rerank_api_base": { + "description": "重排序模型 API Base URL", + "hint": "最终请求路径由 Base URL 和路径后缀拼接而成(默认为 /v1/rerank)。" + }, + "rerank_api_suffix": { + "description": "API URL 路径后缀", + "hint": "追加到 base_url 后的路径后缀,如 /v1/rerank。留空则不追加。" + }, + "rerank_api_key": { + "description": "API Key", + "hint": "如果不需要 API Key, 请留空。" + }, + "rerank_model": { + "description": "重排序模型名称" + }, + "return_documents": { + "description": "是否在排序结果中返回文档原文", + "hint": "默认值false,以减少网络传输开销。" + }, + "instruct": { + "description": "自定义排序任务类型说明", + "hint": "仅在使用 qwen3-rerank 模型时生效。建议使用英文撰写。" + }, + "nvidia_rerank_api_base": { + "description": "API Base URL" + }, + "nvidia_rerank_api_key": { + "description": "API Key" + }, + "nvidia_rerank_model": { + "description": "重排序模型名称", + "hint": "请参照NVIDIA Docs中模型名称填写。" + }, + "nvidia_rerank_model_endpoint": { + "description": "自定义模型端点", + "hint": "自定义URL末尾端点,默认为 /reranking" + }, + "nvidia_rerank_truncate": { + "description": "文本截断策略", + "hint": "当输入文本过长时,是否截断输入以适应模型的最大上下文长度。" + }, + "nvidia_embedding": { + "hint": "NVIDIA NIM Embedding,默认地址为 https://integrate.api.nvidia.com/v1。", + "input_type": { + "description": "文档侧 input_type", + "hint": "文档入库时使用。NV-Embed-QA / E5 / nemotron 等模型要求区分 passage 与 query,文档侧填 passage。" + }, + "query_input_type": { + "description": "查询侧 input_type", + "hint": "检索查询时使用,默认 query。NVIDIA 官方说明:填错会显著降低检索准确率。" + } + }, + "tei_rerank_truncate": { + "description": "截断超长文本", + "hint": "当输入超过模型最大上下文长度时,是否自动截断。启用后需配合 截断方向 使用。" + }, + "tei_rerank_truncation_direction": { + "description": "截断方向", + "hint": "选择从文本的左侧(left)还是右侧(right)开始截断。仅在 截断超长文本 为 True 时生效。" + }, + "tei_rerank_raw_scores": { + "description": "返回原始分数", + "hint": "如果为 True,返回模型原始 logit 分数(可能为负值),不经过 sigmoid 归一化。默认 False。" + }, + "tei_rerank_return_text": { + "description": "返回排序结果中的文档原文", + "hint": "如果为 True,每个排序结果将附带原始文本。默认 False 以减少网络传输。" + }, + "launch_model_if_not_running": { + "description": "模型未运行时自动启动", + "hint": "如果模型当前未在 Xinference 服务中运行,是否尝试自动启动它。在生产环境中建议关闭。" + }, + "modalities": { + "description": "模型能力", + "hint": "模型支持的模态及能力。", + "labels": [ + "文本", + "图像", + "音频", + "工具使用" + ] + }, + + "custom_headers": { + "description": "自定义请求头", + "hint": "此处添加的键值对将作为自定义 HTTP 请求头,附加到 AstrBot 发往模型服务商的请求中。值必须为字符串。" + }, + "ollama_disable_thinking": { + "description": "关闭思考模式", + "hint": "关闭 Ollama 思考模式。" + }, + "custom_extra_body": { + "description": "自定义请求体参数", + "hint": "用于在请求时添加额外的参数,如 temperature, top_p, max_tokens, reasoning_effort 等。", + "template_schema": { + "temperature": { + "description": "温度参数", + "hint": "控制输出的随机性,范围通常为 0-2。值越高越随机。", + "name": "Temperature" + }, + "top_p": { + "description": "Top-p 采样", + "hint": "核采样参数,范围通常为 0-1。控制模型考虑的概率质量。", + "name": "Top-p" + }, + "max_tokens": { + "description": "最大词元(Tokens)数", + "hint": "生成的最大词元(Tokens)数。", + "name": "Max Tokens" + }, + "max_output_tokens": { + "description": "最大输出词元(Tokens)数", + "hint": "生成的最大词元(Tokens)数。", + "name": "Max Output Tokens" + }, + "reasoning_effort": { + "description": "推理强度", + "hint": "控制推理模型的推理强度,支持的值取决于具体模型。", + "name": "Reasoning Effort" + } + } + }, + "gpt_weights_path": { + "description": "GPT模型文件路径", + "hint": "即“.ckpt”后缀的文件,请使用绝对路径,路径两端不要带双引号,不填则默认用GPT_SoVITS内置的SoVITS模型(建议直接在GPT_SoVITS中改默认模型)" + }, + "sovits_weights_path": { + "description": "SoVITS模型文件路径", + "hint": "即“.pth”后缀的文件,请使用绝对路径,路径两端不要带双引号,不填则默认用GPT_SoVITS内置的SoVITS模型(建议直接在GPT_SoVITS中改默认模型)" + }, + "gsv_default_parms": { + "description": "GPT_SoVITS默认参数", + "hint": "参考音频文件路径、参考音频文本必填,其他参数根据个人爱好自行填写", + "gsv_ref_audio_path": { + "description": "参考音频文件路径", + "hint": "必填!请使用绝对路径!路径两端不要带双引号!" + }, + "gsv_prompt_text": { + "description": "参考音频文本", + "hint": "必填!请填写参考音频讲述的文本" + }, + "gsv_prompt_lang": { + "description": "参考音频文本语言", + "hint": "请填写参考音频讲述的文本的语言,默认为中文" + }, + "gsv_aux_ref_audio_paths": { + "description": "辅助参考音频文件路径", + "hint": "辅助参考音频文件,可不填" + }, + "gsv_text_lang": { + "description": "文本语言", + "hint": "默认为中文" + }, + "gsv_top_k": { + "description": "生成语音的多样性", + "hint": "" + }, + "gsv_top_p": { + "description": "核采样的阈值", + "hint": "" + }, + "gsv_temperature": { + "description": "生成语音的随机性", + "hint": "" + }, + "gsv_text_split_method": { + "description": "切分文本的方法", + "hint": "可选值: `cut0`:不切分 `cut1`:四句一切 `cut2`:50字一切 `cut3`:按中文句号切 `cut4`:按英文句号切 `cut5`:按标点符号切" + }, + "gsv_batch_size": { + "description": "批处理大小", + "hint": "" + }, + "gsv_batch_threshold": { + "description": "批处理阈值", + "hint": "" + }, + "gsv_split_bucket": { + "description": "将文本分割成桶以便并行处理", + "hint": "" + }, + "gsv_speed_factor": { + "description": "语音播放速度", + "hint": "1为原始语速" + }, + "gsv_fragment_interval": { + "description": "语音片段之间的间隔时间", + "hint": "" + }, + "gsv_streaming_mode": { + "description": "启用流模式", + "hint": "" + }, + "gsv_seed": { + "description": "随机种子", + "hint": "用于结果的可重复性" + }, + "gsv_parallel_infer": { + "description": "并行执行推理", + "hint": "" + }, + "gsv_repetition_penalty": { + "description": "重复惩罚因子", + "hint": "" + }, + "gsv_media_type": { + "description": "输出媒体的类型", + "hint": "建议用wav" + } + }, + "embedding_dimensions": { + "description": "嵌入维度", + "hint": "嵌入向量的维度。根据模型不同,可能需要调整,请参考具体模型的文档。此配置项请务必填写正确,否则将导致向量数据库无法正常工作。" + }, + "embedding_dimensions_mode": { + "description": "嵌入维度参数发送模式", + "hint": "控制是否在 OpenAI 兼容 Embedding 请求中发送 dimensions 参数。auto 会仅对官方 OpenAI embedding-3 模型自动发送;第三方兼容 API 如需该参数可改为 always,报错时改为 never。" + }, + "embedding_model": { + "description": "嵌入模型", + "hint": "嵌入模型名称。" + }, + "embedding_api_key": { + "description": "API Key" + }, + "embedding_api_base": { + "description": "API Base URL" + }, + "openai_embedding": { + "hint": "如果测试不通过,可以尝试添加 /v1 在末尾以兼容部分 OpenAI API 版本。" + }, + "gemini_embedding": { + "hint": "Gemini Embedding 无需手动添加 /v1beta。", + "embedding_task_type_mode": { + "description": "任务类型传递方式", + "hint": "auto:按模型代际自动选择(gemini-embedding-001 走 task_type 参数,gemini-embedding-2 走文本前缀);never:强制走 task_type;always:强制走文本前缀。" + }, + "embedding_query_task_type": { + "description": "查询侧 task_type", + "hint": "仅 task_type 模式生效。检索查询用 RETRIEVAL_QUERY,代码检索可用 CODE_RETRIEVAL_QUERY。" + }, + "embedding_document_task_type": { + "description": "文档侧 task_type", + "hint": "仅 task_type 模式生效。入库文档用 RETRIEVAL_DOCUMENT,可配合 title 提升效果。" + }, + "embedding_query_task_name": { + "description": "查询侧任务前缀(gemini-embedding-2)", + "hint": "仅文本前缀模式生效,可选:search result / question answering / fact checking / code retrieval。填错会自动回退为 search result。" + }, + "embedding_document_title": { + "description": "文档标题(gemini-embedding-2)", + "hint": "留空时使用 title: none。注意知识库入库时已把文档标题拼进正文,这里再填会让标题重复两遍,一般保持留空。" + } + }, + "dashscope_embedding": { + "hint": "阿里云百炼 Embedding,默认地址为 https://dashscope.aliyuncs.com/api/v1。", + "embedding_text_type_mode": { + "description": "查询/文档区分模式", + "hint": "auto:检索查询用 text_type=query,入库文档用 text_type=document(推荐,检索效果更好);never:不发送 text_type。多模态模型不受此开关影响。" + } + }, + "volcengine_cluster": { + "description": "火山引擎集群", + "hint": "若使用语音复刻大模型,可选volcano_icl或volcano_icl_concurr,默认使用volcano_tts" + }, + "volcengine_voice_type": { + "description": "火山引擎音色", + "hint": "输入声音id(Voice_type)" + }, + "volcengine_speed_ratio": { + "description": "语速设置", + "hint": "语速设置,范围为 0.2 到 3.0,默认值为 1.0" + }, + "volcengine_volume_ratio": { + "description": "音量设置", + "hint": "音量设置,范围为 0.0 到 2.0,默认值为 1.0" + }, + "azure_tts_voice": { + "description": "音色设置", + "hint": "API 音色" + }, + "azure_tts_style": { + "description": "风格设置", + "hint": "声音特定的讲话风格。 可以表达快乐、同情和平静等情绪。" + }, + "azure_tts_role": { + "description": "模仿设置(可选)", + "hint": "讲话角色扮演。 声音可以模仿不同的年龄和性别,但声音名称不会更改。 例如,男性语音可以提高音调和改变语调来模拟女性语音,但语音名称不会更改。 如果角色缺失或不受声音的支持,则会忽略此属性。" + }, + "azure_tts_rate": { + "description": "语速设置", + "hint": "指示文本的讲出速率。可在字词或句子层面应用语速。 速率变化应为原始音频的 0.5 到 2 倍。" + }, + "azure_tts_volume": { + "description": "语音音量设置", + "hint": "指示语音的音量级别。 可在句子层面应用音量的变化。以从 0.0 到 100.0(从最安静到最大声,例如 75)的数字表示。 默认值为 100.0。" + }, + "azure_tts_region": { + "description": "API 地区", + "hint": "Azure_TTS 处理数据所在区域,具体参考 https://learn.microsoft.com/zh-cn/azure/ai-services/speech-service/regions" + }, + "azure_tts_subscription_key": { + "description": "服务订阅密钥", + "hint": "Azure_TTS 服务的订阅密钥(注意不是令牌)" + }, + "dashscope_tts_voice": { + "description": "音色" + }, + "gm_resp_image_modal": { + "description": "启用图片模态", + "hint": "启用后,将支持返回图片内容。需要模型支持,否则会报错。具体支持模型请查看 Google Gemini 官方网站。温馨提示,如果您需要生成图片,请关闭 `启用群员识别` 配置获得更好的效果。" + }, + "gm_native_search": { + "description": "启用原生搜索功能", + "hint": "仅 Gemini 3 及以上模型支持与函数工具同时使用;Gemini 3 及以上模型的原生搜索仅限付费层级,计费规则请查阅官方文档" + }, + "gm_native_coderunner": { + "description": "启用原生代码执行器", + "hint": "仅 Gemini 3 及以上模型支持与函数工具同时使用" + }, + "gm_url_context": { + "description": "启用URL上下文功能", + "hint": "仅 Gemini 3 及以上模型支持与函数工具同时使用" + }, + "gm_safety_settings": { + "description": "安全过滤器", + "hint": "设置模型输入的内容安全过滤级别。过滤级别分类为NONE(不屏蔽)、HIGH(高风险时屏蔽)、MEDIUM_AND_ABOVE(中等风险及以上屏蔽)、LOW_AND_ABOVE(低风险及以上时屏蔽),具体参见Gemini API文档。", + "harassment": { + "description": "骚扰内容", + "hint": "负面或有害评论" + }, + "hate_speech": { + "description": "仇恨言论", + "hint": "粗鲁、无礼或亵渎性质内容" + }, + "sexually_explicit": { + "description": "露骨色情内容", + "hint": "包含性行为或其他淫秽内容的引用" + }, + "dangerous_content": { + "description": "危险内容", + "hint": "宣扬、助长或鼓励有害行为的信息" + } + }, + "gm_thinking_config": { + "description": "思考配置", + "budget": { + "description": "思考预算", + "hint": "用于指定模型推理时使用的思考 token 数量上限。参见: https://ai.google.dev/gemini-api/docs/thinking#set-budget" + }, + "level": { + "description": "思考级别", + "hint": "推荐用于 Gemini 3 及以上模型,可控制推理行为。参见: https://ai.google.dev/gemini-api/docs/thinking#thinking-levels" + } + }, + "anth_thinking_config": { + "description": "思考配置", + "type": { + "description": "思考类型", + "hint": "设为 'adaptive' 以使用自适应思考(推荐 Opus 4.6+ / Sonnet 4.6+)。留空则使用手动预算模式。参见: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking" + }, + "budget": { + "description": "思考预算", + "hint": "Anthropic thinking.budget_tokens 参数。必须 >= 1024。仅在思考类型为空时生效。Opus 4.6 / Sonnet 4.6 已弃用。参见: https://platform.claude.com/docs/en/build-with-claude/extended-thinking" + }, + "effort": { + "description": "思考深度", + "hint": "当思考类型为 'adaptive' 时控制思考深度。'high' 为默认值。'max' 仅限 Opus 4.6。参见: https://platform.claude.com/docs/en/build-with-claude/effort" + } + }, + "minimax-group-id": { + "description": "用户组", + "hint": "于账户管理->基本信息中可见" + }, + "minimax-langboost": { + "description": "指定语言/方言", + "hint": "增强对指定的小语种和方言的识别能力,设置后可以提升在指定小语种/方言场景下的语音表现" + }, + "minimax-voice-speed": { + "description": "语速", + "hint": "生成声音的语速, 取值[0.5, 2], 默认为1.0, 取值越大,语速越快" + }, + "minimax-voice-vol": { + "description": "音量", + "hint": "生成声音的音量, 取值(0, 10], 默认为1.0, 取值越大,音量越高" + }, + "minimax-voice-pitch": { + "description": "语调", + "hint": "生成声音的语调, 取值[-12, 12], 默认为0" + }, + "minimax-is-timber-weight": { + "description": "启用混合音色", + "hint": "启用混合音色, 支持以自定义权重混合最多四种音色, 启用后自动忽略单一音色设置" + }, + "minimax-timber-weight": { + "description": "混合音色", + "hint": "混合音色及其权重, 最多支持四种音色, 权重为整数, 取值[1, 100]. 可在官网API语音调试台预览代码获得预设以及编写模板, 需要严格按照json字符串格式编写, 可以查看控制台判断是否解析成功. 具体结构可参照默认值以及官网代码预览." + }, + "minimax-voice-id": { + "description": "单一音色", + "hint": "单一音色编号, 详见官网文档" + }, + "minimax-voice-emotion": { + "description": "情绪", + "hint": "控制合成语音的情绪。当为 auto 时,将根据文本内容自动选择情绪。" + }, + "minimax-voice-latex": { + "description": "支持朗读latex公式", + "hint": "朗读latex公式, 但是需要确保输入文本按官网要求格式化" + }, + "minimax-voice-english-normalization": { + "description": "支持英语文本规范化", + "hint": "可提升数字阅读场景的性能,但会略微增加延迟" + }, + "rag_options": { + "description": "RAG 选项", + "hint": "检索知识库设置, 非必填。仅 Agent 应用类型支持(智能体应用, 包括 RAG 应用)。阿里云百炼应用开启此功能后将无法多轮对话。", + "pipeline_ids": { + "description": "知识库 ID 列表", + "hint": "对指定知识库内所有文档进行检索, 前往 https://bailian.console.aliyun.com/ 数据应用->知识索引创建和获取 ID。" + }, + "file_ids": { + "description": "非结构化文档 ID, 传入该参数将对指定非结构化文档进行检索。", + "hint": "对指定非结构化文档进行检索。前往 https://bailian.console.aliyun.com/ 数据管理创建和获取 ID。" + }, + "output_reference": { + "description": "是否输出知识库/文档的引用", + "hint": "在每次回答尾部加上引用源。默认为 False。" + } + }, + "sensevoice_hint": { + "description": "部署SenseVoice", + "hint": "启用前请 pip 安装 funasr、funasr_onnx、torchaudio、torch、modelscope、jieba 库(默认使用CPU,大约下载 1 GB),并且安装 ffmpeg。否则将无法正常转文字。" + }, + "is_emotion": { + "description": "情绪识别", + "hint": "是否开启情绪识别。happy|sad|angry|neutral|fearful|disgusted|surprised|unknown" + }, + "stt_model": { + "description": "模型名称", + "hint": "modelscope 上的模型名称。默认:iic/SenseVoiceSmall。" + }, + "variables": { + "description": "工作流固定输入变量", + "hint": "可选。工作流固定输入变量,将会作为工作流的输入。也可以在对话时使用 /set 指令动态设置变量。如果变量名冲突,优先使用动态设置的变量。" + }, + "dashscope_app_type": { + "description": "应用类型", + "hint": "百炼应用的应用类型。" + }, + "timeout": { + "description": "超时时间", + "hint": "超时时间,单位为秒。" + }, + "openai-tts-voice": { + "description": "voice", + "hint": "OpenAI TTS 的声音。OpenAI 默认支持:'alloy', 'echo', 'fable', 'onyx', 'nova', 'shimmer'" + }, + "elevenlabs-tts-voice-id": { + "description": "音色 ID", + "hint": "ElevenLabs 音色 ID。可在 https://elevenlabs.io/app/voice-library 浏览并复制音色 ID。默认 'JBFqnCBsd6RMkjVDRZzb'(George)。" + }, + "elevenlabs-tts-output-format": { + "description": "输出格式", + "hint": "音频输出格式,例如 'mp3_44100_128'、'mp3_22050_32'、'wav_44100'、'opus_48000_128'。不支持裸 PCM/u-law/a-law 格式。默认 'mp3_44100_128'。" + }, + "elevenlabs-tts-stability": { + "description": "稳定性", + "hint": "音色稳定性,范围 [0, 1]。值越高越稳定,越低越富有表现力。留空则使用服务端默认值。" + }, + "elevenlabs-tts-similarity-boost": { + "description": "相似度增强", + "hint": "输出与原始音色的接近程度,范围 [0, 1]。留空则使用服务端默认值。" + }, + "elevenlabs-tts-style": { + "description": "风格夸张度", + "hint": "音色风格的夸张程度,范围 [0, 1]。值越高延迟越大。留空则使用服务端默认值。" + }, + "elevenlabs-tts-use-speaker-boost": { + "description": "说话人增强", + "hint": "增强与原始说话人的相似度,可能略微增加延迟。" + }, + "mimo-tts-voice": { + "description": "音色", + "hint": "MiMo TTS 的音色名称。可选值包括 'mimo_default'、'default_en'、'default_zh'。" + }, + "mimo-tts-format": { + "description": "输出格式", + "hint": "MiMo TTS 生成音频的格式。支持 'wav'、'mp3'、'pcm'。" + }, + "mimo-tts-style-prompt": { + "description": "风格提示词", + "hint": "会以 标签形式添加到待合成文本开头,用于控制语速、情绪、角色或风格,例如 开心、变快、孙悟空、悄悄话。可留空。" + }, + "mimo-tts-dialect": { + "description": "方言", + "hint": "会与风格提示词一起写入开头的 标签中,例如 东北话、四川话、河南话、粤语。可留空。" + }, + "mimo-tts-seed-text": { + "description": "种子文本", + "hint": "作为可选的 user 消息发送,用于辅助调节语气和风格,不会拼接到待合成文本中。" + }, + "fishaudio-tts-character": { + "description": "character", + "hint": "fishaudio TTS 的角色。默认为可莉。更多角色请访问:https://fish.audio/zh-CN/discovery" + }, + "fishaudio-tts-reference-id": { + "description": "reference_id", + "hint": "fishaudio TTS 的参考模型ID(可选)。如果填入此字段,将直接使用模型ID而不通过角色名称查询。例如:626bb6d3f3364c9cbc3aa6a67300a664。更多模型请访问:https://fish.audio/zh-CN/discovery,进入模型详情界面后可复制模型ID" + }, + "whisper_hint": { + "description": "本地部署 Whisper 模型须知", + "hint": "启用前请 pip 安装 openai-whisper 库(N卡用户大约下载 2GB,主要是 torch 和 cuda,CPU 用户大约下载 1 GB),并且安装 ffmpeg。否则将无法正常转文字。" + }, + "whisper_device": { + "description": "推理设备", + "hint": "Whisper 推理设备。Apple Silicon 可选 mps;其他环境建议使用 cpu。若指定 mps 但当前环境不可用,将自动回退到 cpu。" + }, + "id": { + "description": "ID" + }, + "type": { + "description": "模型提供商种类" + }, + "provider_type": { + "description": "模型提供商能力种类" + }, + "enable": { + "description": "启用" + }, + "key": { + "description": "API Key" + }, + "api_base": { + "description": "API Base URL" + }, + "total_timeout": { + "description": "总超时时间", + "hint": "单次决策请求的总超时时间(秒),包含等待并发名额、重试与退避;默认 5 秒。" + }, + "max_concurrency": { + "description": "最大并发数", + "hint": "该提供商同时进行的决策请求上限;默认 4。" + }, + "proxy": { + "description": "代理地址", + "hint": "HTTP/HTTPS 代理地址,格式如 http://127.0.0.1:7890。仅对该提供商的 API 请求生效,不影响 Docker 内网通信。" + }, + "model": { + "description": "模型 ID", + "hint": "模型名称,如 gpt-4o-mini, deepseek-chat。" + }, + "max_context_tokens": { + "description": "模型上下文窗口大小", + "hint": "模型最大上下文 Token 大小。如果为 0,则会自动从模型元数据填充(如有)。" + }, + "dify_api_key": { + "description": "API Key", + "hint": "Dify API Key。此项必填。" + }, + "dify_api_base": { + "description": "API Base URL", + "hint": "Dify API Base URL。默认为 https://api.dify.ai/v1" + }, + "dify_api_type": { + "description": "Dify 应用类型", + "hint": "Dify API 类型。根据 Dify 官网,目前支持 chat, chatflow, agent, workflow 三种应用类型。" + }, + "dify_workflow_output_key": { + "description": "Dify Workflow 输出变量名", + "hint": "Dify Workflow 输出变量名。当应用类型为 workflow 时才使用。默认为 astrbot_wf_output。" + }, + "dify_query_input_key": { + "description": "Prompt 输入变量名", + "hint": "发送的消息文本内容对应的输入变量名。默认为 astrbot_text_query。" + }, + "coze_api_key": { + "description": "Coze API Key", + "hint": "Coze API 密钥,用于访问 Coze 服务。" + }, + "bot_id": { + "description": "Bot ID", + "hint": "Coze 机器人的 ID,在 Coze 平台上创建机器人后获得。" + }, + "coze_api_base": { + "description": "API Base URL", + "hint": "Coze API 的基础 URL 地址,默认为 https://api.coze.cn" + }, + "deerflow_api_base": { + "description": "API Base URL", + "hint": "DeerFlow API 网关地址,默认为 http://127.0.0.1:2026" + }, + "deerflow_api_key": { + "description": "DeerFlow API Key", + "hint": "可选。若 DeerFlow 网关配置了 Bearer 鉴权,则在此填写。" + }, + "deerflow_auth_header": { + "description": "Authorization Header", + "hint": "可选。自定义 Authorization 请求头,优先级高于 DeerFlow API Key。" + }, + "deerflow_assistant_id": { + "description": "Assistant ID", + "hint": "DeerFlow 2.0 LangGraph assistant_id,默认为 lead_agent。" + }, + "deerflow_model_name": { + "description": "模型名称覆盖", + "hint": "可选。覆盖 DeerFlow 默认模型(对应运行时 configurable 的 model_name)。" + }, + "deerflow_thinking_enabled": { + "description": "启用思考模式" + }, + "deerflow_plan_mode": { + "description": "启用计划模式", + "hint": "对应 DeerFlow 2.0 运行时 configurable 的 is_plan_mode。" + }, + "deerflow_subagent_enabled": { + "description": "启用子智能体", + "hint": "对应 DeerFlow 2.0 运行时 configurable 的 subagent_enabled。" + }, + "deerflow_max_concurrent_subagents": { + "description": "子智能体最大并发数", + "hint": "对应 DeerFlow 2.0 运行时 configurable 的 max_concurrent_subagents。仅在启用子智能体时生效,默认 3。" + }, + "deerflow_recursion_limit": { + "description": "递归深度上限", + "hint": "对应 LangGraph recursion_limit。" + }, + "auto_save_history": { + "description": "由 Coze 管理对话记录", + "hint": "启用后,将由 Coze 进行对话历史记录管理, 此时 AstrBot 本地保存的上下文不会生效(仅供浏览), 对 AstrBot 的上下文进行的操作也不会生效。如果为禁用, 则使用 AstrBot 管理上下文。" + } + } + }, + "help": { + "documentation": "官方文档", + "support": "加群询问", + "helpText": "不了解配置?请见 {documentation} 或 {support}。", + "helpPrefix": "不了解配置?请见", + "helpMiddle": "或", + "helpSuffix": "。" + } +} diff --git a/tests/test_embedding_task_types.py b/tests/test_embedding_task_types.py new file mode 100644 index 00000000000..7c980fc0a54 --- /dev/null +++ b/tests/test_embedding_task_types.py @@ -0,0 +1,164 @@ +"""DashScope / NVIDIA Embedding 的非对称检索任务类型测试。 + +两家都需要区分查询与文档侧的编码模式,否则检索区分度下降: + +- DashScope: ``text_type`` = ``query`` / ``document`` +- NVIDIA: ``input_type`` = ``query`` / ``passage`` +""" + +from unittest.mock import patch + +import pytest + +from astrbot.core.provider.sources.dashscope_embedding_source import ( + DashScopeEmbeddingProvider, +) +from astrbot.core.provider.sources.nvidia_embedding_source import ( + NvidiaEmbeddingProvider, +) + +# ── DashScope ─────────────────────────────────────────────── + + +def _make_dashscope(**overrides) -> DashScopeEmbeddingProvider: + provider = DashScopeEmbeddingProvider.__new__(DashScopeEmbeddingProvider) + provider.provider_config = { + "embedding_api_key": "test-key", + "embedding_model": "text-embedding-v4", + "embedding_dimensions": 1024, + **overrides, + } + provider.api_key = "test-key" + provider.base_url = "https://dashscope.aliyuncs.com/api/v1" + provider.model = overrides.get("embedding_model", "text-embedding-v4") + provider.request_headers = {} + provider.text_type_mode = overrides.get("embedding_text_type_mode", "auto") + return provider + + +class _FakeResp: + def __init__(self) -> None: + self.status_code = 200 + self.output = {"embeddings": [{"text_index": 0, "embedding": [0.1, 0.2]}]} + + +@pytest.mark.asyncio +async def test_dashscope_sends_query_text_type_for_retrieval(): + provider = _make_dashscope() + captured: list[dict] = [] + + def fake_call(**kwargs): + captured.append(kwargs) + return _FakeResp() + + with patch( + "astrbot.core.provider.sources.dashscope_embedding_source.TextEmbedding" + ) as mock_te: + mock_te.call.side_effect = fake_call + await provider.get_query_embedding("查询词") + + assert captured[0]["text_type"] == "query" + + +@pytest.mark.asyncio +async def test_dashscope_sends_document_text_type_for_indexing(): + provider = _make_dashscope() + captured: list[dict] = [] + + def fake_call(**kwargs): + captured.append(kwargs) + return _FakeResp() + + with patch( + "astrbot.core.provider.sources.dashscope_embedding_source.TextEmbedding" + ) as mock_te: + mock_te.call.side_effect = fake_call + await provider.get_embedding("文档正文") + await provider.get_embeddings(["甲", "乙"]) + + assert captured[0]["text_type"] == "document" + assert captured[1]["text_type"] == "document" + + +@pytest.mark.asyncio +async def test_dashscope_never_mode_omits_text_type(): + provider = _make_dashscope(embedding_text_type_mode="never") + captured: list[dict] = [] + + def fake_call(**kwargs): + captured.append(kwargs) + return _FakeResp() + + with patch( + "astrbot.core.provider.sources.dashscope_embedding_source.TextEmbedding" + ) as mock_te: + mock_te.call.side_effect = fake_call + await provider.get_query_embedding("查询词") + + assert "text_type" not in captured[0] + + +@pytest.mark.asyncio +async def test_dashscope_multimodal_does_not_send_text_type(): + """多模态端点不接受 text_type 参数。""" + provider = _make_dashscope(embedding_model="qwen3-vl-embedding") + captured: list[dict] = [] + + def fake_call(**kwargs): + captured.append(kwargs) + return _FakeResp() + + with patch( + "astrbot.core.provider.sources.dashscope_embedding_source.MultiModalEmbedding" + ) as mock_mm: + mock_mm.call.side_effect = fake_call + await provider.get_query_embedding("查询词") + + assert "text_type" not in captured[0] + + +def test_dashscope_invalid_mode_falls_back_to_auto(): + provider = _make_dashscope(embedding_text_type_mode="bogus") + # __init__ 会校验并回退;这里直接验证判定函数的结果 + provider.text_type_mode = "auto" + assert provider._should_send_text_type() is True + + +# ── NVIDIA ────────────────────────────────────────────────── + + +def _make_nvidia(**overrides) -> NvidiaEmbeddingProvider: + provider = NvidiaEmbeddingProvider.__new__(NvidiaEmbeddingProvider) + provider.provider_config = { + "embedding_api_key": "test-key", + "embedding_model": "nvidia/nemotron-3-embed-1b", + "input_type": "passage", + "query_input_type": "query", + "embedding_dimensions": 2048, + **overrides, + } + provider.api_key = "test-key" + provider.base_url = "https://integrate.api.nvidia.com/v1" + provider.model = overrides.get("embedding_model", "nvidia/nemotron-3-embed-1b") + provider.input_type = overrides.get("input_type", "passage") + provider.query_input_type = overrides.get("query_input_type", "query") + provider.request_headers = {} + provider.proxy = "" + provider.client = None + return provider + + +def test_nvidia_payload_uses_query_input_type_for_query(): + provider = _make_nvidia() + payload = provider._build_payload(["q"], input_type=provider.query_input_type) + assert payload["input_type"] == "query" + + +def test_nvidia_payload_defaults_to_passage_for_documents(): + provider = _make_nvidia() + assert provider._build_payload(["d"])["input_type"] == "passage" + + +def test_nvidia_payload_allows_custom_query_input_type(): + provider = _make_nvidia(query_input_type="query") + assert provider._build_payload(["q"], input_type="query")["input_type"] == "query"