Required. The name of the ExampleStore resource that examples are retrieved from. Format: projects/{project}/locations/{location}/exampleStores/{exampleStore}
Request body
The request body contains data with the following structure:
Optional. The number of similar examples to return.
parameters
Union type
The parameters to search for similar examples. This includes which value to use for similarity search and the filters that should be applied to the search. Filters limit which examples are considered as candidates for similarity search. parameters can be only one of the following:
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-06-27 UTC."],[],[],null,["# Method: exampleStores.searchExamples\n\n**Full name**: projects.locations.exampleStores.searchExamples\n\nSearch for similar Examples for given selection criteria. \n\n### Endpoint\n\npost `https:``/``/{service-endpoint}``/v1beta1``/{exampleStore}:searchExamples` \nWhere `{service-endpoint}` is one of the [supported service endpoints](/vertex-ai/docs/reference/rest#rest_endpoints).\n\n### Path parameters\n\n`exampleStore` `string` \nRequired. The name of the ExampleStore resource that examples are retrieved from. Format: `projects/{project}/locations/{location}/exampleStores/{exampleStore}`\n\n### Request body\n\nThe request body contains data with the following structure:\nFields `topK` `string (`[int64](https://developers.google.com/discovery/v1/type-format)` format)` \nOptional. The number of similar examples to return. \n`parameters` `Union type` \nThe parameters to search for similar examples. This includes which value to use for similarity search and the filters that should be applied to the search. Filters limit which examples are considered as candidates for similarity search. `parameters` can be only one of the following:\n`storedContentsExampleParameters` `object (`[StoredContentsExampleParameters](/vertex-ai/docs/reference/rest/v1beta1/projects.locations.exampleStores/searchExamples#StoredContentsExampleParameters)`)` \nThe parameters of StoredContentsExamples to be searched. \n\n### Response body\n\nResponse message for [ExampleStoreService.SearchExamples](/vertex-ai/docs/reference/rest/v1beta1/projects.locations.exampleStores/searchExamples#google.cloud.aiplatform.v1beta1.ExampleStoreService.SearchExamples).\n\nIf successful, the response body contains data with the following structure:\nFields `results[]` `object (`[SimilarExample](/vertex-ai/docs/reference/rest/v1beta1/projects.locations.exampleStores/searchExamples#SimilarExample)`)` \nThe results of searching for similar examples. \n\nStoredContentsExampleParameters\n-------------------------------\n\nThe metadata filters that will be used to search StoredContentsExamples. If a field is unspecified, then no filtering for that field will be applied\nFields `functionNames` `object (`[ExamplesArrayFilter](/vertex-ai/docs/reference/rest/v1beta1/ExamplesArrayFilter)`)` \nOptional. The function names for filtering. \n`query` `Union type` \nThe query to use to retrieve similar StoredContentsExamples. `query` can be only one of the following:\n`searchKey` `string` \nThe exact search key to use for retrieval.\n`contentSearchKey` `object (`[ContentSearchKey](/vertex-ai/docs/reference/rest/v1beta1/projects.locations.exampleStores/searchExamples#ContentSearchKey)`)` \nThe chat history to use to generate the search key for retrieval. \n\nContentSearchKey\n----------------\n\nThe chat history to use to generate the search key for retrieval.\nFields `contents[]` `object (`[Content](/vertex-ai/docs/reference/rest/v1beta1/Content)`)` \nRequired. The conversation for generating a search key.\n`searchKeyGenerationMethod` `object (`[SearchKeyGenerationMethod](/vertex-ai/docs/reference/rest/v1beta1/SearchKeyGenerationMethod)`)` \nRequired. The method of generating a search key. \n\nSimilarExample\n--------------\n\nThe result of the similar example.\nFields `example` `object (`[Example](/vertex-ai/docs/reference/rest/v1beta1/Example)`)` \nThe example that is similar to the searched query.\n`similarityScore` `number` \nThe similarity score of this example."]]