Yandex Cloud
Поиск
Связаться с намиПодключиться
  • Документация
  • Блог
  • Все сервисы
  • Статус работы сервисов
    • Популярные
    • Инфраструктура и сеть
    • Платформа данных
    • Контейнеры
    • Инструменты разработчика
    • Бессерверные вычисления
    • Безопасность
    • Мониторинг и управление ресурсами
    • Машинное обучение
    • Бизнес-инструменты
  • Все решения
    • По отраслям
    • По типу задач
    • Экономика платформы
    • Безопасность
    • Техническая поддержка
    • Каталог партнёров
    • Обучение и сертификация
    • Облако для стартапов
    • Облако для крупного бизнеса
    • Центр технологий для общества
    • Облако для интеграторов
    • Поддержка IT-бизнеса
    • Облако для фрилансеров
    • Обучение и сертификация
    • Блог
    • Документация
    • Контент-программа
    • Мероприятия и вебинары
    • Контакты, чаты и сообщества
    • Идеи
    • Истории успеха
    • Тарифы Yandex Cloud
    • Промоакции и free tier
    • Правила тарификации
  • Документация
  • Блог
Проект Яндекса
© 2025 ООО «Яндекс.Облако»
Yandex Search API
  • Управление доступом
  • Правила тарификации
    • Аутентификация в API v2
        • Overview
          • Overview
          • Search
  • Аудитные логи Audit Trails

В этой статье:

  • gRPC request
  • GenSearchRequest
  • GenSearchMessage
  • SiteOption
  • HostOption
  • UrlOption
  • SearchFilter
  • GenSearchResponse
  • GenSearchMessage
  • Source
  • SearchQuery
  1. Справочник API
  2. API v2
  3. gRPC (англ.)
  4. GenSearch
  5. Search

Web Search API, gRPC: GenSearchService.Search

Статья создана
Yandex Cloud
Обновлена 8 апреля 2025 г.
  • gRPC request
  • GenSearchRequest
  • GenSearchMessage
  • SiteOption
  • HostOption
  • UrlOption
  • SearchFilter
  • GenSearchResponse
  • GenSearchMessage
  • Source
  • SearchQuery

gRPC requestgRPC request

rpc Search (GenSearchRequest) returns (stream GenSearchResponse)

GenSearchRequestGenSearchRequest

{
  "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
    }
  ]
}

Field

Description

messages[]

GenSearchMessage

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

SiteOption

Required field.

Includes only one of the fields site, host, url.

Restricts the search to the specific websites, hosts or pages.

host

HostOption

Required field.

Includes only one of the fields site, host, url.

Restricts the search to the specific websites, hosts or pages.

url

UrlOption

Required field.

Includes only one of the fields site, host, url.

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[]

SearchFilter

Restricts the search by date, document formats or language.

GenSearchMessageGenSearchMessage

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

  • ROLE_UNSPECIFIED
  • ROLE_USER: The message is sent by the user.
  • ROLE_ASSISTANT: The message is sent by the model.

SiteOptionSiteOption

Field

Description

site[]

string

Restricts the search to the specific websites.

HostOptionHostOption

Field

Description

host[]

string

Restricts the search to the specific hosts.

UrlOptionUrlOption

Field

Description

url[]

string

Restricts the search to the specific pages.

SearchFilterSearchFilter

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 date, lang, format.

lang

string

Restrict by document language. Use ISO 639-1 language codes.

Includes only one of the fields date, lang, format.

format

enum DocFormat

Restrict by document format.

Includes only one of the fields date, lang, format.

  • DOC_FORMAT_UNSPECIFIED
  • DOC_FORMAT_PDF
  • DOC_FORMAT_XLS
  • DOC_FORMAT_ODS
  • DOC_FORMAT_RTF
  • DOC_FORMAT_PPT
  • DOC_FORMAT_ODP
  • DOC_FORMAT_SWF
  • DOC_FORMAT_ODT
  • DOC_FORMAT_ODG
  • DOC_FORMAT_DOC

GenSearchResponseGenSearchResponse

{
  "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"
}

Field

Description

message

GenSearchMessage

The text of the generative response.

sources[]

Source

The documents used to form the generative response.

search_queries[]

SearchQuery

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.

GenSearchMessageGenSearchMessage

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

  • ROLE_UNSPECIFIED
  • ROLE_USER: The message is sent by the user.
  • ROLE_ASSISTANT: The message is sent by the model.

SourceSource

Field

Description

url

string

Document URL.

title

string

Document title.

used

bool

The document was used in the answer.

SearchQuerySearchQuery

Field

Description

text

string

Query text.

req_id

string

Query ID in Yandex Search.

Была ли статья полезна?

Предыдущая
Overview
Следующая
Overview
Проект Яндекса
© 2025 ООО «Яндекс.Облако»