- Navigation GuideYou are on a Client landing page. Commands (operations) are listed on this page. The Client constructor type is linked at the bottom.
BedrockRuntimeClient
Describes the API operations for running inference using Amazon Bedrock models.
Installation
npm install @aws-sdk/client-bedrock-runtime
yarn add @aws-sdk/client-bedrock-runtime
pnpm add @aws-sdk/client-bedrock-runtime
BedrockRuntimeClient Operations
Command | Summary |
---|
Command | Summary |
---|---|
ApplyGuardrailCommand | The action to apply a guardrail. For troubleshooting some of the common errors you might encounter when using the |
ConverseCommand | Sends messages to the specified Amazon Bedrock model. Amazon Bedrock doesn't store any text, images, or documents that you provide as content. The data is only used to generate the response. You can submit a prompt by including it in the You can also submit a prompt from Prompt management by specifying the ARN of the prompt version and including a map of variables to values in 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 Converse API examples in the Amazon Bedrock User Guide. This operation requires permission for the To deny all inference access to resources that you specify in the modelId field, you need to deny access to the For troubleshooting some of the common errors you might encounter when using the |
ConverseStreamCommand | 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 The CLI doesn't support streaming operations in Amazon Bedrock, including Amazon Bedrock doesn't store any text, images, or documents that you provide as content. The data is only used to generate the response. You can submit a prompt by including it in the You can also submit a prompt from Prompt management by specifying the ARN of the prompt version and including a map of variables to values in 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 To deny all inference access to resources that you specify in the modelId field, you need to deny access to the For troubleshooting some of the common errors you might encounter when using the |
GetAsyncInvokeCommand | Retrieve information about an asynchronous invocation. |
InvokeModelCommand | 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 To deny all inference access to resources that you specify in the modelId field, you need to deny access to the For troubleshooting some of the common errors you might encounter when using the |
InvokeModelWithResponseStreamCommand | 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 streaming operations in Amazon Bedrock, including For example code, see Invoke model with streaming code example in the Amazon Bedrock User Guide. This operation requires permissions to perform the To deny all inference access to resources that you specify in the modelId field, you need to deny access to the For troubleshooting some of the common errors you might encounter when using the |
ListAsyncInvokesCommand | Lists asynchronous invocations. |
StartAsyncInvokeCommand | Starts an asynchronous invocation. This operation requires permission for the To deny all inference access to resources that you specify in the modelId field, you need to deny access to the |
BedrockRuntimeClient Configuration
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
defaultsMode Optional | DefaultsMode | Provider<DefaultsMode> | The @smithy/smithy-client#DefaultsMode that will be used to determine how certain default configuration options are resolved in the SDK. |
disableHostPrefix Optional | boolean | Disable dynamically changing the endpoint of the client based on the hostPrefix trait of an operation. |
eventStreamSerdeProvider Optional | EventStreamSerdeProvider | The function that provides necessary utilities for generating and parsing event stream |
extensions Optional | RuntimeExtension[] | Optional extensions |
logger Optional | Logger | Optional logger for logging debug/info/warn/error. |
maxAttempts Optional | number | Provider<number> | Value for how many times a request will be made at most in case of retry. |
profile Optional | string | Setting a client profile is similar to setting a value for the AWS_PROFILE environment variable. Setting a profile on a client in code only affects the single client instance, unlike AWS_PROFILE.When set, and only for environments where an AWS configuration file exists, fields configurable by this file will be retrieved from the specified profile within that file. Conflicting code configuration and environment variables will still have higher priority.For client credential resolution that involves checking the AWS configuration file, the client's profile (this value) will be used unless a different profile is set in the credential provider options. |
region Optional | string | Provider<string> | The AWS region to which this client will send requests |
requestHandler Optional | __HttpHandlerUserInput | The HTTP handler to use or its constructor options. Fetch in browser and Https in Nodejs. |
retryMode Optional | string | Provider<string> | Specifies which retry algorithm to use. |
useDualstackEndpoint Optional | boolean | Provider<boolean> | Enables IPv6/IPv4 dualstack endpoint. |
useFipsEndpoint Optional | boolean | Provider<boolean> | Enables FIPS compatible endpoints. |
Additional config fields are described in the full configuration type: BedrockRuntimeClientConfig