dify 版本总结,加上图片发送
This commit is contained in:
@@ -65,7 +65,10 @@ def message_summary_dify(content):
|
||||
# 添加token信息
|
||||
tokens_info = f"\n\n【tokens】输入: {prompt_tokens} 生成: {completion_tokens} 总: {total_tokens}"
|
||||
answer += tokens_info
|
||||
spath = convert_md_str_to_image(answer, "output.png")
|
||||
try:
|
||||
spath = convert_md_str_to_image(answer, "output.png")
|
||||
except Exception as e:
|
||||
print(f"生成image失败:{e}")
|
||||
# 返回文本内容和图片路径
|
||||
return answer, spath
|
||||
|
||||
|
||||
Reference in New Issue
Block a user