From a93cd3dd5ff913bde57d55269aae901e224a4940 Mon Sep 17 00:00:00 2001 From: Soulter <905617992@qq.com> Date: Thu, 7 Aug 2025 20:25:38 +0800 Subject: [PATCH 1/9] feat: compshare provider --- astrbot/core/config/default.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/astrbot/core/config/default.py b/astrbot/core/config/default.py index 60d45be1f..54d1907c8 100644 --- a/astrbot/core/config/default.py +++ b/astrbot/core/config/default.py @@ -757,6 +757,19 @@ CONFIG_METADATA_2 = { "model": "deepseek/deepseek-r1", }, }, + "优云智算": { + "id": "compshare", + "provider": "compshare", + "type": "openai_chat_completion", + "provider_type": "chat_completion", + "enable": True, + "key": [], + "api_base": "https://api.modelverse.cn/v1", + "timeout": 120, + "model_config": { + "model": "moonshotai/Kimi-K2-Instruct", + }, + }, "Kimi": { "id": "moonshot", "provider": "moonshot", From 2beea7d218081c4a16b0597e90a2f82767c6099f Mon Sep 17 00:00:00 2001 From: Soulter <905617992@qq.com> Date: Thu, 7 Aug 2025 20:36:59 +0800 Subject: [PATCH 2/9] =?UTF-8?q?=F0=9F=93=A6=20release:=20v3.5.24?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- astrbot/core/config/default.py | 2 +- changelogs/v3.5.24.md | 10 ++++++++++ pyproject.toml | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 changelogs/v3.5.24.md diff --git a/astrbot/core/config/default.py b/astrbot/core/config/default.py index 54d1907c8..51743defc 100644 --- a/astrbot/core/config/default.py +++ b/astrbot/core/config/default.py @@ -6,7 +6,7 @@ import os from astrbot.core.utils.astrbot_path import get_astrbot_data_path -VERSION = "3.5.23" +VERSION = "3.5.24" DB_PATH = os.path.join(get_astrbot_data_path(), "data_v3.db") # 默认配置 diff --git a/changelogs/v3.5.24.md b/changelogs/v3.5.24.md new file mode 100644 index 000000000..7e0eff884 --- /dev/null +++ b/changelogs/v3.5.24.md @@ -0,0 +1,10 @@ +# What's Changed + +> 新版本预告: v4.0.0 即将发布。 + +1. 新增: 添加对 ModelScope、Compshare(优云智算)的模版支持。 +2. 优化: 增加插件数据缓存,优化插件市场数据获取时的稳定性。 + +其他更新: + +1. 现已支持在 1Panel 平台通过应用商城快捷部署 AstrBot。详见:[在 1Panel 部署 AstrBot](https://docs.astrbot.app/deploy/astrbot/1panel.html) diff --git a/pyproject.toml b/pyproject.toml index 3cb7f2206..e0ecda9c4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "AstrBot" -version = "3.5.23" +version = "3.5.24" description = "易上手的多平台 LLM 聊天机器人及开发框架" readme = "README.md" requires-python = ">=3.10" From a85bc510ddfb612accae4cfadc770d56b6efba63 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 12 Aug 2025 15:15:28 +0800 Subject: [PATCH 3/9] chore(deps): bump actions/checkout in the github-actions group (#2400) Bumps the github-actions group with 1 update: [actions/checkout](https://github.com/actions/checkout). Updates `actions/checkout` from 4 to 5 - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/auto_release.yml | 4 ++-- .github/workflows/codeql.yml | 2 +- .github/workflows/coverage_test.yml | 2 +- .github/workflows/dashboard_ci.yml | 2 +- .github/workflows/docker-image.yml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/auto_release.yml b/.github/workflows/auto_release.yml index 46d914a9a..fca9dc52e 100644 --- a/.github/workflows/auto_release.yml +++ b/.github/workflows/auto_release.yml @@ -13,7 +13,7 @@ jobs: contents: write steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Dashboard Build run: | @@ -70,7 +70,7 @@ jobs: needs: build-and-publish-to-github-release steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Set up Python uses: actions/setup-python@v5 diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 8503bb715..9d79d4345 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -56,7 +56,7 @@ jobs: # your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@v5 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL diff --git a/.github/workflows/coverage_test.yml b/.github/workflows/coverage_test.yml index e9c94d679..06311aa84 100644 --- a/.github/workflows/coverage_test.yml +++ b/.github/workflows/coverage_test.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: fetch-depth: 0 diff --git a/.github/workflows/dashboard_ci.yml b/.github/workflows/dashboard_ci.yml index 4c6304e4a..9ea359579 100644 --- a/.github/workflows/dashboard_ci.yml +++ b/.github/workflows/dashboard_ci.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: npm install, build run: | diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index c0610a3c1..95b8bc9db 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -12,7 +12,7 @@ jobs: steps: - name: Pull The Codes - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: fetch-depth: 0 # Must be 0 so we can fetch tags From d5a53a89eb5e0fc8ca077ea1a6ce42bc778610c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=A0=E4=BB=AC=E7=9A=84=E9=A5=BA=E5=AD=90?= <64739528+MCjiaozi@users.noreply.github.com> Date: Tue, 12 Aug 2025 21:41:19 +0800 Subject: [PATCH 4/9] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=E7=9A=84=20terminate=20=E6=97=A0=E6=B3=95=E8=A2=AB=E6=AD=A3?= =?UTF-8?q?=E5=B8=B8=E8=B0=83=E7=94=A8=E7=9A=84=E9=97=AE=E9=A2=98=20(#2352?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- astrbot/core/star/star_manager.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/astrbot/core/star/star_manager.py b/astrbot/core/star/star_manager.py index b64b4aa85..ab98b254e 100644 --- a/astrbot/core/star/star_manager.py +++ b/astrbot/core/star/star_manager.py @@ -809,11 +809,11 @@ class PluginManager: if star_metadata.star_cls is None: return - if hasattr(star_metadata.star_cls, "__del__"): + if '__del__' in star_metadata.star_cls_type.__dict__: asyncio.get_event_loop().run_in_executor( None, star_metadata.star_cls.__del__ ) - elif hasattr(star_metadata.star_cls, "terminate"): + elif 'terminate' in star_metadata.star_cls_type.__dict__: await star_metadata.star_cls.terminate() async def turn_on_plugin(self, plugin_name: str): From 7d46314dc832e8cd955fe162813ca2f1a6f49ddd Mon Sep 17 00:00:00 2001 From: MUKAPP Date: Tue, 12 Aug 2025 21:47:31 +0800 Subject: [PATCH 5/9] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=B3=A8=E5=86=8C?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E6=97=B6=E7=94=B1=E4=BA=8E=20file:///=20?= =?UTF-8?q?=E5=89=8D=E7=BC=80=EF=BC=8C=E5=AF=BC=E8=87=B4=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E8=A2=AB=E8=AF=AF=E5=88=A4=E4=B8=BA=E4=B8=8D=E5=AD=98=E5=9C=A8?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98=20(#2325)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fixes #2222 --- astrbot/core/file_token_service.py | 34 +++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/astrbot/core/file_token_service.py b/astrbot/core/file_token_service.py index 2ed46d433..ce5e2349a 100644 --- a/astrbot/core/file_token_service.py +++ b/astrbot/core/file_token_service.py @@ -2,6 +2,8 @@ import asyncio import os import uuid import time +from urllib.parse import urlparse, unquote +import platform class FileTokenService: @@ -15,7 +17,9 @@ class FileTokenService: async def _cleanup_expired_tokens(self): """清理过期的令牌""" now = time.time() - expired_tokens = [token for token, (_, expire) in self.staged_files.items() if expire < now] + expired_tokens = [ + token for token, (_, expire) in self.staged_files.items() if expire < now + ] for token in expired_tokens: self.staged_files.pop(token, None) @@ -32,15 +36,35 @@ class FileTokenService: Raises: FileNotFoundError: 当路径不存在时抛出 """ + + # 处理 file:/// + try: + parsed_uri = urlparse(file_path) + if parsed_uri.scheme == "file": + local_path = unquote(parsed_uri.path) + if platform.system() == "Windows" and local_path.startswith("/"): + local_path = local_path[1:] + else: + # 如果没有 file:/// 前缀,则认为是普通路径 + local_path = file_path + except Exception: + # 解析失败时,按原路径处理 + local_path = file_path + async with self.lock: await self._cleanup_expired_tokens() - if not os.path.exists(file_path): - raise FileNotFoundError(f"文件不存在: {file_path}") + if not os.path.exists(local_path): + raise FileNotFoundError( + f"文件不存在: {local_path} (原始输入: {file_path})" + ) file_token = str(uuid.uuid4()) - expire_time = time.time() + (timeout if timeout is not None else self.default_timeout) - self.staged_files[file_token] = (file_path, expire_time) + expire_time = time.time() + ( + timeout if timeout is not None else self.default_timeout + ) + # 存储转换后的真实路径 + self.staged_files[file_token] = (local_path, expire_time) return file_token async def handle_file(self, file_token: str) -> str: From 73edeae0131c24dc3cbf15ed205c3df425bc2a9c Mon Sep 17 00:00:00 2001 From: RC-CHN <67079377+RC-CHN@users.noreply.github.com> Date: Tue, 12 Aug 2025 21:53:06 +0800 Subject: [PATCH 6/9] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96hint=E6=B8=B2?= =?UTF-8?q?=E6=9F=93=E6=96=B9=E5=BC=8F=EF=BC=8C=E4=B8=BA=E9=83=A8=E5=88=86?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E4=BE=9B=E5=BA=94=E5=95=86=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E7=9A=84=E6=B8=A9=E5=BA=A6=E9=80=89=E9=A1=B9?= =?UTF-8?q?=20(#2321)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat:为webchat页面添加一个手动上传文件按钮(目前只处理图片) * fix:上传后清空value,允许触发change事件以多次上传同一张图片 * perf:webchat页面消息发送后清空图片预览缩略图,维持与文本信息行为一致 * perf:将文件输入的值重置为空字符串以提升浏览器兼容性 * feat:webchat文件上传按钮支持多选文件上传 * fix:释放blob URL以防止内存泄漏 * perf:并行化sendMessage中的图片获取逻辑 * perf:优化hint渲染方式,为部分类型供应商添加默认的温度选项 --- astrbot/core/config/default.py | 23 +++++++++++++-- .../src/components/shared/AstrBotConfig.vue | 28 +++++++++++++++++-- dashboard/src/views/ProviderPage.vue | 1 + 3 files changed, 46 insertions(+), 6 deletions(-) diff --git a/astrbot/core/config/default.py b/astrbot/core/config/default.py index 51743defc..b662d386e 100644 --- a/astrbot/core/config/default.py +++ b/astrbot/core/config/default.py @@ -599,7 +599,9 @@ CONFIG_METADATA_2 = { "timeout": 120, "model_config": { "model": "gpt-4o-mini", + "temperature": 0.4 }, + "hint": "也兼容所有与OpenAI API兼容的服务。" }, "Azure OpenAI": { "id": "azure", @@ -613,6 +615,7 @@ CONFIG_METADATA_2 = { "timeout": 120, "model_config": { "model": "gpt-4o-mini", + "temperature": 0.4 }, }, "xAI": { @@ -626,9 +629,11 @@ CONFIG_METADATA_2 = { "timeout": 120, "model_config": { "model": "grok-2-latest", + "temperature": 0.4 }, }, "Anthropic": { + "hint": "注意Claude系列模型的温度调节范围为0到1.0,超出可能导致报错", "id": "claude", "provider": "anthropic", "type": "anthropic_chat_completion", @@ -640,9 +645,11 @@ CONFIG_METADATA_2 = { "model_config": { "model": "claude-3-5-sonnet-latest", "max_tokens": 4096, + "temperature": 0.2 }, }, "Ollama": { + "hint":"启用前请确保已正确安装并运行 Ollama 服务端,Ollama默认不带鉴权,无需修改key", "id": "ollama_default", "provider": "ollama", "type": "openai_chat_completion", @@ -652,6 +659,7 @@ CONFIG_METADATA_2 = { "api_base": "http://localhost:11434/v1", "model_config": { "model": "llama3.1-8b", + "temperature": 0.4 }, }, "LM Studio": { @@ -677,6 +685,7 @@ CONFIG_METADATA_2 = { "timeout": 120, "model_config": { "model": "gemini-1.5-flash", + "temperature": 0.4 }, }, "Gemini": { @@ -690,6 +699,7 @@ CONFIG_METADATA_2 = { "timeout": 120, "model_config": { "model": "gemini-2.0-flash-exp", + "temperature": 0.4 }, "gm_resp_image_modal": False, "gm_native_search": False, @@ -716,6 +726,7 @@ CONFIG_METADATA_2 = { "timeout": 120, "model_config": { "model": "deepseek-chat", + "temperature": 0.4 }, }, "302.AI": { @@ -729,6 +740,7 @@ CONFIG_METADATA_2 = { "timeout": 120, "model_config": { "model": "gpt-4.1-mini", + "temperature": 0.4 }, }, "硅基流动": { @@ -742,6 +754,7 @@ CONFIG_METADATA_2 = { "api_base": "https://api.siliconflow.cn/v1", "model_config": { "model": "deepseek-ai/DeepSeek-V3", + "temperature": 0.4 }, }, "PPIO派欧云": { @@ -755,6 +768,7 @@ CONFIG_METADATA_2 = { "timeout": 120, "model_config": { "model": "deepseek/deepseek-r1", + "temperature": 0.4 }, }, "优云智算": { @@ -781,6 +795,7 @@ CONFIG_METADATA_2 = { "api_base": "https://api.moonshot.cn/v1", "model_config": { "model": "moonshot-v1-8k", + "temperature": 0.4 }, }, "智谱 AI": { @@ -809,6 +824,7 @@ CONFIG_METADATA_2 = { "dify_query_input_key": "astrbot_text_query", "variables": {}, "timeout": 60, + "hint": "请确保你在 AstrBot 里设置的 APP 类型和 Dify 里面创建的应用的类型一致!" }, "阿里云百炼应用": { "id": "dashscope", @@ -838,6 +854,7 @@ CONFIG_METADATA_2 = { "api_base": "https://api-inference.modelscope.cn/v1", "model_config": { "model": "Qwen/Qwen3-32B", + "temperature": 0.4 }, }, "FastGPT": { @@ -861,7 +878,7 @@ CONFIG_METADATA_2 = { "model": "whisper-1", }, "Whisper(本地加载)": { - "whisper_hint": "(不用修改我)", + "hint": "启用前请 pip 安装 openai-whisper 库(N卡用户大约下载 2GB,主要是 torch 和 cuda,CPU 用户大约下载 1 GB),并且安装 ffmpeg。否则将无法正常转文字。", "provider": "openai", "type": "openai_whisper_selfhost", "provider_type": "speech_to_text", @@ -870,7 +887,7 @@ CONFIG_METADATA_2 = { "model": "tiny", }, "SenseVoice(本地加载)": { - "sensevoice_hint": "(不用修改我)", + "hint": "启用前请 pip 安装 funasr、funasr_onnx、torchaudio、torch、modelscope、jieba 库(默认使用CPU,大约下载 1 GB),并且安装 ffmpeg。否则将无法正常转文字。", "type": "sensevoice_stt_selfhost", "provider": "sensevoice", "provider_type": "speech_to_text", @@ -892,7 +909,7 @@ CONFIG_METADATA_2 = { "timeout": "20", }, "Edge TTS": { - "edgetts_hint": "提示:使用这个服务前需要安装有 ffmpeg,并且可以直接在终端调用 ffmpeg 指令。", + "hint": "提示:使用这个服务前需要安装有 ffmpeg,并且可以直接在终端调用 ffmpeg 指令。", "id": "edge_tts", "provider": "microsoft", "type": "edge_tts", diff --git a/dashboard/src/components/shared/AstrBotConfig.vue b/dashboard/src/components/shared/AstrBotConfig.vue index 5610e7bc4..12de2561b 100644 --- a/dashboard/src/components/shared/AstrBotConfig.vue +++ b/dashboard/src/components/shared/AstrBotConfig.vue @@ -1,10 +1,10 @@