docs: 更新快速开始指南和版本号,优化数据库描述注入逻辑
This commit is contained in:
parent
d3c482d6bf
commit
794a860a58
@ -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)
|
||||
:::
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
2
uv.lock
2
uv.lock
@ -4906,7 +4906,7 @@ wheels = [
|
||||
|
||||
[[package]]
|
||||
name = "yuxi-know"
|
||||
version = "0.4.3.dev0"
|
||||
version = "0.5.0.dev0"
|
||||
source = { virtual = "." }
|
||||
dependencies = [
|
||||
{ name = "aiofiles" },
|
||||
|
||||
@ -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))
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user