Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
C
coderai
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexlab
coderai
Commits
fbdcc1d5
Commit
fbdcc1d5
authored
May 06, 2026
by
Stefy Lanza (nextime / spora )
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: add multimodal client doubt modes
parent
49c2f682
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
80 additions
and
0 deletions
+80
-0
test_manual_multimodal_test_client.py
tests/test_manual_multimodal_test_client.py
+46
-0
manual_multimodal_test_client.py
tools/manual_multimodal_test_client.py
+34
-0
No files found.
tests/test_manual_multimodal_test_client.py
View file @
fbdcc1d5
...
@@ -234,6 +234,52 @@ def test_build_request_spec_for_video_generation_uses_json_payload(tmp_path):
...
@@ -234,6 +234,52 @@ def test_build_request_spec_for_video_generation_uses_json_payload(tmp_path):
}
}
def
test_build_request_spec_for_video_doubt_uses_text_endpoint_with_video_context
(
tmp_path
):
video_path
=
tmp_path
/
"clip.mp4"
video_path
.
write_bytes
(
b
"video-bytes"
)
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"
:
str
(
video_path
),
"response_format"
:
None
,
}
spec
=
build_request_spec
(
config
)
assert
spec
[
"url"
]
.
endswith
(
"/v1/chat/completions"
)
assert
spec
[
"json"
][
"model"
]
==
"vision:test"
assert
str
(
video_path
)
in
spec
[
"json"
][
"messages"
][
0
][
"content"
]
assert
"What happens in this clip?"
in
spec
[
"json"
][
"messages"
][
0
][
"content"
]
def
test_build_request_spec_for_music_audio_doubt_uses_text_endpoint_with_audio_context
(
tmp_path
):
audio_path
=
tmp_path
/
"clip.wav"
audio_path
.
write_bytes
(
b
"audio-bytes"
)
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"
:
str
(
audio_path
),
"video_file"
:
None
,
"response_format"
:
None
,
}
spec
=
build_request_spec
(
config
)
assert
spec
[
"url"
]
.
endswith
(
"/v1/chat/completions"
)
assert
spec
[
"json"
][
"model"
]
==
"audio:test"
assert
str
(
audio_path
)
in
spec
[
"json"
][
"messages"
][
0
][
"content"
]
assert
"Describe the music."
in
spec
[
"json"
][
"messages"
][
0
][
"content"
]
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
):
config
=
{
config
=
{
"mode"
:
"transcription"
,
"mode"
:
"transcription"
,
...
...
tools/manual_multimodal_test_client.py
View file @
fbdcc1d5
...
@@ -145,6 +145,40 @@ def build_request_spec(config: dict) -> dict:
...
@@ -145,6 +145,40 @@ def build_request_spec(config: dict) -> dict:
},
},
}
}
if
mode
==
"video-doubt"
:
video_path
=
_require_file
(
config
.
get
(
"video_file"
),
"--video-file"
)
content
=
(
f
"Video file: {video_path}
\n
"
f
"Question: {config['prompt']}
\n
"
"Answer based on the referenced video input if the model/backend supports it."
)
return
{
"method"
:
"POST"
,
"url"
:
f
"{config['url']}/v1/chat/completions"
,
"headers"
:
headers
,
"json"
:
{
"model"
:
config
[
"model"
],
"messages"
:
[{
"role"
:
"user"
,
"content"
:
content
}],
},
}
if
mode
==
"music-audio-doubt"
:
audio_path
=
_require_file
(
config
.
get
(
"audio_file"
),
"--audio-file"
)
content
=
(
f
"Audio file: {audio_path}
\n
"
f
"Question: {config['prompt']}
\n
"
"Answer based on the referenced audio input if the model/backend supports it."
)
return
{
"method"
:
"POST"
,
"url"
:
f
"{config['url']}/v1/chat/completions"
,
"headers"
:
headers
,
"json"
:
{
"model"
:
config
[
"model"
],
"messages"
:
[{
"role"
:
"user"
,
"content"
:
content
}],
},
}
raise
ValueError
(
f
"Unsupported mode for this task: {mode}"
)
raise
ValueError
(
f
"Unsupported mode for this task: {mode}"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment