Class: AWS.BedrockRuntime
- Inherits:
-
AWS.Service
- Object
- AWS.Service
- AWS.BedrockRuntime
- Identifier:
- bedrockruntime
- API Version:
- 2023-09-30
- Defined in:
- (unknown)
Overview
Constructs a service interface object. Each API operation is exposed as a function on service.
Service Description
Describes the API operations for running inference using Amazon Bedrock models.
Sending a Request Using BedrockRuntime
var bedrockruntime = new AWS.BedrockRuntime();
bedrockruntime.applyGuardrail(params, function (err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Locking the API Version
In order to ensure that the BedrockRuntime object uses this specific API, you can
construct the object by passing the apiVersion option to the constructor:
var bedrockruntime = new AWS.BedrockRuntime({apiVersion: '2023-09-30'});
You can also set the API version globally in AWS.config.apiVersions using
the bedrockruntime service identifier:
AWS.config.apiVersions = {
bedrockruntime: '2023-09-30',
// other service API versions
};
var bedrockruntime = new AWS.BedrockRuntime();
Constructor Summary collapse
-
new AWS.BedrockRuntime(options = {}) ⇒ Object
constructor
Constructs a service object.
Property Summary collapse
-
endpoint ⇒ AWS.Endpoint
readwrite
An Endpoint object representing the endpoint URL for service requests.
Properties inherited from AWS.Service
Method Summary collapse
-
applyGuardrail(params = {}, callback) ⇒ AWS.Request
The action to apply a guardrail.
.
-
converse(params = {}, callback) ⇒ AWS.Request
Sends messages to the specified Amazon Bedrock model.
-
converseStream(params = {}, callback) ⇒ AWS.Request
Sends messages to the specified Amazon Bedrock model and returns the response in a stream.
-
invokeModel(params = {}, callback) ⇒ AWS.Request
Invokes the specified Amazon Bedrock model to run inference using the prompt and inference parameters provided in the request body.
-
invokeModelWithResponseStream(params = {}, callback) ⇒ AWS.Request
Invoke the specified Amazon Bedrock model to run inference using the prompt and inference parameters provided in the request body.
-
waitFor(state, params = {}, callback) ⇒ AWS.Request
Waits for a given BedrockRuntime resource.
Methods inherited from AWS.Service
makeRequest, makeUnauthenticatedRequest, setupRequestListeners, defineService
Constructor Details
new AWS.BedrockRuntime(options = {}) ⇒ Object
Constructs a service object. This object has one method for each API operation.
Property Details
Method Details
converse(params = {}, callback) ⇒ AWS.Request
Sends messages to the specified Amazon Bedrock model. Converse provides a consistent interface that works with all models that support messages. This allows you to write code once and use it with different models. If a model has unique inference parameters, you can also pass those unique parameters to the 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.
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 bedrock:InvokeModel action.