com.amazonaws.services.bedrockruntime.AmazonBedrockRuntimeAsync Maven / Gradle / Ivy
Show all versions of aws-java-sdk-bedrockruntime Show documentation
/*
* Copyright 2019-2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.bedrockruntime;
import javax.annotation.Generated;
import com.amazonaws.services.bedrockruntime.model.*;
/**
* Interface for accessing Amazon Bedrock Runtime asynchronously. Each asynchronous method will return a Java Future
* object representing the asynchronous operation; overloads which accept an {@code AsyncHandler} can be used to receive
* notification when an asynchronous operation completes.
*
* Note: Do not directly implement this interface, new methods are added to it regularly. Extend from
* {@link com.amazonaws.services.bedrockruntime.AbstractAmazonBedrockRuntimeAsync} instead.
*
*
*
* Describes the API operations for running inference using Amazon Bedrock models.
*
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public interface AmazonBedrockRuntimeAsync extends AmazonBedrockRuntime {
/**
*
* The action to apply a guardrail.
*
*
* @param applyGuardrailRequest
* @return A Java Future containing the result of the ApplyGuardrail operation returned by the service.
* @sample AmazonBedrockRuntimeAsync.ApplyGuardrail
* @see AWS
* API Documentation
*/
java.util.concurrent.Future applyGuardrailAsync(ApplyGuardrailRequest applyGuardrailRequest);
/**
*
* The action to apply a guardrail.
*
*
* @param applyGuardrailRequest
* @param asyncHandler
* Asynchronous callback handler for events in the lifecycle of the request. Users can provide an
* implementation of the callback methods in this interface to receive notification of successful or
* unsuccessful completion of the operation.
* @return A Java Future containing the result of the ApplyGuardrail operation returned by the service.
* @sample AmazonBedrockRuntimeAsyncHandler.ApplyGuardrail
* @see AWS
* API Documentation
*/
java.util.concurrent.Future applyGuardrailAsync(ApplyGuardrailRequest applyGuardrailRequest,
com.amazonaws.handlers.AsyncHandler asyncHandler);
/**
*
* 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.
*
*
* @param converseRequest
* @return A Java Future containing the result of the Converse operation returned by the service.
* @sample AmazonBedrockRuntimeAsync.Converse
* @see AWS API
* Documentation
*/
java.util.concurrent.Future converseAsync(ConverseRequest converseRequest);
/**
*
* 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.
*
*
* @param converseRequest
* @param asyncHandler
* Asynchronous callback handler for events in the lifecycle of the request. Users can provide an
* implementation of the callback methods in this interface to receive notification of successful or
* unsuccessful completion of the operation.
* @return A Java Future containing the result of the Converse operation returned by the service.
* @sample AmazonBedrockRuntimeAsyncHandler.Converse
* @see AWS API
* Documentation
*/
java.util.concurrent.Future converseAsync(ConverseRequest converseRequest,
com.amazonaws.handlers.AsyncHandler asyncHandler);
/**
*
* 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.
*
*
* @param invokeModelRequest
* @return A Java Future containing the result of the InvokeModel operation returned by the service.
* @sample AmazonBedrockRuntimeAsync.InvokeModel
* @see AWS
* API Documentation
*/
java.util.concurrent.Future invokeModelAsync(InvokeModelRequest 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 bedrock:InvokeModel
action.
*
*
* @param invokeModelRequest
* @param asyncHandler
* Asynchronous callback handler for events in the lifecycle of the request. Users can provide an
* implementation of the callback methods in this interface to receive notification of successful or
* unsuccessful completion of the operation.
* @return A Java Future containing the result of the InvokeModel operation returned by the service.
* @sample AmazonBedrockRuntimeAsyncHandler.InvokeModel
* @see AWS
* API Documentation
*/
java.util.concurrent.Future invokeModelAsync(InvokeModelRequest invokeModelRequest,
com.amazonaws.handlers.AsyncHandler asyncHandler);
}