- Newest
- Most votes
- Most comments
Based on the information provided, it appears that there might be a misunderstanding about how pagination works with the Bedrock Agent Runtime's retrieve operation.
The retrieve operation in the Bedrock Agent Runtime service doesn't actually support pagination in the same way that many other AWS services do. Instead, it allows you to specify the number of results you want to retrieve in a single call using the 'numberOfResults' parameter within the 'vectorSearchConfiguration'.
When you use the retrieve operation, you typically specify the number of results you want to get back in a single call. This is different from pagination where you would get a subset of results and then use a token to get the next set.
Here's how you would typically use the retrieve operation:
- You make a call to the retrieve method, specifying the number of results you want.
- The service returns up to that number of results in a single response.
- There is no 'NextToken' or pagination mechanism because all requested results are returned in that single call.
If you need more results than what can be returned in a single call, you would need to make multiple separate calls to the retrieve method, potentially adjusting your query or other parameters to get different results.
The 'MaxItems' parameter you're using is likely part of the boto3 paginator configuration, but it doesn't apply to this particular operation in the way you're expecting. The Bedrock Agent Runtime's retrieve operation is designed to return all requested results in one go, rather than paginating across multiple calls.
To get the behavior you're looking for, you would need to:
- Determine the maximum number of results you can retrieve in a single call.
- Make multiple calls to the retrieve method if you need more results than can be returned in one call.
- Potentially adjust your query or other parameters between calls to get different sets of results.
If you need to process large numbers of results, you might need to implement your own pagination logic at the application level, making multiple retrieve calls and managing the results yourself.
Sources
Amazon Bedrock Knowledge Bases now supports hybrid search | AWS Machine Learning Blog
answered 2 years ago
Here I am not using the direct "retrieve" operation from the Bedrock Runtime Agent, it's actually "retreive" with Paginators which is available on a client instance via the "get_paginator" method.
answered 2 years ago
Relevant content
asked a year ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 7 months ago
