| Name | Type | Description |
|---|---|---|
client* | Any | The |
model_id* | str | The Nova Sonic model identifier. |
system_prompt | Optional[str] | Default: NoneOptional system prompt for the conversation. |
voice_id | str | Default: 'matthew' |
max_tokens | int | Default: 1024 |
temperature | float | Default: 0.7 |
top_p | float | Default: 0.9 |
input_sample_rate | int | Default: DEFAULT_INPUT_SAMPLE_RATE |
output_sample_rate | int | Default: DEFAULT_OUTPUT_SAMPLE_RATE |
audio_media_type | str | Default: DEFAULT_AUDIO_MEDIA_TYPE |
endpointing_sensitivity | Optional[str] | Default: None |
Manages a single bidirectional streaming session with Nova Sonic.
This class handles the event protocol for sending and receiving audio/text
over the InvokeModelWithBidirectionalStream API. Sessions are created
via :meth:ChatBedrockNovaSonic.create_session and should be used as an
async context manager.
Example::
async with model.create_session(system_prompt="Be helpful.") as session:
await session.send_audio_chunk(audio_bytes)
async for event in session.receive_events():
handle(event)
Voice identifier for audio output.
Maximum tokens for inference.
Sampling temperature.
Top-p sampling parameter.
Sample rate for input audio in Hz.
Sample rate for output audio in Hz.
Media type for audio data.
Turn-detection sensitivity (HIGH/MEDIUM/LOW). Nova 2 Sonic only.