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

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)