Web Search API, gRPC: GenSearchService.Search
gRPC request
rpc Search (GenSearchRequest) returns (stream GenSearchResponse)
GenSearchRequest
{
"messages": [
{
"content": "string",
"role": "Role"
}
],
"folder_id": "string",
// Includes only one of the fields `site`, `host`, `url`
"site": {
"site": [
"string"
]
},
"host": {
"host": [
"string"
]
},
"url": {
"url": [
"string"
]
},
// end of the list of possible fields
"fix_misspell": "bool",
"enable_nrfm_docs": "bool",
"search_filters": [
{
// Includes only one of the fields `date`, `lang`, `format`
"date": "string",
"lang": "string",
"format": "DocFormat"
// end of the list of possible fields
}
],
"search_type": "SearchType",
"get_partial_results": "bool",
"metadata": {
"fields": "map<string, string>"
}
}
|
Field |
Description |
|
messages[] |
Single search query or a search query with context in the form of chat with the model. |
|
folder_id |
string Required field. ID of the folder. |
|
site |
Includes only one of the fields Restricts the search to the specific websites, hosts or pages. |
|
host |
Includes only one of the fields Restricts the search to the specific websites, hosts or pages. |
|
url |
Includes only one of the fields Restricts the search to the specific websites, hosts or pages. |
|
fix_misspell |
bool Fix query misspells. |
|
enable_nrfm_docs |
bool Use the documents inaccessible from the site's front page. |
|
search_filters[] |
Restricts the search by date, document formats or language. |
|
search_type |
enum SearchType Search type that determines the domain name that will be used for the search queries.
|
|
get_partial_results |
bool Get partial results |
|
metadata |
Search flags |
GenSearchMessage
|
Field |
Description |
|
content |
string Required field. Text of user query or the model's response (depending on the role value). |
|
role |
enum Role Required field. Message sender's role
|
SiteOption
|
Field |
Description |
|
site[] |
string Restricts the search to the specific websites. |
HostOption
|
Field |
Description |
|
host[] |
string Restricts the search to the specific hosts. |
UrlOption
|
Field |
Description |
|
url[] |
string Restricts the search to the specific pages. |
SearchFilter
|
Field |
Description |
|
date |
string Restrict by document date. See https://yandex.ru/support/search/ru/query-language/search-operators details. Includes only one of the fields |
|
lang |
string Restrict by document language. Use ISO 639-1 language codes. Includes only one of the fields |
|
format |
enum DocFormat Restrict by document format. Includes only one of the fields
|
SearchMetadata
|
Field |
Description |
|
fields |
object (map<string, string>) Search flags, |
GenSearchResponse
{
"message": {
"content": "string",
"role": "Role"
},
"sources": [
{
"url": "string",
"title": "string",
"used": "bool"
}
],
"search_queries": [
{
"text": "string",
"req_id": "string"
}
],
"fixed_misspell_query": "string",
"is_answer_rejected": "bool",
"is_bullet_answer": "bool",
"hints": [
"string"
],
"problematic_answer": "bool"
}
|
Field |
Description |
|
message |
The text of the generative response. |
|
sources[] |
The documents used to form the generative response. |
|
search_queries[] |
The search queries, refined by the YandexGPT model and used for the generative response. |
|
fixed_misspell_query |
string The text of the search query with fixed misspells. |
|
is_answer_rejected |
bool The model failed to answer due to the ethical concerns. |
|
is_bullet_answer |
bool A bullet answer in case the model cannot give a proper response and returns a set of bullets with various data. |
|
hints[] |
string Search hints |
|
problematic_answer |
bool The answer may contain inappropriate content |
GenSearchMessage
|
Field |
Description |
|
content |
string Required field. Text of user query or the model's response (depending on the role value). |
|
role |
enum Role Required field. Message sender's role
|
Source
|
Field |
Description |
|
url |
string Document URL. |
|
title |
string Document title. |
|
used |
bool The document was used in the answer. |
SearchQuery
|
Field |
Description |
|
text |
string Query text. |
|
req_id |
string Query ID in Yandex Search. |