feat: 添加同步获取embedding向量和生成响应的方法

This commit is contained in:
墨梓柒
2025-07-16 11:00:16 +08:00
parent a8cbb2978b
commit c71f2b21c0
5 changed files with 41 additions and 6 deletions

View File

@@ -10,7 +10,7 @@ from .kg_manager import KGManager
# from .lpmmconfig import global_config
from .utils.dyn_topk import dyn_select_top_k
from src.llm_models.utils_model import LLMRequest
from src.chat.utils.utils import get_embedding
from src.chat.utils.utils import get_embedding_sync
from src.config.config import global_config
MAX_KNOWLEDGE_LENGTH = 10000 # 最大知识长度
@@ -36,7 +36,7 @@ class QAManager:
# 生成问题的Embedding
part_start_time = time.perf_counter()
question_embedding = await get_embedding(question)
question_embedding = await get_embedding_sync(question)
if question_embedding is None:
logger.error("生成问题Embedding失败")
return None