dify 支持图片http请求,方便随时追加API,添加video 类型
This commit is contained in:
@@ -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"]
|
||||
|
||||
Reference in New Issue
Block a user