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
b178f70b
Commit
b178f70b
authored
May 06, 2026
by
Stefy Lanza (nextime / spora )
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: wire managed sample resolution into request builders
parent
1f1d0393
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
3 deletions
+42
-3
test_manual_multimodal_test_client.py
tests/test_manual_multimodal_test_client.py
+39
-0
manual_multimodal_test_client.py
tools/manual_multimodal_test_client.py
+3
-3
No files found.
tests/test_manual_multimodal_test_client.py
View file @
b178f70b
...
...
@@ -227,6 +227,45 @@ def test_build_request_spec_for_transcription_uses_multipart_file(tmp_path):
uploaded_file
.
close
()
def
test_build_request_spec_for_transcription_downloads_missing_managed_default
(
tmp_path
,
monkeypatch
):
managed_path
=
tmp_path
/
"samples"
/
"transcription.wav"
downloaded
=
[]
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_download
(
path
):
downloaded
.
append
(
path
)
path
.
parent
.
mkdir
(
parents
=
True
,
exist_ok
=
True
)
path
.
write_bytes
(
b
"downloaded-wav"
)
return
path
monkeypatch
.
setattr
(
"tools.manual_multimodal_test_client.SAMPLE_URLS"
,
{
managed_path
.
as_posix
():
"https://example.invalid/transcription.wav"
},
)
monkeypatch
.
setattr
(
"tools.manual_multimodal_test_client.download_default_sample"
,
fake_download
,
)
spec
=
build_request_spec
(
config
)
uploaded_name
,
uploaded_file
=
spec
[
"files"
][
"file"
]
assert
uploaded_name
==
"transcription.wav"
assert
uploaded_file
.
read
()
==
b
"downloaded-wav"
assert
downloaded
==
[
managed_path
]
uploaded_file
.
close
()
def
test_build_request_spec_for_audio_generation_uses_json_payload
(
tmp_path
):
config
=
{
"mode"
:
"audio-generation"
,
...
...
tools/manual_multimodal_test_client.py
View file @
b178f70b
...
...
@@ -139,7 +139,7 @@ def build_request_spec(config: dict) -> dict:
}
if
mode
==
"transcription"
:
audio_path
=
_requir
e_file
(
config
.
get
(
"audio_file"
),
"--audio-file"
)
audio_path
=
ensure_sampl
e_file
(
config
.
get
(
"audio_file"
),
"--audio-file"
)
file_stack
=
ExitStack
()
return
{
"method"
:
"POST"
,
...
...
@@ -180,7 +180,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
"
...
...
@@ -198,7 +198,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