feat(dify): throw error event (#1251)

This commit is contained in:
Junyan Qin (Chin)
2025-03-30 23:04:46 +08:00
committed by GitHub
parent 629ebae0e9
commit 23a0dba470

View File

@@ -225,6 +225,8 @@ class DifyServiceAPIRunner(runner.RequestRunner):
role="assistant",
content=[llm_entities.ContentElement.from_image_url(image_url)],
)
if chunk['event'] == 'error':
raise errors.DifyAPIError("dify 服务错误: " + chunk['message'])
query.session.using_conversation.uuid = chunk["conversation_id"]