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
0a64e7d0
Commit
0a64e7d0
authored
May 06, 2026
by
Stefy Lanza (nextime / spora )
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: use managed sample resolution in request builders
parent
9537c9b8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
70 additions
and
2 deletions
+70
-2
test_manual_multimodal_test_client.py
tests/test_manual_multimodal_test_client.py
+68
-0
manual_multimodal_test_client.py
tools/manual_multimodal_test_client.py
+2
-2
No files found.
tests/test_manual_multimodal_test_client.py
View file @
0a64e7d0
...
...
@@ -380,6 +380,41 @@ def test_build_request_spec_for_transcription_downloads_missing_managed_default(
uploaded_file
.
close
()
def
test_build_request_spec_for_transcription_downloads_missing_default_audio
(
tmp_path
,
monkeypatch
):
managed_path
=
tmp_path
/
"samples"
/
"transcription.wav"
calls
=
[]
config
=
{
"mode"
:
"transcription"
,
"url"
:
"http://127.0.0.1:6745"
,
"model"
:
"audio:test"
,
"prompt"
:
"Transcribe carefully"
,
"output_dir"
:
tmp_path
,
"token"
:
None
,
"audio_file"
:
str
(
managed_path
),
"video_file"
:
None
,
"response_format"
:
None
,
}
def
fake_ensure
(
path_value
,
flag_name
):
calls
.
append
((
path_value
,
flag_name
))
managed_path
.
parent
.
mkdir
(
parents
=
True
,
exist_ok
=
True
)
managed_path
.
write_bytes
(
b
"downloaded-audio"
)
return
managed_path
monkeypatch
.
setattr
(
"tools.manual_multimodal_test_client.ensure_sample_file"
,
fake_ensure
,
)
spec
=
build_request_spec
(
config
)
uploaded_name
,
uploaded_file
=
spec
[
"files"
][
"file"
]
assert
calls
==
[(
str
(
managed_path
),
"--audio-file"
)]
assert
uploaded_name
==
"transcription.wav"
assert
uploaded_file
.
read
()
==
b
"downloaded-audio"
uploaded_file
.
close
()
def
test_build_request_spec_for_audio_generation_uses_json_payload
(
tmp_path
):
config
=
{
"mode"
:
"audio-generation"
,
...
...
@@ -460,6 +495,39 @@ def test_build_request_spec_for_video_doubt_request_builder_uses_text_endpoint_w
assert
"acknowledge that limitation"
in
spec
[
"json"
][
"messages"
][
0
][
"content"
]
def
test_build_request_spec_for_video_doubt_downloads_missing_default_video
(
tmp_path
,
monkeypatch
):
managed_path
=
tmp_path
/
"samples"
/
"question-video.mp4"
calls
=
[]
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
(
managed_path
),
"response_format"
:
None
,
}
def
fake_ensure
(
path_value
,
flag_name
):
calls
.
append
((
path_value
,
flag_name
))
managed_path
.
parent
.
mkdir
(
parents
=
True
,
exist_ok
=
True
)
managed_path
.
write_bytes
(
b
"video-bytes"
)
return
managed_path
monkeypatch
.
setattr
(
"tools.manual_multimodal_test_client.ensure_sample_file"
,
fake_ensure
,
)
spec
=
build_request_spec
(
config
)
assert
calls
==
[(
str
(
managed_path
),
"--video-file"
)]
assert
str
(
managed_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_request_builder_uses_text_endpoint_with_audio_context
(
tmp_path
):
audio_path
=
tmp_path
/
"clip.wav"
audio_path
.
write_bytes
(
b
"audio-bytes"
)
...
...
tools/manual_multimodal_test_client.py
View file @
0a64e7d0
...
...
@@ -197,7 +197,7 @@ def build_request_spec(config: dict) -> dict:
}
if
mode
==
"video-doubt"
:
video_path
=
_requir
e_file
(
config
.
get
(
"video_file"
),
"--video-file"
)
video_path
=
ensure_sampl
e_file
(
config
.
get
(
"video_file"
),
"--video-file"
)
content
=
(
f
"Video file: {video_path}
\n
"
f
"Question: {config['prompt']}
\n
"
...
...
@@ -215,7 +215,7 @@ def build_request_spec(config: dict) -> dict:
}
if
mode
==
"music-audio-doubt"
:
audio_path
=
_requir
e_file
(
config
.
get
(
"audio_file"
),
"--audio-file"
)
audio_path
=
ensure_sampl
e_file
(
config
.
get
(
"audio_file"
),
"--audio-file"
)
content
=
(
f
"Audio file: {audio_path}
\n
"
f
"Question: {config['prompt']}
\n
"
...
...
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