Interface BedrockAgentRuntimeAsyncClient
- All Superinterfaces:
AutoCloseable
,AwsClient
,SdkAutoCloseable
,SdkClient
builder()
method.The asynchronous client performs non-blocking I/O when configured with any
SdkAsyncHttpClient
supported in the SDK. However, full non-blocking is not guaranteed as the async client may
perform blocking calls in some cases such as credentials retrieval and endpoint discovery as part of the async API
call.
Contains APIs related to model invocation and querying of knowledge bases.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Value for looking up the service's metadata from theServiceMetadataProvider
.static final String
-
Method Summary
Modifier and TypeMethodDescriptionbuilder()
Create a builder that can be used to configure and create aBedrockAgentRuntimeAsyncClient
.create()
Create aBedrockAgentRuntimeAsyncClient
with the region loaded from theDefaultAwsRegionProviderChain
and credentials loaded from theDefaultCredentialsProvider
.createInvocation
(Consumer<CreateInvocationRequest.Builder> createInvocationRequest) Creates a new invocation within a session.createInvocation
(CreateInvocationRequest createInvocationRequest) Creates a new invocation within a session.default CompletableFuture
<CreateSessionResponse> createSession
(Consumer<CreateSessionRequest.Builder> createSessionRequest) Creates a session to temporarily store conversations for generative AI (GenAI) applications built with open-source frameworks such as LangGraph and LlamaIndex.default CompletableFuture
<CreateSessionResponse> createSession
(CreateSessionRequest createSessionRequest) Creates a session to temporarily store conversations for generative AI (GenAI) applications built with open-source frameworks such as LangGraph and LlamaIndex.deleteAgentMemory
(Consumer<DeleteAgentMemoryRequest.Builder> deleteAgentMemoryRequest) Deletes memory from the specified memory identifier.deleteAgentMemory
(DeleteAgentMemoryRequest deleteAgentMemoryRequest) Deletes memory from the specified memory identifier.default CompletableFuture
<DeleteSessionResponse> deleteSession
(Consumer<DeleteSessionRequest.Builder> deleteSessionRequest) Deletes a session that you ended.default CompletableFuture
<DeleteSessionResponse> deleteSession
(DeleteSessionRequest deleteSessionRequest) Deletes a session that you ended.default CompletableFuture
<EndSessionResponse> endSession
(Consumer<EndSessionRequest.Builder> endSessionRequest) Ends the session.default CompletableFuture
<EndSessionResponse> endSession
(EndSessionRequest endSessionRequest) Ends the session.default CompletableFuture
<GenerateQueryResponse> generateQuery
(Consumer<GenerateQueryRequest.Builder> generateQueryRequest) Generates an SQL query from a natural language query.default CompletableFuture
<GenerateQueryResponse> generateQuery
(GenerateQueryRequest generateQueryRequest) Generates an SQL query from a natural language query.default CompletableFuture
<GetAgentMemoryResponse> getAgentMemory
(Consumer<GetAgentMemoryRequest.Builder> getAgentMemoryRequest) Gets the sessions stored in the memory of the agent.default CompletableFuture
<GetAgentMemoryResponse> getAgentMemory
(GetAgentMemoryRequest getAgentMemoryRequest) Gets the sessions stored in the memory of the agent.default GetAgentMemoryPublisher
getAgentMemoryPaginator
(Consumer<GetAgentMemoryRequest.Builder> getAgentMemoryRequest) This is a variant ofgetAgentMemory(software.amazon.awssdk.services.bedrockagentruntime.model.GetAgentMemoryRequest)
operation.default GetAgentMemoryPublisher
getAgentMemoryPaginator
(GetAgentMemoryRequest getAgentMemoryRequest) This is a variant ofgetAgentMemory(software.amazon.awssdk.services.bedrockagentruntime.model.GetAgentMemoryRequest)
operation.getExecutionFlowSnapshot
(Consumer<GetExecutionFlowSnapshotRequest.Builder> getExecutionFlowSnapshotRequest) Retrieves the flow definition snapshot used for a flow execution.getExecutionFlowSnapshot
(GetExecutionFlowSnapshotRequest getExecutionFlowSnapshotRequest) Retrieves the flow definition snapshot used for a flow execution.getFlowExecution
(Consumer<GetFlowExecutionRequest.Builder> getFlowExecutionRequest) Retrieves details about a specific flow execution, including its status, start and end times, and any errors that occurred during execution.getFlowExecution
(GetFlowExecutionRequest getFlowExecutionRequest) Retrieves details about a specific flow execution, including its status, start and end times, and any errors that occurred during execution.getInvocationStep
(Consumer<GetInvocationStepRequest.Builder> getInvocationStepRequest) Retrieves the details of a specific invocation step within an invocation in a session.getInvocationStep
(GetInvocationStepRequest getInvocationStepRequest) Retrieves the details of a specific invocation step within an invocation in a session.default CompletableFuture
<GetSessionResponse> getSession
(Consumer<GetSessionRequest.Builder> getSessionRequest) Retrieves details about a specific session.default CompletableFuture
<GetSessionResponse> getSession
(GetSessionRequest getSessionRequest) Retrieves details about a specific session.default CompletableFuture
<Void> invokeAgent
(Consumer<InvokeAgentRequest.Builder> invokeAgentRequest, InvokeAgentResponseHandler asyncResponseHandler) default CompletableFuture
<Void> invokeAgent
(InvokeAgentRequest invokeAgentRequest, InvokeAgentResponseHandler asyncResponseHandler) default CompletableFuture
<Void> invokeFlow
(Consumer<InvokeFlowRequest.Builder> invokeFlowRequest, InvokeFlowResponseHandler asyncResponseHandler) Invokes an alias of a flow to run the inputs that you specify and return the output of each node as a stream.default CompletableFuture
<Void> invokeFlow
(InvokeFlowRequest invokeFlowRequest, InvokeFlowResponseHandler asyncResponseHandler) Invokes an alias of a flow to run the inputs that you specify and return the output of each node as a stream.default CompletableFuture
<Void> invokeInlineAgent
(Consumer<InvokeInlineAgentRequest.Builder> invokeInlineAgentRequest, InvokeInlineAgentResponseHandler asyncResponseHandler) Invokes an inline Amazon Bedrock agent using the configurations you provide with the request.default CompletableFuture
<Void> invokeInlineAgent
(InvokeInlineAgentRequest invokeInlineAgentRequest, InvokeInlineAgentResponseHandler asyncResponseHandler) Invokes an inline Amazon Bedrock agent using the configurations you provide with the request.listFlowExecutionEvents
(Consumer<ListFlowExecutionEventsRequest.Builder> listFlowExecutionEventsRequest) Lists events that occurred during a flow execution.listFlowExecutionEvents
(ListFlowExecutionEventsRequest listFlowExecutionEventsRequest) Lists events that occurred during a flow execution.default ListFlowExecutionEventsPublisher
listFlowExecutionEventsPaginator
(Consumer<ListFlowExecutionEventsRequest.Builder> listFlowExecutionEventsRequest) This is a variant oflistFlowExecutionEvents(software.amazon.awssdk.services.bedrockagentruntime.model.ListFlowExecutionEventsRequest)
operation.default ListFlowExecutionEventsPublisher
listFlowExecutionEventsPaginator
(ListFlowExecutionEventsRequest listFlowExecutionEventsRequest) This is a variant oflistFlowExecutionEvents(software.amazon.awssdk.services.bedrockagentruntime.model.ListFlowExecutionEventsRequest)
operation.listFlowExecutions
(Consumer<ListFlowExecutionsRequest.Builder> listFlowExecutionsRequest) Lists all executions of a flow.listFlowExecutions
(ListFlowExecutionsRequest listFlowExecutionsRequest) Lists all executions of a flow.default ListFlowExecutionsPublisher
listFlowExecutionsPaginator
(Consumer<ListFlowExecutionsRequest.Builder> listFlowExecutionsRequest) This is a variant oflistFlowExecutions(software.amazon.awssdk.services.bedrockagentruntime.model.ListFlowExecutionsRequest)
operation.default ListFlowExecutionsPublisher
listFlowExecutionsPaginator
(ListFlowExecutionsRequest listFlowExecutionsRequest) This is a variant oflistFlowExecutions(software.amazon.awssdk.services.bedrockagentruntime.model.ListFlowExecutionsRequest)
operation.default CompletableFuture
<ListInvocationsResponse> listInvocations
(Consumer<ListInvocationsRequest.Builder> listInvocationsRequest) Lists all invocations associated with a specific session.default CompletableFuture
<ListInvocationsResponse> listInvocations
(ListInvocationsRequest listInvocationsRequest) Lists all invocations associated with a specific session.default ListInvocationsPublisher
listInvocationsPaginator
(Consumer<ListInvocationsRequest.Builder> listInvocationsRequest) This is a variant oflistInvocations(software.amazon.awssdk.services.bedrockagentruntime.model.ListInvocationsRequest)
operation.default ListInvocationsPublisher
listInvocationsPaginator
(ListInvocationsRequest listInvocationsRequest) This is a variant oflistInvocations(software.amazon.awssdk.services.bedrockagentruntime.model.ListInvocationsRequest)
operation.listInvocationSteps
(Consumer<ListInvocationStepsRequest.Builder> listInvocationStepsRequest) Lists all invocation steps associated with a session and optionally, an invocation within the session.listInvocationSteps
(ListInvocationStepsRequest listInvocationStepsRequest) Lists all invocation steps associated with a session and optionally, an invocation within the session.default ListInvocationStepsPublisher
listInvocationStepsPaginator
(Consumer<ListInvocationStepsRequest.Builder> listInvocationStepsRequest) This is a variant oflistInvocationSteps(software.amazon.awssdk.services.bedrockagentruntime.model.ListInvocationStepsRequest)
operation.default ListInvocationStepsPublisher
listInvocationStepsPaginator
(ListInvocationStepsRequest listInvocationStepsRequest) This is a variant oflistInvocationSteps(software.amazon.awssdk.services.bedrockagentruntime.model.ListInvocationStepsRequest)
operation.default CompletableFuture
<ListSessionsResponse> listSessions
(Consumer<ListSessionsRequest.Builder> listSessionsRequest) Lists all sessions in your Amazon Web Services account.default CompletableFuture
<ListSessionsResponse> listSessions
(ListSessionsRequest listSessionsRequest) Lists all sessions in your Amazon Web Services account.default ListSessionsPublisher
listSessionsPaginator
(Consumer<ListSessionsRequest.Builder> listSessionsRequest) This is a variant oflistSessions(software.amazon.awssdk.services.bedrockagentruntime.model.ListSessionsRequest)
operation.default ListSessionsPublisher
listSessionsPaginator
(ListSessionsRequest listSessionsRequest) This is a variant oflistSessions(software.amazon.awssdk.services.bedrockagentruntime.model.ListSessionsRequest)
operation.listTagsForResource
(Consumer<ListTagsForResourceRequest.Builder> listTagsForResourceRequest) List all the tags for the resource you specify.listTagsForResource
(ListTagsForResourceRequest listTagsForResourceRequest) List all the tags for the resource you specify.default CompletableFuture
<Void> optimizePrompt
(Consumer<OptimizePromptRequest.Builder> optimizePromptRequest, OptimizePromptResponseHandler asyncResponseHandler) Optimizes a prompt for the task that you specify.default CompletableFuture
<Void> optimizePrompt
(OptimizePromptRequest optimizePromptRequest, OptimizePromptResponseHandler asyncResponseHandler) Optimizes a prompt for the task that you specify.putInvocationStep
(Consumer<PutInvocationStepRequest.Builder> putInvocationStepRequest) Add an invocation step to an invocation in a session.putInvocationStep
(PutInvocationStepRequest putInvocationStepRequest) Add an invocation step to an invocation in a session.default CompletableFuture
<RerankResponse> rerank
(Consumer<RerankRequest.Builder> rerankRequest) Reranks the relevance of sources based on queries.default CompletableFuture
<RerankResponse> rerank
(RerankRequest rerankRequest) Reranks the relevance of sources based on queries.default RerankPublisher
rerankPaginator
(Consumer<RerankRequest.Builder> rerankRequest) This is a variant ofrerank(software.amazon.awssdk.services.bedrockagentruntime.model.RerankRequest)
operation.default RerankPublisher
rerankPaginator
(RerankRequest rerankRequest) This is a variant ofrerank(software.amazon.awssdk.services.bedrockagentruntime.model.RerankRequest)
operation.default CompletableFuture
<RetrieveResponse> retrieve
(Consumer<RetrieveRequest.Builder> retrieveRequest) Queries a knowledge base and retrieves information from it.default CompletableFuture
<RetrieveResponse> retrieve
(RetrieveRequest retrieveRequest) Queries a knowledge base and retrieves information from it.retrieveAndGenerate
(Consumer<RetrieveAndGenerateRequest.Builder> retrieveAndGenerateRequest) Queries a knowledge base and generates responses based on the retrieved results and using the specified foundation model or inference profile.retrieveAndGenerate
(RetrieveAndGenerateRequest retrieveAndGenerateRequest) Queries a knowledge base and generates responses based on the retrieved results and using the specified foundation model or inference profile.default CompletableFuture
<Void> retrieveAndGenerateStream
(Consumer<RetrieveAndGenerateStreamRequest.Builder> retrieveAndGenerateStreamRequest, RetrieveAndGenerateStreamResponseHandler asyncResponseHandler) Queries a knowledge base and generates responses based on the retrieved results, with output in streaming format.default CompletableFuture
<Void> retrieveAndGenerateStream
(RetrieveAndGenerateStreamRequest retrieveAndGenerateStreamRequest, RetrieveAndGenerateStreamResponseHandler asyncResponseHandler) Queries a knowledge base and generates responses based on the retrieved results, with output in streaming format.default RetrievePublisher
retrievePaginator
(Consumer<RetrieveRequest.Builder> retrieveRequest) This is a variant ofretrieve(software.amazon.awssdk.services.bedrockagentruntime.model.RetrieveRequest)
operation.default RetrievePublisher
retrievePaginator
(RetrieveRequest retrieveRequest) This is a variant ofretrieve(software.amazon.awssdk.services.bedrockagentruntime.model.RetrieveRequest)
operation.The SDK service client configuration exposes client settings to the user, e.g., ClientOverrideConfigurationstartFlowExecution
(Consumer<StartFlowExecutionRequest.Builder> startFlowExecutionRequest) Starts an execution of an Amazon Bedrock flow.startFlowExecution
(StartFlowExecutionRequest startFlowExecutionRequest) Starts an execution of an Amazon Bedrock flow.stopFlowExecution
(Consumer<StopFlowExecutionRequest.Builder> stopFlowExecutionRequest) Stops an Amazon Bedrock flow's execution.stopFlowExecution
(StopFlowExecutionRequest stopFlowExecutionRequest) Stops an Amazon Bedrock flow's execution.default CompletableFuture
<TagResourceResponse> tagResource
(Consumer<TagResourceRequest.Builder> tagResourceRequest) Associate tags with a resource.default CompletableFuture
<TagResourceResponse> tagResource
(TagResourceRequest tagResourceRequest) Associate tags with a resource.default CompletableFuture
<UntagResourceResponse> untagResource
(Consumer<UntagResourceRequest.Builder> untagResourceRequest) Remove tags from a resource.default CompletableFuture
<UntagResourceResponse> untagResource
(UntagResourceRequest untagResourceRequest) Remove tags from a resource.default CompletableFuture
<UpdateSessionResponse> updateSession
(Consumer<UpdateSessionRequest.Builder> updateSessionRequest) Updates the metadata or encryption settings of a session.default CompletableFuture
<UpdateSessionResponse> updateSession
(UpdateSessionRequest updateSessionRequest) Updates the metadata or encryption settings of a session.Methods inherited from interface software.amazon.awssdk.utils.SdkAutoCloseable
close
Methods inherited from interface software.amazon.awssdk.core.SdkClient
serviceName
-
Field Details
-
SERVICE_NAME
- See Also:
-
SERVICE_METADATA_ID
Value for looking up the service's metadata from theServiceMetadataProvider
.- See Also:
-
-
Method Details
-
createInvocation
default CompletableFuture<CreateInvocationResponse> createInvocation(CreateInvocationRequest createInvocationRequest) Creates a new invocation within a session. An invocation groups the related invocation steps that store the content from a conversation. For more information about sessions, see Store and retrieve conversation history and context with Amazon Bedrock sessions.
Related APIs
- Parameters:
createInvocationRequest
-- Returns:
- A Java Future containing the result of the CreateInvocation operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ConflictException There was a conflict performing an operation. Resolve the conflict and retry your request.
- ResourceNotFoundException The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- ServiceQuotaExceededException The number of requests exceeds the service quota. Resubmit your request later.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
createInvocation
default CompletableFuture<CreateInvocationResponse> createInvocation(Consumer<CreateInvocationRequest.Builder> createInvocationRequest) Creates a new invocation within a session. An invocation groups the related invocation steps that store the content from a conversation. For more information about sessions, see Store and retrieve conversation history and context with Amazon Bedrock sessions.
Related APIs
This is a convenience which creates an instance of the
CreateInvocationRequest.Builder
avoiding the need to create one manually viaCreateInvocationRequest.builder()
- Parameters:
createInvocationRequest
- AConsumer
that will call methods onCreateInvocationRequest.Builder
to create a request.- Returns:
- A Java Future containing the result of the CreateInvocation operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ConflictException There was a conflict performing an operation. Resolve the conflict and retry your request.
- ResourceNotFoundException The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- ServiceQuotaExceededException The number of requests exceeds the service quota. Resubmit your request later.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
createSession
default CompletableFuture<CreateSessionResponse> createSession(CreateSessionRequest createSessionRequest) Creates a session to temporarily store conversations for generative AI (GenAI) applications built with open-source frameworks such as LangGraph and LlamaIndex. Sessions enable you to save the state of conversations at checkpoints, with the added security and infrastructure of Amazon Web Services. For more information, see Store and retrieve conversation history and context with Amazon Bedrock sessions.
By default, Amazon Bedrock uses Amazon Web Services-managed keys for session encryption, including session metadata, or you can use your own KMS key. For more information, see Amazon Bedrock session encryption.
You use a session to store state and conversation history for generative AI applications built with open-source frameworks. For Amazon Bedrock Agents, the service automatically manages conversation context and associates them with the agent-specific sessionId you specify in the InvokeAgent API operation.
Related APIs:
- Parameters:
createSessionRequest
-- Returns:
- A Java Future containing the result of the CreateSession operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ConflictException There was a conflict performing an operation. Resolve the conflict and retry your request.
- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- ServiceQuotaExceededException The number of requests exceeds the service quota. Resubmit your request later.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
createSession
default CompletableFuture<CreateSessionResponse> createSession(Consumer<CreateSessionRequest.Builder> createSessionRequest) Creates a session to temporarily store conversations for generative AI (GenAI) applications built with open-source frameworks such as LangGraph and LlamaIndex. Sessions enable you to save the state of conversations at checkpoints, with the added security and infrastructure of Amazon Web Services. For more information, see Store and retrieve conversation history and context with Amazon Bedrock sessions.
By default, Amazon Bedrock uses Amazon Web Services-managed keys for session encryption, including session metadata, or you can use your own KMS key. For more information, see Amazon Bedrock session encryption.
You use a session to store state and conversation history for generative AI applications built with open-source frameworks. For Amazon Bedrock Agents, the service automatically manages conversation context and associates them with the agent-specific sessionId you specify in the InvokeAgent API operation.
Related APIs:
This is a convenience which creates an instance of the
CreateSessionRequest.Builder
avoiding the need to create one manually viaCreateSessionRequest.builder()
- Parameters:
createSessionRequest
- AConsumer
that will call methods onCreateSessionRequest.Builder
to create a request.- Returns:
- A Java Future containing the result of the CreateSession operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ConflictException There was a conflict performing an operation. Resolve the conflict and retry your request.
- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- ServiceQuotaExceededException The number of requests exceeds the service quota. Resubmit your request later.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
deleteAgentMemory
default CompletableFuture<DeleteAgentMemoryResponse> deleteAgentMemory(DeleteAgentMemoryRequest deleteAgentMemoryRequest) Deletes memory from the specified memory identifier.
- Parameters:
deleteAgentMemoryRequest
-- Returns:
- A Java Future containing the result of the DeleteAgentMemory operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ResourceNotFoundException The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
- ConflictException There was a conflict performing an operation. Resolve the conflict and retry your request.
- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- DependencyFailedException There was an issue with a dependency. Check the resource configurations and retry the request.
- BadGatewayException There was an issue with a dependency due to a server issue. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- ServiceQuotaExceededException The number of requests exceeds the service quota. Resubmit your request later.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
deleteAgentMemory
default CompletableFuture<DeleteAgentMemoryResponse> deleteAgentMemory(Consumer<DeleteAgentMemoryRequest.Builder> deleteAgentMemoryRequest) Deletes memory from the specified memory identifier.
This is a convenience which creates an instance of the
DeleteAgentMemoryRequest.Builder
avoiding the need to create one manually viaDeleteAgentMemoryRequest.builder()
- Parameters:
deleteAgentMemoryRequest
- AConsumer
that will call methods onDeleteAgentMemoryRequest.Builder
to create a request.- Returns:
- A Java Future containing the result of the DeleteAgentMemory operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ResourceNotFoundException The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
- ConflictException There was a conflict performing an operation. Resolve the conflict and retry your request.
- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- DependencyFailedException There was an issue with a dependency. Check the resource configurations and retry the request.
- BadGatewayException There was an issue with a dependency due to a server issue. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- ServiceQuotaExceededException The number of requests exceeds the service quota. Resubmit your request later.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
deleteSession
default CompletableFuture<DeleteSessionResponse> deleteSession(DeleteSessionRequest deleteSessionRequest) Deletes a session that you ended. You can't delete a session with an
ACTIVE
status. To delete an active session, you must first end it with the EndSession API operation. For more information about sessions, see Store and retrieve conversation history and context with Amazon Bedrock sessions.- Parameters:
deleteSessionRequest
-- Returns:
- A Java Future containing the result of the DeleteSession operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ResourceNotFoundException The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
- ConflictException There was a conflict performing an operation. Resolve the conflict and retry your request.
- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
deleteSession
default CompletableFuture<DeleteSessionResponse> deleteSession(Consumer<DeleteSessionRequest.Builder> deleteSessionRequest) Deletes a session that you ended. You can't delete a session with an
ACTIVE
status. To delete an active session, you must first end it with the EndSession API operation. For more information about sessions, see Store and retrieve conversation history and context with Amazon Bedrock sessions.
This is a convenience which creates an instance of the
DeleteSessionRequest.Builder
avoiding the need to create one manually viaDeleteSessionRequest.builder()
- Parameters:
deleteSessionRequest
- AConsumer
that will call methods onDeleteSessionRequest.Builder
to create a request.- Returns:
- A Java Future containing the result of the DeleteSession operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ResourceNotFoundException The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
- ConflictException There was a conflict performing an operation. Resolve the conflict and retry your request.
- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
endSession
Ends the session. After you end a session, you can still access its content but you can’t add to it. To delete the session and it's content, you use the DeleteSession API operation. For more information about sessions, see Store and retrieve conversation history and context with Amazon Bedrock sessions.
- Parameters:
endSessionRequest
-- Returns:
- A Java Future containing the result of the EndSession operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ResourceNotFoundException The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
- ConflictException There was a conflict performing an operation. Resolve the conflict and retry your request.
- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
endSession
default CompletableFuture<EndSessionResponse> endSession(Consumer<EndSessionRequest.Builder> endSessionRequest) Ends the session. After you end a session, you can still access its content but you can’t add to it. To delete the session and it's content, you use the DeleteSession API operation. For more information about sessions, see Store and retrieve conversation history and context with Amazon Bedrock sessions.
This is a convenience which creates an instance of the
EndSessionRequest.Builder
avoiding the need to create one manually viaEndSessionRequest.builder()
- Parameters:
endSessionRequest
- AConsumer
that will call methods onEndSessionRequest.Builder
to create a request.- Returns:
- A Java Future containing the result of the EndSession operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ResourceNotFoundException The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
- ConflictException There was a conflict performing an operation. Resolve the conflict and retry your request.
- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
generateQuery
default CompletableFuture<GenerateQueryResponse> generateQuery(GenerateQueryRequest generateQueryRequest) Generates an SQL query from a natural language query. For more information, see Generate a query for structured data in the Amazon Bedrock User Guide.
- Parameters:
generateQueryRequest
-- Returns:
- A Java Future containing the result of the GenerateQuery operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ResourceNotFoundException The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
- ConflictException There was a conflict performing an operation. Resolve the conflict and retry your request.
- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- DependencyFailedException There was an issue with a dependency. Check the resource configurations and retry the request.
- BadGatewayException There was an issue with a dependency due to a server issue. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- ServiceQuotaExceededException The number of requests exceeds the service quota. Resubmit your request later.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
generateQuery
default CompletableFuture<GenerateQueryResponse> generateQuery(Consumer<GenerateQueryRequest.Builder> generateQueryRequest) Generates an SQL query from a natural language query. For more information, see Generate a query for structured data in the Amazon Bedrock User Guide.
This is a convenience which creates an instance of the
GenerateQueryRequest.Builder
avoiding the need to create one manually viaGenerateQueryRequest.builder()
- Parameters:
generateQueryRequest
- AConsumer
that will call methods onGenerateQueryRequest.Builder
to create a request.- Returns:
- A Java Future containing the result of the GenerateQuery operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ResourceNotFoundException The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
- ConflictException There was a conflict performing an operation. Resolve the conflict and retry your request.
- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- DependencyFailedException There was an issue with a dependency. Check the resource configurations and retry the request.
- BadGatewayException There was an issue with a dependency due to a server issue. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- ServiceQuotaExceededException The number of requests exceeds the service quota. Resubmit your request later.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
getAgentMemory
default CompletableFuture<GetAgentMemoryResponse> getAgentMemory(GetAgentMemoryRequest getAgentMemoryRequest) Gets the sessions stored in the memory of the agent.
- Parameters:
getAgentMemoryRequest
-- Returns:
- A Java Future containing the result of the GetAgentMemory operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ResourceNotFoundException The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
- ConflictException There was a conflict performing an operation. Resolve the conflict and retry your request.
- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- DependencyFailedException There was an issue with a dependency. Check the resource configurations and retry the request.
- BadGatewayException There was an issue with a dependency due to a server issue. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- ServiceQuotaExceededException The number of requests exceeds the service quota. Resubmit your request later.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
getAgentMemory
default CompletableFuture<GetAgentMemoryResponse> getAgentMemory(Consumer<GetAgentMemoryRequest.Builder> getAgentMemoryRequest) Gets the sessions stored in the memory of the agent.
This is a convenience which creates an instance of the
GetAgentMemoryRequest.Builder
avoiding the need to create one manually viaGetAgentMemoryRequest.builder()
- Parameters:
getAgentMemoryRequest
- AConsumer
that will call methods onGetAgentMemoryRequest.Builder
to create a request.- Returns:
- A Java Future containing the result of the GetAgentMemory operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ResourceNotFoundException The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
- ConflictException There was a conflict performing an operation. Resolve the conflict and retry your request.
- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- DependencyFailedException There was an issue with a dependency. Check the resource configurations and retry the request.
- BadGatewayException There was an issue with a dependency due to a server issue. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- ServiceQuotaExceededException The number of requests exceeds the service quota. Resubmit your request later.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
getAgentMemoryPaginator
default GetAgentMemoryPublisher getAgentMemoryPaginator(GetAgentMemoryRequest getAgentMemoryRequest) This is a variant of
getAgentMemory(software.amazon.awssdk.services.bedrockagentruntime.model.GetAgentMemoryRequest)
operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will internally handle making service calls for you.When the operation is called, an instance of this class is returned. At this point, no service calls are made yet and so there is no guarantee that the request is valid. If there are errors in your request, you will see the failures only after you start streaming the data. The subscribe method should be called as a request to start streaming data. For more info, see
Publisher.subscribe(org.reactivestreams.Subscriber)
. Each call to the subscribe method will result in a newSubscription
i.e., a new contract to stream data from the starting request.The following are few ways to use the response class:
1) Using the subscribe helper methodsoftware.amazon.awssdk.services.bedrockagentruntime.paginators.GetAgentMemoryPublisher publisher = client.getAgentMemoryPaginator(request); CompletableFuture<Void> future = publisher.subscribe(res -> { // Do something with the response }); future.get();
software.amazon.awssdk.services.bedrockagentruntime.paginators.GetAgentMemoryPublisher publisher = client.getAgentMemoryPaginator(request); publisher.subscribe(new Subscriber<software.amazon.awssdk.services.bedrockagentruntime.model.GetAgentMemoryResponse>() { public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... }; public void onNext(software.amazon.awssdk.services.bedrockagentruntime.model.GetAgentMemoryResponse response) { //... }; });
Please notice that the configuration of maxItems won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
getAgentMemory(software.amazon.awssdk.services.bedrockagentruntime.model.GetAgentMemoryRequest)
operation.- Parameters:
getAgentMemoryRequest
-- Returns:
- A custom publisher that can be subscribed to request a stream of response pages.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ResourceNotFoundException The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
- ConflictException There was a conflict performing an operation. Resolve the conflict and retry your request.
- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- DependencyFailedException There was an issue with a dependency. Check the resource configurations and retry the request.
- BadGatewayException There was an issue with a dependency due to a server issue. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- ServiceQuotaExceededException The number of requests exceeds the service quota. Resubmit your request later.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
getAgentMemoryPaginator
default GetAgentMemoryPublisher getAgentMemoryPaginator(Consumer<GetAgentMemoryRequest.Builder> getAgentMemoryRequest) This is a variant of
getAgentMemory(software.amazon.awssdk.services.bedrockagentruntime.model.GetAgentMemoryRequest)
operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will internally handle making service calls for you.When the operation is called, an instance of this class is returned. At this point, no service calls are made yet and so there is no guarantee that the request is valid. If there are errors in your request, you will see the failures only after you start streaming the data. The subscribe method should be called as a request to start streaming data. For more info, see
Publisher.subscribe(org.reactivestreams.Subscriber)
. Each call to the subscribe method will result in a newSubscription
i.e., a new contract to stream data from the starting request.The following are few ways to use the response class:
1) Using the subscribe helper methodsoftware.amazon.awssdk.services.bedrockagentruntime.paginators.GetAgentMemoryPublisher publisher = client.getAgentMemoryPaginator(request); CompletableFuture<Void> future = publisher.subscribe(res -> { // Do something with the response }); future.get();
software.amazon.awssdk.services.bedrockagentruntime.paginators.GetAgentMemoryPublisher publisher = client.getAgentMemoryPaginator(request); publisher.subscribe(new Subscriber<software.amazon.awssdk.services.bedrockagentruntime.model.GetAgentMemoryResponse>() { public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... }; public void onNext(software.amazon.awssdk.services.bedrockagentruntime.model.GetAgentMemoryResponse response) { //... }; });
Please notice that the configuration of maxItems won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
getAgentMemory(software.amazon.awssdk.services.bedrockagentruntime.model.GetAgentMemoryRequest)
operation.
This is a convenience which creates an instance of the
GetAgentMemoryRequest.Builder
avoiding the need to create one manually viaGetAgentMemoryRequest.builder()
- Parameters:
getAgentMemoryRequest
- AConsumer
that will call methods onGetAgentMemoryRequest.Builder
to create a request.- Returns:
- A custom publisher that can be subscribed to request a stream of response pages.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ResourceNotFoundException The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
- ConflictException There was a conflict performing an operation. Resolve the conflict and retry your request.
- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- DependencyFailedException There was an issue with a dependency. Check the resource configurations and retry the request.
- BadGatewayException There was an issue with a dependency due to a server issue. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- ServiceQuotaExceededException The number of requests exceeds the service quota. Resubmit your request later.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
getExecutionFlowSnapshot
default CompletableFuture<GetExecutionFlowSnapshotResponse> getExecutionFlowSnapshot(GetExecutionFlowSnapshotRequest getExecutionFlowSnapshotRequest) Retrieves the flow definition snapshot used for a flow execution. The snapshot represents the flow metadata and definition as it existed at the time the execution was started. Note that even if the flow is edited after an execution starts, the snapshot connected to the execution remains unchanged.
Flow executions is in preview release for Amazon Bedrock and is subject to change.
- Parameters:
getExecutionFlowSnapshotRequest
-- Returns:
- A Java Future containing the result of the GetExecutionFlowSnapshot operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ResourceNotFoundException The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
getExecutionFlowSnapshot
default CompletableFuture<GetExecutionFlowSnapshotResponse> getExecutionFlowSnapshot(Consumer<GetExecutionFlowSnapshotRequest.Builder> getExecutionFlowSnapshotRequest) Retrieves the flow definition snapshot used for a flow execution. The snapshot represents the flow metadata and definition as it existed at the time the execution was started. Note that even if the flow is edited after an execution starts, the snapshot connected to the execution remains unchanged.
Flow executions is in preview release for Amazon Bedrock and is subject to change.
This is a convenience which creates an instance of the
GetExecutionFlowSnapshotRequest.Builder
avoiding the need to create one manually viaGetExecutionFlowSnapshotRequest.builder()
- Parameters:
getExecutionFlowSnapshotRequest
- AConsumer
that will call methods onGetExecutionFlowSnapshotRequest.Builder
to create a request.- Returns:
- A Java Future containing the result of the GetExecutionFlowSnapshot operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ResourceNotFoundException The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
getFlowExecution
default CompletableFuture<GetFlowExecutionResponse> getFlowExecution(GetFlowExecutionRequest getFlowExecutionRequest) Retrieves details about a specific flow execution, including its status, start and end times, and any errors that occurred during execution.
- Parameters:
getFlowExecutionRequest
-- Returns:
- A Java Future containing the result of the GetFlowExecution operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ResourceNotFoundException The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
getFlowExecution
default CompletableFuture<GetFlowExecutionResponse> getFlowExecution(Consumer<GetFlowExecutionRequest.Builder> getFlowExecutionRequest) Retrieves details about a specific flow execution, including its status, start and end times, and any errors that occurred during execution.
This is a convenience which creates an instance of the
GetFlowExecutionRequest.Builder
avoiding the need to create one manually viaGetFlowExecutionRequest.builder()
- Parameters:
getFlowExecutionRequest
- AConsumer
that will call methods onGetFlowExecutionRequest.Builder
to create a request.- Returns:
- A Java Future containing the result of the GetFlowExecution operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ResourceNotFoundException The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
getInvocationStep
default CompletableFuture<GetInvocationStepResponse> getInvocationStep(GetInvocationStepRequest getInvocationStepRequest) Retrieves the details of a specific invocation step within an invocation in a session. For more information about sessions, see Store and retrieve conversation history and context with Amazon Bedrock sessions.
- Parameters:
getInvocationStepRequest
-- Returns:
- A Java Future containing the result of the GetInvocationStep operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ResourceNotFoundException The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
getInvocationStep
default CompletableFuture<GetInvocationStepResponse> getInvocationStep(Consumer<GetInvocationStepRequest.Builder> getInvocationStepRequest) Retrieves the details of a specific invocation step within an invocation in a session. For more information about sessions, see Store and retrieve conversation history and context with Amazon Bedrock sessions.
This is a convenience which creates an instance of the
GetInvocationStepRequest.Builder
avoiding the need to create one manually viaGetInvocationStepRequest.builder()
- Parameters:
getInvocationStepRequest
- AConsumer
that will call methods onGetInvocationStepRequest.Builder
to create a request.- Returns:
- A Java Future containing the result of the GetInvocationStep operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ResourceNotFoundException The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
getSession
Retrieves details about a specific session. For more information about sessions, see Store and retrieve conversation history and context with Amazon Bedrock sessions.
- Parameters:
getSessionRequest
-- Returns:
- A Java Future containing the result of the GetSession operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ResourceNotFoundException The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
getSession
default CompletableFuture<GetSessionResponse> getSession(Consumer<GetSessionRequest.Builder> getSessionRequest) Retrieves details about a specific session. For more information about sessions, see Store and retrieve conversation history and context with Amazon Bedrock sessions.
This is a convenience which creates an instance of the
GetSessionRequest.Builder
avoiding the need to create one manually viaGetSessionRequest.builder()
- Parameters:
getSessionRequest
- AConsumer
that will call methods onGetSessionRequest.Builder
to create a request.- Returns:
- A Java Future containing the result of the GetSession operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ResourceNotFoundException The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
invokeAgent
default CompletableFuture<Void> invokeAgent(InvokeAgentRequest invokeAgentRequest, InvokeAgentResponseHandler asyncResponseHandler) 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
totrue
. 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
totrue
. -
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 contains both chunk and trace attributes.
The final response is returned in the
bytes
field of thechunk
object. TheInvokeAgent
returns one chunk for the entire interaction.-
The
attribution
object contains citations for parts of the response. -
If you set
enableTrace
totrue
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.
- Parameters:
invokeAgentRequest
-- Returns:
- A Java Future containing the result of the InvokeAgent operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ModelNotReadyException The model specified in the request is not ready to serve inference requests. The AWS SDK will automatically retry the operation up to 5 times. For information about configuring automatic retries, see Retry behavior in the AWS SDKs and Tools reference guide.
- ResourceNotFoundException The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
- ConflictException There was a conflict performing an operation. Resolve the conflict and retry your request.
- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- DependencyFailedException There was an issue with a dependency. Check the resource configurations and retry the request.
- BadGatewayException There was an issue with a dependency due to a server issue. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- ServiceQuotaExceededException The number of requests exceeds the service quota. Resubmit your request later.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
-
invokeAgent
default CompletableFuture<Void> invokeAgent(Consumer<InvokeAgentRequest.Builder> invokeAgentRequest, InvokeAgentResponseHandler asyncResponseHandler) 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
totrue
. 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
totrue
. -
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 contains both chunk and trace attributes.
The final response is returned in the
bytes
field of thechunk
object. TheInvokeAgent
returns one chunk for the entire interaction.-
The
attribution
object contains citations for parts of the response. -
If you set
enableTrace
totrue
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.
This is a convenience which creates an instance of the
InvokeAgentRequest.Builder
avoiding the need to create one manually viaInvokeAgentRequest.builder()
- Parameters:
invokeAgentRequest
- AConsumer
that will call methods onInvokeAgentRequest.Builder
to create a request.- Returns:
- A Java Future containing the result of the InvokeAgent operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ModelNotReadyException The model specified in the request is not ready to serve inference requests. The AWS SDK will automatically retry the operation up to 5 times. For information about configuring automatic retries, see Retry behavior in the AWS SDKs and Tools reference guide.
- ResourceNotFoundException The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
- ConflictException There was a conflict performing an operation. Resolve the conflict and retry your request.
- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- DependencyFailedException There was an issue with a dependency. Check the resource configurations and retry the request.
- BadGatewayException There was an issue with a dependency due to a server issue. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- ServiceQuotaExceededException The number of requests exceeds the service quota. Resubmit your request later.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
-
invokeFlow
default CompletableFuture<Void> invokeFlow(InvokeFlowRequest invokeFlowRequest, InvokeFlowResponseHandler asyncResponseHandler) Invokes an alias of a flow to run the inputs that you specify and return the output of each node as a stream. If there's an error, the error is returned. For more information, see Test a flow in Amazon Bedrock in the Amazon Bedrock User Guide.
The CLI doesn't support streaming operations in Amazon Bedrock, including
InvokeFlow
.- Parameters:
invokeFlowRequest
-- Returns:
- A Java Future containing the result of the InvokeFlow operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ResourceNotFoundException The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
- ConflictException There was a conflict performing an operation. Resolve the conflict and retry your request.
- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- DependencyFailedException There was an issue with a dependency. Check the resource configurations and retry the request.
- BadGatewayException There was an issue with a dependency due to a server issue. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- ServiceQuotaExceededException The number of requests exceeds the service quota. Resubmit your request later.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
invokeFlow
default CompletableFuture<Void> invokeFlow(Consumer<InvokeFlowRequest.Builder> invokeFlowRequest, InvokeFlowResponseHandler asyncResponseHandler) Invokes an alias of a flow to run the inputs that you specify and return the output of each node as a stream. If there's an error, the error is returned. For more information, see Test a flow in Amazon Bedrock in the Amazon Bedrock User Guide.
The CLI doesn't support streaming operations in Amazon Bedrock, including
InvokeFlow
.
This is a convenience which creates an instance of the
InvokeFlowRequest.Builder
avoiding the need to create one manually viaInvokeFlowRequest.builder()
- Parameters:
invokeFlowRequest
- AConsumer
that will call methods onInvokeFlowRequest.Builder
to create a request.- Returns:
- A Java Future containing the result of the InvokeFlow operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ResourceNotFoundException The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
- ConflictException There was a conflict performing an operation. Resolve the conflict and retry your request.
- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- DependencyFailedException There was an issue with a dependency. Check the resource configurations and retry the request.
- BadGatewayException There was an issue with a dependency due to a server issue. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- ServiceQuotaExceededException The number of requests exceeds the service quota. Resubmit your request later.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
invokeInlineAgent
default CompletableFuture<Void> invokeInlineAgent(InvokeInlineAgentRequest invokeInlineAgentRequest, InvokeInlineAgentResponseHandler asyncResponseHandler) Invokes an inline Amazon Bedrock agent using the configurations you provide with the request.
-
Specify the following fields for security purposes.
-
(Optional)
customerEncryptionKeyArn
– The Amazon Resource Name (ARN) of a KMS key to encrypt the creation of the agent. -
(Optional)
idleSessionTTLinSeconds
– Specify the number of seconds for which the agent should maintain session information. After this time expires, the subsequentInvokeInlineAgent
request begins a new session.
-
-
To override the default prompt behavior for agent orchestration and to use advanced prompts, include a
promptOverrideConfiguration
object. For more information, see Advanced prompts. -
The agent instructions will not be honored if your agent has only one knowledge base, uses default prompts, has no action group, and user input is disabled.
- Parameters:
invokeInlineAgentRequest
-- Returns:
- A Java Future containing the result of the InvokeInlineAgent operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ResourceNotFoundException The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
- ConflictException There was a conflict performing an operation. Resolve the conflict and retry your request.
- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- DependencyFailedException There was an issue with a dependency. Check the resource configurations and retry the request.
- BadGatewayException There was an issue with a dependency due to a server issue. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- ServiceQuotaExceededException The number of requests exceeds the service quota. Resubmit your request later.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
-
invokeInlineAgent
default CompletableFuture<Void> invokeInlineAgent(Consumer<InvokeInlineAgentRequest.Builder> invokeInlineAgentRequest, InvokeInlineAgentResponseHandler asyncResponseHandler) Invokes an inline Amazon Bedrock agent using the configurations you provide with the request.
-
Specify the following fields for security purposes.
-
(Optional)
customerEncryptionKeyArn
– The Amazon Resource Name (ARN) of a KMS key to encrypt the creation of the agent. -
(Optional)
idleSessionTTLinSeconds
– Specify the number of seconds for which the agent should maintain session information. After this time expires, the subsequentInvokeInlineAgent
request begins a new session.
-
-
To override the default prompt behavior for agent orchestration and to use advanced prompts, include a
promptOverrideConfiguration
object. For more information, see Advanced prompts. -
The agent instructions will not be honored if your agent has only one knowledge base, uses default prompts, has no action group, and user input is disabled.
This is a convenience which creates an instance of the
InvokeInlineAgentRequest.Builder
avoiding the need to create one manually viaInvokeInlineAgentRequest.builder()
- Parameters:
invokeInlineAgentRequest
- AConsumer
that will call methods onInvokeInlineAgentRequest.Builder
to create a request.- Returns:
- A Java Future containing the result of the InvokeInlineAgent operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ResourceNotFoundException The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
- ConflictException There was a conflict performing an operation. Resolve the conflict and retry your request.
- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- DependencyFailedException There was an issue with a dependency. Check the resource configurations and retry the request.
- BadGatewayException There was an issue with a dependency due to a server issue. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- ServiceQuotaExceededException The number of requests exceeds the service quota. Resubmit your request later.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
-
listFlowExecutionEvents
default CompletableFuture<ListFlowExecutionEventsResponse> listFlowExecutionEvents(ListFlowExecutionEventsRequest listFlowExecutionEventsRequest) Lists events that occurred during a flow execution. Events provide detailed information about the execution progress, including node inputs and outputs, flow inputs and outputs, condition results, and failure events.
Flow executions is in preview release for Amazon Bedrock and is subject to change.
- Parameters:
listFlowExecutionEventsRequest
-- Returns:
- A Java Future containing the result of the ListFlowExecutionEvents operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ResourceNotFoundException The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
listFlowExecutionEvents
default CompletableFuture<ListFlowExecutionEventsResponse> listFlowExecutionEvents(Consumer<ListFlowExecutionEventsRequest.Builder> listFlowExecutionEventsRequest) Lists events that occurred during a flow execution. Events provide detailed information about the execution progress, including node inputs and outputs, flow inputs and outputs, condition results, and failure events.
Flow executions is in preview release for Amazon Bedrock and is subject to change.
This is a convenience which creates an instance of the
ListFlowExecutionEventsRequest.Builder
avoiding the need to create one manually viaListFlowExecutionEventsRequest.builder()
- Parameters:
listFlowExecutionEventsRequest
- AConsumer
that will call methods onListFlowExecutionEventsRequest.Builder
to create a request.- Returns:
- A Java Future containing the result of the ListFlowExecutionEvents operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ResourceNotFoundException The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
listFlowExecutionEventsPaginator
default ListFlowExecutionEventsPublisher listFlowExecutionEventsPaginator(ListFlowExecutionEventsRequest listFlowExecutionEventsRequest) This is a variant of
listFlowExecutionEvents(software.amazon.awssdk.services.bedrockagentruntime.model.ListFlowExecutionEventsRequest)
operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will internally handle making service calls for you.When the operation is called, an instance of this class is returned. At this point, no service calls are made yet and so there is no guarantee that the request is valid. If there are errors in your request, you will see the failures only after you start streaming the data. The subscribe method should be called as a request to start streaming data. For more info, see
Publisher.subscribe(org.reactivestreams.Subscriber)
. Each call to the subscribe method will result in a newSubscription
i.e., a new contract to stream data from the starting request.The following are few ways to use the response class:
1) Using the subscribe helper methodsoftware.amazon.awssdk.services.bedrockagentruntime.paginators.ListFlowExecutionEventsPublisher publisher = client.listFlowExecutionEventsPaginator(request); CompletableFuture<Void> future = publisher.subscribe(res -> { // Do something with the response }); future.get();
software.amazon.awssdk.services.bedrockagentruntime.paginators.ListFlowExecutionEventsPublisher publisher = client.listFlowExecutionEventsPaginator(request); publisher.subscribe(new Subscriber<software.amazon.awssdk.services.bedrockagentruntime.model.ListFlowExecutionEventsResponse>() { public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... }; public void onNext(software.amazon.awssdk.services.bedrockagentruntime.model.ListFlowExecutionEventsResponse response) { //... }; });
Please notice that the configuration of maxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
listFlowExecutionEvents(software.amazon.awssdk.services.bedrockagentruntime.model.ListFlowExecutionEventsRequest)
operation.- Parameters:
listFlowExecutionEventsRequest
-- Returns:
- A custom publisher that can be subscribed to request a stream of response pages.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ResourceNotFoundException The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
listFlowExecutionEventsPaginator
default ListFlowExecutionEventsPublisher listFlowExecutionEventsPaginator(Consumer<ListFlowExecutionEventsRequest.Builder> listFlowExecutionEventsRequest) This is a variant of
listFlowExecutionEvents(software.amazon.awssdk.services.bedrockagentruntime.model.ListFlowExecutionEventsRequest)
operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will internally handle making service calls for you.When the operation is called, an instance of this class is returned. At this point, no service calls are made yet and so there is no guarantee that the request is valid. If there are errors in your request, you will see the failures only after you start streaming the data. The subscribe method should be called as a request to start streaming data. For more info, see
Publisher.subscribe(org.reactivestreams.Subscriber)
. Each call to the subscribe method will result in a newSubscription
i.e., a new contract to stream data from the starting request.The following are few ways to use the response class:
1) Using the subscribe helper methodsoftware.amazon.awssdk.services.bedrockagentruntime.paginators.ListFlowExecutionEventsPublisher publisher = client.listFlowExecutionEventsPaginator(request); CompletableFuture<Void> future = publisher.subscribe(res -> { // Do something with the response }); future.get();
software.amazon.awssdk.services.bedrockagentruntime.paginators.ListFlowExecutionEventsPublisher publisher = client.listFlowExecutionEventsPaginator(request); publisher.subscribe(new Subscriber<software.amazon.awssdk.services.bedrockagentruntime.model.ListFlowExecutionEventsResponse>() { public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... }; public void onNext(software.amazon.awssdk.services.bedrockagentruntime.model.ListFlowExecutionEventsResponse response) { //... }; });
Please notice that the configuration of maxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
listFlowExecutionEvents(software.amazon.awssdk.services.bedrockagentruntime.model.ListFlowExecutionEventsRequest)
operation.
This is a convenience which creates an instance of the
ListFlowExecutionEventsRequest.Builder
avoiding the need to create one manually viaListFlowExecutionEventsRequest.builder()
- Parameters:
listFlowExecutionEventsRequest
- AConsumer
that will call methods onListFlowExecutionEventsRequest.Builder
to create a request.- Returns:
- A custom publisher that can be subscribed to request a stream of response pages.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ResourceNotFoundException The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
listFlowExecutions
default CompletableFuture<ListFlowExecutionsResponse> listFlowExecutions(ListFlowExecutionsRequest listFlowExecutionsRequest) Lists all executions of a flow. Results can be paginated and include summary information about each execution, such as status, start and end times, and the execution's Amazon Resource Name (ARN).
Flow executions is in preview release for Amazon Bedrock and is subject to change.
- Parameters:
listFlowExecutionsRequest
-- Returns:
- A Java Future containing the result of the ListFlowExecutions operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ResourceNotFoundException The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
listFlowExecutions
default CompletableFuture<ListFlowExecutionsResponse> listFlowExecutions(Consumer<ListFlowExecutionsRequest.Builder> listFlowExecutionsRequest) Lists all executions of a flow. Results can be paginated and include summary information about each execution, such as status, start and end times, and the execution's Amazon Resource Name (ARN).
Flow executions is in preview release for Amazon Bedrock and is subject to change.
This is a convenience which creates an instance of the
ListFlowExecutionsRequest.Builder
avoiding the need to create one manually viaListFlowExecutionsRequest.builder()
- Parameters:
listFlowExecutionsRequest
- AConsumer
that will call methods onListFlowExecutionsRequest.Builder
to create a request.- Returns:
- A Java Future containing the result of the ListFlowExecutions operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ResourceNotFoundException The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
listFlowExecutionsPaginator
default ListFlowExecutionsPublisher listFlowExecutionsPaginator(ListFlowExecutionsRequest listFlowExecutionsRequest) This is a variant of
listFlowExecutions(software.amazon.awssdk.services.bedrockagentruntime.model.ListFlowExecutionsRequest)
operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will internally handle making service calls for you.When the operation is called, an instance of this class is returned. At this point, no service calls are made yet and so there is no guarantee that the request is valid. If there are errors in your request, you will see the failures only after you start streaming the data. The subscribe method should be called as a request to start streaming data. For more info, see
Publisher.subscribe(org.reactivestreams.Subscriber)
. Each call to the subscribe method will result in a newSubscription
i.e., a new contract to stream data from the starting request.The following are few ways to use the response class:
1) Using the subscribe helper methodsoftware.amazon.awssdk.services.bedrockagentruntime.paginators.ListFlowExecutionsPublisher publisher = client.listFlowExecutionsPaginator(request); CompletableFuture<Void> future = publisher.subscribe(res -> { // Do something with the response }); future.get();
software.amazon.awssdk.services.bedrockagentruntime.paginators.ListFlowExecutionsPublisher publisher = client.listFlowExecutionsPaginator(request); publisher.subscribe(new Subscriber<software.amazon.awssdk.services.bedrockagentruntime.model.ListFlowExecutionsResponse>() { public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... }; public void onNext(software.amazon.awssdk.services.bedrockagentruntime.model.ListFlowExecutionsResponse response) { //... }; });
Please notice that the configuration of maxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
listFlowExecutions(software.amazon.awssdk.services.bedrockagentruntime.model.ListFlowExecutionsRequest)
operation.- Parameters:
listFlowExecutionsRequest
-- Returns:
- A custom publisher that can be subscribed to request a stream of response pages.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ResourceNotFoundException The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
listFlowExecutionsPaginator
default ListFlowExecutionsPublisher listFlowExecutionsPaginator(Consumer<ListFlowExecutionsRequest.Builder> listFlowExecutionsRequest) This is a variant of
listFlowExecutions(software.amazon.awssdk.services.bedrockagentruntime.model.ListFlowExecutionsRequest)
operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will internally handle making service calls for you.When the operation is called, an instance of this class is returned. At this point, no service calls are made yet and so there is no guarantee that the request is valid. If there are errors in your request, you will see the failures only after you start streaming the data. The subscribe method should be called as a request to start streaming data. For more info, see
Publisher.subscribe(org.reactivestreams.Subscriber)
. Each call to the subscribe method will result in a newSubscription
i.e., a new contract to stream data from the starting request.The following are few ways to use the response class:
1) Using the subscribe helper methodsoftware.amazon.awssdk.services.bedrockagentruntime.paginators.ListFlowExecutionsPublisher publisher = client.listFlowExecutionsPaginator(request); CompletableFuture<Void> future = publisher.subscribe(res -> { // Do something with the response }); future.get();
software.amazon.awssdk.services.bedrockagentruntime.paginators.ListFlowExecutionsPublisher publisher = client.listFlowExecutionsPaginator(request); publisher.subscribe(new Subscriber<software.amazon.awssdk.services.bedrockagentruntime.model.ListFlowExecutionsResponse>() { public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... }; public void onNext(software.amazon.awssdk.services.bedrockagentruntime.model.ListFlowExecutionsResponse response) { //... }; });
Please notice that the configuration of maxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
listFlowExecutions(software.amazon.awssdk.services.bedrockagentruntime.model.ListFlowExecutionsRequest)
operation.
This is a convenience which creates an instance of the
ListFlowExecutionsRequest.Builder
avoiding the need to create one manually viaListFlowExecutionsRequest.builder()
- Parameters:
listFlowExecutionsRequest
- AConsumer
that will call methods onListFlowExecutionsRequest.Builder
to create a request.- Returns:
- A custom publisher that can be subscribed to request a stream of response pages.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ResourceNotFoundException The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
listInvocationSteps
default CompletableFuture<ListInvocationStepsResponse> listInvocationSteps(ListInvocationStepsRequest listInvocationStepsRequest) Lists all invocation steps associated with a session and optionally, an invocation within the session. For more information about sessions, see Store and retrieve conversation history and context with Amazon Bedrock sessions.
- Parameters:
listInvocationStepsRequest
-- Returns:
- A Java Future containing the result of the ListInvocationSteps operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ResourceNotFoundException The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
listInvocationSteps
default CompletableFuture<ListInvocationStepsResponse> listInvocationSteps(Consumer<ListInvocationStepsRequest.Builder> listInvocationStepsRequest) Lists all invocation steps associated with a session and optionally, an invocation within the session. For more information about sessions, see Store and retrieve conversation history and context with Amazon Bedrock sessions.
This is a convenience which creates an instance of the
ListInvocationStepsRequest.Builder
avoiding the need to create one manually viaListInvocationStepsRequest.builder()
- Parameters:
listInvocationStepsRequest
- AConsumer
that will call methods onListInvocationStepsRequest.Builder
to create a request.- Returns:
- A Java Future containing the result of the ListInvocationSteps operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ResourceNotFoundException The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
listInvocationStepsPaginator
default ListInvocationStepsPublisher listInvocationStepsPaginator(ListInvocationStepsRequest listInvocationStepsRequest) This is a variant of
listInvocationSteps(software.amazon.awssdk.services.bedrockagentruntime.model.ListInvocationStepsRequest)
operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will internally handle making service calls for you.When the operation is called, an instance of this class is returned. At this point, no service calls are made yet and so there is no guarantee that the request is valid. If there are errors in your request, you will see the failures only after you start streaming the data. The subscribe method should be called as a request to start streaming data. For more info, see
Publisher.subscribe(org.reactivestreams.Subscriber)
. Each call to the subscribe method will result in a newSubscription
i.e., a new contract to stream data from the starting request.The following are few ways to use the response class:
1) Using the subscribe helper methodsoftware.amazon.awssdk.services.bedrockagentruntime.paginators.ListInvocationStepsPublisher publisher = client.listInvocationStepsPaginator(request); CompletableFuture<Void> future = publisher.subscribe(res -> { // Do something with the response }); future.get();
software.amazon.awssdk.services.bedrockagentruntime.paginators.ListInvocationStepsPublisher publisher = client.listInvocationStepsPaginator(request); publisher.subscribe(new Subscriber<software.amazon.awssdk.services.bedrockagentruntime.model.ListInvocationStepsResponse>() { public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... }; public void onNext(software.amazon.awssdk.services.bedrockagentruntime.model.ListInvocationStepsResponse response) { //... }; });
Please notice that the configuration of maxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
listInvocationSteps(software.amazon.awssdk.services.bedrockagentruntime.model.ListInvocationStepsRequest)
operation.- Parameters:
listInvocationStepsRequest
-- Returns:
- A custom publisher that can be subscribed to request a stream of response pages.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ResourceNotFoundException The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
listInvocationStepsPaginator
default ListInvocationStepsPublisher listInvocationStepsPaginator(Consumer<ListInvocationStepsRequest.Builder> listInvocationStepsRequest) This is a variant of
listInvocationSteps(software.amazon.awssdk.services.bedrockagentruntime.model.ListInvocationStepsRequest)
operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will internally handle making service calls for you.When the operation is called, an instance of this class is returned. At this point, no service calls are made yet and so there is no guarantee that the request is valid. If there are errors in your request, you will see the failures only after you start streaming the data. The subscribe method should be called as a request to start streaming data. For more info, see
Publisher.subscribe(org.reactivestreams.Subscriber)
. Each call to the subscribe method will result in a newSubscription
i.e., a new contract to stream data from the starting request.The following are few ways to use the response class:
1) Using the subscribe helper methodsoftware.amazon.awssdk.services.bedrockagentruntime.paginators.ListInvocationStepsPublisher publisher = client.listInvocationStepsPaginator(request); CompletableFuture<Void> future = publisher.subscribe(res -> { // Do something with the response }); future.get();
software.amazon.awssdk.services.bedrockagentruntime.paginators.ListInvocationStepsPublisher publisher = client.listInvocationStepsPaginator(request); publisher.subscribe(new Subscriber<software.amazon.awssdk.services.bedrockagentruntime.model.ListInvocationStepsResponse>() { public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... }; public void onNext(software.amazon.awssdk.services.bedrockagentruntime.model.ListInvocationStepsResponse response) { //... }; });
Please notice that the configuration of maxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
listInvocationSteps(software.amazon.awssdk.services.bedrockagentruntime.model.ListInvocationStepsRequest)
operation.
This is a convenience which creates an instance of the
ListInvocationStepsRequest.Builder
avoiding the need to create one manually viaListInvocationStepsRequest.builder()
- Parameters:
listInvocationStepsRequest
- AConsumer
that will call methods onListInvocationStepsRequest.Builder
to create a request.- Returns:
- A custom publisher that can be subscribed to request a stream of response pages.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ResourceNotFoundException The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
listInvocations
default CompletableFuture<ListInvocationsResponse> listInvocations(ListInvocationsRequest listInvocationsRequest) Lists all invocations associated with a specific session. For more information about sessions, see Store and retrieve conversation history and context with Amazon Bedrock sessions.
- Parameters:
listInvocationsRequest
-- Returns:
- A Java Future containing the result of the ListInvocations operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ResourceNotFoundException The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
listInvocations
default CompletableFuture<ListInvocationsResponse> listInvocations(Consumer<ListInvocationsRequest.Builder> listInvocationsRequest) Lists all invocations associated with a specific session. For more information about sessions, see Store and retrieve conversation history and context with Amazon Bedrock sessions.
This is a convenience which creates an instance of the
ListInvocationsRequest.Builder
avoiding the need to create one manually viaListInvocationsRequest.builder()
- Parameters:
listInvocationsRequest
- AConsumer
that will call methods onListInvocationsRequest.Builder
to create a request.- Returns:
- A Java Future containing the result of the ListInvocations operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ResourceNotFoundException The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
listInvocationsPaginator
default ListInvocationsPublisher listInvocationsPaginator(ListInvocationsRequest listInvocationsRequest) This is a variant of
listInvocations(software.amazon.awssdk.services.bedrockagentruntime.model.ListInvocationsRequest)
operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will internally handle making service calls for you.When the operation is called, an instance of this class is returned. At this point, no service calls are made yet and so there is no guarantee that the request is valid. If there are errors in your request, you will see the failures only after you start streaming the data. The subscribe method should be called as a request to start streaming data. For more info, see
Publisher.subscribe(org.reactivestreams.Subscriber)
. Each call to the subscribe method will result in a newSubscription
i.e., a new contract to stream data from the starting request.The following are few ways to use the response class:
1) Using the subscribe helper methodsoftware.amazon.awssdk.services.bedrockagentruntime.paginators.ListInvocationsPublisher publisher = client.listInvocationsPaginator(request); CompletableFuture<Void> future = publisher.subscribe(res -> { // Do something with the response }); future.get();
software.amazon.awssdk.services.bedrockagentruntime.paginators.ListInvocationsPublisher publisher = client.listInvocationsPaginator(request); publisher.subscribe(new Subscriber<software.amazon.awssdk.services.bedrockagentruntime.model.ListInvocationsResponse>() { public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... }; public void onNext(software.amazon.awssdk.services.bedrockagentruntime.model.ListInvocationsResponse response) { //... }; });
Please notice that the configuration of maxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
listInvocations(software.amazon.awssdk.services.bedrockagentruntime.model.ListInvocationsRequest)
operation.- Parameters:
listInvocationsRequest
-- Returns:
- A custom publisher that can be subscribed to request a stream of response pages.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ResourceNotFoundException The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
listInvocationsPaginator
default ListInvocationsPublisher listInvocationsPaginator(Consumer<ListInvocationsRequest.Builder> listInvocationsRequest) This is a variant of
listInvocations(software.amazon.awssdk.services.bedrockagentruntime.model.ListInvocationsRequest)
operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will internally handle making service calls for you.When the operation is called, an instance of this class is returned. At this point, no service calls are made yet and so there is no guarantee that the request is valid. If there are errors in your request, you will see the failures only after you start streaming the data. The subscribe method should be called as a request to start streaming data. For more info, see
Publisher.subscribe(org.reactivestreams.Subscriber)
. Each call to the subscribe method will result in a newSubscription
i.e., a new contract to stream data from the starting request.The following are few ways to use the response class:
1) Using the subscribe helper methodsoftware.amazon.awssdk.services.bedrockagentruntime.paginators.ListInvocationsPublisher publisher = client.listInvocationsPaginator(request); CompletableFuture<Void> future = publisher.subscribe(res -> { // Do something with the response }); future.get();
software.amazon.awssdk.services.bedrockagentruntime.paginators.ListInvocationsPublisher publisher = client.listInvocationsPaginator(request); publisher.subscribe(new Subscriber<software.amazon.awssdk.services.bedrockagentruntime.model.ListInvocationsResponse>() { public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... }; public void onNext(software.amazon.awssdk.services.bedrockagentruntime.model.ListInvocationsResponse response) { //... }; });
Please notice that the configuration of maxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
listInvocations(software.amazon.awssdk.services.bedrockagentruntime.model.ListInvocationsRequest)
operation.
This is a convenience which creates an instance of the
ListInvocationsRequest.Builder
avoiding the need to create one manually viaListInvocationsRequest.builder()
- Parameters:
listInvocationsRequest
- AConsumer
that will call methods onListInvocationsRequest.Builder
to create a request.- Returns:
- A custom publisher that can be subscribed to request a stream of response pages.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ResourceNotFoundException The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
listSessions
default CompletableFuture<ListSessionsResponse> listSessions(ListSessionsRequest listSessionsRequest) Lists all sessions in your Amazon Web Services account. For more information about sessions, see Store and retrieve conversation history and context with Amazon Bedrock sessions.
- Parameters:
listSessionsRequest
-- Returns:
- A Java Future containing the result of the ListSessions operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
listSessions
default CompletableFuture<ListSessionsResponse> listSessions(Consumer<ListSessionsRequest.Builder> listSessionsRequest) Lists all sessions in your Amazon Web Services account. For more information about sessions, see Store and retrieve conversation history and context with Amazon Bedrock sessions.
This is a convenience which creates an instance of the
ListSessionsRequest.Builder
avoiding the need to create one manually viaListSessionsRequest.builder()
- Parameters:
listSessionsRequest
- AConsumer
that will call methods onListSessionsRequest.Builder
to create a request.- Returns:
- A Java Future containing the result of the ListSessions operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
listSessionsPaginator
This is a variant of
listSessions(software.amazon.awssdk.services.bedrockagentruntime.model.ListSessionsRequest)
operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will internally handle making service calls for you.When the operation is called, an instance of this class is returned. At this point, no service calls are made yet and so there is no guarantee that the request is valid. If there are errors in your request, you will see the failures only after you start streaming the data. The subscribe method should be called as a request to start streaming data. For more info, see
Publisher.subscribe(org.reactivestreams.Subscriber)
. Each call to the subscribe method will result in a newSubscription
i.e., a new contract to stream data from the starting request.The following are few ways to use the response class:
1) Using the subscribe helper methodsoftware.amazon.awssdk.services.bedrockagentruntime.paginators.ListSessionsPublisher publisher = client.listSessionsPaginator(request); CompletableFuture<Void> future = publisher.subscribe(res -> { // Do something with the response }); future.get();
software.amazon.awssdk.services.bedrockagentruntime.paginators.ListSessionsPublisher publisher = client.listSessionsPaginator(request); publisher.subscribe(new Subscriber<software.amazon.awssdk.services.bedrockagentruntime.model.ListSessionsResponse>() { public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... }; public void onNext(software.amazon.awssdk.services.bedrockagentruntime.model.ListSessionsResponse response) { //... }; });
Please notice that the configuration of maxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
listSessions(software.amazon.awssdk.services.bedrockagentruntime.model.ListSessionsRequest)
operation.- Parameters:
listSessionsRequest
-- Returns:
- A custom publisher that can be subscribed to request a stream of response pages.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
listSessionsPaginator
default ListSessionsPublisher listSessionsPaginator(Consumer<ListSessionsRequest.Builder> listSessionsRequest) This is a variant of
listSessions(software.amazon.awssdk.services.bedrockagentruntime.model.ListSessionsRequest)
operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will internally handle making service calls for you.When the operation is called, an instance of this class is returned. At this point, no service calls are made yet and so there is no guarantee that the request is valid. If there are errors in your request, you will see the failures only after you start streaming the data. The subscribe method should be called as a request to start streaming data. For more info, see
Publisher.subscribe(org.reactivestreams.Subscriber)
. Each call to the subscribe method will result in a newSubscription
i.e., a new contract to stream data from the starting request.The following are few ways to use the response class:
1) Using the subscribe helper methodsoftware.amazon.awssdk.services.bedrockagentruntime.paginators.ListSessionsPublisher publisher = client.listSessionsPaginator(request); CompletableFuture<Void> future = publisher.subscribe(res -> { // Do something with the response }); future.get();
software.amazon.awssdk.services.bedrockagentruntime.paginators.ListSessionsPublisher publisher = client.listSessionsPaginator(request); publisher.subscribe(new Subscriber<software.amazon.awssdk.services.bedrockagentruntime.model.ListSessionsResponse>() { public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... }; public void onNext(software.amazon.awssdk.services.bedrockagentruntime.model.ListSessionsResponse response) { //... }; });
Please notice that the configuration of maxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
listSessions(software.amazon.awssdk.services.bedrockagentruntime.model.ListSessionsRequest)
operation.
This is a convenience which creates an instance of the
ListSessionsRequest.Builder
avoiding the need to create one manually viaListSessionsRequest.builder()
- Parameters:
listSessionsRequest
- AConsumer
that will call methods onListSessionsRequest.Builder
to create a request.- Returns:
- A custom publisher that can be subscribed to request a stream of response pages.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
listTagsForResource
default CompletableFuture<ListTagsForResourceResponse> listTagsForResource(ListTagsForResourceRequest listTagsForResourceRequest) List all the tags for the resource you specify.
- Parameters:
listTagsForResourceRequest
-- Returns:
- A Java Future containing the result of the ListTagsForResource operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ResourceNotFoundException The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
listTagsForResource
default CompletableFuture<ListTagsForResourceResponse> listTagsForResource(Consumer<ListTagsForResourceRequest.Builder> listTagsForResourceRequest) List all the tags for the resource you specify.
This is a convenience which creates an instance of the
ListTagsForResourceRequest.Builder
avoiding the need to create one manually viaListTagsForResourceRequest.builder()
- Parameters:
listTagsForResourceRequest
- AConsumer
that will call methods onListTagsForResourceRequest.Builder
to create a request.- Returns:
- A Java Future containing the result of the ListTagsForResource operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ResourceNotFoundException The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
optimizePrompt
default CompletableFuture<Void> optimizePrompt(OptimizePromptRequest optimizePromptRequest, OptimizePromptResponseHandler asyncResponseHandler) Optimizes a prompt for the task that you specify. For more information, see Optimize a prompt in the Amazon Bedrock User Guide.
- Parameters:
optimizePromptRequest
-- Returns:
- A Java Future containing the result of the OptimizePrompt operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- DependencyFailedException There was an issue with a dependency. Check the resource configurations and retry the request.
- BadGatewayException There was an issue with a dependency due to a server issue. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
optimizePrompt
default CompletableFuture<Void> optimizePrompt(Consumer<OptimizePromptRequest.Builder> optimizePromptRequest, OptimizePromptResponseHandler asyncResponseHandler) Optimizes a prompt for the task that you specify. For more information, see Optimize a prompt in the Amazon Bedrock User Guide.
This is a convenience which creates an instance of the
OptimizePromptRequest.Builder
avoiding the need to create one manually viaOptimizePromptRequest.builder()
- Parameters:
optimizePromptRequest
- AConsumer
that will call methods onOptimizePromptRequest.Builder
to create a request.- Returns:
- A Java Future containing the result of the OptimizePrompt operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- DependencyFailedException There was an issue with a dependency. Check the resource configurations and retry the request.
- BadGatewayException There was an issue with a dependency due to a server issue. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
putInvocationStep
default CompletableFuture<PutInvocationStepResponse> putInvocationStep(PutInvocationStepRequest putInvocationStepRequest) Add an invocation step to an invocation in a session. An invocation step stores fine-grained state checkpoints, including text and images, for each interaction. For more information about sessions, see Store and retrieve conversation history and context with Amazon Bedrock sessions.
Related APIs:
- Parameters:
putInvocationStepRequest
-- Returns:
- A Java Future containing the result of the PutInvocationStep operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ResourceNotFoundException The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
- ConflictException There was a conflict performing an operation. Resolve the conflict and retry your request.
- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- ServiceQuotaExceededException The number of requests exceeds the service quota. Resubmit your request later.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
putInvocationStep
default CompletableFuture<PutInvocationStepResponse> putInvocationStep(Consumer<PutInvocationStepRequest.Builder> putInvocationStepRequest) Add an invocation step to an invocation in a session. An invocation step stores fine-grained state checkpoints, including text and images, for each interaction. For more information about sessions, see Store and retrieve conversation history and context with Amazon Bedrock sessions.
Related APIs:
This is a convenience which creates an instance of the
PutInvocationStepRequest.Builder
avoiding the need to create one manually viaPutInvocationStepRequest.builder()
- Parameters:
putInvocationStepRequest
- AConsumer
that will call methods onPutInvocationStepRequest.Builder
to create a request.- Returns:
- A Java Future containing the result of the PutInvocationStep operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ResourceNotFoundException The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
- ConflictException There was a conflict performing an operation. Resolve the conflict and retry your request.
- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- ServiceQuotaExceededException The number of requests exceeds the service quota. Resubmit your request later.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
rerank
Reranks the relevance of sources based on queries. For more information, see Improve the relevance of query responses with a reranker model.
- Parameters:
rerankRequest
-- Returns:
- A Java Future containing the result of the Rerank operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ResourceNotFoundException The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
- ConflictException There was a conflict performing an operation. Resolve the conflict and retry your request.
- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- DependencyFailedException There was an issue with a dependency. Check the resource configurations and retry the request.
- BadGatewayException There was an issue with a dependency due to a server issue. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- ServiceQuotaExceededException The number of requests exceeds the service quota. Resubmit your request later.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
rerank
Reranks the relevance of sources based on queries. For more information, see Improve the relevance of query responses with a reranker model.
This is a convenience which creates an instance of the
RerankRequest.Builder
avoiding the need to create one manually viaRerankRequest.builder()
- Parameters:
rerankRequest
- AConsumer
that will call methods onRerankRequest.Builder
to create a request.- Returns:
- A Java Future containing the result of the Rerank operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ResourceNotFoundException The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
- ConflictException There was a conflict performing an operation. Resolve the conflict and retry your request.
- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- DependencyFailedException There was an issue with a dependency. Check the resource configurations and retry the request.
- BadGatewayException There was an issue with a dependency due to a server issue. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- ServiceQuotaExceededException The number of requests exceeds the service quota. Resubmit your request later.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
rerankPaginator
This is a variant of
rerank(software.amazon.awssdk.services.bedrockagentruntime.model.RerankRequest)
operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will internally handle making service calls for you.When the operation is called, an instance of this class is returned. At this point, no service calls are made yet and so there is no guarantee that the request is valid. If there are errors in your request, you will see the failures only after you start streaming the data. The subscribe method should be called as a request to start streaming data. For more info, see
Publisher.subscribe(org.reactivestreams.Subscriber)
. Each call to the subscribe method will result in a newSubscription
i.e., a new contract to stream data from the starting request.The following are few ways to use the response class:
1) Using the subscribe helper methodsoftware.amazon.awssdk.services.bedrockagentruntime.paginators.RerankPublisher publisher = client.rerankPaginator(request); CompletableFuture<Void> future = publisher.subscribe(res -> { // Do something with the response }); future.get();
software.amazon.awssdk.services.bedrockagentruntime.paginators.RerankPublisher publisher = client.rerankPaginator(request); publisher.subscribe(new Subscriber<software.amazon.awssdk.services.bedrockagentruntime.model.RerankResponse>() { public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... }; public void onNext(software.amazon.awssdk.services.bedrockagentruntime.model.RerankResponse response) { //... }; });
Please notice that the configuration of null won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
rerank(software.amazon.awssdk.services.bedrockagentruntime.model.RerankRequest)
operation.- Parameters:
rerankRequest
-- Returns:
- A custom publisher that can be subscribed to request a stream of response pages.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ResourceNotFoundException The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
- ConflictException There was a conflict performing an operation. Resolve the conflict and retry your request.
- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- DependencyFailedException There was an issue with a dependency. Check the resource configurations and retry the request.
- BadGatewayException There was an issue with a dependency due to a server issue. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- ServiceQuotaExceededException The number of requests exceeds the service quota. Resubmit your request later.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
rerankPaginator
This is a variant of
rerank(software.amazon.awssdk.services.bedrockagentruntime.model.RerankRequest)
operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will internally handle making service calls for you.When the operation is called, an instance of this class is returned. At this point, no service calls are made yet and so there is no guarantee that the request is valid. If there are errors in your request, you will see the failures only after you start streaming the data. The subscribe method should be called as a request to start streaming data. For more info, see
Publisher.subscribe(org.reactivestreams.Subscriber)
. Each call to the subscribe method will result in a newSubscription
i.e., a new contract to stream data from the starting request.The following are few ways to use the response class:
1) Using the subscribe helper methodsoftware.amazon.awssdk.services.bedrockagentruntime.paginators.RerankPublisher publisher = client.rerankPaginator(request); CompletableFuture<Void> future = publisher.subscribe(res -> { // Do something with the response }); future.get();
software.amazon.awssdk.services.bedrockagentruntime.paginators.RerankPublisher publisher = client.rerankPaginator(request); publisher.subscribe(new Subscriber<software.amazon.awssdk.services.bedrockagentruntime.model.RerankResponse>() { public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... }; public void onNext(software.amazon.awssdk.services.bedrockagentruntime.model.RerankResponse response) { //... }; });
Please notice that the configuration of null won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
rerank(software.amazon.awssdk.services.bedrockagentruntime.model.RerankRequest)
operation.
This is a convenience which creates an instance of the
RerankRequest.Builder
avoiding the need to create one manually viaRerankRequest.builder()
- Parameters:
rerankRequest
- AConsumer
that will call methods onRerankRequest.Builder
to create a request.- Returns:
- A custom publisher that can be subscribed to request a stream of response pages.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ResourceNotFoundException The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
- ConflictException There was a conflict performing an operation. Resolve the conflict and retry your request.
- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- DependencyFailedException There was an issue with a dependency. Check the resource configurations and retry the request.
- BadGatewayException There was an issue with a dependency due to a server issue. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- ServiceQuotaExceededException The number of requests exceeds the service quota. Resubmit your request later.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
retrieve
Queries a knowledge base and retrieves information from it.
- Parameters:
retrieveRequest
-- Returns:
- A Java Future containing the result of the Retrieve operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ResourceNotFoundException The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
- ConflictException There was a conflict performing an operation. Resolve the conflict and retry your request.
- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- DependencyFailedException There was an issue with a dependency. Check the resource configurations and retry the request.
- BadGatewayException There was an issue with a dependency due to a server issue. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- ServiceQuotaExceededException The number of requests exceeds the service quota. Resubmit your request later.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
retrieve
default CompletableFuture<RetrieveResponse> retrieve(Consumer<RetrieveRequest.Builder> retrieveRequest) Queries a knowledge base and retrieves information from it.
This is a convenience which creates an instance of the
RetrieveRequest.Builder
avoiding the need to create one manually viaRetrieveRequest.builder()
- Parameters:
retrieveRequest
- AConsumer
that will call methods onRetrieveRequest.Builder
to create a request.- Returns:
- A Java Future containing the result of the Retrieve operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ResourceNotFoundException The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
- ConflictException There was a conflict performing an operation. Resolve the conflict and retry your request.
- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- DependencyFailedException There was an issue with a dependency. Check the resource configurations and retry the request.
- BadGatewayException There was an issue with a dependency due to a server issue. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- ServiceQuotaExceededException The number of requests exceeds the service quota. Resubmit your request later.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
retrieveAndGenerate
default CompletableFuture<RetrieveAndGenerateResponse> retrieveAndGenerate(RetrieveAndGenerateRequest retrieveAndGenerateRequest) Queries a knowledge base and generates responses based on the retrieved results and using the specified foundation model or inference profile. The response only cites sources that are relevant to the query.
- Parameters:
retrieveAndGenerateRequest
-- Returns:
- A Java Future containing the result of the RetrieveAndGenerate operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ResourceNotFoundException The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
- ConflictException There was a conflict performing an operation. Resolve the conflict and retry your request.
- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- DependencyFailedException There was an issue with a dependency. Check the resource configurations and retry the request.
- BadGatewayException There was an issue with a dependency due to a server issue. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- ServiceQuotaExceededException The number of requests exceeds the service quota. Resubmit your request later.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
retrieveAndGenerate
default CompletableFuture<RetrieveAndGenerateResponse> retrieveAndGenerate(Consumer<RetrieveAndGenerateRequest.Builder> retrieveAndGenerateRequest) Queries a knowledge base and generates responses based on the retrieved results and using the specified foundation model or inference profile. The response only cites sources that are relevant to the query.
This is a convenience which creates an instance of the
RetrieveAndGenerateRequest.Builder
avoiding the need to create one manually viaRetrieveAndGenerateRequest.builder()
- Parameters:
retrieveAndGenerateRequest
- AConsumer
that will call methods onRetrieveAndGenerateRequest.Builder
to create a request.- Returns:
- A Java Future containing the result of the RetrieveAndGenerate operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ResourceNotFoundException The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
- ConflictException There was a conflict performing an operation. Resolve the conflict and retry your request.
- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- DependencyFailedException There was an issue with a dependency. Check the resource configurations and retry the request.
- BadGatewayException There was an issue with a dependency due to a server issue. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- ServiceQuotaExceededException The number of requests exceeds the service quota. Resubmit your request later.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
retrieveAndGenerateStream
default CompletableFuture<Void> retrieveAndGenerateStream(RetrieveAndGenerateStreamRequest retrieveAndGenerateStreamRequest, RetrieveAndGenerateStreamResponseHandler asyncResponseHandler) Queries a knowledge base and generates responses based on the retrieved results, with output in streaming format.
The CLI doesn't support streaming operations in Amazon Bedrock, including
InvokeModelWithResponseStream
.This operation requires permission for the
bedrock:RetrieveAndGenerate
action.- Parameters:
retrieveAndGenerateStreamRequest
-- Returns:
- A Java Future containing the result of the RetrieveAndGenerateStream operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ResourceNotFoundException The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
- ConflictException There was a conflict performing an operation. Resolve the conflict and retry your request.
- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- DependencyFailedException There was an issue with a dependency. Check the resource configurations and retry the request.
- BadGatewayException There was an issue with a dependency due to a server issue. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- ServiceQuotaExceededException The number of requests exceeds the service quota. Resubmit your request later.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
retrieveAndGenerateStream
default CompletableFuture<Void> retrieveAndGenerateStream(Consumer<RetrieveAndGenerateStreamRequest.Builder> retrieveAndGenerateStreamRequest, RetrieveAndGenerateStreamResponseHandler asyncResponseHandler) Queries a knowledge base and generates responses based on the retrieved results, with output in streaming format.
The CLI doesn't support streaming operations in Amazon Bedrock, including
InvokeModelWithResponseStream
.This operation requires permission for the
bedrock:RetrieveAndGenerate
action.
This is a convenience which creates an instance of the
RetrieveAndGenerateStreamRequest.Builder
avoiding the need to create one manually viaRetrieveAndGenerateStreamRequest.builder()
- Parameters:
retrieveAndGenerateStreamRequest
- AConsumer
that will call methods onRetrieveAndGenerateStreamRequest.Builder
to create a request.- Returns:
- A Java Future containing the result of the RetrieveAndGenerateStream operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ResourceNotFoundException The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
- ConflictException There was a conflict performing an operation. Resolve the conflict and retry your request.
- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- DependencyFailedException There was an issue with a dependency. Check the resource configurations and retry the request.
- BadGatewayException There was an issue with a dependency due to a server issue. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- ServiceQuotaExceededException The number of requests exceeds the service quota. Resubmit your request later.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
retrievePaginator
This is a variant of
retrieve(software.amazon.awssdk.services.bedrockagentruntime.model.RetrieveRequest)
operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will internally handle making service calls for you.When the operation is called, an instance of this class is returned. At this point, no service calls are made yet and so there is no guarantee that the request is valid. If there are errors in your request, you will see the failures only after you start streaming the data. The subscribe method should be called as a request to start streaming data. For more info, see
Publisher.subscribe(org.reactivestreams.Subscriber)
. Each call to the subscribe method will result in a newSubscription
i.e., a new contract to stream data from the starting request.The following are few ways to use the response class:
1) Using the subscribe helper methodsoftware.amazon.awssdk.services.bedrockagentruntime.paginators.RetrievePublisher publisher = client.retrievePaginator(request); CompletableFuture<Void> future = publisher.subscribe(res -> { // Do something with the response }); future.get();
software.amazon.awssdk.services.bedrockagentruntime.paginators.RetrievePublisher publisher = client.retrievePaginator(request); publisher.subscribe(new Subscriber<software.amazon.awssdk.services.bedrockagentruntime.model.RetrieveResponse>() { public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... }; public void onNext(software.amazon.awssdk.services.bedrockagentruntime.model.RetrieveResponse response) { //... }; });
Please notice that the configuration of null won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
retrieve(software.amazon.awssdk.services.bedrockagentruntime.model.RetrieveRequest)
operation.- Parameters:
retrieveRequest
-- Returns:
- A custom publisher that can be subscribed to request a stream of response pages.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ResourceNotFoundException The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
- ConflictException There was a conflict performing an operation. Resolve the conflict and retry your request.
- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- DependencyFailedException There was an issue with a dependency. Check the resource configurations and retry the request.
- BadGatewayException There was an issue with a dependency due to a server issue. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- ServiceQuotaExceededException The number of requests exceeds the service quota. Resubmit your request later.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
retrievePaginator
This is a variant of
retrieve(software.amazon.awssdk.services.bedrockagentruntime.model.RetrieveRequest)
operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will internally handle making service calls for you.When the operation is called, an instance of this class is returned. At this point, no service calls are made yet and so there is no guarantee that the request is valid. If there are errors in your request, you will see the failures only after you start streaming the data. The subscribe method should be called as a request to start streaming data. For more info, see
Publisher.subscribe(org.reactivestreams.Subscriber)
. Each call to the subscribe method will result in a newSubscription
i.e., a new contract to stream data from the starting request.The following are few ways to use the response class:
1) Using the subscribe helper methodsoftware.amazon.awssdk.services.bedrockagentruntime.paginators.RetrievePublisher publisher = client.retrievePaginator(request); CompletableFuture<Void> future = publisher.subscribe(res -> { // Do something with the response }); future.get();
software.amazon.awssdk.services.bedrockagentruntime.paginators.RetrievePublisher publisher = client.retrievePaginator(request); publisher.subscribe(new Subscriber<software.amazon.awssdk.services.bedrockagentruntime.model.RetrieveResponse>() { public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... }; public void onNext(software.amazon.awssdk.services.bedrockagentruntime.model.RetrieveResponse response) { //... }; });
Please notice that the configuration of null won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
retrieve(software.amazon.awssdk.services.bedrockagentruntime.model.RetrieveRequest)
operation.
This is a convenience which creates an instance of the
RetrieveRequest.Builder
avoiding the need to create one manually viaRetrieveRequest.builder()
- Parameters:
retrieveRequest
- AConsumer
that will call methods onRetrieveRequest.Builder
to create a request.- Returns:
- A custom publisher that can be subscribed to request a stream of response pages.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ResourceNotFoundException The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
- ConflictException There was a conflict performing an operation. Resolve the conflict and retry your request.
- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- DependencyFailedException There was an issue with a dependency. Check the resource configurations and retry the request.
- BadGatewayException There was an issue with a dependency due to a server issue. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- ServiceQuotaExceededException The number of requests exceeds the service quota. Resubmit your request later.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
startFlowExecution
default CompletableFuture<StartFlowExecutionResponse> startFlowExecution(StartFlowExecutionRequest startFlowExecutionRequest) Starts an execution of an Amazon Bedrock flow. Unlike flows that run until completion or time out after five minutes, flow executions let you run flows asynchronously for longer durations. Flow executions also yield control so that your application can perform other tasks.
This operation returns an Amazon Resource Name (ARN) that you can use to track and manage your flow execution.
Flow executions is in preview release for Amazon Bedrock and is subject to change.
- Parameters:
startFlowExecutionRequest
-- Returns:
- A Java Future containing the result of the StartFlowExecution operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ResourceNotFoundException The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
- ConflictException There was a conflict performing an operation. Resolve the conflict and retry your request.
- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- DependencyFailedException There was an issue with a dependency. Check the resource configurations and retry the request.
- BadGatewayException There was an issue with a dependency due to a server issue. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- ServiceQuotaExceededException The number of requests exceeds the service quota. Resubmit your request later.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
startFlowExecution
default CompletableFuture<StartFlowExecutionResponse> startFlowExecution(Consumer<StartFlowExecutionRequest.Builder> startFlowExecutionRequest) Starts an execution of an Amazon Bedrock flow. Unlike flows that run until completion or time out after five minutes, flow executions let you run flows asynchronously for longer durations. Flow executions also yield control so that your application can perform other tasks.
This operation returns an Amazon Resource Name (ARN) that you can use to track and manage your flow execution.
Flow executions is in preview release for Amazon Bedrock and is subject to change.
This is a convenience which creates an instance of the
StartFlowExecutionRequest.Builder
avoiding the need to create one manually viaStartFlowExecutionRequest.builder()
- Parameters:
startFlowExecutionRequest
- AConsumer
that will call methods onStartFlowExecutionRequest.Builder
to create a request.- Returns:
- A Java Future containing the result of the StartFlowExecution operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ResourceNotFoundException The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
- ConflictException There was a conflict performing an operation. Resolve the conflict and retry your request.
- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- DependencyFailedException There was an issue with a dependency. Check the resource configurations and retry the request.
- BadGatewayException There was an issue with a dependency due to a server issue. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- ServiceQuotaExceededException The number of requests exceeds the service quota. Resubmit your request later.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
stopFlowExecution
default CompletableFuture<StopFlowExecutionResponse> stopFlowExecution(StopFlowExecutionRequest stopFlowExecutionRequest) Stops an Amazon Bedrock flow's execution. This operation prevents further processing of the flow and changes the execution status to
Aborted
.- Parameters:
stopFlowExecutionRequest
-- Returns:
- A Java Future containing the result of the StopFlowExecution operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ResourceNotFoundException The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
- ConflictException There was a conflict performing an operation. Resolve the conflict and retry your request.
- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- DependencyFailedException There was an issue with a dependency. Check the resource configurations and retry the request.
- BadGatewayException There was an issue with a dependency due to a server issue. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
stopFlowExecution
default CompletableFuture<StopFlowExecutionResponse> stopFlowExecution(Consumer<StopFlowExecutionRequest.Builder> stopFlowExecutionRequest) Stops an Amazon Bedrock flow's execution. This operation prevents further processing of the flow and changes the execution status to
Aborted
.
This is a convenience which creates an instance of the
StopFlowExecutionRequest.Builder
avoiding the need to create one manually viaStopFlowExecutionRequest.builder()
- Parameters:
stopFlowExecutionRequest
- AConsumer
that will call methods onStopFlowExecutionRequest.Builder
to create a request.- Returns:
- A Java Future containing the result of the StopFlowExecution operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ResourceNotFoundException The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
- ConflictException There was a conflict performing an operation. Resolve the conflict and retry your request.
- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- DependencyFailedException There was an issue with a dependency. Check the resource configurations and retry the request.
- BadGatewayException There was an issue with a dependency due to a server issue. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
tagResource
Associate tags with a resource. For more information, see Tagging resources in the Amazon Bedrock User Guide.
- Parameters:
tagResourceRequest
-- Returns:
- A Java Future containing the result of the TagResource operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ResourceNotFoundException The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- ServiceQuotaExceededException The number of requests exceeds the service quota. Resubmit your request later.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
tagResource
default CompletableFuture<TagResourceResponse> tagResource(Consumer<TagResourceRequest.Builder> tagResourceRequest) Associate tags with a resource. For more information, see Tagging resources in the Amazon Bedrock User Guide.
This is a convenience which creates an instance of the
TagResourceRequest.Builder
avoiding the need to create one manually viaTagResourceRequest.builder()
- Parameters:
tagResourceRequest
- AConsumer
that will call methods onTagResourceRequest.Builder
to create a request.- Returns:
- A Java Future containing the result of the TagResource operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ResourceNotFoundException The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- ServiceQuotaExceededException The number of requests exceeds the service quota. Resubmit your request later.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
untagResource
default CompletableFuture<UntagResourceResponse> untagResource(UntagResourceRequest untagResourceRequest) Remove tags from a resource.
- Parameters:
untagResourceRequest
-- Returns:
- A Java Future containing the result of the UntagResource operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ResourceNotFoundException The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
untagResource
default CompletableFuture<UntagResourceResponse> untagResource(Consumer<UntagResourceRequest.Builder> untagResourceRequest) Remove tags from a resource.
This is a convenience which creates an instance of the
UntagResourceRequest.Builder
avoiding the need to create one manually viaUntagResourceRequest.builder()
- Parameters:
untagResourceRequest
- AConsumer
that will call methods onUntagResourceRequest.Builder
to create a request.- Returns:
- A Java Future containing the result of the UntagResource operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ResourceNotFoundException The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
updateSession
default CompletableFuture<UpdateSessionResponse> updateSession(UpdateSessionRequest updateSessionRequest) Updates the metadata or encryption settings of a session. For more information about sessions, see Store and retrieve conversation history and context with Amazon Bedrock sessions.
- Parameters:
updateSessionRequest
-- Returns:
- A Java Future containing the result of the UpdateSession operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ConflictException There was a conflict performing an operation. Resolve the conflict and retry your request.
- ResourceNotFoundException The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
updateSession
default CompletableFuture<UpdateSessionResponse> updateSession(Consumer<UpdateSessionRequest.Builder> updateSessionRequest) Updates the metadata or encryption settings of a session. For more information about sessions, see Store and retrieve conversation history and context with Amazon Bedrock sessions.
This is a convenience which creates an instance of the
UpdateSessionRequest.Builder
avoiding the need to create one manually viaUpdateSessionRequest.builder()
- Parameters:
updateSessionRequest
- AConsumer
that will call methods onUpdateSessionRequest.Builder
to create a request.- Returns:
- A Java Future containing the result of the UpdateSession operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()
to retrieve the underlying exception.- ConflictException There was a conflict performing an operation. Resolve the conflict and retry your request.
- ResourceNotFoundException The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
- ValidationException Input validation failed. Check your request parameters and retry the request.
- InternalServerException An internal server error occurred. Retry your request.
- ThrottlingException The number of requests exceeds the limit. Resubmit your request later.
- AccessDeniedException The request is denied because of missing access permissions. Check your permissions and retry your request.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- BedrockAgentRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
serviceClientConfiguration
Description copied from interface:SdkClient
The SDK service client configuration exposes client settings to the user, e.g., ClientOverrideConfiguration- Specified by:
serviceClientConfiguration
in interfaceAwsClient
- Specified by:
serviceClientConfiguration
in interfaceSdkClient
- Returns:
- SdkServiceClientConfiguration
-
create
Create aBedrockAgentRuntimeAsyncClient
with the region loaded from theDefaultAwsRegionProviderChain
and credentials loaded from theDefaultCredentialsProvider
. -
builder
Create a builder that can be used to configure and create aBedrockAgentRuntimeAsyncClient
.
-