fix: clarify multimodal doubt fallback behavior

parent 8497d29a
...@@ -255,6 +255,9 @@ def test_build_request_spec_for_video_doubt_request_builder_uses_text_endpoint_w ...@@ -255,6 +255,9 @@ def test_build_request_spec_for_video_doubt_request_builder_uses_text_endpoint_w
assert spec["json"]["model"] == "vision:test" assert spec["json"]["model"] == "vision:test"
assert str(video_path) in spec["json"]["messages"][0]["content"] assert str(video_path) in spec["json"]["messages"][0]["content"]
assert "What happens in this clip?" in spec["json"]["messages"][0]["content"] assert "What happens in this clip?" in spec["json"]["messages"][0]["content"]
assert "local path reference only" in spec["json"]["messages"][0]["content"]
assert "may or may not support reasoning from that reference" in spec["json"]["messages"][0]["content"]
assert "acknowledge that limitation" in spec["json"]["messages"][0]["content"]
def test_build_request_spec_for_music_audio_doubt_request_builder_uses_text_endpoint_with_audio_context(tmp_path): def test_build_request_spec_for_music_audio_doubt_request_builder_uses_text_endpoint_with_audio_context(tmp_path):
...@@ -278,6 +281,43 @@ def test_build_request_spec_for_music_audio_doubt_request_builder_uses_text_endp ...@@ -278,6 +281,43 @@ def test_build_request_spec_for_music_audio_doubt_request_builder_uses_text_endp
assert spec["json"]["model"] == "audio:test" assert spec["json"]["model"] == "audio:test"
assert str(audio_path) in spec["json"]["messages"][0]["content"] assert str(audio_path) in spec["json"]["messages"][0]["content"]
assert "Describe the music." in spec["json"]["messages"][0]["content"] assert "Describe the music." in spec["json"]["messages"][0]["content"]
assert "local path reference only" in spec["json"]["messages"][0]["content"]
assert "may or may not support reasoning from that reference" in spec["json"]["messages"][0]["content"]
assert "acknowledge that limitation" in spec["json"]["messages"][0]["content"]
def test_build_request_spec_for_video_doubt_request_builder_requires_video_file_flag(tmp_path):
config = {
"mode": "video-doubt",
"url": "http://127.0.0.1:6745",
"model": "vision:test",
"prompt": "What happens in this clip?",
"output_dir": tmp_path,
"token": None,
"audio_file": None,
"video_file": None,
"response_format": None,
}
with pytest.raises(FileNotFoundError, match=r"Missing required file\. Supply --video-file\."):
build_request_spec(config)
def test_build_request_spec_for_music_audio_doubt_request_builder_requires_audio_file_flag(tmp_path):
config = {
"mode": "music-audio-doubt",
"url": "http://127.0.0.1:6745",
"model": "audio:test",
"prompt": "Describe the music.",
"output_dir": tmp_path,
"token": None,
"audio_file": None,
"video_file": None,
"response_format": None,
}
with pytest.raises(FileNotFoundError, match=r"Missing required file\. Supply --audio-file\."):
build_request_spec(config)
def test_build_request_spec_for_transcription_requires_audio_file_flag(tmp_path): def test_build_request_spec_for_transcription_requires_audio_file_flag(tmp_path):
......
...@@ -150,7 +150,8 @@ def build_request_spec(config: dict) -> dict: ...@@ -150,7 +150,8 @@ def build_request_spec(config: dict) -> dict:
content = ( content = (
f"Video file: {video_path}\n" f"Video file: {video_path}\n"
f"Question: {config['prompt']}\n" f"Question: {config['prompt']}\n"
"Answer based on the referenced video input if the model/backend supports it." "This request provides a local path reference only; the backend/model may or may not support reasoning from that reference. "
"If you cannot access the referenced media, acknowledge that limitation in your answer."
) )
return { return {
"method": "POST", "method": "POST",
...@@ -167,7 +168,8 @@ def build_request_spec(config: dict) -> dict: ...@@ -167,7 +168,8 @@ def build_request_spec(config: dict) -> dict:
content = ( content = (
f"Audio file: {audio_path}\n" f"Audio file: {audio_path}\n"
f"Question: {config['prompt']}\n" f"Question: {config['prompt']}\n"
"Answer based on the referenced audio input if the model/backend supports it." "This request provides a local path reference only; the backend/model may or may not support reasoning from that reference. "
"If you cannot access the referenced media, acknowledge that limitation in your answer."
) )
return { return {
"method": "POST", "method": "POST",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment