fix(chatter): 修复impression_llm未初始化时调用问题
在调用`impression_llm.generate_response_async`之前增加空值检查,避免在`impression_llm`未被初始化时引发异常,增强了代码的健壮性。
This commit is contained in:
committed by
Windpicker-owo
parent
2ee6aa3951
commit
b4f83b887a
@@ -284,6 +284,9 @@ class ChatStreamImpressionTool(BaseTool):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
# 调用LLM
|
# 调用LLM
|
||||||
|
if not self.impression_llm:
|
||||||
|
logger.info("未初始化impression_llm")
|
||||||
|
return None
|
||||||
llm_response, _ = await self.impression_llm.generate_response_async(prompt=prompt)
|
llm_response, _ = await self.impression_llm.generate_response_async(prompt=prompt)
|
||||||
|
|
||||||
if not llm_response:
|
if not llm_response:
|
||||||
|
|||||||
Reference in New Issue
Block a user