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

This commit is contained in:
MuWinds committed 2025-03-14 17:25:44 +08:00
1 parent aa5bc85e31
commit 339cbe3f8f
1 file changed
+3
+3
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: