dify 支持图片http请求,方便随时追加API,添加video 类型

This commit is contained in:
liuwei
2025-04-07 16:47:13 +08:00
parent 3b34be2e7a
commit 330cb95f82

View File

@@ -270,6 +270,11 @@ class DifyPlugin(MessagePluginInterface):
image_url = outputs["result"]
image_path = downloader.download_media(image_url)
answer = image_path
if outputs["type"] == "video":
downloader = MediaDownloader()
image_url = outputs["result"]
image_path = downloader.download_media(image_url)
answer = image_path
# 处理文本类型返回
elif "text" in outputs and isinstance(outputs["text"], str):
answer = outputs["text"]