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.
Implementation for accessing BedrockRuntime
Describes the API operations for running inference using Amazon Bedrock models.Namespace: Amazon.BedrockRuntime
Assembly: AWSSDK.BedrockRuntime.dll
Version: 3.x.y.z
public class AmazonBedrockRuntimeClient : AmazonServiceClient IAmazonBedrockRuntime, IAmazonService, IDisposable
The AmazonBedrockRuntimeClient type exposes the following members
Name | Description | |
---|---|---|
![]() |
AmazonBedrockRuntimeClient() |
Constructs AmazonBedrockRuntimeClient with the credentials loaded from the application's default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance. Example App.config with credentials set. <?xml version="1.0" encoding="utf-8" ?> <configuration> <appSettings> <add key="AWSProfileName" value="AWS Default"/> </appSettings> </configuration> |
![]() |
AmazonBedrockRuntimeClient(RegionEndpoint) |
Constructs AmazonBedrockRuntimeClient with the credentials loaded from the application's default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance. Example App.config with credentials set. <?xml version="1.0" encoding="utf-8" ?> <configuration> <appSettings> <add key="AWSProfileName" value="AWS Default"/> </appSettings> </configuration> |
![]() |
AmazonBedrockRuntimeClient(AmazonBedrockRuntimeConfig) |
Constructs AmazonBedrockRuntimeClient with the credentials loaded from the application's default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance. Example App.config with credentials set. <?xml version="1.0" encoding="utf-8" ?> <configuration> <appSettings> <add key="AWSProfileName" value="AWS Default"/> </appSettings> </configuration> |
![]() |
AmazonBedrockRuntimeClient(AWSCredentials) |
Constructs AmazonBedrockRuntimeClient with AWS Credentials |
![]() |
AmazonBedrockRuntimeClient(AWSCredentials, RegionEndpoint) |
Constructs AmazonBedrockRuntimeClient with AWS Credentials |
![]() |
AmazonBedrockRuntimeClient(AWSCredentials, AmazonBedrockRuntimeConfig) |
Constructs AmazonBedrockRuntimeClient with AWS Credentials and an AmazonBedrockRuntimeClient Configuration object. |
![]() |
AmazonBedrockRuntimeClient(string, string) |
Constructs AmazonBedrockRuntimeClient with AWS Access Key ID and AWS Secret Key |
![]() |
AmazonBedrockRuntimeClient(string, string, RegionEndpoint) |
Constructs AmazonBedrockRuntimeClient with AWS Access Key ID and AWS Secret Key |
![]() |
AmazonBedrockRuntimeClient(string, string, AmazonBedrockRuntimeConfig) |
Constructs AmazonBedrockRuntimeClient with AWS Access Key ID, AWS Secret Key and an AmazonBedrockRuntimeClient Configuration object. |
![]() |
AmazonBedrockRuntimeClient(string, string, string) |
Constructs AmazonBedrockRuntimeClient with AWS Access Key ID and AWS Secret Key |
![]() |
AmazonBedrockRuntimeClient(string, string, string, RegionEndpoint) |
Constructs AmazonBedrockRuntimeClient with AWS Access Key ID and AWS Secret Key |
![]() |
AmazonBedrockRuntimeClient(string, string, string, AmazonBedrockRuntimeConfig) |
Constructs AmazonBedrockRuntimeClient with AWS Access Key ID, AWS Secret Key and an AmazonBedrockRuntimeClient Configuration object. |
Name | Type | Description | |
---|---|---|---|
![]() |
Config | Amazon.Runtime.IClientConfig | Inherited from Amazon.Runtime.AmazonServiceClient. |
Name | Description | |
---|---|---|
![]() |
Converse(ConverseRequest) |
Sends messages to the specified Amazon Bedrock model. For information about the Converse API, see Use the Converse API in the Amazon Bedrock User Guide. To use a guardrail, see Use a guardrail with the Converse API in the Amazon Bedrock User Guide. To use a tool with a model, see Tool use (Function calling) in the Amazon Bedrock User Guide For example code, see Converse API examples in the Amazon Bedrock User Guide.
This operation requires permission for the |
![]() |
ConverseAsync(ConverseRequest, CancellationToken) |
Sends messages to the specified Amazon Bedrock model. For information about the Converse API, see Use the Converse API in the Amazon Bedrock User Guide. To use a guardrail, see Use a guardrail with the Converse API in the Amazon Bedrock User Guide. To use a tool with a model, see Tool use (Function calling) in the Amazon Bedrock User Guide For example code, see Converse API examples in the Amazon Bedrock User Guide.
This operation requires permission for the |
![]() |
ConverseStream(ConverseStreamRequest) |
Sends messages to the specified Amazon Bedrock model and returns the response in a
stream.
To find out if a model supports streaming, call GetFoundationModel
and check the For information about the Converse API, see Use the Converse API in the Amazon Bedrock User Guide. To use a guardrail, see Use a guardrail with the Converse API in the Amazon Bedrock User Guide. To use a tool with a model, see Tool use (Function calling) in the Amazon Bedrock User Guide For example code, see Conversation streaming example in the Amazon Bedrock User Guide.
This operation requires permission for the |
![]() |
ConverseStreamAsync(ConverseStreamRequest, CancellationToken) |
Sends messages to the specified Amazon Bedrock model and returns the response in a
stream.
To find out if a model supports streaming, call GetFoundationModel
and check the For information about the Converse API, see Use the Converse API in the Amazon Bedrock User Guide. To use a guardrail, see Use a guardrail with the Converse API in the Amazon Bedrock User Guide. To use a tool with a model, see Tool use (Function calling) in the Amazon Bedrock User Guide For example code, see Conversation streaming example in the Amazon Bedrock User Guide.
This operation requires permission for the |
![]() |
DetermineServiceOperationEndpoint(AmazonWebServiceRequest) |
Returns the endpoint that will be used for a particular request. |
![]() |
Dispose() | Inherited from Amazon.Runtime.AmazonServiceClient. |
![]() |
InvokeModel(InvokeModelRequest) |
Invokes the specified Amazon Bedrock model to run inference using the prompt and inference parameters provided in the request body. You use model inference to generate text, images, and embeddings. For example code, see Invoke model code examples in the Amazon Bedrock User Guide.
This operation requires permission for the |
![]() |
InvokeModelAsync(InvokeModelRequest, CancellationToken) |
Invokes the specified Amazon Bedrock model to run inference using the prompt and inference parameters provided in the request body. You use model inference to generate text, images, and embeddings. For example code, see Invoke model code examples in the Amazon Bedrock User Guide.
This operation requires permission for the |
![]() |
InvokeModelWithResponseStream(InvokeModelWithResponseStreamRequest) |
Invoke the specified Amazon Bedrock model to run inference using the prompt and inference parameters provided in the request body. The response is returned in a stream.
To see if a model supports streaming, call GetFoundationModel
and check the
The CLI doesn't support For example code, see Invoke model with streaming code example in the Amazon Bedrock User Guide.
This operation requires permissions to perform the |
![]() |
InvokeModelWithResponseStreamAsync(InvokeModelWithResponseStreamRequest, CancellationToken) |
Invoke the specified Amazon Bedrock model to run inference using the prompt and inference parameters provided in the request body. The response is returned in a stream.
To see if a model supports streaming, call GetFoundationModel
and check the
The CLI doesn't support For example code, see Invoke model with streaming code example in the Amazon Bedrock User Guide.
This operation requires permissions to perform the |
Name | Description | |
---|---|---|
![]() |
AfterResponseEvent | Inherited from Amazon.Runtime.AmazonServiceClient. |
![]() |
BeforeRequestEvent | Inherited from Amazon.Runtime.AmazonServiceClient. |
![]() |
ExceptionEvent | Inherited from Amazon.Runtime.AmazonServiceClient. |
.NET:
Supported in: 8.0 and newer, Core 3.1
.NET Standard:
Supported in: 2.0
.NET Framework:
Supported in: 4.5 and newer, 3.5