docs: 更新快速开始指南和版本号,优化数据库描述注入逻辑
This commit is contained in:
parent
d3c482d6bf
commit
794a860a58
@ -16,13 +16,13 @@
|
|||||||
|
|
||||||
```bash
|
```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
|
cd Yuxi-Know
|
||||||
```
|
```
|
||||||
|
|
||||||
::: warning 版本说明
|
::: warning 版本说明
|
||||||
- `v0.4.4`: 稳定版本
|
- `v0.4.4`: 稳定版本
|
||||||
- `v0.5.0-beta`: 由于数据库重构使用 postgres,可能会存在数据库迁移问题,建议新用户使用。
|
- `v0.5.0-beta2`: 由于数据库重构使用 postgres,可能会存在数据库迁移问题,建议新用户使用。
|
||||||
- `main`: 最新开发版本(不稳定,新特性可能会导致新 bug)
|
- `main`: 最新开发版本(不稳定,新特性可能会导致新 bug)
|
||||||
:::
|
:::
|
||||||
|
|
||||||
|
|||||||
@ -312,6 +312,7 @@ def mysql_query(
|
|||||||
def _get_db_description() -> str:
|
def _get_db_description() -> str:
|
||||||
"""获取数据库描述"""
|
"""获取数据库描述"""
|
||||||
import os
|
import os
|
||||||
|
|
||||||
return os.getenv("MYSQL_DATABASE_DESCRIPTION") or ""
|
return os.getenv("MYSQL_DATABASE_DESCRIPTION") or ""
|
||||||
|
|
||||||
|
|
||||||
@ -329,10 +330,10 @@ def _inject_db_description(tools: list[Any]) -> None:
|
|||||||
if not db_desc:
|
if not db_desc:
|
||||||
return
|
return
|
||||||
|
|
||||||
for tool in tools:
|
for _tool in tools:
|
||||||
if hasattr(tool, 'description'):
|
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
|
_db_description_injected = True
|
||||||
|
|
||||||
|
|||||||
2
uv.lock
2
uv.lock
@ -4906,7 +4906,7 @@ wheels = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "yuxi-know"
|
name = "yuxi-know"
|
||||||
version = "0.4.3.dev0"
|
version = "0.5.0.dev0"
|
||||||
source = { virtual = "." }
|
source = { virtual = "." }
|
||||||
dependencies = [
|
dependencies = [
|
||||||
{ name = "aiofiles" },
|
{ name = "aiofiles" },
|
||||||
|
|||||||
@ -691,7 +691,11 @@ const validateAndFilterConfig = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 检查多选配置项 (type === 'list' 且有 options)
|
// 检查多选配置项 (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
|
const validOptions = configItem.options
|
||||||
validatedConfig[key] = currentValue.filter((value) => validOptions.includes(value))
|
validatedConfig[key] = currentValue.filter((value) => validOptions.includes(value))
|
||||||
|
|
||||||
|
|||||||
@ -164,14 +164,14 @@ const isEvaluationSupported = computed(() => {
|
|||||||
// 计算待解析文件数量(status: 'uploaded')
|
// 计算待解析文件数量(status: 'uploaded')
|
||||||
const pendingParseCount = computed(() => {
|
const pendingParseCount = computed(() => {
|
||||||
const files = store.database.files || {}
|
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')
|
// 计算待入库文件数量(status: 'parsed' 或 'error_indexing')
|
||||||
const pendingIndexCount = computed(() => {
|
const pendingIndexCount = computed(() => {
|
||||||
const files = store.database.files || {}
|
const files = store.database.files || {}
|
||||||
const isLightRAG = database.value?.kb_type?.toLowerCase() === 'lightrag'
|
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 (f.is_folder) return false
|
||||||
if (isLightRAG) {
|
if (isLightRAG) {
|
||||||
return f.status === 'parsed'
|
return f.status === 'parsed'
|
||||||
@ -183,8 +183,8 @@ const pendingIndexCount = computed(() => {
|
|||||||
// 确认批量解析
|
// 确认批量解析
|
||||||
const confirmBatchParse = () => {
|
const confirmBatchParse = () => {
|
||||||
const fileIds = Object.values(store.database.files || {})
|
const fileIds = Object.values(store.database.files || {})
|
||||||
.filter(f => f.status === 'uploaded')
|
.filter((f) => f.status === 'uploaded')
|
||||||
.map(f => f.file_id)
|
.map((f) => f.file_id)
|
||||||
|
|
||||||
if (fileIds.length === 0) {
|
if (fileIds.length === 0) {
|
||||||
return
|
return
|
||||||
@ -201,12 +201,12 @@ const confirmBatchParse = () => {
|
|||||||
const confirmBatchIndex = () => {
|
const confirmBatchIndex = () => {
|
||||||
const isLightRAG = database.value?.kb_type?.toLowerCase() === 'lightrag'
|
const isLightRAG = database.value?.kb_type?.toLowerCase() === 'lightrag'
|
||||||
const fileIds = Object.values(store.database.files || {})
|
const fileIds = Object.values(store.database.files || {})
|
||||||
.filter(f => {
|
.filter((f) => {
|
||||||
if (f.is_folder) return false
|
if (f.is_folder) return false
|
||||||
if (isLightRAG) return f.status === 'parsed'
|
if (isLightRAG) return f.status === 'parsed'
|
||||||
return f.status === 'parsed' || f.status === 'error_indexing'
|
return f.status === 'parsed' || f.status === 'error_indexing'
|
||||||
})
|
})
|
||||||
.map(f => f.file_id)
|
.map((f) => f.file_id)
|
||||||
|
|
||||||
if (fileIds.length === 0) {
|
if (fileIds.length === 0) {
|
||||||
return
|
return
|
||||||
|
|||||||
@ -21,7 +21,9 @@
|
|||||||
<h1 class="brand-text">{{ brandName }}</h1>
|
<h1 class="brand-text">{{ brandName }}</h1>
|
||||||
</div>
|
</div>
|
||||||
<div class="login-top-action">
|
<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>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user