diff --git a/dist/index.js b/dist/index.js index 6d3fc0792a237a90ab5f1d0a7a4bc20434ee1981..ef4f93163d649848ea1ca58f7f623f8dddabfbc7 100644 --- a/dist/index.js +++ b/dist/index.js @@ -181,6 +181,17 @@ function convertToOpenAICompatibleChatMessages(prompt) { ...partMetadata }; } + if (part.mediaType.startsWith("video/")) { + // zcode patch: video/* file part -> OpenAI-compatible video_url content part. + // Video bytes are serialized as a base64 data URL. + return { + type: "video_url", + video_url: { + url: `data:${part.mediaType};base64,${(0, import_provider_utils.convertToBase64)(part.data)}` + }, + ...partMetadata + }; + } if (part.mediaType === "application/pdf") { if (part.data instanceof URL) { throw new import_provider.UnsupportedFunctionalityError({ diff --git a/dist/index.mjs b/dist/index.mjs index 499fd17e4c9ac77352789c1f1f69ed32809218a4..759273c1a5035dfb699753164dd79b0dcba3cb4e 100644 --- a/dist/index.mjs +++ b/dist/index.mjs @@ -165,6 +165,17 @@ function convertToOpenAICompatibleChatMessages(prompt) { ...partMetadata }; } + if (part.mediaType.startsWith("video/")) { + // zcode patch: video/* file part -> OpenAI-compatible video_url content part. + // Video bytes are serialized as a base64 data URL. + return { + type: "video_url", + video_url: { + url: `data:${part.mediaType};base64,${convertToBase64(part.data)}` + }, + ...partMetadata + }; + } if (part.mediaType === "application/pdf") { if (part.data instanceof URL) { throw new UnsupportedFunctionalityError({