Compare commits

...

7 Commits

Author SHA1 Message Date
Soulter 61d4f1fd4b 📦 release: v3.5.27 2025-09-04 15:01:44 +08:00
Soulter 121b68995e chore: update changelog 2025-09-04 14:34:23 +08:00
Soulter d11f1d8dae perf: enhance update checks to consider pre-release versions 2025-09-04 14:33:19 +08:00
Soulter c0ef2b5064 📦 release: v3.5.27 2025-09-04 13:56:47 +08:00
Soulter 2a7308363e fix: 下载 WebUI 时,明确版本号 2025-09-04 13:54:16 +08:00
Soulter dc0c556f96 ci: build docker image 时同时 build webui,并放入 image 中 2025-09-04 13:42:26 +08:00
Soulter ba2ee1c0aa fix: 初次下载 webui 构建文件时下载指定版本而非 latest 2025-09-04 13:27:55 +08:00
15 changed files with 1578 additions and 1560 deletions
+11
View File
@@ -27,6 +27,17 @@ jobs:
if: github.event_name == 'workflow_dispatch'
run: git checkout ${{ steps.get-latest-tag.outputs.latest_tag }}
- name: Build Dashboard
run: |
cd dashboard
npm install
npm run build
mkdir -p dist/assets
echo $(git rev-parse HEAD) > dist/assets/version
cd ..
mkdir -p data
cp -r dashboard/dist data/
- name: Set QEMU
uses: docker/setup-qemu-action@v3
+12 -3
View File
@@ -37,7 +37,10 @@ async def check_dashboard(astrbot_root: Path) -> None:
):
click.echo("正在安装管理面板...")
await download_dashboard(
path="data/dashboard.zip", extract_path=str(astrbot_root)
path="data/dashboard.zip",
extract_path=str(astrbot_root),
version=f"v{VERSION}",
latest=False,
)
click.echo("管理面板安装完成")
@@ -50,7 +53,10 @@ async def check_dashboard(astrbot_root: Path) -> None:
version = dashboard_version.split("v")[1]
click.echo(f"管理面板版本: {version}")
await download_dashboard(
path="data/dashboard.zip", extract_path=str(astrbot_root)
path="data/dashboard.zip",
extract_path=str(astrbot_root),
version=f"v{VERSION}",
latest=False,
)
except Exception as e:
click.echo(f"下载管理面板失败: {e}")
@@ -59,7 +65,10 @@ async def check_dashboard(astrbot_root: Path) -> None:
click.echo("初始化管理面板目录...")
try:
await download_dashboard(
path=str(astrbot_root / "dashboard.zip"), extract_path=str(astrbot_root)
path=str(astrbot_root / "dashboard.zip"),
extract_path=str(astrbot_root),
version=f"v{VERSION}",
latest=False,
)
click.echo("管理面板初始化完成")
except Exception as e:
+18 -42
View File
@@ -6,7 +6,7 @@ import os
from astrbot.core.utils.astrbot_path import get_astrbot_data_path
VERSION = "3.5.26"
VERSION = "3.5.27"
DB_PATH = os.path.join(get_astrbot_data_path(), "data_v3.db")
# 默认配置
@@ -65,7 +65,7 @@ DEFAULT_CONFIG = {
"show_tool_use_status": False,
"streaming_segmented": False,
"separate_provider": True,
"max_agent_step": 30
"max_agent_step": 30,
},
"provider_stt_settings": {
"enable": False,
@@ -599,11 +599,8 @@ CONFIG_METADATA_2 = {
"key": [],
"api_base": "https://api.openai.com/v1",
"timeout": 120,
"model_config": {
"model": "gpt-4o-mini",
"temperature": 0.4
},
"hint": "也兼容所有与OpenAI API兼容的服务。"
"model_config": {"model": "gpt-4o-mini", "temperature": 0.4},
"hint": "也兼容所有与OpenAI API兼容的服务。",
},
"Azure OpenAI": {
"id": "azure",
@@ -615,10 +612,7 @@ CONFIG_METADATA_2 = {
"key": [],
"api_base": "",
"timeout": 120,
"model_config": {
"model": "gpt-4o-mini",
"temperature": 0.4
},
"model_config": {"model": "gpt-4o-mini", "temperature": 0.4},
},
"xAI": {
"id": "xai",
@@ -629,10 +623,7 @@ CONFIG_METADATA_2 = {
"key": [],
"api_base": "https://api.x.ai/v1",
"timeout": 120,
"model_config": {
"model": "grok-2-latest",
"temperature": 0.4
},
"model_config": {"model": "grok-2-latest", "temperature": 0.4},
},
"Anthropic": {
"hint": "注意Claude系列模型的温度调节范围为0到1.0,超出可能导致报错",
@@ -647,11 +638,11 @@ CONFIG_METADATA_2 = {
"model_config": {
"model": "claude-3-5-sonnet-latest",
"max_tokens": 4096,
"temperature": 0.2
"temperature": 0.2,
},
},
"Ollama": {
"hint":"启用前请确保已正确安装并运行 Ollama 服务端,Ollama默认不带鉴权,无需修改key",
"hint": "启用前请确保已正确安装并运行 Ollama 服务端,Ollama默认不带鉴权,无需修改key",
"id": "ollama_default",
"provider": "ollama",
"type": "openai_chat_completion",
@@ -659,10 +650,7 @@ CONFIG_METADATA_2 = {
"enable": True,
"key": ["ollama"], # ollama 的 key 默认是 ollama
"api_base": "http://localhost:11434/v1",
"model_config": {
"model": "llama3.1-8b",
"temperature": 0.4
},
"model_config": {"model": "llama3.1-8b", "temperature": 0.4},
},
"LM Studio": {
"id": "lm_studio",
@@ -687,7 +675,7 @@ CONFIG_METADATA_2 = {
"timeout": 120,
"model_config": {
"model": "gemini-1.5-flash",
"temperature": 0.4
"temperature": 0.4,
},
},
"Gemini": {
@@ -701,7 +689,7 @@ CONFIG_METADATA_2 = {
"timeout": 120,
"model_config": {
"model": "gemini-2.0-flash-exp",
"temperature": 0.4
"temperature": 0.4,
},
"gm_resp_image_modal": False,
"gm_native_search": False,
@@ -726,10 +714,7 @@ CONFIG_METADATA_2 = {
"key": [],
"api_base": "https://api.deepseek.com/v1",
"timeout": 120,
"model_config": {
"model": "deepseek-chat",
"temperature": 0.4
},
"model_config": {"model": "deepseek-chat", "temperature": 0.4},
},
"302.AI": {
"id": "302ai",
@@ -740,10 +725,7 @@ CONFIG_METADATA_2 = {
"key": [],
"api_base": "https://api.302.ai/v1",
"timeout": 120,
"model_config": {
"model": "gpt-4.1-mini",
"temperature": 0.4
},
"model_config": {"model": "gpt-4.1-mini", "temperature": 0.4},
},
"硅基流动": {
"id": "siliconflow",
@@ -756,7 +738,7 @@ CONFIG_METADATA_2 = {
"api_base": "https://api.siliconflow.cn/v1",
"model_config": {
"model": "deepseek-ai/DeepSeek-V3",
"temperature": 0.4
"temperature": 0.4,
},
},
"PPIO派欧云": {
@@ -770,7 +752,7 @@ CONFIG_METADATA_2 = {
"timeout": 120,
"model_config": {
"model": "deepseek/deepseek-r1",
"temperature": 0.4
"temperature": 0.4,
},
},
"优云智算": {
@@ -795,10 +777,7 @@ CONFIG_METADATA_2 = {
"key": [],
"timeout": 120,
"api_base": "https://api.moonshot.cn/v1",
"model_config": {
"model": "moonshot-v1-8k",
"temperature": 0.4
},
"model_config": {"model": "moonshot-v1-8k", "temperature": 0.4},
},
"智谱 AI": {
"id": "zhipu_default",
@@ -826,7 +805,7 @@ CONFIG_METADATA_2 = {
"dify_query_input_key": "astrbot_text_query",
"variables": {},
"timeout": 60,
"hint": "请确保你在 AstrBot 里设置的 APP 类型和 Dify 里面创建的应用的类型一致!"
"hint": "请确保你在 AstrBot 里设置的 APP 类型和 Dify 里面创建的应用的类型一致!",
},
"阿里云百炼应用": {
"id": "dashscope",
@@ -854,10 +833,7 @@ CONFIG_METADATA_2 = {
"key": [],
"timeout": 120,
"api_base": "https://api-inference.modelscope.cn/v1",
"model_config": {
"model": "Qwen/Qwen3-32B",
"temperature": 0.4
},
"model_config": {"model": "Qwen/Qwen3-32B", "temperature": 0.4},
},
"FastGPT": {
"id": "fastgpt",
+7 -5
View File
@@ -56,9 +56,7 @@ class AstrBotUpdator(RepoZipUpdator):
try:
if "astrbot" in os.path.basename(sys.argv[0]): # 兼容cli
if os.name == "nt":
args = [
f'"{arg}"' if " " in arg else arg for arg in sys.argv[1:]
]
args = [f'"{arg}"' if " " in arg else arg for arg in sys.argv[1:]]
else:
args = sys.argv[1:]
os.execl(sys.executable, py, "-m", "astrbot.cli.__main__", *args)
@@ -68,9 +66,13 @@ class AstrBotUpdator(RepoZipUpdator):
logger.error(f"重启失败({py}, {e}),请尝试手动重启。")
raise e
async def check_update(self, url: str, current_version: str) -> ReleaseInfo:
async def check_update(
self, url: str, current_version: str, consider_prerelease: bool = True
) -> ReleaseInfo:
"""检查更新"""
return await super().check_update(self.ASTRBOT_RELEASE_API, VERSION)
return await super().check_update(
self.ASTRBOT_RELEASE_API, VERSION, consider_prerelease
)
async def get_releases(self) -> list:
return await self.fetch_release_info(self.ASTRBOT_RELEASE_API)
+1 -1
View File
@@ -227,7 +227,7 @@ async def download_dashboard(
path = os.path.join(get_astrbot_data_path(), "dashboard.zip")
if latest or len(str(version)) != 40:
logger.info("准备下载最新发行版本的 AstrBot WebUI")
logger.info(f"准备下载 {version} 发行版本的 AstrBot WebUI 文件")
ver_name = "latest" if latest else version
dashboard_release_url = f"https://astrbot-registry.soulter.top/download/astrbot-dashboard/{ver_name}/dist.zip"
try:
+26 -4
View File
@@ -107,16 +107,38 @@ class RepoZipUpdator:
"""Semver 版本比较"""
return VersionComparator.compare_version(v1, v2)
async def check_update(self, url: str, current_version: str) -> ReleaseInfo | None:
async def check_update(
self, url: str, current_version: str, consider_prerelease: bool = True
) -> ReleaseInfo | None:
update_data = await self.fetch_release_info(url)
tag_name = update_data[0]["tag_name"]
sel_release_data = None
if consider_prerelease:
tag_name = update_data[0]["tag_name"]
sel_release_data = update_data[0]
else:
for data in update_data:
# 跳过带有 alpha、beta 等预发布标签的版本
if re.search(
r"[\-_.]?(alpha|beta|rc|dev)[\-_.]?\d*$",
data["tag_name"],
re.IGNORECASE,
):
continue
tag_name = data["tag_name"]
sel_release_data = data
break
if not sel_release_data or not tag_name:
logger.error("未找到合适的发布版本")
return None
if self.compare_version(current_version, tag_name) >= 0:
return None
return ReleaseInfo(
version=tag_name,
published_at=update_data[0]["published_at"],
body=update_data[0]["body"],
published_at=sel_release_data["published_at"],
body=f"{tag_name}\n\n{sel_release_data['body']}",
)
async def download_from_repo_url(self, target_path: str, repo_url: str, proxy=""):
+3 -5
View File
@@ -40,7 +40,7 @@ class UpdateRoute(Route):
.__dict__
)
else:
ret = await self.astrbot_updator.check_update(None, None)
ret = await self.astrbot_updator.check_update(None, None, False)
return Response(
status="success",
message=str(ret) if ret is not None else "已经是最新版本了。",
@@ -83,9 +83,7 @@ class UpdateRoute(Route):
)
try:
await download_dashboard(
latest=latest, version=version, proxy=proxy
)
await download_dashboard(latest=latest, version=version, proxy=proxy)
except Exception as e:
logger.error(f"下载管理面板文件失败: {e}")
@@ -116,7 +114,7 @@ class UpdateRoute(Route):
async def update_dashboard(self):
try:
try:
await download_dashboard()
await download_dashboard(version=f"v{VERSION}", latest=False)
except Exception as e:
logger.error(f"下载管理面板文件失败: {e}")
return Response().error(f"下载管理面板文件失败: {e}").__dict__
+5
View File
@@ -0,0 +1,5 @@
# What's Changed
1. 修复:构建 docker 镜像时同时构建 webui,并放入镜像中。
2. 修复:下载 WebUI 文件时,明确版本号,以防止 latest 不一致导致下载的 WebUI 文件版本号与实际所需不符的问题。
3. 优化:优化版本检测,考虑预发布版本,移除 `更新到最新版本` 按钮
@@ -34,7 +34,7 @@
"tip": "💡 TIP:",
"tipLink": "",
"tipContinue": "By default, the corresponding version of the WebUI files will be downloaded when switching versions. The WebUI code is located in the dashboard directory of the project, and you can use npm to build it yourself.",
"dockerTip": "The `Update to Latest Version` button will try to update both the bot main program and the dashboard. If you are using Docker deployment, you can also re-pull the image or use",
"dockerTip": "When switching versions, it will try to update both the bot main program and the dashboard. If you are using Docker deployment, you can also re-pull the image or use",
"dockerTipLink": "watchtower",
"dockerTipContinue": "to automatically monitor and pull.",
"table": {
@@ -33,7 +33,7 @@
},
"tip": "💡 TIP: ",
"tipContinue": "默认在切换版本时会下载对应版本的 WebUI 文件。WebUI 代码位于项目的 dashboard 目录,您可使用 npm 自行构建。",
"dockerTip": "`更新到最新版本` 按钮会同时尝试更新机器人主程序和管理面板。如果您正在使用 Docker 部署,也可以重新拉取镜像或者使用",
"dockerTip": "切换版本时,会同时尝试更新机器人主程序和管理面板。如果您正在使用 Docker 部署,也可以重新拉取镜像或者使用",
"dockerTipLink": "watchtower",
"dockerTipContinue": "来自动监控拉取。",
"table": {
@@ -377,10 +377,6 @@ commonStore.getStartTime();
<!-- 发行版 -->
<v-tabs-window-item key="0" v-show="tab == 0">
<v-btn class="mt-4 mb-4" @click="switchVersion('latest')" color="primary" style="border-radius: 10px;"
:disabled="!hasNewVersion">
{{ t('core.header.updateDialog.updateToLatest') }}
</v-btn>
<div class="mb-4">
<small>{{ t('core.header.updateDialog.dockerTip') }} <a
href="https://containrrr.dev/watchtower/usage-overview/">{{ t('core.header.updateDialog.dockerTipLink') }}</a> {{ t('core.header.updateDialog.dockerTipContinue') }}</small>
+3 -3
View File
@@ -44,10 +44,10 @@ async def check_dashboard_files():
if v is not None:
# has file
if v == f"v{VERSION}":
logger.info("管理面板文件已是最新。")
logger.info("WebUI 版本已是最新。")
else:
logger.warning(
"检测到管理面板有更新。可以使用 /dashboard_update 命令更新"
f"检测到 WebUI 版本 ({v}) 与当前 AstrBot 版本 (v{VERSION}) 不符"
)
return
@@ -56,7 +56,7 @@ async def check_dashboard_files():
)
try:
await download_dashboard()
await download_dashboard(version=f"v{VERSION}", latest=False)
except Exception as e:
logger.critical(f"下载管理面板文件失败: {e}")
return
+1 -1
View File
@@ -1119,7 +1119,7 @@ UID: {user_id} 此 ID 可用于设置管理员。
@filter.command("dashboard_update")
async def update_dashboard(self, event: AstrMessageEvent):
yield event.plain_result("正在尝试更新管理面板...")
await download_dashboard()
await download_dashboard(version=f"v{VERSION}", latest=False)
yield event.plain_result("管理面板更新完成。")
@filter.command("set")
+1 -1
View File
@@ -1,6 +1,6 @@
[project]
name = "AstrBot"
version = "3.5.26"
version = "3.5.27"
description = "易上手的多平台 LLM 聊天机器人及开发框架"
readme = "README.md"
requires-python = ">=3.10"
Generated
+1488 -1489
View File
File diff suppressed because it is too large Load Diff