invoke_model_with_bidirectional_stream¶
Operation¶
invoke_model_with_bidirectional_stream
async
¶
invoke_model_with_bidirectional_stream(input: InvokeModelWithBidirectionalStreamOperationInput, plugins: list[Plugin] | None = None) -> DuplexEventStream[InvokeModelWithBidirectionalStreamInput, InvokeModelWithBidirectionalStreamOutput, InvokeModelWithBidirectionalStreamOperationOutput]
Invoke the specified Amazon Bedrock model to run inference using the bidirectional stream. The response is returned in a stream that remains open for 8 minutes. A single session can contain multiple prompts and responses from the model. The prompts to the model are provided as audio files and the model's responses are spoken back to the user and transcribed.
It is possible for users to interrupt the model's response with a new prompt, which will halt the response speech. The model will retain contextual awareness of the conversation while pivoting to respond to the new prompt.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input
|
InvokeModelWithBidirectionalStreamOperationInput
|
An instance of |
required |
plugins
|
list[Plugin] | None
|
A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations. |
None
|
Returns:
| Type | Description |
|---|---|
DuplexEventStream[InvokeModelWithBidirectionalStreamInput, InvokeModelWithBidirectionalStreamOutput, InvokeModelWithBidirectionalStreamOperationOutput]
|
A |
Input¶
InvokeModelWithBidirectionalStreamOperationInput
dataclass
¶
Output¶
This operation returns a DuplexEventStream for bidirectional streaming.
Event Stream Structure¶
Input Event Type¶
InvokeModelWithBidirectionalStreamInput
Output Event Type¶
InvokeModelWithBidirectionalStreamOutput
Initial Response Structure¶
InvokeModelWithBidirectionalStreamOperationOutput
dataclass
¶
Dataclass for InvokeModelWithBidirectionalStreamOperationOutput structure.