AWS SDK Version 3 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.

Implementation for accessing BedrockAgentRuntime

Contains APIs related to model invocation and querying of knowledge bases.

Inheritance Hierarchy

System.Object
  Amazon.Runtime.AmazonServiceClient
    Amazon.BedrockAgentRuntime.AmazonBedrockAgentRuntimeClient

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

Syntax

C#
public class AmazonBedrockAgentRuntimeClient : AmazonServiceClient
         IAmazonBedrockAgentRuntime, IAmazonService, IDisposable

The AmazonBedrockAgentRuntimeClient type exposes the following members

Constructors

NameDescription
Public Method AmazonBedrockAgentRuntimeClient()

Constructs AmazonBedrockAgentRuntimeClient 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>
             

Public Method AmazonBedrockAgentRuntimeClient(RegionEndpoint)

Constructs AmazonBedrockAgentRuntimeClient 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>
             

Public Method AmazonBedrockAgentRuntimeClient(AmazonBedrockAgentRuntimeConfig)

Constructs AmazonBedrockAgentRuntimeClient 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>
             

Public Method AmazonBedrockAgentRuntimeClient(AWSCredentials)

Constructs AmazonBedrockAgentRuntimeClient with AWS Credentials

Public Method AmazonBedrockAgentRuntimeClient(AWSCredentials, RegionEndpoint)

Constructs AmazonBedrockAgentRuntimeClient with AWS Credentials

Public Method AmazonBedrockAgentRuntimeClient(AWSCredentials, AmazonBedrockAgentRuntimeConfig)

Constructs AmazonBedrockAgentRuntimeClient with AWS Credentials and an AmazonBedrockAgentRuntimeClient Configuration object.

Public Method AmazonBedrockAgentRuntimeClient(string, string)

Constructs AmazonBedrockAgentRuntimeClient with AWS Access Key ID and AWS Secret Key

Public Method AmazonBedrockAgentRuntimeClient(string, string, RegionEndpoint)

Constructs AmazonBedrockAgentRuntimeClient with AWS Access Key ID and AWS Secret Key

Public Method AmazonBedrockAgentRuntimeClient(string, string, AmazonBedrockAgentRuntimeConfig)

Constructs AmazonBedrockAgentRuntimeClient with AWS Access Key ID, AWS Secret Key and an AmazonBedrockAgentRuntimeClient Configuration object.

Public Method AmazonBedrockAgentRuntimeClient(string, string, string)

Constructs AmazonBedrockAgentRuntimeClient with AWS Access Key ID and AWS Secret Key

Public Method AmazonBedrockAgentRuntimeClient(string, string, string, RegionEndpoint)

Constructs AmazonBedrockAgentRuntimeClient with AWS Access Key ID and AWS Secret Key

Public Method AmazonBedrockAgentRuntimeClient(string, string, string, AmazonBedrockAgentRuntimeConfig)

Constructs AmazonBedrockAgentRuntimeClient with AWS Access Key ID, AWS Secret Key and an AmazonBedrockAgentRuntimeClient Configuration object.

Properties

NameTypeDescription
Public Property Config Amazon.Runtime.IClientConfig Inherited from Amazon.Runtime.AmazonServiceClient.
Public Property Paginators Amazon.BedrockAgentRuntime.Model.IBedrockAgentRuntimePaginatorFactory

Paginators for the service

Methods

Note:

Asynchronous operations (methods ending with Async) in the table below are for .NET 4.5 or higher. For .NET 3.5 the SDK follows the standard naming convention of BeginMethodName and EndMethodName to indicate asynchronous operations - these method pairs are not shown in the table below.

NameDescription
Public Method DetermineServiceOperationEndpoint(AmazonWebServiceRequest)

Returns the endpoint that will be used for a particular request.

Public Method Dispose() Inherited from Amazon.Runtime.AmazonServiceClient.
Public Method InvokeAgent(InvokeAgentRequest)

The CLI doesn't support InvokeAgent.

Sends a prompt for the agent to process and respond to. Note the following fields for the request:

  • To continue the same conversation with an agent, use the same sessionId value in the request.

  • To activate trace enablement, turn enableTrace to true. Trace enablement helps you follow the agent's reasoning process that led it to the information it processed, the actions it took, and the final result it yielded. For more information, see Trace enablement.

  • End a conversation by setting endSession to true.

  • In the sessionState object, you can include attributes for the session or prompt or, if you configured an action group to return control, results from invocation of the action group.

The response is returned in the bytes field of the chunk object.

  • The attribution object contains citations for parts of the response.

  • If you set enableTrace to true in the request, you can trace the agent's steps and reasoning process that led it to the response.

  • If the action predicted was configured to return control, the response returns parameters for the action, elicited from the user, in the returnControl field.

  • Errors are also surfaced in the response.

Public Method InvokeAgentAsync(InvokeAgentRequest, CancellationToken)

The CLI doesn't support InvokeAgent.

Sends a prompt for the agent to process and respond to. Note the following fields for the request:

  • To continue the same conversation with an agent, use the same sessionId value in the request.

  • To activate trace enablement, turn enableTrace to true. Trace enablement helps you follow the agent's reasoning process that led it to the information it processed, the actions it took, and the final result it yielded. For more information, see Trace enablement.

  • End a conversation by setting endSession to true.

  • In the sessionState object, you can include attributes for the session or prompt or, if you configured an action group to return control, results from invocation of the action group.

The response is returned in the bytes field of the chunk object.

  • The attribution object contains citations for parts of the response.

  • If you set enableTrace to true in the request, you can trace the agent's steps and reasoning process that led it to the response.

  • If the action predicted was configured to return control, the response returns parameters for the action, elicited from the user, in the returnControl field.

  • Errors are also surfaced in the response.

Public Method Retrieve(RetrieveRequest)

Queries a knowledge base and retrieves information from it.

Public Method RetrieveAndGenerate(RetrieveAndGenerateRequest)

Queries a knowledge base and generates responses based on the retrieved results. The response only cites sources that are relevant to the query.

Public Method RetrieveAndGenerateAsync(RetrieveAndGenerateRequest, CancellationToken)

Queries a knowledge base and generates responses based on the retrieved results. The response only cites sources that are relevant to the query.

Public Method RetrieveAsync(RetrieveRequest, CancellationToken)

Queries a knowledge base and retrieves information from it.

Events

NameDescription
Event AfterResponseEvent Inherited from Amazon.Runtime.AmazonServiceClient.
Event BeforeRequestEvent Inherited from Amazon.Runtime.AmazonServiceClient.
Event ExceptionEvent Inherited from Amazon.Runtime.AmazonServiceClient.

Version Information

.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