retrieve
async
¶
retrieve(
knowledge_base_id: KnowledgeBaseIdentifier,
retrieval_query: KnowledgeBaseQuery,
*,
config_overrides: Optional[AsyncBedrockAgentRuntimeClientConfig] = 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/async_bedrock_agent_runtime.py
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 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 | |