AstrBot 3.5.26__tar.gz → 4.0.0b2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {astrbot-3.5.26 → astrbot-4.0.0b2}/PKG-INFO +4 -1
- astrbot-4.0.0b2/astrbot/api/__init__.py +20 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/__init__.py +1 -2
- astrbot-4.0.0b2/astrbot/core/agent/agent.py +13 -0
- astrbot-4.0.0b2/astrbot/core/agent/handoff.py +34 -0
- astrbot-4.0.0b2/astrbot/core/agent/hooks.py +27 -0
- astrbot-4.0.0b2/astrbot/core/agent/mcp_client.py +208 -0
- astrbot-4.0.0b2/astrbot/core/agent/response.py +12 -0
- astrbot-4.0.0b2/astrbot/core/agent/run_context.py +17 -0
- astrbot-4.0.0b2/astrbot/core/agent/runners/__init__.py +3 -0
- {astrbot-3.5.26/astrbot/core/pipeline/process_stage/agent_runner → astrbot-4.0.0b2/astrbot/core/agent/runners}/base.py +20 -19
- astrbot-3.5.26/astrbot/core/pipeline/process_stage/agent_runner/tool_loop_agent.py → astrbot-4.0.0b2/astrbot/core/agent/runners/tool_loop_agent_runner.py +126 -98
- astrbot-4.0.0b2/astrbot/core/agent/tool.py +256 -0
- astrbot-4.0.0b2/astrbot/core/agent/tool_executor.py +11 -0
- astrbot-4.0.0b2/astrbot/core/astr_agent_context.py +11 -0
- astrbot-4.0.0b2/astrbot/core/astrbot_config_mgr.py +276 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/config/default.py +598 -239
- astrbot-4.0.0b2/astrbot/core/conversation_mgr.py +297 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/core_lifecycle.py +66 -9
- astrbot-4.0.0b2/astrbot/core/db/__init__.py +284 -0
- astrbot-4.0.0b2/astrbot/core/db/migration/helper.py +64 -0
- astrbot-4.0.0b2/astrbot/core/db/migration/migra_3_to_4.py +338 -0
- astrbot-3.5.26/astrbot/core/utils/shared_preferences.py → astrbot-4.0.0b2/astrbot/core/db/migration/shared_preferences_v3.py +3 -1
- astrbot-3.5.26/astrbot/core/db/sqlite.py → astrbot-4.0.0b2/astrbot/core/db/migration/sqlite_v3.py +78 -152
- astrbot-4.0.0b2/astrbot/core/db/po.py +244 -0
- astrbot-4.0.0b2/astrbot/core/db/sqlite.py +542 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/db/vec_db/faiss_impl/vec_db.py +28 -5
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/event_bus.py +21 -19
- astrbot-4.0.0b2/astrbot/core/persona_mgr.py +183 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/pipeline/__init__.py +0 -3
- astrbot-4.0.0b2/astrbot/core/pipeline/context.py +15 -0
- astrbot-4.0.0b2/astrbot/core/pipeline/context_utils.py +98 -0
- astrbot-4.0.0b2/astrbot/core/pipeline/process_stage/method/llm_request.py +590 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/pipeline/process_stage/method/star_request.py +2 -12
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/pipeline/respond/stage.py +2 -2
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/pipeline/result_decorate/stage.py +5 -4
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/pipeline/scheduler.py +9 -8
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/pipeline/stage.py +3 -3
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/pipeline/waking_check/stage.py +10 -1
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/astr_message_event.py +15 -17
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/manager.py +3 -0
- astrbot-4.0.0b2/astrbot/core/platform/message_session.py +28 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/platform.py +1 -1
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/platform_metadata.py +1 -1
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/sources/webchat/webchat_adapter.py +1 -1
- astrbot-4.0.0b2/astrbot/core/platform_message_history_mgr.py +47 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/provider/entities.py +10 -2
- astrbot-4.0.0b2/astrbot/core/provider/func_tool_manager.py +570 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/provider/manager.py +115 -94
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/provider/provider.py +25 -16
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/provider/sources/dashscope_source.py +1 -2
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/provider/sources/dify_source.py +1 -2
- astrbot-4.0.0b2/astrbot/core/provider/sources/vllm_rerank_source.py +59 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/star/__init__.py +1 -1
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/star/context.py +73 -78
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/star/register/__init__.py +2 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/star/register/star_handler.py +67 -5
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/star/session_llm_manager.py +42 -85
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/star/session_plugin_manager.py +12 -4
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/star/star.py +0 -24
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/star/star_handler.py +17 -33
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/star/star_manager.py +33 -51
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/utils/metrics.py +4 -3
- astrbot-4.0.0b2/astrbot/core/utils/shared_preferences.py +180 -0
- astrbot-4.0.0b2/astrbot/core/utils/t2i/network_strategy.py +135 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/utils/t2i/renderer.py +2 -4
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/dashboard/routes/__init__.py +3 -2
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/dashboard/routes/chat.py +83 -53
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/dashboard/routes/config.py +263 -71
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/dashboard/routes/conversation.py +26 -12
- astrbot-4.0.0b2/astrbot/dashboard/routes/persona.py +199 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/dashboard/routes/plugin.py +0 -105
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/dashboard/routes/route.py +6 -4
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/dashboard/routes/session_management.py +35 -199
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/dashboard/routes/stat.py +5 -1
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/dashboard/routes/tools.py +65 -65
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/dashboard/routes/update.py +17 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/dashboard/server.py +3 -0
- astrbot-4.0.0b2/changelogs/v4.0.0-beta.1.md +3 -0
- astrbot-4.0.0b2/changelogs/v4.0.0-beta.2.md +1 -0
- astrbot-4.0.0b2/dashboard/src/assets/images/astrbot_banner.png +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/components/shared/AstrBotConfig.vue +106 -7
- astrbot-4.0.0b2/dashboard/src/components/shared/AstrBotConfigV4.vue +456 -0
- astrbot-4.0.0b2/dashboard/src/components/shared/KnowledgeBaseSelector.vue +225 -0
- astrbot-4.0.0b2/dashboard/src/components/shared/ListConfigItem.vue +216 -0
- astrbot-4.0.0b2/dashboard/src/components/shared/MigrationDialog.vue +275 -0
- astrbot-4.0.0b2/dashboard/src/components/shared/PersonaSelector.vue +152 -0
- astrbot-4.0.0b2/dashboard/src/components/shared/PluginSetSelector.vue +226 -0
- astrbot-4.0.0b2/dashboard/src/components/shared/ProviderSelector.vue +167 -0
- astrbot-4.0.0b2/dashboard/src/components/shared/T2ITemplateEditor.vue +307 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/loader.ts +2 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/en-US/core/navigation.json +2 -1
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/en-US/features/alkaid/knowledge-base.json +36 -18
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/en-US/features/extension.json +0 -15
- astrbot-4.0.0b2/dashboard/src/i18n/locales/en-US/features/migration.json +16 -0
- astrbot-4.0.0b2/dashboard/src/i18n/locales/en-US/features/persona.json +67 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/en-US/features/provider.json +4 -2
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/en-US/features/settings.json +5 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/en-US/features/tool-use.json +8 -3
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/zh-CN/core/navigation.json +4 -3
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/zh-CN/features/alkaid/knowledge-base.json +37 -19
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/zh-CN/features/config.json +5 -1
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/zh-CN/features/extension.json +0 -15
- astrbot-4.0.0b2/dashboard/src/i18n/locales/zh-CN/features/migration.json +16 -0
- astrbot-4.0.0b2/dashboard/src/i18n/locales/zh-CN/features/persona.json +67 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/zh-CN/features/provider.json +5 -2
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/zh-CN/features/settings.json +5 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/zh-CN/features/tool-use.json +46 -5
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/translations.ts +10 -2
- astrbot-4.0.0b2/dashboard/src/layouts/full/FullLayout.vue +59 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/layouts/full/vertical-header/VerticalHeader.vue +3 -1
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/layouts/full/vertical-sidebar/VerticalSidebar.vue +1 -2
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/layouts/full/vertical-sidebar/sidebarItem.ts +13 -14
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/router/MainRoutes.ts +30 -20
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/scss/components/_VTextField.scss +4 -14
- astrbot-4.0.0b2/dashboard/src/views/AboutPage.vue +40 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/views/ChatPage.vue +69 -57
- astrbot-4.0.0b2/dashboard/src/views/ConfigPage.vue +1166 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/views/ExtensionPage.vue +11 -197
- astrbot-4.0.0b2/dashboard/src/views/PersonaPage.vue +808 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/views/PlatformPage.vue +0 -5
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/views/ProviderPage.vue +28 -94
- astrbot-4.0.0b2/dashboard/src/views/Settings.vue +61 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/views/ToolUsePage.vue +192 -414
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/views/alkaid/KnowledgeBase.vue +541 -94
- {astrbot-3.5.26 → astrbot-4.0.0b2}/packages/astrbot/long_term_memory.py +54 -35
- {astrbot-3.5.26 → astrbot-4.0.0b2}/packages/astrbot/main.py +112 -112
- {astrbot-3.5.26 → astrbot-4.0.0b2}/packages/session_controller/main.py +8 -7
- {astrbot-3.5.26 → astrbot-4.0.0b2}/packages/thinking_filter/main.py +4 -6
- astrbot-4.0.0b2/packages/web_searcher/main.py +352 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/pyproject.toml +4 -1
- {astrbot-3.5.26 → astrbot-4.0.0b2}/requirements.txt +4 -1
- astrbot-3.5.26/astrbot/api/__init__.py +0 -7
- astrbot-3.5.26/astrbot/core/conversation_mgr.py +0 -209
- astrbot-3.5.26/astrbot/core/db/__init__.py +0 -161
- astrbot-3.5.26/astrbot/core/db/po.py +0 -89
- astrbot-3.5.26/astrbot/core/db/sqlite_init.sql +0 -50
- astrbot-3.5.26/astrbot/core/pipeline/context.py +0 -113
- astrbot-3.5.26/astrbot/core/pipeline/platform_compatibility/stage.py +0 -56
- astrbot-3.5.26/astrbot/core/pipeline/process_stage/method/llm_request.py +0 -373
- astrbot-3.5.26/astrbot/core/provider/func_tool_manager.py +0 -758
- astrbot-3.5.26/astrbot/core/utils/t2i/network_strategy.py +0 -81
- astrbot-3.5.26/dashboard/src/assets/images/logo-normal.svg +0 -40
- astrbot-3.5.26/dashboard/src/assets/images/logo-waifu.png +0 -0
- astrbot-3.5.26/dashboard/src/components/shared/ListConfigItem.vue +0 -135
- astrbot-3.5.26/dashboard/src/layouts/full/FullLayout.vue +0 -25
- astrbot-3.5.26/dashboard/src/views/AboutPage.vue +0 -244
- astrbot-3.5.26/dashboard/src/views/AlkaidPage_sigma.vue +0 -438
- astrbot-3.5.26/dashboard/src/views/ConfigPage.vue +0 -280
- astrbot-3.5.26/dashboard/src/views/Settings.vue +0 -48
- astrbot-3.5.26/packages/web_searcher/main.py +0 -150
- astrbot-3.5.26/uv.lock +0 -2748
- {astrbot-3.5.26 → astrbot-4.0.0b2}/.dockerignore +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/.github/FUNDING.yml +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/.github/ISSUE_TEMPLATE/PLUGIN_PUBLISH.yml +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/.github/ISSUE_TEMPLATE/bug-report.yml +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/.github/ISSUE_TEMPLATE/feature-request.yml +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/.github/copilot-instructions.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/.github/dependabot.yml +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/.github/workflows/auto_release.yml +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/.github/workflows/codeql.yml +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/.github/workflows/coverage_test.yml +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/.github/workflows/dashboard_ci.yml +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/.github/workflows/docker-image.yml +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/.github/workflows/stale.yml +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/.gitignore +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/.pre-commit-config.yaml +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/.python-version +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/CODE_OF_CONDUCT.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/Dockerfile +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/Dockerfile_with_node +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/LICENSE +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/README.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/README_en.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/README_ja.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/__init__.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/api/all.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/api/event/__init__.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/api/event/filter/__init__.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/api/message_components.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/api/platform/__init__.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/api/provider/__init__.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/api/star/__init__.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/api/util/__init__.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/cli/__init__.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/cli/__main__.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/cli/commands/__init__.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/cli/commands/cmd_conf.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/cli/commands/cmd_init.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/cli/commands/cmd_plug.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/cli/commands/cmd_run.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/cli/utils/__init__.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/cli/utils/basic.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/cli/utils/plugin.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/cli/utils/version_comparator.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/config/__init__.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/config/astrbot_config.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/db/vec_db/base.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/db/vec_db/faiss_impl/__init__.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/db/vec_db/faiss_impl/document_storage.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/db/vec_db/faiss_impl/embedding_storage.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/db/vec_db/faiss_impl/sqlite_init.sql +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/file_token_service.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/initial_loader.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/log.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/message/components.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/message/message_event_result.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/pipeline/content_safety_check/stage.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/pipeline/content_safety_check/strategies/__init__.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/pipeline/content_safety_check/strategies/baidu_aip.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/pipeline/content_safety_check/strategies/keywords.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/pipeline/content_safety_check/strategies/strategy.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/pipeline/preprocess_stage/stage.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/pipeline/process_stage/stage.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/pipeline/rate_limit_check/stage.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/pipeline/session_status_check/stage.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/pipeline/whitelist_check/stage.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/__init__.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/astrbot_message.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/message_type.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/register.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/sources/aiocqhttp/aiocqhttp_message_event.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/sources/aiocqhttp/aiocqhttp_platform_adapter.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/sources/dingtalk/dingtalk_adapter.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/sources/dingtalk/dingtalk_event.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/sources/discord/client.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/sources/discord/components.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/sources/discord/discord_platform_adapter.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/sources/discord/discord_platform_event.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/sources/lark/lark_adapter.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/sources/lark/lark_event.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/sources/qqofficial/qqofficial_message_event.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/sources/qqofficial/qqofficial_platform_adapter.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/sources/qqofficial_webhook/qo_webhook_adapter.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/sources/qqofficial_webhook/qo_webhook_event.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/sources/qqofficial_webhook/qo_webhook_server.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/sources/slack/client.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/sources/slack/slack_adapter.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/sources/slack/slack_event.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/sources/telegram/tg_adapter.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/sources/telegram/tg_event.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/sources/webchat/webchat_event.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/sources/webchat/webchat_queue_mgr.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/sources/wechatpadpro/wechatpadpro_adapter.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/sources/wechatpadpro/wechatpadpro_message_event.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/sources/wechatpadpro/xml_data_parser.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/sources/wecom/wecom_adapter.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/sources/wecom/wecom_event.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/sources/wecom/wecom_kf.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/sources/wecom/wecom_kf_message.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/sources/weixin_official_account/weixin_offacc_adapter.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/sources/weixin_official_account/weixin_offacc_event.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/provider/__init__.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/provider/entites.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/provider/register.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/provider/sources/anthropic_source.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/provider/sources/azure_tts_source.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/provider/sources/dashscope_tts.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/provider/sources/edge_tts_source.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/provider/sources/fishaudio_tts_api_source.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/provider/sources/gemini_embedding_source.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/provider/sources/gemini_source.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/provider/sources/gemini_tts_source.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/provider/sources/gsv_selfhosted_source.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/provider/sources/gsvi_tts_source.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/provider/sources/minimax_tts_api_source.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/provider/sources/openai_embedding_source.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/provider/sources/openai_source.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/provider/sources/openai_tts_api_source.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/provider/sources/sensevoice_selfhosted_source.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/provider/sources/volcengine_tts.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/provider/sources/whisper_api_source.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/provider/sources/whisper_selfhosted_source.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/provider/sources/zhipu_source.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/star/README.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/star/config.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/star/filter/__init__.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/star/filter/command.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/star/filter/command_group.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/star/filter/custom_filter.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/star/filter/event_message_type.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/star/filter/permission.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/star/filter/platform_adapter_type.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/star/filter/regex.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/star/register/star.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/star/star_tools.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/star/updator.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/updator.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/utils/astrbot_path.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/utils/command_parser.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/utils/dify_api_client.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/utils/io.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/utils/log_pipe.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/utils/path_util.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/utils/pip_installer.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/utils/session_lock.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/utils/session_waiter.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/utils/t2i/__init__.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/utils/t2i/local_strategy.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/utils/t2i/template/base.html +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/utils/tencent_record_helper.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/utils/version_comparator.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/zip_updator.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/dashboard/routes/auth.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/dashboard/routes/file.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/dashboard/routes/log.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/dashboard/routes/static_file.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.0.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.1.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.10.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.11.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.12.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.13.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.14.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.15.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.16.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.17.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.18.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.19.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.20.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.21.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.22.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.23.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.24.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.25.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.26.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.27.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.28.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.29.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.3.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.30.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.31.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.32.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.33.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.35.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.36.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.37.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.38.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.39.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.4.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.5.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.6.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.7.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.8.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.9.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.5.0.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.5.1.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.5.10.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.5.11.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.5.12.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.5.13.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.5.14.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.5.15.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.5.16.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.5.17.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.5.18.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.5.19.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.5.2.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.5.20.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.5.21.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.5.22.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.5.23.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.5.24.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.5.25.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.5.26.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.5.3.1.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.5.3.2.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.5.3.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.5.4.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.5.5.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.5.6.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.5.7.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.5.8.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.5.9.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/compose.yml +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/.gitignore +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/LICENSE +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/README.md +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/env.d.ts +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/index.html +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/public/_redirects +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/public/favicon.svg +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/App.vue +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/assets/images/astrbot_logo_mini.webp +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/assets/images/platform_logos/dingtalk.svg +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/assets/images/platform_logos/discord.svg +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/assets/images/platform_logos/kook.png +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/assets/images/platform_logos/lark.png +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/assets/images/platform_logos/qq.png +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/assets/images/platform_logos/slack.svg +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/assets/images/platform_logos/telegram.svg +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/assets/images/platform_logos/vocechat.png +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/assets/images/platform_logos/wechat.png +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/assets/images/platform_logos/wecom.png +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/components/ConfirmDialog.vue +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/components/chat/ProviderModelSelector.vue +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/components/shared/ConsoleDisplayer.vue +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/components/shared/ExtensionCard.vue +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/components/shared/ItemCard.vue +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/components/shared/ItemCardGrid.vue +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/components/shared/LanguageSwitcher.vue +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/components/shared/Logo.vue +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/components/shared/ProxySelector.vue +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/components/shared/ReadmeDialog.vue +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/components/shared/UiParentCard.vue +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/components/shared/WaitingForRestart.vue +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/config.ts +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/composables.ts +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/en-US/core/actions.json +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/en-US/core/common.json +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/en-US/core/header.json +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/en-US/core/status.json +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/en-US/features/about.json +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/en-US/features/alkaid/index.json +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/en-US/features/alkaid/memory.json +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/en-US/features/auth.json +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/en-US/features/chart.json +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/en-US/features/chat.json +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/en-US/features/config.json +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/en-US/features/console.json +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/en-US/features/conversation.json +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/en-US/features/dashboard.json +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/en-US/features/platform.json +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/en-US/features/session-management.json +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/en-US/messages/errors.json +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/en-US/messages/success.json +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/en-US/messages/validation.json +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/zh-CN/core/actions.json +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/zh-CN/core/common.json +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/zh-CN/core/header.json +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/zh-CN/core/status.json +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/zh-CN/features/about.json +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/zh-CN/features/alkaid/index.json +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/zh-CN/features/alkaid/memory.json +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/zh-CN/features/auth.json +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/zh-CN/features/chart.json +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/zh-CN/features/chat.json +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/zh-CN/features/console.json +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/zh-CN/features/conversation.json +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/zh-CN/features/dashboard.json +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/zh-CN/features/platform.json +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/zh-CN/features/session-management.json +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/zh-CN/messages/errors.json +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/zh-CN/messages/success.json +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/zh-CN/messages/validation.json +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/tools/index.ts +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/types.ts +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/validator.ts +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/layouts/blank/BlankLayout.vue +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/layouts/full/vertical-sidebar/NavItem.vue +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/main.ts +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/plugins/confirmPlugin.ts +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/plugins/vuetify.ts +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/router/AuthRoutes.ts +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/router/ChatBoxRoutes.ts +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/router/index.ts +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/scss/_override.scss +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/scss/_variables.scss +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/scss/components/_VButtons.scss +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/scss/components/_VCard.scss +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/scss/components/_VField.scss +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/scss/components/_VInput.scss +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/scss/components/_VNavigationDrawer.scss +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/scss/components/_VScrollbar.scss +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/scss/components/_VShadow.scss +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/scss/components/_VTabs.scss +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/scss/layout/_container.scss +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/scss/layout/_sidebar.scss +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/scss/pages/_dashboards.scss +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/scss/style.scss +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/stores/auth.ts +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/stores/common.js +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/stores/customizer.ts +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/theme/DarkTheme.ts +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/theme/LightTheme.ts +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/types/themeTypes/ThemeType.ts +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/types/vue3-print-nb.d.ts +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/types/vue_tabler_icon.d.ts +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/views/AlkaidPage.vue +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/views/ChatBoxPage.vue +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/views/ConsolePage.vue +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/views/ConversationPage.vue +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/views/SessionManagementPage.vue +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/views/alkaid/LongTermMemory.vue +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/views/alkaid/Other.vue +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/views/authentication/auth/LoginPage.vue +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/views/authentication/authForms/AuthLogin.vue +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/views/dashboards/default/DefaultDashboard.vue +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/views/dashboards/default/components/MemoryUsage.vue +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/views/dashboards/default/components/MessageStat.vue +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/views/dashboards/default/components/OnlinePlatform.vue +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/views/dashboards/default/components/OnlineTime.vue +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/views/dashboards/default/components/PlatformStat.vue +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/views/dashboards/default/components/RunningTime.vue +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/views/dashboards/default/components/TotalMessage.vue +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/tsconfig.json +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/tsconfig.vite-config.json +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/vite.config.ts +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/main.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/packages/astrbot/metadata.yaml +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/packages/python_interpreter/main.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/packages/python_interpreter/metadata.yaml +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/packages/python_interpreter/requirements.txt +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/packages/python_interpreter/shared/api.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/packages/reminder/main.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/packages/reminder/metadata.yaml +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/packages/session_controller/metadata.yaml +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/packages/thinking_filter/metadata.yaml +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/packages/web_searcher/engines/__init__.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/packages/web_searcher/engines/bing.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/packages/web_searcher/engines/google.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/packages/web_searcher/engines/sogo.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/packages/web_searcher/metadata.yaml +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/samples/stt_health_check.wav +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/tests/test_dashboard.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/tests/test_main.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/tests/test_pipeline.py +0 -0
- {astrbot-3.5.26 → astrbot-4.0.0b2}/tests/test_plugin_manager.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: AstrBot
|
|
3
|
-
Version:
|
|
3
|
+
Version: 4.0.0b2
|
|
4
4
|
Summary: 易上手的多平台 LLM 聊天机器人及开发框架
|
|
5
5
|
License-File: LICENSE
|
|
6
6
|
Requires-Python: >=3.10
|
|
@@ -17,6 +17,7 @@ Requires-Dist: colorlog>=6.9.0
|
|
|
17
17
|
Requires-Dist: cryptography>=44.0.3
|
|
18
18
|
Requires-Dist: dashscope>=1.23.2
|
|
19
19
|
Requires-Dist: defusedxml>=0.7.1
|
|
20
|
+
Requires-Dist: deprecated>=1.2.18
|
|
20
21
|
Requires-Dist: dingtalk-stream>=0.22.1
|
|
21
22
|
Requires-Dist: docstring-parser>=0.16
|
|
22
23
|
Requires-Dist: faiss-cpu>=1.10.0
|
|
@@ -41,6 +42,8 @@ Requires-Dist: quart>=0.20.0
|
|
|
41
42
|
Requires-Dist: readability-lxml>=0.8.4.1
|
|
42
43
|
Requires-Dist: silk-python>=0.2.6
|
|
43
44
|
Requires-Dist: slack-sdk>=3.35.0
|
|
45
|
+
Requires-Dist: sqlalchemy[asyncio]>=2.0.41
|
|
46
|
+
Requires-Dist: sqlmodel>=0.0.24
|
|
44
47
|
Requires-Dist: telegramify-markdown>=0.5.1
|
|
45
48
|
Requires-Dist: watchfiles>=1.0.5
|
|
46
49
|
Requires-Dist: websockets>=15.0.1
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
from astrbot.core.config.astrbot_config import AstrBotConfig
|
|
2
|
+
from astrbot import logger
|
|
3
|
+
from astrbot.core import html_renderer
|
|
4
|
+
from astrbot.core import sp
|
|
5
|
+
from astrbot.core.star.register import register_llm_tool as llm_tool
|
|
6
|
+
from astrbot.core.star.register import register_agent as agent
|
|
7
|
+
from astrbot.core.agent.tool import ToolSet, FunctionTool
|
|
8
|
+
from astrbot.core.agent.tool_executor import BaseFunctionToolExecutor
|
|
9
|
+
|
|
10
|
+
__all__ = [
|
|
11
|
+
"AstrBotConfig",
|
|
12
|
+
"logger",
|
|
13
|
+
"html_renderer",
|
|
14
|
+
"llm_tool",
|
|
15
|
+
"agent",
|
|
16
|
+
"sp",
|
|
17
|
+
"ToolSet",
|
|
18
|
+
"FunctionTool",
|
|
19
|
+
"BaseFunctionToolExecutor",
|
|
20
|
+
]
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import os
|
|
2
|
-
import asyncio
|
|
3
2
|
from .log import LogManager, LogBroker # noqa
|
|
4
3
|
from astrbot.core.utils.t2i.renderer import HtmlRenderer
|
|
5
4
|
from astrbot.core.utils.shared_preferences import SharedPreferences
|
|
@@ -21,7 +20,7 @@ html_renderer = HtmlRenderer(t2i_base_url)
|
|
|
21
20
|
logger = LogManager.GetLogger(log_name="astrbot")
|
|
22
21
|
db_helper = SQLiteDatabase(DB_PATH)
|
|
23
22
|
# 简单的偏好设置存储, 这里后续应该存储到数据库中, 一些部分可以存储到配置中
|
|
24
|
-
sp = SharedPreferences()
|
|
23
|
+
sp = SharedPreferences(db_helper=db_helper)
|
|
25
24
|
# 文件令牌服务
|
|
26
25
|
file_token_service = FileTokenService()
|
|
27
26
|
pip_installer = PipInstaller(
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
from dataclasses import dataclass
|
|
2
|
+
from .tool import FunctionTool
|
|
3
|
+
from typing import Generic
|
|
4
|
+
from .run_context import TContext
|
|
5
|
+
from .hooks import BaseAgentRunHooks
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
@dataclass
|
|
9
|
+
class Agent(Generic[TContext]):
|
|
10
|
+
name: str
|
|
11
|
+
instructions: str | None = None
|
|
12
|
+
tools: list[str, FunctionTool] | None = None
|
|
13
|
+
run_hooks: BaseAgentRunHooks[TContext] | None = None
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
from typing import Generic
|
|
2
|
+
from .tool import FunctionTool
|
|
3
|
+
from .agent import Agent
|
|
4
|
+
from .run_context import TContext
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class HandoffTool(FunctionTool, Generic[TContext]):
|
|
8
|
+
"""Handoff tool for delegating tasks to another agent."""
|
|
9
|
+
|
|
10
|
+
def __init__(
|
|
11
|
+
self, agent: Agent[TContext], parameters: dict | None = None, **kwargs
|
|
12
|
+
):
|
|
13
|
+
self.agent = agent
|
|
14
|
+
super().__init__(
|
|
15
|
+
name=f"transfer_to_{agent.name}",
|
|
16
|
+
parameters=parameters or self.default_parameters(),
|
|
17
|
+
description=agent.instructions or self.default_description(agent.name),
|
|
18
|
+
**kwargs,
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
def default_parameters(self) -> dict:
|
|
22
|
+
return {
|
|
23
|
+
"type": "object",
|
|
24
|
+
"properties": {
|
|
25
|
+
"input": {
|
|
26
|
+
"type": "string",
|
|
27
|
+
"description": "The input to be handed off to another agent. This should be a clear and concise request or task.",
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
def default_description(self, agent_name: str | None) -> str:
|
|
33
|
+
agent_name = agent_name or "another"
|
|
34
|
+
return f"Delegate tasks to {self.name} agent to handle the request."
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import mcp
|
|
2
|
+
from dataclasses import dataclass
|
|
3
|
+
from .run_context import ContextWrapper, TContext
|
|
4
|
+
from typing import Generic
|
|
5
|
+
from astrbot.core.provider.entities import LLMResponse
|
|
6
|
+
from astrbot.core.agent.tool import FunctionTool
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
@dataclass
|
|
10
|
+
class BaseAgentRunHooks(Generic[TContext]):
|
|
11
|
+
async def on_agent_begin(self, run_context: ContextWrapper[TContext]): ...
|
|
12
|
+
async def on_tool_start(
|
|
13
|
+
self,
|
|
14
|
+
run_context: ContextWrapper[TContext],
|
|
15
|
+
tool: FunctionTool,
|
|
16
|
+
tool_args: dict | None,
|
|
17
|
+
): ...
|
|
18
|
+
async def on_tool_end(
|
|
19
|
+
self,
|
|
20
|
+
run_context: ContextWrapper[TContext],
|
|
21
|
+
tool: FunctionTool,
|
|
22
|
+
tool_args: dict | None,
|
|
23
|
+
tool_result: mcp.types.CallToolResult | None,
|
|
24
|
+
): ...
|
|
25
|
+
async def on_agent_done(
|
|
26
|
+
self, run_context: ContextWrapper[TContext], llm_response: LLMResponse
|
|
27
|
+
): ...
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import asyncio
|
|
2
|
+
import logging
|
|
3
|
+
from datetime import timedelta
|
|
4
|
+
from typing import Optional
|
|
5
|
+
from contextlib import AsyncExitStack
|
|
6
|
+
from astrbot import logger
|
|
7
|
+
from astrbot.core.utils.log_pipe import LogPipe
|
|
8
|
+
|
|
9
|
+
try:
|
|
10
|
+
import mcp
|
|
11
|
+
from mcp.client.sse import sse_client
|
|
12
|
+
except (ModuleNotFoundError, ImportError):
|
|
13
|
+
logger.warning("警告: 缺少依赖库 'mcp',将无法使用 MCP 服务。")
|
|
14
|
+
|
|
15
|
+
try:
|
|
16
|
+
from mcp.client.streamable_http import streamablehttp_client
|
|
17
|
+
except (ModuleNotFoundError, ImportError):
|
|
18
|
+
logger.warning(
|
|
19
|
+
"警告: 缺少依赖库 'mcp' 或者 mcp 库版本过低,无法使用 Streamable HTTP 连接方式。"
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def _prepare_config(config: dict) -> dict:
|
|
24
|
+
"""准备配置,处理嵌套格式"""
|
|
25
|
+
if "mcpServers" in config and config["mcpServers"]:
|
|
26
|
+
first_key = next(iter(config["mcpServers"]))
|
|
27
|
+
config = config["mcpServers"][first_key]
|
|
28
|
+
config.pop("active", None)
|
|
29
|
+
return config
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
async def _quick_test_mcp_connection(config: dict) -> tuple[bool, str]:
|
|
33
|
+
"""快速测试 MCP 服务器可达性"""
|
|
34
|
+
import aiohttp
|
|
35
|
+
|
|
36
|
+
cfg = _prepare_config(config.copy())
|
|
37
|
+
|
|
38
|
+
url = cfg["url"]
|
|
39
|
+
headers = cfg.get("headers", {})
|
|
40
|
+
timeout = cfg.get("timeout", 10)
|
|
41
|
+
|
|
42
|
+
try:
|
|
43
|
+
async with aiohttp.ClientSession() as session:
|
|
44
|
+
if cfg.get("transport") == "streamable_http":
|
|
45
|
+
test_payload = {
|
|
46
|
+
"jsonrpc": "2.0",
|
|
47
|
+
"method": "initialize",
|
|
48
|
+
"id": 0,
|
|
49
|
+
"params": {
|
|
50
|
+
"protocolVersion": "2024-11-05",
|
|
51
|
+
"capabilities": {},
|
|
52
|
+
"clientInfo": {"name": "test-client", "version": "1.2.3"},
|
|
53
|
+
},
|
|
54
|
+
}
|
|
55
|
+
async with session.post(
|
|
56
|
+
url,
|
|
57
|
+
headers={
|
|
58
|
+
**headers,
|
|
59
|
+
"Content-Type": "application/json",
|
|
60
|
+
"Accept": "application/json, text/event-stream",
|
|
61
|
+
},
|
|
62
|
+
json=test_payload,
|
|
63
|
+
timeout=aiohttp.ClientTimeout(total=timeout),
|
|
64
|
+
) as response:
|
|
65
|
+
if response.status == 200:
|
|
66
|
+
return True, ""
|
|
67
|
+
else:
|
|
68
|
+
return False, f"HTTP {response.status}: {response.reason}"
|
|
69
|
+
else:
|
|
70
|
+
async with session.get(
|
|
71
|
+
url,
|
|
72
|
+
headers={
|
|
73
|
+
**headers,
|
|
74
|
+
"Accept": "application/json, text/event-stream",
|
|
75
|
+
},
|
|
76
|
+
timeout=aiohttp.ClientTimeout(total=timeout),
|
|
77
|
+
) as response:
|
|
78
|
+
if response.status == 200:
|
|
79
|
+
return True, ""
|
|
80
|
+
else:
|
|
81
|
+
return False, f"HTTP {response.status}: {response.reason}"
|
|
82
|
+
|
|
83
|
+
except asyncio.TimeoutError:
|
|
84
|
+
return False, f"连接超时: {timeout}秒"
|
|
85
|
+
except Exception as e:
|
|
86
|
+
return False, f"{e!s}"
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
class MCPClient:
|
|
90
|
+
def __init__(self):
|
|
91
|
+
# Initialize session and client objects
|
|
92
|
+
self.session: Optional[mcp.ClientSession] = None
|
|
93
|
+
self.exit_stack = AsyncExitStack()
|
|
94
|
+
|
|
95
|
+
self.name = None
|
|
96
|
+
self.active: bool = True
|
|
97
|
+
self.tools: list[mcp.Tool] = []
|
|
98
|
+
self.server_errlogs: list[str] = []
|
|
99
|
+
self.running_event = asyncio.Event()
|
|
100
|
+
|
|
101
|
+
async def connect_to_server(self, mcp_server_config: dict, name: str):
|
|
102
|
+
"""连接到 MCP 服务器
|
|
103
|
+
|
|
104
|
+
如果 `url` 参数存在:
|
|
105
|
+
1. 当 transport 指定为 `streamable_http` 时,使用 Streamable HTTP 连接方式。
|
|
106
|
+
1. 当 transport 指定为 `sse` 时,使用 SSE 连接方式。
|
|
107
|
+
2. 如果没有指定,默认使用 SSE 的方式连接到 MCP 服务。
|
|
108
|
+
|
|
109
|
+
Args:
|
|
110
|
+
mcp_server_config (dict): Configuration for the MCP server. See https://modelcontextprotocol.io/quickstart/server
|
|
111
|
+
"""
|
|
112
|
+
cfg = _prepare_config(mcp_server_config.copy())
|
|
113
|
+
|
|
114
|
+
def logging_callback(msg: str):
|
|
115
|
+
# 处理 MCP 服务的错误日志
|
|
116
|
+
print(f"MCP Server {name} Error: {msg}")
|
|
117
|
+
self.server_errlogs.append(msg)
|
|
118
|
+
|
|
119
|
+
if "url" in cfg:
|
|
120
|
+
success, error_msg = await _quick_test_mcp_connection(cfg)
|
|
121
|
+
if not success:
|
|
122
|
+
raise Exception(error_msg)
|
|
123
|
+
|
|
124
|
+
if cfg.get("transport") != "streamable_http":
|
|
125
|
+
# SSE transport method
|
|
126
|
+
self._streams_context = sse_client(
|
|
127
|
+
url=cfg["url"],
|
|
128
|
+
headers=cfg.get("headers", {}),
|
|
129
|
+
timeout=cfg.get("timeout", 5),
|
|
130
|
+
sse_read_timeout=cfg.get("sse_read_timeout", 60 * 5),
|
|
131
|
+
)
|
|
132
|
+
streams = await self.exit_stack.enter_async_context(
|
|
133
|
+
self._streams_context
|
|
134
|
+
)
|
|
135
|
+
|
|
136
|
+
# Create a new client session
|
|
137
|
+
read_timeout = timedelta(seconds=cfg.get("session_read_timeout", 20))
|
|
138
|
+
self.session = await self.exit_stack.enter_async_context(
|
|
139
|
+
mcp.ClientSession(
|
|
140
|
+
*streams,
|
|
141
|
+
read_timeout_seconds=read_timeout,
|
|
142
|
+
logging_callback=logging_callback, # type: ignore
|
|
143
|
+
)
|
|
144
|
+
)
|
|
145
|
+
else:
|
|
146
|
+
timeout = timedelta(seconds=cfg.get("timeout", 30))
|
|
147
|
+
sse_read_timeout = timedelta(
|
|
148
|
+
seconds=cfg.get("sse_read_timeout", 60 * 5)
|
|
149
|
+
)
|
|
150
|
+
self._streams_context = streamablehttp_client(
|
|
151
|
+
url=cfg["url"],
|
|
152
|
+
headers=cfg.get("headers", {}),
|
|
153
|
+
timeout=timeout,
|
|
154
|
+
sse_read_timeout=sse_read_timeout,
|
|
155
|
+
terminate_on_close=cfg.get("terminate_on_close", True),
|
|
156
|
+
)
|
|
157
|
+
read_s, write_s, _ = await self.exit_stack.enter_async_context(
|
|
158
|
+
self._streams_context
|
|
159
|
+
)
|
|
160
|
+
|
|
161
|
+
# Create a new client session
|
|
162
|
+
read_timeout = timedelta(seconds=cfg.get("session_read_timeout", 20))
|
|
163
|
+
self.session = await self.exit_stack.enter_async_context(
|
|
164
|
+
mcp.ClientSession(
|
|
165
|
+
read_stream=read_s,
|
|
166
|
+
write_stream=write_s,
|
|
167
|
+
read_timeout_seconds=read_timeout,
|
|
168
|
+
logging_callback=logging_callback, # type: ignore
|
|
169
|
+
)
|
|
170
|
+
)
|
|
171
|
+
|
|
172
|
+
else:
|
|
173
|
+
server_params = mcp.StdioServerParameters(
|
|
174
|
+
**cfg,
|
|
175
|
+
)
|
|
176
|
+
|
|
177
|
+
def callback(msg: str):
|
|
178
|
+
# 处理 MCP 服务的错误日志
|
|
179
|
+
self.server_errlogs.append(msg)
|
|
180
|
+
|
|
181
|
+
stdio_transport = await self.exit_stack.enter_async_context(
|
|
182
|
+
mcp.stdio_client(
|
|
183
|
+
server_params,
|
|
184
|
+
errlog=LogPipe(
|
|
185
|
+
level=logging.ERROR,
|
|
186
|
+
logger=logger,
|
|
187
|
+
identifier=f"MCPServer-{name}",
|
|
188
|
+
callback=callback,
|
|
189
|
+
), # type: ignore
|
|
190
|
+
),
|
|
191
|
+
)
|
|
192
|
+
|
|
193
|
+
# Create a new client session
|
|
194
|
+
self.session = await self.exit_stack.enter_async_context(
|
|
195
|
+
mcp.ClientSession(*stdio_transport)
|
|
196
|
+
)
|
|
197
|
+
await self.session.initialize()
|
|
198
|
+
|
|
199
|
+
async def list_tools_and_save(self) -> mcp.ListToolsResult:
|
|
200
|
+
"""List all tools from the server and save them to self.tools"""
|
|
201
|
+
response = await self.session.list_tools()
|
|
202
|
+
self.tools = response.tools
|
|
203
|
+
return response
|
|
204
|
+
|
|
205
|
+
async def cleanup(self):
|
|
206
|
+
"""Clean up resources"""
|
|
207
|
+
await self.exit_stack.aclose()
|
|
208
|
+
self.running_event.set() # Set the running event to indicate cleanup is done
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
from dataclasses import dataclass
|
|
2
|
+
import typing as T
|
|
3
|
+
from astrbot.core.message.message_event_result import MessageChain
|
|
4
|
+
|
|
5
|
+
class AgentResponseData(T.TypedDict):
|
|
6
|
+
chain: MessageChain
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
@dataclass
|
|
10
|
+
class AgentResponse:
|
|
11
|
+
type: str
|
|
12
|
+
data: AgentResponseData
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
from dataclasses import dataclass
|
|
2
|
+
from typing import Any, Generic
|
|
3
|
+
from typing_extensions import TypeVar
|
|
4
|
+
|
|
5
|
+
from astrbot.core.platform.astr_message_event import AstrMessageEvent
|
|
6
|
+
|
|
7
|
+
TContext = TypeVar("TContext", default=Any)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
@dataclass
|
|
11
|
+
class ContextWrapper(Generic[TContext]):
|
|
12
|
+
"""A context for running an agent, which can be used to pass additional data or state."""
|
|
13
|
+
|
|
14
|
+
context: TContext
|
|
15
|
+
event: AstrMessageEvent
|
|
16
|
+
|
|
17
|
+
NoContext = ContextWrapper[None]
|
|
@@ -1,32 +1,33 @@
|
|
|
1
1
|
import abc
|
|
2
2
|
import typing as T
|
|
3
|
-
from dataclasses import dataclass
|
|
4
|
-
from astrbot.core.provider.entities import LLMResponse
|
|
5
|
-
from ....message.message_event_result import MessageChain
|
|
6
3
|
from enum import Enum, auto
|
|
4
|
+
from ..run_context import ContextWrapper, TContext
|
|
5
|
+
from ..response import AgentResponse
|
|
6
|
+
from ..hooks import BaseAgentRunHooks
|
|
7
|
+
from ..tool_executor import BaseFunctionToolExecutor
|
|
8
|
+
from astrbot.core.provider import Provider
|
|
9
|
+
from astrbot.core.provider.entities import LLMResponse
|
|
7
10
|
|
|
8
11
|
|
|
9
12
|
class AgentState(Enum):
|
|
10
|
-
"""
|
|
11
|
-
IDLE = auto() # 初始状态
|
|
12
|
-
RUNNING = auto() # 运行中
|
|
13
|
-
DONE = auto() # 完成
|
|
14
|
-
ERROR = auto() # 错误状态
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
class AgentResponseData(T.TypedDict):
|
|
18
|
-
chain: MessageChain
|
|
19
|
-
|
|
13
|
+
"""Defines the state of the agent."""
|
|
20
14
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
15
|
+
IDLE = auto() # Initial state
|
|
16
|
+
RUNNING = auto() # Currently processing
|
|
17
|
+
DONE = auto() # Completed
|
|
18
|
+
ERROR = auto() # Error state
|
|
25
19
|
|
|
26
20
|
|
|
27
|
-
class BaseAgentRunner:
|
|
21
|
+
class BaseAgentRunner(T.Generic[TContext]):
|
|
28
22
|
@abc.abstractmethod
|
|
29
|
-
async def reset(
|
|
23
|
+
async def reset(
|
|
24
|
+
self,
|
|
25
|
+
provider: Provider,
|
|
26
|
+
run_context: ContextWrapper[TContext],
|
|
27
|
+
tool_executor: BaseFunctionToolExecutor[TContext],
|
|
28
|
+
agent_hooks: BaseAgentRunHooks[TContext],
|
|
29
|
+
**kwargs: T.Any,
|
|
30
|
+
) -> None:
|
|
30
31
|
"""
|
|
31
32
|
Reset the agent to its initial state.
|
|
32
33
|
This method should be called before starting a new run.
|