Search API
- Generative serch
- class yandex_cloud_ml_sdk._search_api.generative.config.GenerativeSearchConfig
- class yandex_cloud_ml_sdk._search_api.generative.result.SearchSource
- class yandex_cloud_ml_sdk._search_api.generative.result.SearchQuery
- class yandex_cloud_ml_sdk._search_api.generative.result.GenerativeSearchResult
- class yandex_cloud_ml_sdk._search_api.generative.config.FilterType
- General
- Web search
- Image search
- Search by image
- Enum-like settings
- class yandex_cloud_ml_sdk._search_api.enums.SearchType
- class yandex_cloud_ml_sdk._search_api.enums.FamilyMode
- class yandex_cloud_ml_sdk._search_api.enums.FixTypoMode
- class yandex_cloud_ml_sdk._search_api.enums.SortOrder
- class yandex_cloud_ml_sdk._search_api.enums.SortMode
- class yandex_cloud_ml_sdk._search_api.enums.GroupMode
- class yandex_cloud_ml_sdk._search_api.enums.Localization
- class yandex_cloud_ml_sdk._search_api.enums.Format
- class yandex_cloud_ml_sdk._search_api.enums.ImageFormat
- class yandex_cloud_ml_sdk._search_api.enums.ImageOrientation
- class yandex_cloud_ml_sdk._search_api.enums.ImageSize
- class yandex_cloud_ml_sdk._search_api.enums.ImageColor
Generative serch
typeddict yandex_cloud_ml_sdk._search_api.generative.config.DateFilterType
Date filter dict type for generative search.
Example:
>>> filter_ = {'date': '>20240125'}
|
Required Keys |
|
typeddict yandex_cloud_ml_sdk._search_api.generative.config.FormatFilterType
Format filter dict type for generative search.
Example:
>>> filter_ = {'format': 'xlsx'}
|
Required Keys |
|
typeddict yandex_cloud_ml_sdk._search_api.generative.config.LangFilterType
Language filter dict type for generative search.
Example:
>>> filter_ = {'lang': 'ru'}
|
Required Keys |
|
class yandex_cloud_ml_sdk._search_api.generative.config.GenerativeSearchConfig
GenerativeSearchConfig(site: ‘tuple[str, …] | None’ = None, host: ‘tuple[str, …] | None’ = None, url: ‘tuple[str, …] | None’ = None, fix_misspell: ‘bool | None’ = None, enable_nrfm_docs: ‘bool | None’ = None, search_filters: ‘tuple[FilterType, …] | None’ = None)
site: tuple
Parameter for limiting search to specific location or list of sites.
host: tuple
Parameter for limiting search to specific location or list of hosts.
url: tuple
Parameter for limiting search to specific location or list of urls.
fix_misspell: bool
tells to backend to fix or not to fix misspels in queries.
enable_nrfm_docs: bool
tells to backend to include or not to include pages, which are not available via direct clicks from given sites/hosts/urls to search result.
search_filters: tuple
allows to limit search results with additional filters.
__init__(site=None, host=None, url=None, fix_misspell=None, enable_nrfm_docs=None, search_filters=None)
|
Parameters |
|
|
Return type |
None |
class yandex_cloud_ml_sdk._search_api.generative.result.SearchSource
Source document found for user query.
Might be used or not used in generative answer itself.
url: str
Url of the document
title: str
Title of the document
used: bool
Has this source been used in generative answer or not
class yandex_cloud_ml_sdk._search_api.generative.result.SearchQuery
SearchQuery(text: ‘str’, req_id: ‘str’)
text: str
Text of the search query
req_id: str
Request id
class yandex_cloud_ml_sdk._search_api.generative.result.GenerativeSearchResult
A class representing the result of a generative search request.
text: str
Generative answer itself. Note that footnootes like [N] in the text refers to GenerativeSearchResult.sources[N] source.
role: str
Message sender role; in case of the generative search, model always answers with the “assistant” role.
fixed_misspell_query: str
Fixed query string in case of query was fixed
is_answer_rejected: bool
Anwer was rejected by some reasons, probably because of the ethics constrictions
is_bullet_answer: bool
Model was unable to give good answer and returned bulleted list with some info.
sources: tuple
List of documents found by user query; every element number matches with footnotes in the .text attribute.
search_queries: tuple
List of search queries sent to model
property content: str
Alias to GenerativeSearchResult.text.
Only to add some compatibility with raw Search API answer which have “content” field in protobufs and REST answers unlike other parts of this SDK.
class yandex_cloud_ml_sdk._search_api.generative.config.FilterType
yandex_cloud_ml_sdk._search_api.generative.config.FilterType
Generative search filter type which describes dict formats eligible to use with generative search API.
alias of DateFilterType | FormatFilterType | LangFilterType
General
class yandex_cloud_ml_sdk._search_api.types.SearchGroup
SearchGroup(documents: ‘tuple[XMLSearchDocumentTypeT, …]’)
documents: tuple
count(value) → integer -- return number of occurrences of value
index(value[, start[, stop]]) → integer -- return first index of value.
Raises ValueError if the value is not present.
Supporting start and stop arguments is optional, but recommended.
Web search
class yandex_cloud_ml_sdk._search_api.web.result.WebSearchDocument
WebSearchDocument(url: ‘str | None’, domain: ‘str | None’, modtime: ‘datetime.datetime | None’, title: ‘str | None’, lang: ‘str | None’, extra: ‘NestedDict’, passages: ‘tuple[str, …]’)
extra: dict
Image search
class yandex_cloud_ml_sdk._search_api.image.result.ImageSearchDocument
ImageSearchDocument(url: ‘str | None’, domain: ‘str | None’, modtime: ‘datetime.datetime | None’, width: ‘int | None’, height: ‘int | None’, format: ‘str | None’, extra: ‘NestedDict’)
extra: NestedDict
modtime: datetime.datetime
Search by image
class yandex_cloud_ml_sdk._search_api.by_image.result.ByImageSearchDocument
ByImageSearchDocument(url: ‘str’, format: ‘str | None’, width: ‘int’, height: ‘int’, passage: ‘str’, host: ‘str’, page_title: ‘str’, page_url: ‘str’)
url: str
Image URL.
Image format.
width: int
Image width.
height: int
Image height.
passage: str
Text passage.
host: str
Document host.
page_title: str
Document title.
page_url: str
Document URL.
Enum-like settings
class yandex_cloud_ml_sdk._search_api.enums.SearchType
Search type.
RU = 1
TR = 2
COM = 3
KK = 4
BE = 5
UZ = 6
classmethod Unknown(name, value)
|
Parameters |
classmethod get_available()
|
Return type |
__new__(value)
conjugate()
Returns self, the complex conjugate of any int.
bit_length()
Number of bits necessary to represent self in binary.
>>> bin(37)
'0b100101'
>>> (37).bit_length()
6
bit_count()
Number of ones in the binary representation of the absolute value of self.
Also known as the population count.
>>> bin(13)
'0b1101'
>>> (13).bit_count()
3
as_integer_ratio()
Return a pair of integers, whose ratio is equal to the original int.
The ratio is in lowest terms and has a positive denominator.
>>> (10).as_integer_ratio()
(10, 1)
>>> (-10).as_integer_ratio()
(-10, 1)
>>> (0).as_integer_ratio()
(0, 1)
is_integer()
Returns True. Exists for duck type compatibility with float.is_integer.
real
the real part of a complex number
imag
the imaginary part of a complex number
numerator
the numerator of a rational number in lowest terms
denominator
the denominator of a rational number in lowest terms
__init__(*args, **kwds)
class yandex_cloud_ml_sdk._search_api.enums.FamilyMode
Results filtering.
NONE = 1
Filtering is disabled. Search results include any documents regardless of their contents.
MODERATE = 2
Moderate filter (default value). Documents of the Adult category are excluded from search results unless a query is explicitly made for searching resources of this category.
STRICT = 3
Regardless of a search query, documents of the Adult category and those with profanity are excluded from search results.
classmethod Unknown(name, value)
|
Parameters |
classmethod get_available()
|
Return type |
__new__(value)
conjugate()
Returns self, the complex conjugate of any int.
bit_length()
Number of bits necessary to represent self in binary.
>>> bin(37)
'0b100101'
>>> (37).bit_length()
6
bit_count()
Number of ones in the binary representation of the absolute value of self.
Also known as the population count.
>>> bin(13)
'0b1101'
>>> (13).bit_count()
3
as_integer_ratio()
Return a pair of integers, whose ratio is equal to the original int.
The ratio is in lowest terms and has a positive denominator.
>>> (10).as_integer_ratio()
(10, 1)
>>> (-10).as_integer_ratio()
(-10, 1)
>>> (0).as_integer_ratio()
(0, 1)
is_integer()
Returns True. Exists for duck type compatibility with float.is_integer.
real
the real part of a complex number
imag
the imaginary part of a complex number
numerator
the numerator of a rational number in lowest terms
denominator
the denominator of a rational number in lowest terms
__init__(*args, **kwds)
class yandex_cloud_ml_sdk._search_api.enums.FixTypoMode
Search query typo correction setting
ON = 1
Automatically correct typos (default value).
OFF = 2
Autocorrection is off.
classmethod Unknown(name, value)
|
Parameters |
classmethod get_available()
|
Return type |
__new__(value)
conjugate()
Returns self, the complex conjugate of any int.
bit_length()
Number of bits necessary to represent self in binary.
>>> bin(37)
'0b100101'
>>> (37).bit_length()
6
bit_count()
Number of ones in the binary representation of the absolute value of self.
Also known as the population count.
>>> bin(13)
'0b1101'
>>> (13).bit_count()
3
as_integer_ratio()
Return a pair of integers, whose ratio is equal to the original int.
The ratio is in lowest terms and has a positive denominator.
>>> (10).as_integer_ratio()
(10, 1)
>>> (-10).as_integer_ratio()
(-10, 1)
>>> (0).as_integer_ratio()
(0, 1)
is_integer()
Returns True. Exists for duck type compatibility with float.is_integer.
real
the real part of a complex number
imag
the imaginary part of a complex number
numerator
the numerator of a rational number in lowest terms
denominator
the denominator of a rational number in lowest terms
__init__(*args, **kwds)
class yandex_cloud_ml_sdk._search_api.enums.SortOrder
Search results sorting order
ASC = 1
Reverse order from oldest to most recent.
DESC = 2
Direct order from most recent to oldest (default).
classmethod Unknown(name, value)
|
Parameters |
classmethod get_available()
|
Return type |
__new__(value)
conjugate()
Returns self, the complex conjugate of any int.
bit_length()
Number of bits necessary to represent self in binary.
>>> bin(37)
'0b100101'
>>> (37).bit_length()
6
bit_count()
Number of ones in the binary representation of the absolute value of self.
Also known as the population count.
>>> bin(13)
'0b1101'
>>> (13).bit_count()
3
as_integer_ratio()
Return a pair of integers, whose ratio is equal to the original int.
The ratio is in lowest terms and has a positive denominator.
>>> (10).as_integer_ratio()
(10, 1)
>>> (-10).as_integer_ratio()
(-10, 1)
>>> (0).as_integer_ratio()
(0, 1)
is_integer()
Returns True. Exists for duck type compatibility with float.is_integer.
real
the real part of a complex number
imag
the imaginary part of a complex number
numerator
the numerator of a rational number in lowest terms
denominator
the denominator of a rational number in lowest terms
__init__(*args, **kwds)
class yandex_cloud_ml_sdk._search_api.enums.SortMode
Search results sorting mode rule
BY_RELEVANCE = 1
Sort documents by relevance (default value).
BY_TIME = 2
Sort documents by update time.
classmethod Unknown(name, value)
|
Parameters |
classmethod get_available()
|
Return type |
__new__(value)
conjugate()
Returns self, the complex conjugate of any int.
bit_length()
Number of bits necessary to represent self in binary.
>>> bin(37)
'0b100101'
>>> (37).bit_length()
6
bit_count()
Number of ones in the binary representation of the absolute value of self.
Also known as the population count.
>>> bin(13)
'0b1101'
>>> (13).bit_count()
3
as_integer_ratio()
Return a pair of integers, whose ratio is equal to the original int.
The ratio is in lowest terms and has a positive denominator.
>>> (10).as_integer_ratio()
(10, 1)
>>> (-10).as_integer_ratio()
(-10, 1)
>>> (0).as_integer_ratio()
(0, 1)
is_integer()
Returns True. Exists for duck type compatibility with float.is_integer.
real
the real part of a complex number
imag
the imaginary part of a complex number
numerator
the numerator of a rational number in lowest terms
denominator
the denominator of a rational number in lowest terms
__init__(*args, **kwds)
class yandex_cloud_ml_sdk._search_api.enums.GroupMode
Result grouping method.
FLAT = 1
Flat grouping. Each group contains a single document.
DEEP = 2
Grouping by domain. Each group contains documents from one domain.
classmethod Unknown(name, value)
|
Parameters |
classmethod get_available()
|
Return type |
__new__(value)
conjugate()
Returns self, the complex conjugate of any int.
bit_length()
Number of bits necessary to represent self in binary.
>>> bin(37)
'0b100101'
>>> (37).bit_length()
6
bit_count()
Number of ones in the binary representation of the absolute value of self.
Also known as the population count.
>>> bin(13)
'0b1101'
>>> (13).bit_count()
3
as_integer_ratio()
Return a pair of integers, whose ratio is equal to the original int.
The ratio is in lowest terms and has a positive denominator.
>>> (10).as_integer_ratio()
(10, 1)
>>> (-10).as_integer_ratio()
(-10, 1)
>>> (0).as_integer_ratio()
(0, 1)
is_integer()
Returns True. Exists for duck type compatibility with float.is_integer.
real
the real part of a complex number
imag
the imaginary part of a complex number
numerator
the numerator of a rational number in lowest terms
denominator
the denominator of a rational number in lowest terms
__init__(*args, **kwds)
class yandex_cloud_ml_sdk._search_api.enums.Localization
Maximum number of groups that can be returned per page.
RU = 1
UK = 2
BE = 3
KK = 4
TR = 5
EN = 6
classmethod Unknown(name, value)
|
Parameters |
classmethod get_available()
|
Return type |
__new__(value)
conjugate()
Returns self, the complex conjugate of any int.
bit_length()
Number of bits necessary to represent self in binary.
>>> bin(37)
'0b100101'
>>> (37).bit_length()
6
bit_count()
Number of ones in the binary representation of the absolute value of self.
Also known as the population count.
>>> bin(13)
'0b1101'
>>> (13).bit_count()
3
as_integer_ratio()
Return a pair of integers, whose ratio is equal to the original int.
The ratio is in lowest terms and has a positive denominator.
>>> (10).as_integer_ratio()
(10, 1)
>>> (-10).as_integer_ratio()
(-10, 1)
>>> (0).as_integer_ratio()
(0, 1)
is_integer()
Returns True. Exists for duck type compatibility with float.is_integer.
real
the real part of a complex number
imag
the imaginary part of a complex number
numerator
the numerator of a rational number in lowest terms
denominator
the denominator of a rational number in lowest terms
__init__(*args, **kwds)
class yandex_cloud_ml_sdk._search_api.enums.Format
Search result format
XML = 1
HTML = 2
classmethod Unknown(name, value)
|
Parameters |
classmethod get_available()
|
Return type |
__new__(value)
conjugate()
Returns self, the complex conjugate of any int.
bit_length()
Number of bits necessary to represent self in binary.
>>> bin(37)
'0b100101'
>>> (37).bit_length()
6
bit_count()
Number of ones in the binary representation of the absolute value of self.
Also known as the population count.
>>> bin(13)
'0b1101'
>>> (13).bit_count()
3
as_integer_ratio()
Return a pair of integers, whose ratio is equal to the original int.
The ratio is in lowest terms and has a positive denominator.
>>> (10).as_integer_ratio()
(10, 1)
>>> (-10).as_integer_ratio()
(-10, 1)
>>> (0).as_integer_ratio()
(0, 1)
is_integer()
Returns True. Exists for duck type compatibility with float.is_integer.
real
the real part of a complex number
imag
the imaginary part of a complex number
numerator
the numerator of a rational number in lowest terms
denominator
the denominator of a rational number in lowest terms
__init__(*args, **kwds)
class yandex_cloud_ml_sdk._search_api.enums.ImageFormat
JPEG = 1
JPG format.
GIF = 2
GIF format.
PNG = 3
PNG format.
classmethod Unknown(name, value)
|
Parameters |
classmethod get_available()
|
Return type |
__new__(value)
conjugate()
Returns self, the complex conjugate of any int.
bit_length()
Number of bits necessary to represent self in binary.
>>> bin(37)
'0b100101'
>>> (37).bit_length()
6
bit_count()
Number of ones in the binary representation of the absolute value of self.
Also known as the population count.
>>> bin(13)
'0b1101'
>>> (13).bit_count()
3
as_integer_ratio()
Return a pair of integers, whose ratio is equal to the original int.
The ratio is in lowest terms and has a positive denominator.
>>> (10).as_integer_ratio()
(10, 1)
>>> (-10).as_integer_ratio()
(-10, 1)
>>> (0).as_integer_ratio()
(0, 1)
is_integer()
Returns True. Exists for duck type compatibility with float.is_integer.
real
the real part of a complex number
imag
the imaginary part of a complex number
numerator
the numerator of a rational number in lowest terms
denominator
the denominator of a rational number in lowest terms
__init__(*args, **kwds)
class yandex_cloud_ml_sdk._search_api.enums.ImageOrientation
VERTICAL = 1
Horizontal orientation.
HORIZONTAL = 2
Vertical orientation.
SQUARE = 3
Square aspect ratio.
classmethod Unknown(name, value)
|
Parameters |
classmethod get_available()
|
Return type |
__new__(value)
conjugate()
Returns self, the complex conjugate of any int.
bit_length()
Number of bits necessary to represent self in binary.
>>> bin(37)
'0b100101'
>>> (37).bit_length()
6
bit_count()
Number of ones in the binary representation of the absolute value of self.
Also known as the population count.
>>> bin(13)
'0b1101'
>>> (13).bit_count()
3
as_integer_ratio()
Return a pair of integers, whose ratio is equal to the original int.
The ratio is in lowest terms and has a positive denominator.
>>> (10).as_integer_ratio()
(10, 1)
>>> (-10).as_integer_ratio()
(-10, 1)
>>> (0).as_integer_ratio()
(0, 1)
is_integer()
Returns True. Exists for duck type compatibility with float.is_integer.
real
the real part of a complex number
imag
the imaginary part of a complex number
numerator
the numerator of a rational number in lowest terms
denominator
the denominator of a rational number in lowest terms
__init__(*args, **kwds)
class yandex_cloud_ml_sdk._search_api.enums.ImageSize
ENORMOUS = 1
Very large images (larger than 1,600 × 1,200 pixels).
LARGE = 2
Large images (from 800 × 600 to 1,600 × 1,200 pixels).
MEDIUM = 3
Medium images (from 150 × 150 to 800 × 600 pixels).
SMALL = 4
Small images (from 32 × 32 to 150 × 150 pixels).
TINY = 5
Icons (up to 32 × 32 pixels).
WALLPAPER = 6
Desktop wallpapers.
classmethod Unknown(name, value)
|
Parameters |
classmethod get_available()
|
Return type |
__new__(value)
conjugate()
Returns self, the complex conjugate of any int.
bit_length()
Number of bits necessary to represent self in binary.
>>> bin(37)
'0b100101'
>>> (37).bit_length()
6
bit_count()
Number of ones in the binary representation of the absolute value of self.
Also known as the population count.
>>> bin(13)
'0b1101'
>>> (13).bit_count()
3
as_integer_ratio()
Return a pair of integers, whose ratio is equal to the original int.
The ratio is in lowest terms and has a positive denominator.
>>> (10).as_integer_ratio()
(10, 1)
>>> (-10).as_integer_ratio()
(-10, 1)
>>> (0).as_integer_ratio()
(0, 1)
is_integer()
Returns True. Exists for duck type compatibility with float.is_integer.
real
the real part of a complex number
imag
the imaginary part of a complex number
numerator
the numerator of a rational number in lowest terms
denominator
the denominator of a rational number in lowest terms
__init__(*args, **kwds)
class yandex_cloud_ml_sdk._search_api.enums.ImageColor
COLOR = 1
Color images.
GRAYSCALE = 2
Black and white images.
RED = 3
Red is the main color of the image.
ORANGE = 4
Orange is the main color of the image.
YELLOW = 5
Yellow is the main color of the image.
GREEN = 6
Green is the main color of the image.
CYAN = 7
Cyan is the main color of the image.
BLUE = 8
Blue is the main color of the image.
VIOLET = 9
Violet is the main color of the image.
WHITE = 10
White is the main color of the image.
BLACK = 11
Black is the main color of the image.
classmethod Unknown(name, value)
|
Parameters |
classmethod get_available()
|
Return type |
__new__(value)
conjugate()
Returns self, the complex conjugate of any int.
bit_length()
Number of bits necessary to represent self in binary.
>>> bin(37)
'0b100101'
>>> (37).bit_length()
6
bit_count()
Number of ones in the binary representation of the absolute value of self.
Also known as the population count.
>>> bin(13)
'0b1101'
>>> (13).bit_count()
3
as_integer_ratio()
Return a pair of integers, whose ratio is equal to the original int.
The ratio is in lowest terms and has a positive denominator.
>>> (10).as_integer_ratio()
(10, 1)
>>> (-10).as_integer_ratio()
(-10, 1)
>>> (0).as_integer_ratio()
(0, 1)
is_integer()
Returns True. Exists for duck type compatibility with float.is_integer.
real
the real part of a complex number
imag
the imaginary part of a complex number
numerator
the numerator of a rational number in lowest terms
denominator
the denominator of a rational number in lowest terms
__init__(*args, **kwds)