diff --git a/python/dify_plugin/interfaces/model/openai_compatible/llm.py b/python/dify_plugin/interfaces/model/openai_compatible/llm.py index e26c7464..583d6857 100644 --- a/python/dify_plugin/interfaces/model/openai_compatible/llm.py +++ b/python/dify_plugin/interfaces/model/openai_compatible/llm.py @@ -39,6 +39,7 @@ SystemPromptMessage, ToolPromptMessage, UserPromptMessage, + VideoPromptMessageContent, ) from dify_plugin.errors.model import CredentialsValidateFailedError, InvokeError from dify_plugin.interfaces.model.large_language_model import LargeLanguageModel @@ -730,6 +731,15 @@ def _convert_prompt_message_to_dict(self, message: PromptMessage, credentials: d }, } sub_messages.append(sub_message_dict) + elif message_content.type == PromptMessageContentType.VIDEO: + message_content = cast(VideoPromptMessageContent, message_content) + sub_message_dict = { + "type": "video_url", + "video_url": { + "url": message_content.data, + }, + } + sub_messages.append(sub_message_dict) message_dict = {"role": "user", "content": sub_messages} elif isinstance(message, AssistantPromptMessage):