vllm_omni.protocol.realtime.session ¶
Reading the Realtime session object.
session.update carries one JSON object that a client may spell in either of two shapes: the GA nest (session.audio.input.format, session.audio.output.sample_rate_hz) or the older flat beta keys (input_audio_format, sample_rate_hz). Everything downstream --- the append decoder, the projection that renders session.created back out, a model's runtime configuration --- has to agree on what a given session object means, so the readers live here once.
:class:RealtimeInputDefaults is the resolved answer for the input path: the format, sample rate and silence threshold an input_audio_buffer.append inherits when it omits them. A connection keeps one of these and re-derives it on every session.update.
overlap_policy / playback_commit_policy are vLLM-Omni extension fields on the session object rather than GA OpenAI fields. They are read here because this module owns what the wire may say; what a server does with them is the consumer's business.
RealtimeInputDefaults dataclass ¶
Session-level wire defaults an append may omit (derived from the session object).
with_session_payload ¶
with_session_payload(
session_payload: Mapping[str, object],
) -> RealtimeInputDefaults
Return defaults updated from a Realtime session object (session.update).
apply_realtime_session_defaults ¶
apply_realtime_session_defaults(
defaults: RealtimeInputDefaults,
session_payload: Mapping[str, object],
) -> RealtimeInputDefaults
Derive the wire defaults a Realtime session object declares.
input_audio_transcription_config ¶
input_audio_transcription_config(
session_payload: Mapping[str, object],
) -> dict[str, object] | None
json_safe_realtime_payload ¶
realtime_max_output_tokens ¶
Normalize Realtime max output tokens ("inf" -> None).