docs: 更新快速开始指南和版本号,优化数据库描述注入逻辑

This commit is contained in:
Wenjie Zhang 2026-01-24 12:36:24 +08:00
parent d3c482d6bf
commit 794a860a58
6 changed files with 22 additions and 15 deletions

View File

@ -16,13 +16,13 @@
```bash
# 克隆稳定版本
git clone --branch v0.5.0-beta --depth 1 https://github.com/xerrors/Yuxi-Know.git
git clone --branch v0.5.0-beta2 --depth 1 https://github.com/xerrors/Yuxi-Know.git
cd Yuxi-Know
```
::: warning 版本说明
- `v0.4.4`: 稳定版本
- `v0.5.0-beta`: 由于数据库重构使用 postgres可能会存在数据库迁移问题建议新用户使用。
- `v0.5.0-beta2`: 由于数据库重构使用 postgres可能会存在数据库迁移问题建议新用户使用。
- `main`: 最新开发版本(不稳定,新特性可能会导致新 bug
:::

View File

@ -312,6 +312,7 @@ def mysql_query(
def _get_db_description() -> str:
"""获取数据库描述"""
import os
return os.getenv("MYSQL_DATABASE_DESCRIPTION") or ""
@ -329,10 +330,10 @@ def _inject_db_description(tools: list[Any]) -> None:
if not db_desc:
return
for tool in tools:
if hasattr(tool, 'description'):
for _tool in tools:
if hasattr(_tool, "description"):
# 在描述末尾添加数据库说明
tool.description = f"{tool.description}\n\n当前数据库说明: {db_desc}"
_tool.description = f"{_tool.description}\n\n当前数据库说明: {db_desc}"
_db_description_injected = True

View File

@ -4906,7 +4906,7 @@ wheels = [
[[package]]
name = "yuxi-know"
version = "0.4.3.dev0"
version = "0.5.0.dev0"
source = { virtual = "." }
dependencies = [
{ name = "aiofiles" },

View File

@ -691,7 +691,11 @@ const validateAndFilterConfig = () => {
}
// (type === 'list' options)
else if (configItem.type === 'list' && configItem.options.length > 0 && Array.isArray(currentValue)) {
else if (
configItem.type === 'list' &&
configItem.options.length > 0 &&
Array.isArray(currentValue)
) {
const validOptions = configItem.options
validatedConfig[key] = currentValue.filter((value) => validOptions.includes(value))

View File

@ -164,14 +164,14 @@ const isEvaluationSupported = computed(() => {
// status: 'uploaded'
const pendingParseCount = computed(() => {
const files = store.database.files || {}
return Object.values(files).filter(f => !f.is_folder && f.status === 'uploaded').length
return Object.values(files).filter((f) => !f.is_folder && f.status === 'uploaded').length
})
// status: 'parsed' 'error_indexing'
const pendingIndexCount = computed(() => {
const files = store.database.files || {}
const isLightRAG = database.value?.kb_type?.toLowerCase() === 'lightrag'
return Object.values(files).filter(f => {
return Object.values(files).filter((f) => {
if (f.is_folder) return false
if (isLightRAG) {
return f.status === 'parsed'
@ -183,8 +183,8 @@ const pendingIndexCount = computed(() => {
//
const confirmBatchParse = () => {
const fileIds = Object.values(store.database.files || {})
.filter(f => f.status === 'uploaded')
.map(f => f.file_id)
.filter((f) => f.status === 'uploaded')
.map((f) => f.file_id)
if (fileIds.length === 0) {
return
@ -201,12 +201,12 @@ const confirmBatchParse = () => {
const confirmBatchIndex = () => {
const isLightRAG = database.value?.kb_type?.toLowerCase() === 'lightrag'
const fileIds = Object.values(store.database.files || {})
.filter(f => {
.filter((f) => {
if (f.is_folder) return false
if (isLightRAG) return f.status === 'parsed'
return f.status === 'parsed' || f.status === 'error_indexing'
})
.map(f => f.file_id)
.map((f) => f.file_id)
if (fileIds.length === 0) {
return

View File

@ -21,7 +21,9 @@
<h1 class="brand-text">{{ brandName }}</h1>
</div>
<div class="login-top-action">
<a-button type="text" size="small" class="back-home-btn" @click="goHome"> 返回首页 </a-button>
<a-button type="text" size="small" class="back-home-btn" @click="goHome">
返回首页
</a-button>
</div>
</div>
</nav>
@ -876,4 +878,4 @@ onUnmounted(() => {
padding: 40px 20px;
}
}
</style>
</style>