search_discoverable_registry_records
¶
search_discoverable_registry_records(
search_query: SearchQuery,
registry_ids: RegistryIdList,
*,
config_overrides: Optional[AgentRegistryClientConfig] = None,
max_results: Optional[int] = None,
filters: Optional[MetadataFilterExpression] = None,
search_type: Optional[SearchType] = None,
next_token: Optional[str] = None,
) -> SearchDiscoverableRegistryRecordsResponse
Searches the discoverable registry records in a registry using a natural language query. Returns metadata for the matching records ordered by relevance.
Returns at most 1000 results across all pages when searchType is KEYWORD, and at most 20 results when it is HYBRID or SEMANTIC. To retrieve more records, refine the query or filters, or use ListDiscoverableRegistryRecords to list every record.
Parameters:
-
search_query(SearchQuery) –The natural language query to search for matching registry records. If you specify an empty string, the operation returns the records that match the
filters, most recently updated first, up to the result limit for thesearchType. -
registry_ids(RegistryIdList) –The registry identifiers to search within. Currently, you must specify exactly one registry identifier. You can provide either the full Amazon Web Services Resource Name (ARN) or the registry ID.
-
max_results(Optional[int], default:None) –The maximum number of results to return in one page. Valid values are 1 through 50 when
searchTypeisKEYWORD, and 1 through 20 when it isHYBRIDorSEMANTIC. The default value is 10. -
filters(Optional[MetadataFilterExpression], default:None) –An optional structured JSON metadata filter that narrows the search results. Supports the field-level operators
$eq,$ne, and$in, and the logical operators$andand$oron filterable fields.Specifies additional filtering on custom metadata fields using the
customMetadata.{key}prefix. For example, to filter by a custom metadata field:{"customMetadata.environment": {"$eq": "production"}}. For a Boolean field, you can also use a native JSON boolean value, for example:{"customMetadata.requiresApproval": {"$eq": true}}. -
search_type(Optional[SearchType], default:None) –Specifies how the service ranks registry records against the search query. If you omit this parameter, the service uses
HYBRIDin Amazon Web Services Regions that support semantic search andKEYWORDin Regions that do not. The response reports the search type that the service used. Valid values are the following:-
KEYWORD– Ranks records by keyword match between the query terms and the record name, description, descriptors, and custom metadata text values. Available in every Amazon Web Services Region. -
SEMANTIC– Ranks records by semantic similarity to the query and returns the most similar records, up tomaxResults, even when none of them closely matches the query. -
HYBRID– Combines keyword ranking and semantic ranking.
HYBRIDandSEMANTICare available in a limited number of Regions. If you specify either one in a Region that does not support semantic search, the request fails with aValidationExceptionthat has the reasonUnsupportedInRegion. -
-
next_token(Optional[str], default:None) –The pagination token from a previous response. Use it to retrieve the next page of results, and send the same
searchQuery,registryIds,filters, andsearchTypethat you used for the first page. If any of them differ, the request fails with aValidationException. A pagination token expires 15 minutes after the service returns the first page.
Raises:
-
AccessDeniedException–The caller is not authorized to perform the requested action.
-
InternalServerException–The request failed due to an unexpected internal error; the caller may retry.
-
ResourceNotFoundException–The requested resource was not found.
-
ThrottlingException–The request was denied due to request throttling; the caller may retry after a delay.
-
UnauthorizedException–The request could not be authenticated.
-
ValidationException–The request failed validation of one or more input fields.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_agent_registry/_services/agent_registry.py
346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 | |