AWS SDK Version 4 for .NET
API Reference

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.

Container for the parameters to the InvokeModelWithBidirectionalStream operation. 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.

Inheritance Hierarchy

System.Object
  Amazon.Runtime.AmazonWebServiceRequest
    Amazon.BedrockRuntime.AmazonBedrockRuntimeRequest
      Amazon.BedrockRuntime.Model.InvokeModelWithBidirectionalStreamRequest

Namespace: Amazon.BedrockRuntime.Model
Assembly: AWSSDK.BedrockRuntime.dll
Version: 3.x.y.z

Syntax

C#
public class InvokeModelWithBidirectionalStreamRequest : AmazonBedrockRuntimeRequest
         IAmazonWebServiceRequest

The InvokeModelWithBidirectionalStreamRequest type exposes the following members

Constructors

Properties

NameTypeDescription
Public Property BodyPublisher System.Func<System.Threading.Tasks.Task<Amazon.BedrockRuntime.Model.IInvokeModelWithBidirectionalStreamInputEvent>>

Gets and sets the property BodyPublisher.

The prompt and inference parameters in the format specified in the BidirectionalInputPayloadPart in the header. You must provide the body in JSON format. To see the format and content of the request and response bodies for different models, refer to Inference parameters. For more information, see Run inference in the Bedrock User Guide.

The Func set for this property by the consumer of the SDK is used to stream events into the service. Consumers provide a Func that the SDK will continue to call to get events to send. When the consumer is done streaming events to the service the Func can return null to stop the SDK calling the Func for new events. The Func must return an event known by the service which can be identified by implementing the IInvokeModelWithBidirectionalStreamInputEvent interface. The known implementatons in the SDK for this interface are:

Public Property ModelId System.String

Gets and sets the property ModelId.

The model ID or ARN of the model ID to use. Currently, only amazon.nova-sonic-v1:0 is supported.

Version Information

.NET:
Supported in: 8.0 and newer, Core 3.1

.NET Standard:
Supported in: 2.0

.NET Framework:
Supported in: 4.7.2 and newer