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.invokeModel(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
-
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
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. 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 bedrock:InvokeModel
action.
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. The response is returned in a stream.
To see if a model supports streaming, call GetFoundationModel and check the responseStreamingSupported
field in the response.
InvokeModelWithResponseStream
. For example code, see Invoke model with streaming code example in the Amazon Bedrock User Guide.
This operation requires permissions to perform the bedrock:InvokeModelWithResponseStream
action.
waitFor(state, params = {}, callback) ⇒ AWS.Request
Waits for a given BedrockRuntime resource. The final callback or 'complete' event will be fired only when the resource is either in its final state or the waiter has timed out and stopped polling for the final state.