Compare commits

..

7 Commits

Author SHA1 Message Date
Soulter f3f347dcba 📦 release: bump verstion to v4.0.0-beta.4 2025-09-03 13:29:20 +08:00
Soulter 655be3519c perf: 数据迁移完毕之后引导重启程序
closes: #2613
2025-09-03 13:21:56 +08:00
Soulter 06df2940af chore: change identifier description 2025-09-03 12:46:10 +08:00
Soulter 4149549e42 fix: KeyError arprompt 2025-09-03 12:45:34 +08:00
Soulter da351991f8 📦 release: bump verstion to v4.0.0-beta.3 2025-09-03 01:01:48 +08:00
Soulter 3305152e50 fix: 修复当人格 ID 为中文时,不可保存的问题 2025-09-03 00:59:07 +08:00
Soulter bea7bae674 fix: dict read 2025-09-03 00:56:41 +08:00
12 changed files with 3468 additions and 23 deletions
+3 -3
View File
@@ -6,7 +6,7 @@ import os
from astrbot.core.utils.astrbot_path import get_astrbot_data_path
VERSION = "4.0.0-beta.2"
VERSION = "4.0.0-beta.4"
DB_PATH = os.path.join(get_astrbot_data_path(), "data_v4.db")
# 默认配置
@@ -1913,7 +1913,7 @@ CONFIG_METADATA_3 = {
"type": "bool",
},
"provider_settings.identifier": {
"description": "用户感知",
"description": "用户识别",
"type": "bool",
},
"provider_settings.datetime_system_prompt": {
@@ -2288,7 +2288,7 @@ CONFIG_METADATA_3_SYSTEM = {
"condition": {
"t2i_strategy": "remote",
},
"_special": "t2i_template"
"_special": "t2i_template",
},
"log_level": {
"description": "控制台日志级别",
-1
View File
@@ -1 +0,0 @@
# What's Changed
@@ -1,3 +1,3 @@
# What's Changed
> 请仔细阅读:**这是 v4.0.0 的测试版本(beta.1),功能尚未完全稳定和加入**。v4.0.0 被设计为向前兼容,如有任何插件兼容性问题或者其他异常请在 GitHub 提交 [Issue](https://github.com/AstrBotDevs/AstrBot/issues)。在测试版本期间,您可以无缝回退到旧版本的 AstrBot,并且数据不受影响。新版本文档请[从此](https://docs-v4.astrbot.app/)访问,直到第一个 v4.0.0 稳定版本发布。
> 请仔细阅读:**这是 v4.0.0 的测试版本(beta.3),功能尚未完全稳定和加入**。v4.0.0 被设计为向前兼容,如有任何插件兼容性问题或者其他异常请在 GitHub 提交 [Issue](https://github.com/AstrBotDevs/AstrBot/issues)。在测试版本期间,您可以无缝回退到旧版本的 AstrBot,并且数据不受影响。新版本文档请[从此](https://docs-v4.astrbot.app/)访问,直到第一个 v4.0.0 稳定版本发布。
+8
View File
@@ -0,0 +1,8 @@
# What's Changed
> 请仔细阅读:**这是 v4.0.0 的测试版本(beta.4),功能尚未完全稳定和加入**。v4.0.0 被设计为向前兼容,如有任何插件兼容性问题或者其他异常请在 GitHub 提交 [Issue](https://github.com/AstrBotDevs/AstrBot/issues)。在测试版本期间,您可以无缝回退到旧版本的 AstrBot,并且数据不受影响。新版本文档请[从此](https://docs-v4.astrbot.app/)访问,直到第一个 v4.0.0 稳定版本发布。
相较于 beta.3
1. 修复了主动回复时报错的问题
2. 数据迁移完毕之后引导重启程序
@@ -12,7 +12,13 @@
<div v-if="migrationCompleted" class="text-center py-8">
<v-icon size="64" color="success" class="mb-4">mdi-check-circle</v-icon>
<h3 class="mb-4">{{ t('features.migration.dialog.completed') }}</h3>
{{ migrationResult?.message || t('features.migration.dialog.success') }}
<p class="mb-4">{{ migrationResult?.message || t('features.migration.dialog.success') }}</p>
<v-alert type="info" variant="tonal" class="mb-4">
<template v-slot:prepend>
<v-icon>mdi-information</v-icon>
</template>
{{ t('features.migration.dialog.restartRecommended') }}
</v-alert>
</div>
<div v-else-if="migrating" class="migration-in-progress">
@@ -80,8 +86,11 @@
<v-card-actions class="px-6 py-4">
<v-spacer></v-spacer>
<template v-if="migrationCompleted">
<v-btn color="primary" variant="elevated" @click="handleClose">
{{ t('core.common.confirm') }}
<v-btn color="grey" variant="text" @click="handleClose">
{{ t('core.common.close') }}
</v-btn>
<v-btn color="primary" variant="elevated" @click="restartAstrBot">
{{ t('features.migration.dialog.restartNow') }}
</v-btn>
</template>
<template v-else>
@@ -96,6 +105,8 @@
</v-card-actions>
</v-card>
</v-dialog>
<WaitingForRestart ref="wfr"></WaitingForRestart>
</template>
<script setup>
@@ -103,6 +114,7 @@ import { ref, computed, watch } from 'vue'
import axios from 'axios'
import { useI18n } from '@/i18n/composables'
import ConsoleDisplayer from './ConsoleDisplayer.vue'
import WaitingForRestart from './WaitingForRestart.vue'
const { t } = useI18n()
@@ -114,6 +126,7 @@ const migrationCompleted = ref(false)
const migrationResult = ref(null)
const platforms = ref([])
const selectedPlatforms = ref({})
const wfr = ref(null)
let resolvePromise = null
@@ -244,6 +257,15 @@ const getPlatformLabel = (platform) => {
return `${name}`
}
// 重启 AstrBot
const restartAstrBot = () => {
axios.post('/api/stat/restart-core').then(() => {
if (wfr.value) {
wfr.value.check();
}
})
}
// 打开对话框的方法
const open = () => {
isOpen.value = true
@@ -11,6 +11,8 @@
"migratingSubtitle": "Please wait patiently, do not close this window during migration",
"migrationError": "Migration failed",
"success": "Migration completed successfully!",
"completed": "Migration Completed"
"completed": "Migration Completed",
"restartRecommended": "It is recommended to restart the application for all changes to take effect.",
"restartNow": "Restart Now"
}
}
@@ -11,6 +11,8 @@
"migratingSubtitle": "请耐心等待,迁移过程中请勿关闭此窗口",
"migrationError": "迁移失败",
"success": "迁移成功完成!",
"completed": "迁移已完成"
"completed": "迁移已完成",
"restartRecommended": "建议重启应用程序以使所有更改生效。",
"restartNow": "立即重启"
}
}
+1 -2
View File
@@ -383,8 +383,7 @@ export default {
messageType: 'success',
personaIdRules: [
v => !!v || this.tm('validation.required'),
v => (v && v.length >= 2) || this.tm('validation.minLength', { min: 2 }),
v => /^[a-zA-Z0-9_-]+$/.test(v) || this.tm('validation.alphanumeric')
v => (v && v.length >= 0) || this.tm('validation.minLength', { min: 2 }),
],
systemPromptRules: [
v => !!v || this.tm('validation.required'),
+12 -6
View File
@@ -25,14 +25,18 @@ class LongTermMemory:
def cfg(self, event: AstrMessageEvent):
cfg = self.context.get_config(umo=event.unified_msg_origin)
try:
max_cnt = int(cfg["group_message_max_cnt"])
max_cnt = int(cfg["provider_ltm_settings"]["group_message_max_cnt"])
except BaseException as e:
logger.error(e)
max_cnt = 300
image_caption = True if cfg["image_caption_provider_id"] else False
image_caption_prompt = cfg["image_caption_prompt"]
image_caption_provider_id = cfg["image_caption_provider_id"]
active_reply = cfg["active_reply"]
image_caption = (
True
if cfg["provider_settings"]["default_image_caption_provider_id"]
else False
)
image_caption_prompt = cfg["provider_settings"]["image_caption_prompt"]
image_caption_provider_id = cfg["provider_settings"]["default_image_caption_provider_id"]
active_reply = cfg["provider_ltm_settings"]["active_reply"]
enable_active_reply = active_reply.get("enable", False)
ar_method = active_reply["method"]
ar_possibility = active_reply["possibility_reply"]
@@ -88,7 +92,9 @@ class LongTermMemory:
if cfg["ar_whitelist"] and (
event.unified_msg_origin not in cfg["ar_whitelist"]
and (event.get_group_id() and event.get_group_id() not in cfg["ar_whitelist"])
and (
event.get_group_id() and event.get_group_id() not in cfg["ar_whitelist"]
)
):
return False
+4 -4
View File
@@ -1110,7 +1110,9 @@ UID: {user_id} 此 ID 可用于设置管理员。
@filter.command("unset")
async def unset_variable(self, event: AstrMessageEvent, key: str):
uid = event.unified_msg_origin
session_var = await sp.session_get(umo="uid", key="session_variables", default={})
session_var = await sp.session_get(
umo="uid", key="session_variables", default={}
)
if key not in session_var:
yield event.plain_result("没有那个变量名。格式 /unset 变量名。")
@@ -1176,9 +1178,7 @@ UID: {user_id} 此 ID 可用于设置管理员。
)
return
prompt = self.ltm.ar_prompt
if not prompt:
prompt = event.message_str
prompt = event.message_str
yield event.request_llm(
prompt=prompt,
+1 -1
View File
@@ -1,6 +1,6 @@
[project]
name = "AstrBot"
version = "4.0.0-beta.2"
version = "4.0.0-beta.4"
description = "易上手的多平台 LLM 聊天机器人及开发框架"
readme = "README.md"
requires-python = ">=3.10"
Generated
+3407
View File
File diff suppressed because it is too large Load Diff