Merge pull request #381 from MuWinds/main-fix

Fix:当bot要处理一个空格消息,获取embedding向量会发生报错
pull/390/head
SengokuCola 2025-03-14 19:35:11 +08:00 committed by GitHub
commit 004b0cc13d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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: