Interface BedrockAgentRuntimeClient
- All Superinterfaces:
AutoCloseable,AwsClient,SdkAutoCloseable,SdkClient
builder() method.
Contains APIs related to model invocation and querying of knowledge bases.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringValue 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 aBedrockAgentRuntimeClient.static BedrockAgentRuntimeClientcreate()Create aBedrockAgentRuntimeClientwith the region loaded from theDefaultAwsRegionProviderChainand credentials loaded from theDefaultCredentialsProvider.default CreateInvocationResponsecreateInvocation(Consumer<CreateInvocationRequest.Builder> createInvocationRequest) Creates a new invocation within a session.default CreateInvocationResponsecreateInvocation(CreateInvocationRequest createInvocationRequest) Creates a new invocation within a session.default CreateSessionResponsecreateSession(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 CreateSessionResponsecreateSession(CreateSessionRequest createSessionRequest) Creates a session to temporarily store conversations for generative AI (GenAI) applications built with open-source frameworks such as LangGraph and LlamaIndex.default DeleteAgentMemoryResponsedeleteAgentMemory(Consumer<DeleteAgentMemoryRequest.Builder> deleteAgentMemoryRequest) Deletes memory from the specified memory identifier.default DeleteAgentMemoryResponsedeleteAgentMemory(DeleteAgentMemoryRequest deleteAgentMemoryRequest) Deletes memory from the specified memory identifier.default DeleteSessionResponsedeleteSession(Consumer<DeleteSessionRequest.Builder> deleteSessionRequest) Deletes a session that you ended.default DeleteSessionResponsedeleteSession(DeleteSessionRequest deleteSessionRequest) Deletes a session that you ended.default EndSessionResponseendSession(Consumer<EndSessionRequest.Builder> endSessionRequest) Ends the session.default EndSessionResponseendSession(EndSessionRequest endSessionRequest) Ends the session.default GenerateQueryResponsegenerateQuery(Consumer<GenerateQueryRequest.Builder> generateQueryRequest) Generates an SQL query from a natural language query.default GenerateQueryResponsegenerateQuery(GenerateQueryRequest generateQueryRequest) Generates an SQL query from a natural language query.default GetAgentMemoryResponsegetAgentMemory(Consumer<GetAgentMemoryRequest.Builder> getAgentMemoryRequest) Gets the sessions stored in the memory of the agent.default GetAgentMemoryResponsegetAgentMemory(GetAgentMemoryRequest getAgentMemoryRequest) Gets the sessions stored in the memory of the agent.default GetAgentMemoryIterablegetAgentMemoryPaginator(Consumer<GetAgentMemoryRequest.Builder> getAgentMemoryRequest) This is a variant ofgetAgentMemory(software.amazon.awssdk.services.bedrockagentruntime.model.GetAgentMemoryRequest)operation.default GetAgentMemoryIterablegetAgentMemoryPaginator(GetAgentMemoryRequest getAgentMemoryRequest) This is a variant ofgetAgentMemory(software.amazon.awssdk.services.bedrockagentruntime.model.GetAgentMemoryRequest)operation.default GetInvocationStepResponsegetInvocationStep(Consumer<GetInvocationStepRequest.Builder> getInvocationStepRequest) Retrieves the details of a specific invocation step within an invocation in a session.default GetInvocationStepResponsegetInvocationStep(GetInvocationStepRequest getInvocationStepRequest) Retrieves the details of a specific invocation step within an invocation in a session.default GetSessionResponsegetSession(Consumer<GetSessionRequest.Builder> getSessionRequest) Retrieves details about a specific session.default GetSessionResponsegetSession(GetSessionRequest getSessionRequest) Retrieves details about a specific session.default ListInvocationsResponselistInvocations(Consumer<ListInvocationsRequest.Builder> listInvocationsRequest) Lists all invocations associated with a specific session.default ListInvocationsResponselistInvocations(ListInvocationsRequest listInvocationsRequest) Lists all invocations associated with a specific session.default ListInvocationsIterablelistInvocationsPaginator(Consumer<ListInvocationsRequest.Builder> listInvocationsRequest) This is a variant oflistInvocations(software.amazon.awssdk.services.bedrockagentruntime.model.ListInvocationsRequest)operation.default ListInvocationsIterablelistInvocationsPaginator(ListInvocationsRequest listInvocationsRequest) This is a variant oflistInvocations(software.amazon.awssdk.services.bedrockagentruntime.model.ListInvocationsRequest)operation.default ListInvocationStepsResponselistInvocationSteps(Consumer<ListInvocationStepsRequest.Builder> listInvocationStepsRequest) Lists all invocation steps associated with a session and optionally, an invocation within the session.default ListInvocationStepsResponselistInvocationSteps(ListInvocationStepsRequest listInvocationStepsRequest) Lists all invocation steps associated with a session and optionally, an invocation within the session.default ListInvocationStepsIterablelistInvocationStepsPaginator(Consumer<ListInvocationStepsRequest.Builder> listInvocationStepsRequest) This is a variant oflistInvocationSteps(software.amazon.awssdk.services.bedrockagentruntime.model.ListInvocationStepsRequest)operation.default ListInvocationStepsIterablelistInvocationStepsPaginator(ListInvocationStepsRequest listInvocationStepsRequest) This is a variant oflistInvocationSteps(software.amazon.awssdk.services.bedrockagentruntime.model.ListInvocationStepsRequest)operation.default ListSessionsResponselistSessions(Consumer<ListSessionsRequest.Builder> listSessionsRequest) Lists all sessions in your Amazon Web Services account.default ListSessionsResponselistSessions(ListSessionsRequest listSessionsRequest) Lists all sessions in your Amazon Web Services account.default ListSessionsIterablelistSessionsPaginator(Consumer<ListSessionsRequest.Builder> listSessionsRequest) This is a variant oflistSessions(software.amazon.awssdk.services.bedrockagentruntime.model.ListSessionsRequest)operation.default ListSessionsIterablelistSessionsPaginator(ListSessionsRequest listSessionsRequest) This is a variant oflistSessions(software.amazon.awssdk.services.bedrockagentruntime.model.ListSessionsRequest)operation.default ListTagsForResourceResponselistTagsForResource(Consumer<ListTagsForResourceRequest.Builder> listTagsForResourceRequest) List all the tags for the resource you specify.default ListTagsForResourceResponselistTagsForResource(ListTagsForResourceRequest listTagsForResourceRequest) List all the tags for the resource you specify.default PutInvocationStepResponseputInvocationStep(Consumer<PutInvocationStepRequest.Builder> putInvocationStepRequest) Add an invocation step to an invocation in a session.default PutInvocationStepResponseputInvocationStep(PutInvocationStepRequest putInvocationStepRequest) Add an invocation step to an invocation in a session.default RerankResponsererank(Consumer<RerankRequest.Builder> rerankRequest) Reranks the relevance of sources based on queries.default RerankResponsererank(RerankRequest rerankRequest) Reranks the relevance of sources based on queries.default RerankIterablererankPaginator(Consumer<RerankRequest.Builder> rerankRequest) This is a variant ofrerank(software.amazon.awssdk.services.bedrockagentruntime.model.RerankRequest)operation.default RerankIterablererankPaginator(RerankRequest rerankRequest) This is a variant ofrerank(software.amazon.awssdk.services.bedrockagentruntime.model.RerankRequest)operation.default RetrieveResponseretrieve(Consumer<RetrieveRequest.Builder> retrieveRequest) Queries a knowledge base and retrieves information from it.default RetrieveResponseretrieve(RetrieveRequest retrieveRequest) Queries a knowledge base and retrieves information from it.default RetrieveAndGenerateResponseretrieveAndGenerate(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.default RetrieveAndGenerateResponseretrieveAndGenerate(RetrieveAndGenerateRequest retrieveAndGenerateRequest) Queries a knowledge base and generates responses based on the retrieved results and using the specified foundation model or inference profile.default RetrieveIterableretrievePaginator(Consumer<RetrieveRequest.Builder> retrieveRequest) This is a variant ofretrieve(software.amazon.awssdk.services.bedrockagentruntime.model.RetrieveRequest)operation.default RetrieveIterableretrievePaginator(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., ClientOverrideConfigurationstatic ServiceMetadatadefault TagResourceResponsetagResource(Consumer<TagResourceRequest.Builder> tagResourceRequest) Associate tags with a resource.default TagResourceResponsetagResource(TagResourceRequest tagResourceRequest) Associate tags with a resource.default UntagResourceResponseuntagResource(Consumer<UntagResourceRequest.Builder> untagResourceRequest) Remove tags from a resource.default UntagResourceResponseuntagResource(UntagResourceRequest untagResourceRequest) Remove tags from a resource.default UpdateSessionResponseupdateSession(Consumer<UpdateSessionRequest.Builder> updateSessionRequest) Updates the metadata or encryption settings of a session.default UpdateSessionResponseupdateSession(UpdateSessionRequest updateSessionRequest) Updates the metadata or encryption settings of a session.Methods inherited from interface software.amazon.awssdk.utils.SdkAutoCloseable
closeMethods 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 CreateInvocationResponse createInvocation(CreateInvocationRequest createInvocationRequest) throws ConflictException, ResourceNotFoundException, ValidationException, InternalServerException, ThrottlingException, AccessDeniedException, ServiceQuotaExceededException, AwsServiceException, SdkClientException, BedrockAgentRuntimeException 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:
- Result of the CreateInvocation operation returned by the service.
- See Also:
-
createInvocation
default CreateInvocationResponse createInvocation(Consumer<CreateInvocationRequest.Builder> createInvocationRequest) throws ConflictException, ResourceNotFoundException, ValidationException, InternalServerException, ThrottlingException, AccessDeniedException, ServiceQuotaExceededException, AwsServiceException, SdkClientException, BedrockAgentRuntimeException 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.Builderavoiding the need to create one manually viaCreateInvocationRequest.builder()- Parameters:
createInvocationRequest- AConsumerthat will call methods onCreateInvocationRequest.Builderto create a request.- Returns:
- Result of the CreateInvocation operation returned by the service.
- See Also:
-
createSession
default CreateSessionResponse createSession(CreateSessionRequest createSessionRequest) throws ConflictException, ValidationException, InternalServerException, ThrottlingException, AccessDeniedException, ServiceQuotaExceededException, AwsServiceException, SdkClientException, BedrockAgentRuntimeException 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:
- Result of the CreateSession operation returned by the service.
- See Also:
-
createSession
default CreateSessionResponse createSession(Consumer<CreateSessionRequest.Builder> createSessionRequest) throws ConflictException, ValidationException, InternalServerException, ThrottlingException, AccessDeniedException, ServiceQuotaExceededException, AwsServiceException, SdkClientException, BedrockAgentRuntimeException 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.Builderavoiding the need to create one manually viaCreateSessionRequest.builder()- Parameters:
createSessionRequest- AConsumerthat will call methods onCreateSessionRequest.Builderto create a request.- Returns:
- Result of the CreateSession operation returned by the service.
- See Also:
-
deleteAgentMemory
default DeleteAgentMemoryResponse deleteAgentMemory(DeleteAgentMemoryRequest deleteAgentMemoryRequest) throws ConflictException, ResourceNotFoundException, ValidationException, InternalServerException, DependencyFailedException, BadGatewayException, ThrottlingException, AccessDeniedException, ServiceQuotaExceededException, AwsServiceException, SdkClientException, BedrockAgentRuntimeException Deletes memory from the specified memory identifier.
- Parameters:
deleteAgentMemoryRequest-- Returns:
- Result of the DeleteAgentMemory operation returned by the service.
- See Also:
-
deleteAgentMemory
default DeleteAgentMemoryResponse deleteAgentMemory(Consumer<DeleteAgentMemoryRequest.Builder> deleteAgentMemoryRequest) throws ConflictException, ResourceNotFoundException, ValidationException, InternalServerException, DependencyFailedException, BadGatewayException, ThrottlingException, AccessDeniedException, ServiceQuotaExceededException, AwsServiceException, SdkClientException, BedrockAgentRuntimeException Deletes memory from the specified memory identifier.
This is a convenience which creates an instance of the
DeleteAgentMemoryRequest.Builderavoiding the need to create one manually viaDeleteAgentMemoryRequest.builder()- Parameters:
deleteAgentMemoryRequest- AConsumerthat will call methods onDeleteAgentMemoryRequest.Builderto create a request.- Returns:
- Result of the DeleteAgentMemory operation returned by the service.
- See Also:
-
deleteSession
default DeleteSessionResponse deleteSession(DeleteSessionRequest deleteSessionRequest) throws ConflictException, ResourceNotFoundException, ValidationException, InternalServerException, ThrottlingException, AccessDeniedException, AwsServiceException, SdkClientException, BedrockAgentRuntimeException Deletes a session that you ended. You can't delete a session with an
ACTIVEstatus. 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:
- Result of the DeleteSession operation returned by the service.
- See Also:
-
deleteSession
default DeleteSessionResponse deleteSession(Consumer<DeleteSessionRequest.Builder> deleteSessionRequest) throws ConflictException, ResourceNotFoundException, ValidationException, InternalServerException, ThrottlingException, AccessDeniedException, AwsServiceException, SdkClientException, BedrockAgentRuntimeException Deletes a session that you ended. You can't delete a session with an
ACTIVEstatus. 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.Builderavoiding the need to create one manually viaDeleteSessionRequest.builder()- Parameters:
deleteSessionRequest- AConsumerthat will call methods onDeleteSessionRequest.Builderto create a request.- Returns:
- Result of the DeleteSession operation returned by the service.
- See Also:
-
endSession
default EndSessionResponse endSession(EndSessionRequest endSessionRequest) throws ConflictException, ResourceNotFoundException, ValidationException, InternalServerException, ThrottlingException, AccessDeniedException, AwsServiceException, SdkClientException, BedrockAgentRuntimeException 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:
- Result of the EndSession operation returned by the service.
- See Also:
-
endSession
default EndSessionResponse endSession(Consumer<EndSessionRequest.Builder> endSessionRequest) throws ConflictException, ResourceNotFoundException, ValidationException, InternalServerException, ThrottlingException, AccessDeniedException, AwsServiceException, SdkClientException, BedrockAgentRuntimeException 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.Builderavoiding the need to create one manually viaEndSessionRequest.builder()- Parameters:
endSessionRequest- AConsumerthat will call methods onEndSessionRequest.Builderto create a request.- Returns:
- Result of the EndSession operation returned by the service.
- See Also:
-
generateQuery
default GenerateQueryResponse generateQuery(GenerateQueryRequest generateQueryRequest) throws ConflictException, ResourceNotFoundException, ValidationException, InternalServerException, DependencyFailedException, BadGatewayException, ThrottlingException, AccessDeniedException, ServiceQuotaExceededException, AwsServiceException, SdkClientException, BedrockAgentRuntimeException 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:
- Result of the GenerateQuery operation returned by the service.
- See Also:
-
generateQuery
default GenerateQueryResponse generateQuery(Consumer<GenerateQueryRequest.Builder> generateQueryRequest) throws ConflictException, ResourceNotFoundException, ValidationException, InternalServerException, DependencyFailedException, BadGatewayException, ThrottlingException, AccessDeniedException, ServiceQuotaExceededException, AwsServiceException, SdkClientException, BedrockAgentRuntimeException 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.Builderavoiding the need to create one manually viaGenerateQueryRequest.builder()- Parameters:
generateQueryRequest- AConsumerthat will call methods onGenerateQueryRequest.Builderto create a request.- Returns:
- Result of the GenerateQuery operation returned by the service.
- See Also:
-
getAgentMemory
default GetAgentMemoryResponse getAgentMemory(GetAgentMemoryRequest getAgentMemoryRequest) throws ConflictException, ResourceNotFoundException, ValidationException, InternalServerException, DependencyFailedException, BadGatewayException, ThrottlingException, AccessDeniedException, ServiceQuotaExceededException, AwsServiceException, SdkClientException, BedrockAgentRuntimeException Gets the sessions stored in the memory of the agent.
- Parameters:
getAgentMemoryRequest-- Returns:
- Result of the GetAgentMemory operation returned by the service.
- See Also:
-
getAgentMemory
default GetAgentMemoryResponse getAgentMemory(Consumer<GetAgentMemoryRequest.Builder> getAgentMemoryRequest) throws ConflictException, ResourceNotFoundException, ValidationException, InternalServerException, DependencyFailedException, BadGatewayException, ThrottlingException, AccessDeniedException, ServiceQuotaExceededException, AwsServiceException, SdkClientException, BedrockAgentRuntimeException Gets the sessions stored in the memory of the agent.
This is a convenience which creates an instance of the
GetAgentMemoryRequest.Builderavoiding the need to create one manually viaGetAgentMemoryRequest.builder()- Parameters:
getAgentMemoryRequest- AConsumerthat will call methods onGetAgentMemoryRequest.Builderto create a request.- Returns:
- Result of the GetAgentMemory operation returned by the service.
- See Also:
-
getAgentMemoryPaginator
default GetAgentMemoryIterable getAgentMemoryPaginator(GetAgentMemoryRequest getAgentMemoryRequest) throws ConflictException, ResourceNotFoundException, ValidationException, InternalServerException, DependencyFailedException, BadGatewayException, ThrottlingException, AccessDeniedException, ServiceQuotaExceededException, AwsServiceException, SdkClientException, BedrockAgentRuntimeException This is a variant of
getAgentMemory(software.amazon.awssdk.services.bedrockagentruntime.model.GetAgentMemoryRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
2) Using For loopsoftware.amazon.awssdk.services.bedrockagentruntime.paginators.GetAgentMemoryIterable responses = client.getAgentMemoryPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.bedrockagentruntime.paginators.GetAgentMemoryIterable responses = client .getAgentMemoryPaginator(request); for (software.amazon.awssdk.services.bedrockagentruntime.model.GetAgentMemoryResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.bedrockagentruntime.paginators.GetAgentMemoryIterable responses = client.getAgentMemoryPaginator(request); responses.iterator().forEachRemaining(....);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 iterable that can be used to iterate through all the response pages.
- See Also:
-
getAgentMemoryPaginator
default GetAgentMemoryIterable getAgentMemoryPaginator(Consumer<GetAgentMemoryRequest.Builder> getAgentMemoryRequest) throws ConflictException, ResourceNotFoundException, ValidationException, InternalServerException, DependencyFailedException, BadGatewayException, ThrottlingException, AccessDeniedException, ServiceQuotaExceededException, AwsServiceException, SdkClientException, BedrockAgentRuntimeException This is a variant of
getAgentMemory(software.amazon.awssdk.services.bedrockagentruntime.model.GetAgentMemoryRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
2) Using For loopsoftware.amazon.awssdk.services.bedrockagentruntime.paginators.GetAgentMemoryIterable responses = client.getAgentMemoryPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.bedrockagentruntime.paginators.GetAgentMemoryIterable responses = client .getAgentMemoryPaginator(request); for (software.amazon.awssdk.services.bedrockagentruntime.model.GetAgentMemoryResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.bedrockagentruntime.paginators.GetAgentMemoryIterable responses = client.getAgentMemoryPaginator(request); responses.iterator().forEachRemaining(....);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.Builderavoiding the need to create one manually viaGetAgentMemoryRequest.builder()- Parameters:
getAgentMemoryRequest- AConsumerthat will call methods onGetAgentMemoryRequest.Builderto create a request.- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
getInvocationStep
default GetInvocationStepResponse getInvocationStep(GetInvocationStepRequest getInvocationStepRequest) throws ResourceNotFoundException, ValidationException, InternalServerException, ThrottlingException, AccessDeniedException, AwsServiceException, SdkClientException, BedrockAgentRuntimeException 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:
- Result of the GetInvocationStep operation returned by the service.
- See Also:
-
getInvocationStep
default GetInvocationStepResponse getInvocationStep(Consumer<GetInvocationStepRequest.Builder> getInvocationStepRequest) throws ResourceNotFoundException, ValidationException, InternalServerException, ThrottlingException, AccessDeniedException, AwsServiceException, SdkClientException, BedrockAgentRuntimeException 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.Builderavoiding the need to create one manually viaGetInvocationStepRequest.builder()- Parameters:
getInvocationStepRequest- AConsumerthat will call methods onGetInvocationStepRequest.Builderto create a request.- Returns:
- Result of the GetInvocationStep operation returned by the service.
- See Also:
-
getSession
default GetSessionResponse getSession(GetSessionRequest getSessionRequest) throws ResourceNotFoundException, ValidationException, InternalServerException, ThrottlingException, AccessDeniedException, AwsServiceException, SdkClientException, BedrockAgentRuntimeException 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:
- Result of the GetSession operation returned by the service.
- See Also:
-
getSession
default GetSessionResponse getSession(Consumer<GetSessionRequest.Builder> getSessionRequest) throws ResourceNotFoundException, ValidationException, InternalServerException, ThrottlingException, AccessDeniedException, AwsServiceException, SdkClientException, BedrockAgentRuntimeException 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.Builderavoiding the need to create one manually viaGetSessionRequest.builder()- Parameters:
getSessionRequest- AConsumerthat will call methods onGetSessionRequest.Builderto create a request.- Returns:
- Result of the GetSession operation returned by the service.
- See Also:
-
listInvocationSteps
default ListInvocationStepsResponse listInvocationSteps(ListInvocationStepsRequest listInvocationStepsRequest) throws ResourceNotFoundException, ValidationException, InternalServerException, ThrottlingException, AccessDeniedException, AwsServiceException, SdkClientException, BedrockAgentRuntimeException 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:
- Result of the ListInvocationSteps operation returned by the service.
- See Also:
-
listInvocationSteps
default ListInvocationStepsResponse listInvocationSteps(Consumer<ListInvocationStepsRequest.Builder> listInvocationStepsRequest) throws ResourceNotFoundException, ValidationException, InternalServerException, ThrottlingException, AccessDeniedException, AwsServiceException, SdkClientException, BedrockAgentRuntimeException 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.Builderavoiding the need to create one manually viaListInvocationStepsRequest.builder()- Parameters:
listInvocationStepsRequest- AConsumerthat will call methods onListInvocationStepsRequest.Builderto create a request.- Returns:
- Result of the ListInvocationSteps operation returned by the service.
- See Also:
-
listInvocationStepsPaginator
default ListInvocationStepsIterable listInvocationStepsPaginator(ListInvocationStepsRequest listInvocationStepsRequest) throws ResourceNotFoundException, ValidationException, InternalServerException, ThrottlingException, AccessDeniedException, AwsServiceException, SdkClientException, BedrockAgentRuntimeException This is a variant of
listInvocationSteps(software.amazon.awssdk.services.bedrockagentruntime.model.ListInvocationStepsRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
2) Using For loopsoftware.amazon.awssdk.services.bedrockagentruntime.paginators.ListInvocationStepsIterable responses = client.listInvocationStepsPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.bedrockagentruntime.paginators.ListInvocationStepsIterable responses = client .listInvocationStepsPaginator(request); for (software.amazon.awssdk.services.bedrockagentruntime.model.ListInvocationStepsResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.bedrockagentruntime.paginators.ListInvocationStepsIterable responses = client.listInvocationStepsPaginator(request); responses.iterator().forEachRemaining(....);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 iterable that can be used to iterate through all the response pages.
- See Also:
-
listInvocationStepsPaginator
default ListInvocationStepsIterable listInvocationStepsPaginator(Consumer<ListInvocationStepsRequest.Builder> listInvocationStepsRequest) throws ResourceNotFoundException, ValidationException, InternalServerException, ThrottlingException, AccessDeniedException, AwsServiceException, SdkClientException, BedrockAgentRuntimeException This is a variant of
listInvocationSteps(software.amazon.awssdk.services.bedrockagentruntime.model.ListInvocationStepsRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
2) Using For loopsoftware.amazon.awssdk.services.bedrockagentruntime.paginators.ListInvocationStepsIterable responses = client.listInvocationStepsPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.bedrockagentruntime.paginators.ListInvocationStepsIterable responses = client .listInvocationStepsPaginator(request); for (software.amazon.awssdk.services.bedrockagentruntime.model.ListInvocationStepsResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.bedrockagentruntime.paginators.ListInvocationStepsIterable responses = client.listInvocationStepsPaginator(request); responses.iterator().forEachRemaining(....);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.Builderavoiding the need to create one manually viaListInvocationStepsRequest.builder()- Parameters:
listInvocationStepsRequest- AConsumerthat will call methods onListInvocationStepsRequest.Builderto create a request.- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
listInvocations
default ListInvocationsResponse listInvocations(ListInvocationsRequest listInvocationsRequest) throws ResourceNotFoundException, ValidationException, InternalServerException, ThrottlingException, AccessDeniedException, AwsServiceException, SdkClientException, BedrockAgentRuntimeException 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:
- Result of the ListInvocations operation returned by the service.
- See Also:
-
listInvocations
default ListInvocationsResponse listInvocations(Consumer<ListInvocationsRequest.Builder> listInvocationsRequest) throws ResourceNotFoundException, ValidationException, InternalServerException, ThrottlingException, AccessDeniedException, AwsServiceException, SdkClientException, BedrockAgentRuntimeException 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.Builderavoiding the need to create one manually viaListInvocationsRequest.builder()- Parameters:
listInvocationsRequest- AConsumerthat will call methods onListInvocationsRequest.Builderto create a request.- Returns:
- Result of the ListInvocations operation returned by the service.
- See Also:
-
listInvocationsPaginator
default ListInvocationsIterable listInvocationsPaginator(ListInvocationsRequest listInvocationsRequest) throws ResourceNotFoundException, ValidationException, InternalServerException, ThrottlingException, AccessDeniedException, AwsServiceException, SdkClientException, BedrockAgentRuntimeException This is a variant of
listInvocations(software.amazon.awssdk.services.bedrockagentruntime.model.ListInvocationsRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
2) Using For loopsoftware.amazon.awssdk.services.bedrockagentruntime.paginators.ListInvocationsIterable responses = client.listInvocationsPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.bedrockagentruntime.paginators.ListInvocationsIterable responses = client .listInvocationsPaginator(request); for (software.amazon.awssdk.services.bedrockagentruntime.model.ListInvocationsResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.bedrockagentruntime.paginators.ListInvocationsIterable responses = client.listInvocationsPaginator(request); responses.iterator().forEachRemaining(....);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 iterable that can be used to iterate through all the response pages.
- See Also:
-
listInvocationsPaginator
default ListInvocationsIterable listInvocationsPaginator(Consumer<ListInvocationsRequest.Builder> listInvocationsRequest) throws ResourceNotFoundException, ValidationException, InternalServerException, ThrottlingException, AccessDeniedException, AwsServiceException, SdkClientException, BedrockAgentRuntimeException This is a variant of
listInvocations(software.amazon.awssdk.services.bedrockagentruntime.model.ListInvocationsRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
2) Using For loopsoftware.amazon.awssdk.services.bedrockagentruntime.paginators.ListInvocationsIterable responses = client.listInvocationsPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.bedrockagentruntime.paginators.ListInvocationsIterable responses = client .listInvocationsPaginator(request); for (software.amazon.awssdk.services.bedrockagentruntime.model.ListInvocationsResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.bedrockagentruntime.paginators.ListInvocationsIterable responses = client.listInvocationsPaginator(request); responses.iterator().forEachRemaining(....);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.Builderavoiding the need to create one manually viaListInvocationsRequest.builder()- Parameters:
listInvocationsRequest- AConsumerthat will call methods onListInvocationsRequest.Builderto create a request.- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
listSessions
default ListSessionsResponse listSessions(ListSessionsRequest listSessionsRequest) throws ValidationException, InternalServerException, ThrottlingException, AccessDeniedException, AwsServiceException, SdkClientException, BedrockAgentRuntimeException 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:
- Result of the ListSessions operation returned by the service.
- See Also:
-
listSessions
default ListSessionsResponse listSessions(Consumer<ListSessionsRequest.Builder> listSessionsRequest) throws ValidationException, InternalServerException, ThrottlingException, AccessDeniedException, AwsServiceException, SdkClientException, BedrockAgentRuntimeException 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.Builderavoiding the need to create one manually viaListSessionsRequest.builder()- Parameters:
listSessionsRequest- AConsumerthat will call methods onListSessionsRequest.Builderto create a request.- Returns:
- Result of the ListSessions operation returned by the service.
- See Also:
-
listSessionsPaginator
default ListSessionsIterable listSessionsPaginator(ListSessionsRequest listSessionsRequest) throws ValidationException, InternalServerException, ThrottlingException, AccessDeniedException, AwsServiceException, SdkClientException, BedrockAgentRuntimeException This is a variant of
listSessions(software.amazon.awssdk.services.bedrockagentruntime.model.ListSessionsRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
2) Using For loopsoftware.amazon.awssdk.services.bedrockagentruntime.paginators.ListSessionsIterable responses = client.listSessionsPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.bedrockagentruntime.paginators.ListSessionsIterable responses = client .listSessionsPaginator(request); for (software.amazon.awssdk.services.bedrockagentruntime.model.ListSessionsResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.bedrockagentruntime.paginators.ListSessionsIterable responses = client.listSessionsPaginator(request); responses.iterator().forEachRemaining(....);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 iterable that can be used to iterate through all the response pages.
- See Also:
-
listSessionsPaginator
default ListSessionsIterable listSessionsPaginator(Consumer<ListSessionsRequest.Builder> listSessionsRequest) throws ValidationException, InternalServerException, ThrottlingException, AccessDeniedException, AwsServiceException, SdkClientException, BedrockAgentRuntimeException This is a variant of
listSessions(software.amazon.awssdk.services.bedrockagentruntime.model.ListSessionsRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
2) Using For loopsoftware.amazon.awssdk.services.bedrockagentruntime.paginators.ListSessionsIterable responses = client.listSessionsPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.bedrockagentruntime.paginators.ListSessionsIterable responses = client .listSessionsPaginator(request); for (software.amazon.awssdk.services.bedrockagentruntime.model.ListSessionsResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.bedrockagentruntime.paginators.ListSessionsIterable responses = client.listSessionsPaginator(request); responses.iterator().forEachRemaining(....);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.Builderavoiding the need to create one manually viaListSessionsRequest.builder()- Parameters:
listSessionsRequest- AConsumerthat will call methods onListSessionsRequest.Builderto create a request.- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
listTagsForResource
default ListTagsForResourceResponse listTagsForResource(ListTagsForResourceRequest listTagsForResourceRequest) throws ResourceNotFoundException, ValidationException, InternalServerException, ThrottlingException, AccessDeniedException, AwsServiceException, SdkClientException, BedrockAgentRuntimeException List all the tags for the resource you specify.
- Parameters:
listTagsForResourceRequest-- Returns:
- Result of the ListTagsForResource operation returned by the service.
- See Also:
-
listTagsForResource
default ListTagsForResourceResponse listTagsForResource(Consumer<ListTagsForResourceRequest.Builder> listTagsForResourceRequest) throws ResourceNotFoundException, ValidationException, InternalServerException, ThrottlingException, AccessDeniedException, AwsServiceException, SdkClientException, BedrockAgentRuntimeException List all the tags for the resource you specify.
This is a convenience which creates an instance of the
ListTagsForResourceRequest.Builderavoiding the need to create one manually viaListTagsForResourceRequest.builder()- Parameters:
listTagsForResourceRequest- AConsumerthat will call methods onListTagsForResourceRequest.Builderto create a request.- Returns:
- Result of the ListTagsForResource operation returned by the service.
- See Also:
-
putInvocationStep
default PutInvocationStepResponse putInvocationStep(PutInvocationStepRequest putInvocationStepRequest) throws ConflictException, ResourceNotFoundException, ValidationException, InternalServerException, ThrottlingException, AccessDeniedException, ServiceQuotaExceededException, AwsServiceException, SdkClientException, BedrockAgentRuntimeException 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:
- Result of the PutInvocationStep operation returned by the service.
- See Also:
-
putInvocationStep
default PutInvocationStepResponse putInvocationStep(Consumer<PutInvocationStepRequest.Builder> putInvocationStepRequest) throws ConflictException, ResourceNotFoundException, ValidationException, InternalServerException, ThrottlingException, AccessDeniedException, ServiceQuotaExceededException, AwsServiceException, SdkClientException, BedrockAgentRuntimeException 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.Builderavoiding the need to create one manually viaPutInvocationStepRequest.builder()- Parameters:
putInvocationStepRequest- AConsumerthat will call methods onPutInvocationStepRequest.Builderto create a request.- Returns:
- Result of the PutInvocationStep operation returned by the service.
- See Also:
-
rerank
default RerankResponse rerank(RerankRequest rerankRequest) throws ConflictException, ResourceNotFoundException, ValidationException, InternalServerException, DependencyFailedException, BadGatewayException, ThrottlingException, AccessDeniedException, ServiceQuotaExceededException, AwsServiceException, SdkClientException, BedrockAgentRuntimeException 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:
- Result of the Rerank operation returned by the service.
- See Also:
-
rerank
default RerankResponse rerank(Consumer<RerankRequest.Builder> rerankRequest) throws ConflictException, ResourceNotFoundException, ValidationException, InternalServerException, DependencyFailedException, BadGatewayException, ThrottlingException, AccessDeniedException, ServiceQuotaExceededException, AwsServiceException, SdkClientException, BedrockAgentRuntimeException 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.Builderavoiding the need to create one manually viaRerankRequest.builder()- Parameters:
rerankRequest- AConsumerthat will call methods onRerankRequest.Builderto create a request.- Returns:
- Result of the Rerank operation returned by the service.
- See Also:
-
rerankPaginator
default RerankIterable rerankPaginator(RerankRequest rerankRequest) throws ConflictException, ResourceNotFoundException, ValidationException, InternalServerException, DependencyFailedException, BadGatewayException, ThrottlingException, AccessDeniedException, ServiceQuotaExceededException, AwsServiceException, SdkClientException, BedrockAgentRuntimeException This is a variant of
rerank(software.amazon.awssdk.services.bedrockagentruntime.model.RerankRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
2) Using For loopsoftware.amazon.awssdk.services.bedrockagentruntime.paginators.RerankIterable responses = client.rerankPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.bedrockagentruntime.paginators.RerankIterable responses = client.rerankPaginator(request); for (software.amazon.awssdk.services.bedrockagentruntime.model.RerankResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.bedrockagentruntime.paginators.RerankIterable responses = client.rerankPaginator(request); responses.iterator().forEachRemaining(....);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 iterable that can be used to iterate through all the response pages.
- See Also:
-
rerankPaginator
default RerankIterable rerankPaginator(Consumer<RerankRequest.Builder> rerankRequest) throws ConflictException, ResourceNotFoundException, ValidationException, InternalServerException, DependencyFailedException, BadGatewayException, ThrottlingException, AccessDeniedException, ServiceQuotaExceededException, AwsServiceException, SdkClientException, BedrockAgentRuntimeException This is a variant of
rerank(software.amazon.awssdk.services.bedrockagentruntime.model.RerankRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
2) Using For loopsoftware.amazon.awssdk.services.bedrockagentruntime.paginators.RerankIterable responses = client.rerankPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.bedrockagentruntime.paginators.RerankIterable responses = client.rerankPaginator(request); for (software.amazon.awssdk.services.bedrockagentruntime.model.RerankResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.bedrockagentruntime.paginators.RerankIterable responses = client.rerankPaginator(request); responses.iterator().forEachRemaining(....);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.Builderavoiding the need to create one manually viaRerankRequest.builder()- Parameters:
rerankRequest- AConsumerthat will call methods onRerankRequest.Builderto create a request.- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
retrieve
default RetrieveResponse retrieve(RetrieveRequest retrieveRequest) throws ConflictException, ResourceNotFoundException, ValidationException, InternalServerException, DependencyFailedException, BadGatewayException, ThrottlingException, AccessDeniedException, ServiceQuotaExceededException, AwsServiceException, SdkClientException, BedrockAgentRuntimeException Queries a knowledge base and retrieves information from it.
- Parameters:
retrieveRequest-- Returns:
- Result of the Retrieve operation returned by the service.
- See Also:
-
retrieve
default RetrieveResponse retrieve(Consumer<RetrieveRequest.Builder> retrieveRequest) throws ConflictException, ResourceNotFoundException, ValidationException, InternalServerException, DependencyFailedException, BadGatewayException, ThrottlingException, AccessDeniedException, ServiceQuotaExceededException, AwsServiceException, SdkClientException, BedrockAgentRuntimeException Queries a knowledge base and retrieves information from it.
This is a convenience which creates an instance of the
RetrieveRequest.Builderavoiding the need to create one manually viaRetrieveRequest.builder()- Parameters:
retrieveRequest- AConsumerthat will call methods onRetrieveRequest.Builderto create a request.- Returns:
- Result of the Retrieve operation returned by the service.
- See Also:
-
retrievePaginator
default RetrieveIterable retrievePaginator(RetrieveRequest retrieveRequest) throws ConflictException, ResourceNotFoundException, ValidationException, InternalServerException, DependencyFailedException, BadGatewayException, ThrottlingException, AccessDeniedException, ServiceQuotaExceededException, AwsServiceException, SdkClientException, BedrockAgentRuntimeException This is a variant of
retrieve(software.amazon.awssdk.services.bedrockagentruntime.model.RetrieveRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
2) Using For loopsoftware.amazon.awssdk.services.bedrockagentruntime.paginators.RetrieveIterable responses = client.retrievePaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.bedrockagentruntime.paginators.RetrieveIterable responses = client.retrievePaginator(request); for (software.amazon.awssdk.services.bedrockagentruntime.model.RetrieveResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.bedrockagentruntime.paginators.RetrieveIterable responses = client.retrievePaginator(request); responses.iterator().forEachRemaining(....);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 iterable that can be used to iterate through all the response pages.
- See Also:
-
retrievePaginator
default RetrieveIterable retrievePaginator(Consumer<RetrieveRequest.Builder> retrieveRequest) throws ConflictException, ResourceNotFoundException, ValidationException, InternalServerException, DependencyFailedException, BadGatewayException, ThrottlingException, AccessDeniedException, ServiceQuotaExceededException, AwsServiceException, SdkClientException, BedrockAgentRuntimeException This is a variant of
retrieve(software.amazon.awssdk.services.bedrockagentruntime.model.RetrieveRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
2) Using For loopsoftware.amazon.awssdk.services.bedrockagentruntime.paginators.RetrieveIterable responses = client.retrievePaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.bedrockagentruntime.paginators.RetrieveIterable responses = client.retrievePaginator(request); for (software.amazon.awssdk.services.bedrockagentruntime.model.RetrieveResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.bedrockagentruntime.paginators.RetrieveIterable responses = client.retrievePaginator(request); responses.iterator().forEachRemaining(....);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.Builderavoiding the need to create one manually viaRetrieveRequest.builder()- Parameters:
retrieveRequest- AConsumerthat will call methods onRetrieveRequest.Builderto create a request.- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
retrieveAndGenerate
default RetrieveAndGenerateResponse retrieveAndGenerate(RetrieveAndGenerateRequest retrieveAndGenerateRequest) throws ConflictException, ResourceNotFoundException, ValidationException, InternalServerException, DependencyFailedException, BadGatewayException, ThrottlingException, AccessDeniedException, ServiceQuotaExceededException, AwsServiceException, SdkClientException, BedrockAgentRuntimeException 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:
- Result of the RetrieveAndGenerate operation returned by the service.
- See Also:
-
retrieveAndGenerate
default RetrieveAndGenerateResponse retrieveAndGenerate(Consumer<RetrieveAndGenerateRequest.Builder> retrieveAndGenerateRequest) throws ConflictException, ResourceNotFoundException, ValidationException, InternalServerException, DependencyFailedException, BadGatewayException, ThrottlingException, AccessDeniedException, ServiceQuotaExceededException, AwsServiceException, SdkClientException, BedrockAgentRuntimeException 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.Builderavoiding the need to create one manually viaRetrieveAndGenerateRequest.builder()- Parameters:
retrieveAndGenerateRequest- AConsumerthat will call methods onRetrieveAndGenerateRequest.Builderto create a request.- Returns:
- Result of the RetrieveAndGenerate operation returned by the service.
- See Also:
-
tagResource
default TagResourceResponse tagResource(TagResourceRequest tagResourceRequest) throws ResourceNotFoundException, ValidationException, InternalServerException, ThrottlingException, AccessDeniedException, ServiceQuotaExceededException, AwsServiceException, SdkClientException, BedrockAgentRuntimeException Associate tags with a resource. For more information, see Tagging resources in the Amazon Bedrock User Guide.
- Parameters:
tagResourceRequest-- Returns:
- Result of the TagResource operation returned by the service.
- See Also:
-
tagResource
default TagResourceResponse tagResource(Consumer<TagResourceRequest.Builder> tagResourceRequest) throws ResourceNotFoundException, ValidationException, InternalServerException, ThrottlingException, AccessDeniedException, ServiceQuotaExceededException, AwsServiceException, SdkClientException, BedrockAgentRuntimeException 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.Builderavoiding the need to create one manually viaTagResourceRequest.builder()- Parameters:
tagResourceRequest- AConsumerthat will call methods onTagResourceRequest.Builderto create a request.- Returns:
- Result of the TagResource operation returned by the service.
- See Also:
-
untagResource
default UntagResourceResponse untagResource(UntagResourceRequest untagResourceRequest) throws ResourceNotFoundException, ValidationException, InternalServerException, ThrottlingException, AccessDeniedException, AwsServiceException, SdkClientException, BedrockAgentRuntimeException Remove tags from a resource.
- Parameters:
untagResourceRequest-- Returns:
- Result of the UntagResource operation returned by the service.
- See Also:
-
untagResource
default UntagResourceResponse untagResource(Consumer<UntagResourceRequest.Builder> untagResourceRequest) throws ResourceNotFoundException, ValidationException, InternalServerException, ThrottlingException, AccessDeniedException, AwsServiceException, SdkClientException, BedrockAgentRuntimeException Remove tags from a resource.
This is a convenience which creates an instance of the
UntagResourceRequest.Builderavoiding the need to create one manually viaUntagResourceRequest.builder()- Parameters:
untagResourceRequest- AConsumerthat will call methods onUntagResourceRequest.Builderto create a request.- Returns:
- Result of the UntagResource operation returned by the service.
- See Also:
-
updateSession
default UpdateSessionResponse updateSession(UpdateSessionRequest updateSessionRequest) throws ConflictException, ResourceNotFoundException, ValidationException, InternalServerException, ThrottlingException, AccessDeniedException, AwsServiceException, SdkClientException, BedrockAgentRuntimeException 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:
- Result of the UpdateSession operation returned by the service.
- See Also:
-
updateSession
default UpdateSessionResponse updateSession(Consumer<UpdateSessionRequest.Builder> updateSessionRequest) throws ConflictException, ResourceNotFoundException, ValidationException, InternalServerException, ThrottlingException, AccessDeniedException, AwsServiceException, SdkClientException, BedrockAgentRuntimeException 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.Builderavoiding the need to create one manually viaUpdateSessionRequest.builder()- Parameters:
updateSessionRequest- AConsumerthat will call methods onUpdateSessionRequest.Builderto create a request.- Returns:
- Result of the UpdateSession operation returned by the service.
- See Also:
-
create
Create aBedrockAgentRuntimeClientwith the region loaded from theDefaultAwsRegionProviderChainand credentials loaded from theDefaultCredentialsProvider. -
builder
Create a builder that can be used to configure and create aBedrockAgentRuntimeClient. -
serviceMetadata
-
serviceClientConfiguration
Description copied from interface:SdkClientThe SDK service client configuration exposes client settings to the user, e.g., ClientOverrideConfiguration- Specified by:
serviceClientConfigurationin interfaceAwsClient- Specified by:
serviceClientConfigurationin interfaceSdkClient- Returns:
- SdkServiceClientConfiguration
-