AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.
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.
This is an asynchronous operation using the standard naming convention for .NET 4.7.2 or higher.
Namespace: Amazon.BedrockRuntime
Assembly: AWSSDK.BedrockRuntime.dll
Version: 3.x.y.z
public virtual Task<InvokeModelWithBidirectionalStreamResponse> InvokeModelWithBidirectionalStreamAsync( InvokeModelWithBidirectionalStreamRequest request, CancellationToken cancellationToken )
Container for the necessary parameters to execute the InvokeModelWithBidirectionalStream service method.
A cancellation token that can be used by other objects or threads to receive notice of cancellation.
| Exception | Condition |
|---|---|
| AccessDeniedException | The request is denied because you do not have sufficient permissions to perform the requested action. For troubleshooting this error, see AccessDeniedException in the Amazon Bedrock User Guide |
| InternalServerException | An internal server error occurred. For troubleshooting this error, see InternalFailure in the Amazon Bedrock User Guide |
| ModelErrorException | The request failed due to an error while processing the model. |
| ModelNotReadyException | The model specified in the request is not ready to serve inference requests. The AWS SDK will automatically retry the operation up to 5 times. For information about configuring automatic retries, see Retry behavior in the AWS SDKs and Tools reference guide. |
| ModelStreamErrorException | An error occurred while streaming the response. Retry your request. |
| ModelTimeoutException | The request took too long to process. Processing time exceeded the model timeout length. |
| ResourceNotFoundException | The specified resource ARN was not found. For troubleshooting this error, see ResourceNotFound in the Amazon Bedrock User Guide |
| ServiceQuotaExceededException | Your request exceeds the service quota for your account. You can view your quotas at Viewing service quotas. You can resubmit your request later. |
| ServiceUnavailableException | The service isn't currently available. For troubleshooting this error, see ServiceUnavailable in the Amazon Bedrock User Guide |
| ThrottlingException | Your request was denied due to exceeding the account quotas for Amazon Bedrock. For troubleshooting this error, see ThrottlingException in the Amazon Bedrock User Guide |
| ValidationException | The input fails to satisfy the constraints specified by Amazon Bedrock. For troubleshooting this error, see ValidationError in the Amazon Bedrock User Guide |
.NET:
Supported in: 8.0 and newer