retrieve
¶
retrieve(
knowledge_base_id: KnowledgeBaseIdentifier,
retrieval_query: KnowledgeBaseQuery,
*,
config_overrides: Optional[BedrockAgentRuntimeClientConfig] = None,
retrieval_configuration: Optional[KnowledgeBaseRetrievalConfiguration] = None,
guardrail_configuration: Optional[GuardrailConfiguration] = None,
next_token: Optional[NextToken] = None,
user_context: Optional[UserContext] = None,
) -> RetrieveResponse
Queries a knowledge base and retrieves information from it.
Parameters:
-
knowledge_base_id(KnowledgeBaseIdentifier) –The unique identifier of the knowledge base to query.
-
retrieval_query(KnowledgeBaseQuery) –Contains the query to send the knowledge base.
-
retrieval_configuration(Optional[KnowledgeBaseRetrievalConfiguration], default:None) –Contains configurations for the knowledge base query and retrieval process. For more information, see Query configurations.
-
guardrail_configuration(Optional[GuardrailConfiguration], default:None) –Guardrail settings.
-
next_token(Optional[NextToken], default:None) –If there are more results than can fit in the response, the response returns a
nextToken. Use this token in thenextTokenfield of another request to retrieve the next batch of results. -
user_context(Optional[UserContext], default:None) –Contains information about the user making the request. This is used for access control filtering to ensure that retrieval results only include documents the user is authorized to access.
Raises:
-
AccessDeniedException–The request is denied because of missing access permissions. Check your permissions and retry your request.
-
BadGatewayException–There was an issue with a dependency due to a server issue. Retry your request.
-
ConflictException–There was a conflict performing an operation. Resolve the conflict and retry your request.
-
DependencyFailedException–There was an issue with a dependency. Check the resource configurations and retry the request.
-
InternalServerException–An internal server error occurred. 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.
-
ServiceQuotaExceededException–The number of requests exceeds the service quota. Resubmit your request later.
-
ThrottlingException–The number of requests exceeds the limit. Resubmit your request later.
-
ValidationException–Input validation failed. Check your request parameters and retry the request.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_bedrock_agent_runtime/_services/bedrock_agent_runtime.py
2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 | |