Fix:当bot要处理一个空格消息,获取embedding向量会发生报错

pull/381/head
MuWinds 2025-03-14 17:25:44 +08:00
parent aa5bc85e31
commit 339cbe3f8f
1 changed files with 3 additions and 0 deletions

View File

@ -530,6 +530,9 @@ class LLM_request:
list: embedding向量如果失败则返回None
"""
if(len(text) < 1):
logger.debug("该消息没有长度不再发送获取embedding向量的请求")
return None
def embedding_handler(result):
"""处理响应"""
if "data" in result and len(result["data"]) > 0: