fix: 知识库添加时 vec 变量未初始化导致 embedding 禁用时报错

This commit is contained in:
2026-04-02 22:51:09 +08:00
parent 7151070c99
commit c3d709afeb
3 changed files with 15 additions and 0 deletions

Binary file not shown.

View File

@@ -0,0 +1,14 @@
{
"feishu": {
"app_id": "cli_a8b50ec0eed1500d",
"table_id": "tblnl3vJPpgMTSiP",
"status": "active",
"app_secret": "***"
},
"system": {
"sync_limit": 10,
"ai_suggestions_enabled": true,
"auto_sync_interval": 0,
"last_sync_time": null
}
}

View File

@@ -356,6 +356,7 @@ class KnowledgeManager:
# 生成 embedding
embedding_json = None
vec = None
text_for_embedding = question + " " + answer
if self.embedding_enabled:
vec = self.embedding_client.embed_text(text_for_embedding)