diff --git a/app/server/README.md b/app/server/README.md index e73ff30c..41f25086 100644 --- a/app/server/README.md +++ b/app/server/README.md @@ -480,6 +480,7 @@ Because the body carries audio rather than JSON, parameters are query parameters | `channels` | `1` | interleaved channel count | | `sample_format` | `s16le` | `s16le` or `f32le` | | `language` | unset | passed through to the model | +| `prompt` | unset | URL-encoded recognition context (hotwords, spellings), same as the multipart `prompt` field | | `busy_timeout_ms` | model policy | how long to wait for the model lock, as elsewhere; clamped by the configured ceiling, so a request can shorten its own wait but never weaken the guard | ```bash diff --git a/app/server/runtime.cpp b/app/server/runtime.cpp index 4f7041b3..03a504f6 100644 --- a/app/server/runtime.cpp +++ b/app/server/runtime.cpp @@ -3018,10 +3018,15 @@ HttpResponse ServerState::handle_transcription_live(const HttpRequest & request) audio_contract.sample_rate = sample_rate; audio_contract.channels = channels; task_request.audio_input = std::move(audio_contract); - const std::string language = query_param(request.query, "language"); + const std::string language = decoded_query_param(request.query, "language"); + // Recognition-context biasing (hotwords), same meaning as the multipart + // route's `prompt` field; URL-encoded because it rides in the query. + const std::string prompt = decoded_query_param(request.query, "prompt"); if (!language.empty()) { task_request.options["language"] = language; - task_request.text_input = engine::runtime::Transcript{std::string(), language}; + } + if (!language.empty() || !prompt.empty()) { + task_request.text_input = engine::runtime::Transcript{prompt, language}; } task_request = apply_default_request_options(model, std::move(task_request)); } catch (const std::runtime_error & ex) { diff --git a/docs/community_models/r2t2.md b/docs/community_models/r2t2.md index bc1939f3..815b4a89 100644 --- a/docs/community_models/r2t2.md +++ b/docs/community_models/r2t2.md @@ -247,6 +247,8 @@ ffmpeg -f avfoundation -i ":0" -ar 16000 -ac 1 -f s16le - \ 'http://127.0.0.1:8488/v1/audio/transcriptions/live?model=r2t2-asr-stream&sample_rate=16000&channels=1&sample_format=s16le' ``` +Add `&prompt=` to bias the live stream the same way `--text` does on the CLI. + ## GGUF checkpoints GGUF is supported for Q8_0 and higher precision. `f16`, `q8_0`, and the native