From 23a0dba4709324ed65a08b1241cd65333c63e4b2 Mon Sep 17 00:00:00 2001 From: "Junyan Qin (Chin)" Date: Sun, 30 Mar 2025 23:04:46 +0800 Subject: [PATCH] feat(dify): throw error event (#1251) --- pkg/provider/runners/difysvapi.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/provider/runners/difysvapi.py b/pkg/provider/runners/difysvapi.py index 81ceddee..a33a3c0b 100644 --- a/pkg/provider/runners/difysvapi.py +++ b/pkg/provider/runners/difysvapi.py @@ -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"]