Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions skillclaw/protocols/openai_responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ def content_to_openai_chat_content(content: Any) -> str | list[dict[str, Any]]:
image_url = image_url.get("url")
if isinstance(image_url, str) and image_url:
parts.append({"type": "image_url", "image_url": {"url": image_url}})
elif item_type in {"input_video", "video_url"}:
video_url = item.get("video_url") or item.get("url")
if isinstance(video_url, dict):
video_url = video_url.get("url")
if isinstance(video_url, str) and video_url:
parts.append({"type": "video_url", "video_url": {"url": video_url}})
if not parts:
return ""
if all(part.get("type") == "text" for part in parts):
Expand Down
5 changes: 5 additions & 0 deletions tests/test_responses_codex.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,11 @@ def test_codex_responses_multimodal_image_input_converts_to_openai_chat_content_
}
]

def test_codex_responses_minimax_video_input_converts_to_openai_chat_content_parts():
body = {"model":"MiniMax-M3","input":[{"type":"message","role":"user","content":[{"type":"input_video","video_url":"https://example.test/video.mp4"}]}]}
converted = openai_responses.to_openai_body(body, "fallback-model")
assert converted["messages"][0]["content"] == [{"type":"video_url","video_url":{"url":"https://example.test/video.mp4"}}]


def test_codex_responses_skill_function_call_and_output_convert_to_chat_tool_roundtrip():
body = {
Expand Down
Loading