Yandex Cloud
Search
Contact UsGet started
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • AI for business
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
© 2025 Direct Cursus Technology L.L.C.
Yandex AI Studio
    • About Yandex AI Studio
    • Yandex Workflows
    • Quotas and limits
    • Terms and definitions
  • Compatibility with OpenAI
  • Access management
  • Pricing policy
  • Audit Trails events
  • Public materials
  • Release notes

In this article:

  • class yandex_cloud_ml_sdk._sdk.BaseSDK
  • class yandex_cloud_ml_sdk._types.domain.BaseDomain
  • class yandex_cloud_ml_sdk._types.model.BaseModel
  • class yandex_cloud_ml_sdk._types.model_config.BaseModelConfig
  • class yandex_cloud_ml_sdk._auth.BaseAuth
  • class yandex_cloud_ml_sdk._tools.domain.BaseTools
  • class yandex_cloud_ml_sdk._tools.function.BaseFunctionTools
  • class yandex_cloud_ml_sdk._tools.tool.BaseTool
  • class yandex_cloud_ml_sdk._tools.tool_call.BaseToolCall
  • class yandex_cloud_ml_sdk._tools.tool_call_list.ToolCallList
  • class yandex_cloud_ml_sdk._tools.function_call.BaseFunctionCall
  • class yandex_cloud_ml_sdk._models.BaseModels
  • class yandex_cloud_ml_sdk._models.completions.function.BaseCompletions
  • class yandex_cloud_ml_sdk._models.completions.model.BaseGPTModel
  • class yandex_cloud_ml_sdk._models.text_classifiers.function.BaseTextClassifiers
  • class yandex_cloud_ml_sdk._models.text_embeddings.function.BaseTextEmbeddings
  • class yandex_cloud_ml_sdk._models.image_generation.function.BaseImageGeneration
  • class yandex_cloud_ml_sdk._threads.domain.BaseThreads
  • class yandex_cloud_ml_sdk._threads.thread.BaseThread
  • class yandex_cloud_ml_sdk._files.domain.BaseFiles
  • class yandex_cloud_ml_sdk._files.file.BaseFile
  • class yandex_cloud_ml_sdk._assistants.domain.BaseAssistants
  • class yandex_cloud_ml_sdk._assistants.assistant.BaseAssistant
  • class yandex_cloud_ml_sdk._runs.domain.BaseRuns
  • class yandex_cloud_ml_sdk._runs.run.BaseRun
  • class yandex_cloud_ml_sdk._search_api.domain.BaseSearchAPIDomain
  • class yandex_cloud_ml_sdk._search_api.generative.function.BaseGenerativeSearchFunction
  • class yandex_cloud_ml_sdk._search_api.generative.generative.BaseGenerativeSearch
  • class yandex_cloud_ml_sdk._search_indexes.domain.BaseSearchIndexes
  • class yandex_cloud_ml_sdk._search_indexes.search_index.BaseSearchIndex
  • class yandex_cloud_ml_sdk._datasets.domain.BaseDatasets
  • class yandex_cloud_ml_sdk._datasets.dataset.BaseDataset
  • class yandex_cloud_ml_sdk._datasets.draft.BaseDatasetDraft
  • class yandex_cloud_ml_sdk._tuning.domain.BaseTuning
  • class yandex_cloud_ml_sdk._types.batch.domain.BaseBatchSubdomain
  • class yandex_cloud_ml_sdk._messages.base.BaseMessage
  • class yandex_cloud_ml_sdk._batch.domain.BaseBatch
  • class yandex_cloud_ml_sdk._types.batch.operation.BaseBatchTaskOperation
  • class yandex_cloud_ml_sdk._chat.BaseChat
  • class yandex_cloud_ml_sdk._chat.completions.function.BaseChatCompletions
  • class yandex_cloud_ml_sdk._chat.completions.model.BaseChatModel
  • class yandex_cloud_ml_sdk._chat.text_embeddings.function.BaseChatEmbeddings
  • class yandex_cloud_ml_sdk._chat.text_embeddings.model.BaseChatEmbeddingsModel
  • class yandex_cloud_ml_sdk._search_api.web.function.BaseWebSearchFunction
  • class yandex_cloud_ml_sdk._search_api.image.function.BaseImageSearchFunction
  • class yandex_cloud_ml_sdk._search_api.by_image.function.BaseByImageSearchFunction

Base classes

Written by
Yandex Cloud
Updated at November 7, 2025
  • class yandex_cloud_ml_sdk._sdk.BaseSDK
  • class yandex_cloud_ml_sdk._types.domain.BaseDomain
  • class yandex_cloud_ml_sdk._types.model.BaseModel
  • class yandex_cloud_ml_sdk._types.model_config.BaseModelConfig
  • class yandex_cloud_ml_sdk._auth.BaseAuth
  • class yandex_cloud_ml_sdk._tools.domain.BaseTools
  • class yandex_cloud_ml_sdk._tools.function.BaseFunctionTools
  • class yandex_cloud_ml_sdk._tools.tool.BaseTool
  • class yandex_cloud_ml_sdk._tools.tool_call.BaseToolCall
  • class yandex_cloud_ml_sdk._tools.tool_call_list.ToolCallList
  • class yandex_cloud_ml_sdk._tools.function_call.BaseFunctionCall
  • class yandex_cloud_ml_sdk._models.BaseModels
  • class yandex_cloud_ml_sdk._models.completions.function.BaseCompletions
  • class yandex_cloud_ml_sdk._models.completions.model.BaseGPTModel
  • class yandex_cloud_ml_sdk._models.text_classifiers.function.BaseTextClassifiers
  • class yandex_cloud_ml_sdk._models.text_embeddings.function.BaseTextEmbeddings
  • class yandex_cloud_ml_sdk._models.image_generation.function.BaseImageGeneration
  • class yandex_cloud_ml_sdk._threads.domain.BaseThreads
  • class yandex_cloud_ml_sdk._threads.thread.BaseThread
  • class yandex_cloud_ml_sdk._files.domain.BaseFiles
  • class yandex_cloud_ml_sdk._files.file.BaseFile
  • class yandex_cloud_ml_sdk._assistants.domain.BaseAssistants
  • class yandex_cloud_ml_sdk._assistants.assistant.BaseAssistant
  • class yandex_cloud_ml_sdk._runs.domain.BaseRuns
  • class yandex_cloud_ml_sdk._runs.run.BaseRun
  • class yandex_cloud_ml_sdk._search_api.domain.BaseSearchAPIDomain
  • class yandex_cloud_ml_sdk._search_api.generative.function.BaseGenerativeSearchFunction
  • class yandex_cloud_ml_sdk._search_api.generative.generative.BaseGenerativeSearch
  • class yandex_cloud_ml_sdk._search_indexes.domain.BaseSearchIndexes
  • class yandex_cloud_ml_sdk._search_indexes.search_index.BaseSearchIndex
  • class yandex_cloud_ml_sdk._datasets.domain.BaseDatasets
  • class yandex_cloud_ml_sdk._datasets.dataset.BaseDataset
  • class yandex_cloud_ml_sdk._datasets.draft.BaseDatasetDraft
  • class yandex_cloud_ml_sdk._tuning.domain.BaseTuning
  • class yandex_cloud_ml_sdk._types.batch.domain.BaseBatchSubdomain
  • class yandex_cloud_ml_sdk._messages.base.BaseMessage
  • class yandex_cloud_ml_sdk._batch.domain.BaseBatch
  • class yandex_cloud_ml_sdk._types.batch.operation.BaseBatchTaskOperation
  • class yandex_cloud_ml_sdk._chat.BaseChat
  • class yandex_cloud_ml_sdk._chat.completions.function.BaseChatCompletions
  • class yandex_cloud_ml_sdk._chat.completions.model.BaseChatModel
  • class yandex_cloud_ml_sdk._chat.text_embeddings.function.BaseChatEmbeddings
  • class yandex_cloud_ml_sdk._chat.text_embeddings.model.BaseChatEmbeddingsModel
  • class yandex_cloud_ml_sdk._search_api.web.function.BaseWebSearchFunction
  • class yandex_cloud_ml_sdk._search_api.image.function.BaseImageSearchFunction
  • class yandex_cloud_ml_sdk._search_api.by_image.function.BaseByImageSearchFunction

class yandexcloudmlsdk.sdk.BaseSDKclass yandex_cloud_ml_sdk._sdk.BaseSDK

The main class that needs to be instantiated to work with SDK.

tools: BaseTools

Domain for creating various tools for assistants and function calling

models: BaseModels

Domain for working with models (inference and tuning)

threads: BaseThreads

Domain for working with threads (a part of the Assistants API)

files: BaseFiles

Domain for working with files (a part of the Asssistants API)

assistants: BaseAssistants

Domain for working with assistants (a part of the Assistants API)

runs: BaseRuns

Domain for working with assistants’ runs (a part of the Assistants API)

search_api: BaseSearchAPIDomain

Domain for working with Search API

search_indexes: BaseSearchIndexes

Domain for working with search indexes (a part of the Assistants API)

datasets: BaseDatasets

Domain for working with datasets

tuning: BaseTuning

Domain for working with tuning

batch: BaseBatch

Domain for working with batch tasks

chat: BaseChat

Domain for working with Yandex Cloud OpenAI Compatible API_BaseSDK_URL.

setup_default_logging(log_level='INFO', log_format='[%(levelname)1.1s %(asctime)s %(name)s:%(lineno)d] %(message)s', date_format='%Y-%m-%d %H:%M:%S')

Sets up the default logging configuration.

Read more about log_levels, log_format, and date_format in Python documentation (logging).

Parameters

  • log_level (Literal['CRITICAL', 'FATAL', 'ERROR', 'WARN', 'WARNING', 'INFO', 'DEBUG', 'TRACE'] | ~typing.Literal['critical', 'fatal', 'error', 'warn', 'warning', 'info', 'debug', 'TRACE'] | int) – The logging level to set.
  • log_format (str) – The format of the log messages.
  • date_format (str) – The format for timestamps in log messages.

Returns

The instance of the SDK with logging configured.

Return type

Self

class yandexcloudmlsdk.types.domain.BaseDomainclass yandex_cloud_ml_sdk._types.domain.BaseDomain

class yandexcloudmlsdk.types.model.BaseModelclass yandex_cloud_ml_sdk._types.model.BaseModel

property uri: str

property config: ConfigTypeT

configure(**kwargs)

Return type

Self

class yandexcloudmlsdk.types.modelconfig.BaseModelConfigclass yandex_cloud_ml_sdk._types.model_config.BaseModelConfig

BaseModelConfig()

class yandexcloudmlsdk.auth.BaseAuthclass yandex_cloud_ml_sdk._auth.BaseAuth

Abstract base class for authentication methods.

This class defines the interface for obtaining authentication metadata and checking if the authentication method is applicable from environment variables.

class yandexcloudmlsdk.tools.domain.BaseToolsclass yandex_cloud_ml_sdk._tools.domain.BaseTools

property function: FunctionToolsTypeT

property rephraser: RephraserFunction

search_index(indexes, *, max_num_results=Undefined, rephraser=Undefined, call_strategy=Undefined)

Creates SearchIndexTool (not to be confused with SearchIndex/AsyncSearchIndex).

Parameters

  • indexes (str | BaseSearchIndex | Iterable[BaseSearchIndex] | Iterable[str]) – parameter takes BaseSearchIndex, string with search index id, or a list of this values in any combination.
  • max_num_results (int | Undefined) – the maximum number of results to return from the search. Fewer results may be returned if necessary to fit within the prompt’s token limit. This ensures that the combined prompt and search results do not exceed the token constraints.
  • rephraser (str | Literal[True] | ~yandex_cloud_ml_sdk._tools.search_index.rephraser.model.Rephraser | ~yandex_cloud_ml_sdk._types.misc.Undefined) – setting for rephrasing user queries; refer to Rephraser documentation for details.
  • call_strategy (Literal['always'] | ~yandex_cloud_ml_sdk._types.tools.function.FunctionDictType | ~yandex_cloud_ml_sdk._tools.search_index.call_strategy.CallStrategy | ~yandex_cloud_ml_sdk._types.misc.Undefined)

Return type

SearchIndexTool

generative_search(*, description, site=Undefined, host=Undefined, url=Undefined, enable_nrfm_docs=Undefined, search_filters=Undefined)

Creates GeberativeSearch tool which provide access to generative search by Search API for LLMs.

Not to be confused with sdk.search_api.generative. Tools domain is for creating tools for using in LLMs/Assistants and search_api domain is for using Search API directly.

To learn more about parameters and their formats and possible values, refer to generative search documentation

NB: All of the site, host, url parameters are mutually exclusive.

Parameters

  • site (str | Sequence[str] | Undefined) – parameter for limiting search to specific location or list of sites.
  • host (str | Sequence[str] | Undefined) – parameter for limiting search to specific location or list of hosts.
  • url (str | Sequence[str] | Undefined) – parameter for limiting search to specific location or list of URLs.
  • enable_nrfm_docs (bool | Undefined) – 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 (Sequence[DateFilterType | FormatFilterType | LangFilterType] | DateFilterType | FormatFilterType | LangFilterType | Undefined) – allows to limit search results with additional filters.
>>> date_filter = {'date': '<20250101'}
>>> format_filter = {'format': 'doc'}
>>> lang_filter = {'lang': 'ru'}
>>> tool = sdk.tools.generative_search(
...     search_filters=[date_filter, format_filter, lang_filter],
...     description="description when model should call a tool"
... )
  • description (str)

Return type

GenerativeSearchTool

class yandexcloudmlsdk.tools.function.BaseFunctionToolsclass yandex_cloud_ml_sdk._tools.function.BaseFunctionTools

__call__(parameters, *, name=Undefined, description=Undefined, strict=Undefined)

Call self as a function.

Parameters

  • parameters (dict[str, None | bool | str | float | int | TypeAliasForwardRef('yandex_cloud_ml_sdk._types.schemas.JsonArray') | dict[str, None | bool | str | float | int | TypeAliasForwardRef('yandex_cloud_ml_sdk._types.schemas.JsonArray') | JsonObject]] | type)
  • name (str | Undefined)
  • description (str | Undefined)
  • strict (bool | Undefined)

Return type

FunctionTool

class yandexcloudmlsdk.tools.tool.BaseToolclass yandex_cloud_ml_sdk._tools.tool.BaseTool

class yandexcloudmlsdk.tools.toolcall.BaseToolCallclass yandex_cloud_ml_sdk._tools.tool_call.BaseToolCall

BaseToolCall(id: ‘str | None’, function: ‘FunctionCallTypeT | None’, _proto_origin: ‘ProtoToolCall | None’, _json_origin: ‘JsonObject | None’)

id: str | None

function: FunctionCallTypeT | None

class yandexcloudmlsdk.tools.toolcalllist.ToolCallListclass yandex_cloud_ml_sdk._tools.tool_call_list.ToolCallList

ToolCallList(tool_calls: ‘tuple[ToolCallTypeT, …]’, _proto_origin: ‘ProtoToolCallListTypeT’)

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.

tool_calls: tuple[ToolCallTypeT]... ,

class yandexcloudmlsdk.tools.functioncall.BaseFunctionCallclass yandex_cloud_ml_sdk._tools.function_call.BaseFunctionCall

BaseFunctionCall(name: ‘str’, arguments: ‘JsonObject’, _proto_origin: ‘ProtoFunctionCall | None’)

name: str

arguments: JsonObject

class yandexcloudmlsdk.models.BaseModelsclass yandex_cloud_ml_sdk._models.BaseModels

Domain for working with Yandex Foundation Models.

completions: BaseCompletions

text_classifiers: BaseTextClassifiers

image_generation: BaseImageGeneration

text_embeddings: BaseTextEmbeddings

class yandexcloudmlsdk.models.completions.function.BaseCompletionsclass yandex_cloud_ml_sdk._models.completions.function.BaseCompletions

A class for handling completions models.

It defines the core functionality for calling a model to generate completions based on the provided model name and version.

__call__(model_name, *, model_version='latest')

Create a model object to call for generating completions.

This method constructs the URI for the model based on the provided name and version. If the name contains ://, it is treated as a full URI. Otherwise, it looks up the model name in the well-known names dictionary. But after this, in any case, we construct a URI in the form gpt://<folder_id>//.

Parameters

  • model_name (str) – the name or URI of the model to call.
  • model_version (str) – the version of the model to use. Defaults to ‘latest’.

Return type

ModelTypeT

class yandexcloudmlsdk.models.completions.model.BaseGPTModelclass yandex_cloud_ml_sdk._models.completions.model.BaseGPTModel

A class for GPT models providing various functionalities including tuning, and batch processing.

langchain(model_type='chat', timeout=60)

Initializes a langchain model based on the specified model type.

Parameters

  • model_type (Literal['chat']) – the type of langchain model to initialize. Defaults to "chat".
  • timeout (int) – the timeout which sets the default for the langchain model object. Defaults to 60 seconds.

Return type

BaseYandexLanguageModel

configure(*, temperature=Undefined, max_tokens=Undefined, reasoning_mode=Undefined, response_format=Undefined, tools=Undefined, parallel_tool_calls=Undefined, tool_choice=Undefined)

Configures the model with specified parameters.

Parameters

  • temperature (float | Undefined) – a sampling temperature to use - higher values mean more random results. Should be a double number between 0 (inclusive) and 1 (inclusive).
  • max_tokens (int | Undefined) – a maximum number of tokens to generate in the response.
  • reasoning_mode (int | str | ReasoningMode | Undefined) – the mode of reasoning to apply during generation, allowing the model to perform internal reasoning before responding. Read more about possible modes in the reasoning documentation.
  • response_format (Literal['json'] | ~yandex_cloud_ml_sdk._types.schemas.JsonSchemaResponseType | type | ~yandex_cloud_ml_sdk._types.misc.Undefined) – a format of the response returned by the model. Could be a JsonSchema, a JSON string, or a pydantic model. Read more about possible response formats in the structured output documentation_BaseGPTModel_URL.
  • tools (Sequence[FunctionTool] | FunctionTool | Undefined) – tools to use for completion. Can be a sequence or a single tool.
  • parallel_tool_calls (bool | Undefined) – whether to allow parallel calls to tools during completion. Defaults to true.
  • tool_choice (Literal['none', 'None', 'NONE', 'auto', 'Auto', 'AUTO', 'required', 'Required', 'REQUIRED'] | ~yandex_cloud_ml_sdk._types.tools.function.FunctionDictType | ~yandex_cloud_ml_sdk._tools.tool.FunctionTool | ~yandex_cloud_ml_sdk._types.misc.Undefined) – the strategy for choosing tools. There are several ways to configure tool_choice for query processing: - no tools to call (tool_choice='none'); - required to call any tool (tool_choice='required'); - call a specific tool (tool_choice={'type': 'function', 'function': {'name': 'another_calculator'}} or directly passing a tool object).

Returns

new model instance with provided configuration.

Return type

Self

property batch: BatchSubdomainTypeT

property config: ConfigTypeT

property uri: str

class yandexcloudmlsdk.models.textclassifiers.function.BaseTextClassifiersclass yandex_cloud_ml_sdk._models.text_classifiers.function.BaseTextClassifiers

A class for text classifiers.

It provides a common interface for text classification models and constructs the model URI based on the provided model name and version.

__call__(model_name, *, model_version='latest')

Call the text classification model.

Constructs the URI for the model based on the provided model’s name and version. If the name contains ://, it is treated as a complete URI. Otherwise, it looks up the model name in the well-known names dictionary. But after this, in any case, we construct a URI in the form cls://<folder_id>//.

Parameters

  • model_name (str) – the name or URI of the model to call.
  • model_version (str) – the version of the model to be used. Defaults to ‘latest’.

class yandexcloudmlsdk.models.textembeddings.function.BaseTextEmbeddingsclass yandex_cloud_ml_sdk._models.text_embeddings.function.BaseTextEmbeddings

A class for text embeddings models.

It provides the functionality to call a text embeddings model either by a well-known name or a full URI.

__call__(model_name, *, model_version='latest')

Call the specified model for text embeddings. It returns an instance of the specified type of the model.

This method constructs the URI for the model based on the provided name and version. If the name contains ://, it is treated as a full URI. Otherwise, it looks up the model name in the well-known names dictionary. But after this, in any case, we construct a URI in the form emb://<folder_id>//.

Parameters

  • model_name (str) – the name or URI of the model to call.
  • model_version (str) – the version of the model to use. Defaults to ‘latest’.

class yandexcloudmlsdk.models.imagegeneration.function.BaseImageGenerationclass yandex_cloud_ml_sdk._models.image_generation.function.BaseImageGeneration

A class for image generation models.

It provides the functionality to call an image generation model by constructing the appropriate URI based on the provided model name and version.

Returns a model’s object through which requests to the backend are made.

>>> model = sdk.models.image_generation('yandex-art')  # this is how the model is created

__call__(model_name, *, model_version='latest')

Call the image generation model with the specified name and version.

Constructs the URI for the model based on the provided model’s name and version. If the name contains ://, it is treated as a complete URI. Otherwise, it looks up the model name in the well-known names dictionary. But after this, in any case, we construct a URI in the form art://<folder_id>//.

Parameters

  • model_name (str) – the name or URI of the model to call.
  • model_version (str) – the version of the model to use. Defaults to ‘latest’.

class yandexcloudmlsdk.threads.domain.BaseThreadsclass yandex_cloud_ml_sdk._threads.domain.BaseThreads

A class for managing threads. It is a part of Assistants API.

This class provides methods to create, retrieve, and list threads.

class yandexcloudmlsdk.threads.thread.BaseThreadclass yandex_cloud_ml_sdk._threads.thread.BaseThread

A class for a thread resource.

It provides methods for working with messages that the thread contains (e.g. updating, deleting, writing to, and reading from).

expiration_config: ExpirationConfig

id: str

class yandexcloudmlsdk.files.domain.BaseFilesclass yandex_cloud_ml_sdk._files.domain.BaseFiles

Files domain, which contains API for working with files.

Files is a part of Assistants API, which is the only place you could use it. Provides upload, get and list methods that allow you to work with remote file objects you created earlier.

class yandexcloudmlsdk.files.file.BaseFileclass yandex_cloud_ml_sdk._files.file.BaseFile

BaseFile(id: ‘str’, _sdk: ‘BaseSDK’, _lock: ‘asyncio.Lock’, _deleted: ‘bool’, expiration_config: ‘ExpirationConfig’)

expiration_config: ExpirationConfig

id: str

class yandexcloudmlsdk.assistants.domain.BaseAssistantsclass yandex_cloud_ml_sdk._assistants.domain.BaseAssistants

Base class for assistants management.

Provides common functionality for creating, getting and listing assistants.

class yandexcloudmlsdk.assistants.assistant.BaseAssistantclass yandex_cloud_ml_sdk._assistants.assistant.BaseAssistant

BaseAssistant(id: ‘str’, _sdk: ‘BaseSDK’, _lock: ‘asyncio.Lock’, _deleted: ‘bool’, expiration_config: ‘ExpirationConfig’, model: ‘BaseGPTModel’, instruction: ‘str | None’, prompt_truncation_options: ‘PromptTruncationOptions’, tools: ‘tuple[BaseTool, …]’, response_format: ‘ResponseType | None’)

expiration_config: ExpirationConfig

Expiration configuration for the assistant.

model: BaseGPTModel

The GPT model used by the assistant.

instruction: str | None

Instructions or guidelines that the assistant should follow. These instructions guide the assistant’s behavior and responses.

prompt_truncation_options: PromptTruncationOptions

Options for truncating thread messages. Controls how messages are truncated when forming the prompt.

tools: tuple[BaseTool]... ,

Tools available to the assistant. Can be a sequence or a single tool. Tools must implement BaseTool interface.

response_format: ResponseType | None

A format of the response returned by the model. Could be a JsonSchema, a JSON string, or a pydantic model

property max_prompt_tokens: int | None

Returns the maximum number of prompt tokens allowed for the assistant.

id: str

class yandexcloudmlsdk.runs.domain.BaseRunsclass yandex_cloud_ml_sdk._runs.domain.BaseRuns

Class for Runs operations. Provides core functionality for managing assistant execution in streams.

For usage examples see runs example.

class yandexcloudmlsdk.runs.run.BaseRunclass yandex_cloud_ml_sdk._runs.run.BaseRun

BaseRun(id: ‘str’, _sdk: ‘BaseSDK’, assistant_id: ‘str’, thread_id: ‘str’, created_by: ‘str’, created_at: ‘datetime’, labels: ‘dict[str, str] | None’, custom_temperature: ‘float | None’, custom_max_tokens: ‘int | None’, custom_prompt_truncation_options: ‘PromptTruncationOptions | None’, custom_response_format: ‘ResponseType | None’)

id: str

Unique run identifier

assistant_id: str

ID of the assistant used

thread_id: str

ID of the thread used

created_by: str

Creator of the run

created_at: datetime

Creation timestamp

labels: dict[str, str] | None

Optional metadata labels

custom_temperature: float | None

Custom temperature setting

custom_max_tokens: int | None

Custom max tokens setting

custom_prompt_truncation_options: PromptTruncationOptions | None

Custom prompt truncation options

custom_response_format: ResponseType | None

Custom response format

property custom_max_prompt_tokens: int | None

Get max prompt tokens from truncation options if set.

class yandexcloudmlsdk.searchapi.domain.BaseSearchAPIDomainclass yandex_cloud_ml_sdk._search_api.domain.BaseSearchAPIDomain

Domain for working with Yandex Search API services.

generative: BaseGenerativeSearchFunction

API for generative response service

web: BaseWebSearchFunction

API for web search service

image: BaseImageSearchFunction

API for text image search service

by_image: BaseByImageSearchFunction

API for search by image service

class yandexcloudmlsdk.searchapi.generative.function.BaseGenerativeSearchFunctionclass yandex_cloud_ml_sdk._search_api.generative.function.BaseGenerativeSearchFunction

Generative search function for creating search object which provides methods for invoking generative search.

__call__(*, site=Undefined, host=Undefined, url=Undefined, fix_misspell=Undefined, enable_nrfm_docs=Undefined, search_filters=Undefined)

Creates generative search object which provides methods for invoking generative search.

Not to be confused with sdk.tools.generative_search. Tools domain is for creating tools for using in LLMs/Assistants and search_api domain is for using Search API directly.

To learn more about parameters and their formats and possible values, refer to generative search documentation

NB: All of the site, host, url parameters are mutually exclusive.

Parameters

  • site (str | Sequence[str] | Undefined) – parameter for limiting search to specific location or list of sites.
  • host (str | Sequence[str] | Undefined) – parameter for limiting search to specific location or list of hosts.
  • url (str | Sequence[str] | Undefined) – parameter for limiting search to specific location or list of URLs.
  • fix_misspell (bool | Undefined) – tells to backend to fix or not to fix misspels in queries.
  • enable_nrfm_docs (bool | Undefined) – 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 (Sequence[DateFilterType | FormatFilterType | LangFilterType] | DateFilterType | FormatFilterType | LangFilterType | Undefined) – allows to limit search results with additional filters.
>>> date_filter = {'date': '<20250101'}
>>> format_filter = {'format': 'doc'}
>>> lang_filter = {'lang': 'ru'}
>>> search = sdk.search_api.generative(search_filters=[date_filter, format_filter, lang_filter])

Return type

GenerativeSearchTypeT

property available_formats

class yandexcloudmlsdk.searchapi.generative.generative.BaseGenerativeSearchclass yandex_cloud_ml_sdk._search_api.generative.generative.BaseGenerativeSearch

Generative search class which provides concrete methods for working with Search API and incapsulates search setting.

configure(*, site=Undefined, host=Undefined, url=Undefined, fix_misspell=Undefined, enable_nrfm_docs=Undefined, search_filters=Undefined)

Returns the new object with config fields overrode by passed values.

To learn more about parameters and their formats and possible values, refer to generative search documentation

NB: All of the site, host, url parameters are mutually exclusive and using one of them is mandatory.

Parameters

  • site (str | Sequence[str] | Undefined | None) – parameter for limiting search to specific location or list of sites.
  • host (str | Sequence[str] | Undefined | None) – parameter for limiting search to specific location or list of hosts.
  • url (str | Sequence[str] | Undefined | None) – parameter for limiting search to specific location or list of URLs.
  • fix_misspell (bool | Undefined | None) – tells to backend to fix or not to fix misspels in queries.
  • enable_nrfm_docs (bool | Undefined | None) – 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 (Sequence[DateFilterType | FormatFilterType | LangFilterType] | DateFilterType | FormatFilterType | LangFilterType | Undefined | None) – allows to limit search results with additional filters.
>>> date_filter = {'date': '<20250101'}
>>> format_filter = {'format': 'doc'}
>>> lang_filter = {'lang': 'ru'}
>>> search = sdk.search_api.generative(search_filters=[date_filter, format_filter, lang_filter])

Return type

Self

as_tool(description)

Converts generative search instance to GenerativeSearchTool object which is eligible to use as tools in LLMs/Assistants.

Parameters

description (str) – description of tool instance which also instructs model when to call it.

Return type

GenerativeSearchTool

property config: ConfigTypeT

property uri: str

class yandexcloudmlsdk.searchindexes.domain.BaseSearchIndexesclass yandex_cloud_ml_sdk._search_indexes.domain.BaseSearchIndexes

A class for search indexes. It is a part of Assistants API and it provides the foundation for creating and managing search indexes.

class yandexcloudmlsdk.searchindexes.searchindex.BaseSearchIndexclass yandex_cloud_ml_sdk._search_indexes.search_index.BaseSearchIndex

This class represents a search index with associated operations.

expiration_config: ExpirationConfig

id: str

class yandexcloudmlsdk.datasets.domain.BaseDatasetsclass yandex_cloud_ml_sdk._datasets.domain.BaseDatasets

This class provides methods to create and manage datasets of a specific type.

completions

a helper for autocompletion text-to-text generation tasks

text_classifiers_multilabel

a helper for autocompletion multilabel text classification tasks

text_classifiers_multiclass

a helper for autocompletion multiclass text classification tasks

text_classifiers_binary

a helper for autocompletion binary text classification tasks

text_embeddings_pair

a helper for autocompletion pairwise text embeddings tasks

text_embeddings_triplet

a helper for autocompletion triplet text embeddings tasks

draft_from_path(path, *, task_type=Undefined, upload_format=Undefined, name=Undefined, description=Undefined, metadata=Undefined, labels=Undefined, allow_data_logging=Undefined)

Create a new dataset draft from a specified path.

Parameters

  • path (str | PathLike) – the path to the data file or directory.
  • task_type (str | Undefined) – the type of task for the dataset.
  • upload_format (str | Undefined) – the format in which the data should be uploaded.
  • name (str | Undefined) – the name of the dataset.
  • description (str | Undefined) – a description of the dataset.
  • metadata (str | Undefined) – metadata associated with the dataset.
  • labels (dict[str, str] | Undefined) – a set of labels for the dataset.
  • allow_data_logging (bool | Undefined) – a flag indicating if data logging is allowed.

Return type

DatasetDraftT

class yandexcloudmlsdk.datasets.dataset.BaseDatasetclass yandex_cloud_ml_sdk._datasets.dataset.BaseDataset

This class represents methods for operating with datasets.

folder_id: str

the ID of the folder which contains the dataset

name: str | None

the name of the dataset

description: str | None

a description of the dataset

metadata: str | None

metadata associated with the dataset

created_by: str

the user who created the dataset

created_at: datetime

the timestamp when the dataset was created

updated_at: datetime

the timestamp when the dataset was last updated

labels: dict[str, str] | None

a dictionary of labels associated with the dataset

allow_data_logging: bool

indicates if data logging is allowed for this dataset

status: DatasetStatus

the current status of the dataset

task_type: str

the type of task associated with the dataset

rows: int

the number of rows in the dataset

size_bytes: int

the size of the dataset in bytes

validation_errors: tuple[ValidationErrorInfo]... ,

a tuple of validation errors associated with the dataset

id: str

class yandexcloudmlsdk.datasets.draft.BaseDatasetDraftclass yandex_cloud_ml_sdk._datasets.draft.BaseDatasetDraft

This class allows users to create a draft representation of a dataset without immediately interacting with the server. This draft serves as a structure for storing configuration settings, enabling users to edit the dataset’s properties before finalizing the upload.

task_type: str | None = None

the type of task associated with the dataset

path: PathLike | None = None

the file path to the dataset

upload_format: str | None = None

the format in which the dataset will be uploaded

name: str | None = None

the name of the dataset

description: str | None = None

a description of the dataset

metadata: str | None = None

metadata associated with the dataset

labels: dict[str, str] | None = None

labels for categorizing the dataset

allow_data_logging: bool | None = None

a flag indicating if iyt is allowed to use the dataset to improve the models quality. Default false.

configure(**kwargs)

Parameters

kwargs (Any)

Return type

Self

validate()

Return type

None

class yandexcloudmlsdk.tuning.domain.BaseTuningclass yandex_cloud_ml_sdk._tuning.domain.BaseTuning

class yandexcloudmlsdk.types.batch.domain.BaseBatchSubdomainclass yandex_cloud_ml_sdk._types.batch.domain.BaseBatchSubdomain

class yandexcloudmlsdk.messages.base.BaseMessageclass yandex_cloud_ml_sdk._messages.base.BaseMessage

Abstract class for messages in Yandex Cloud ML Assistant service.

Provides core functionality for all message types including: - Storage and processing of message parts (text, citations, etc.) - Basic text content operations - Protocol buffer support via BaseProtoResult[ProtoMessageTypeT_contra]

Extended by: - Message: Complete assistant messages - PartialMessage: Intermediate message content during streaming

parts: tuple[Any]... ,

Tuple containing message parts (can be strings or other types)

property text: str

Get concatenated string of all text parts in the message by joining all string parts.

class yandexcloudmlsdk.batch.domain.BaseBatchclass yandex_cloud_ml_sdk._batch.domain.BaseBatch

Сlass for managing batch operations in Yandex Cloud ML SDK.

For usage examples see batch example.

class yandexcloudmlsdk.types.batch.operation.BaseBatchTaskOperationclass yandex_cloud_ml_sdk._types.batch.operation.BaseBatchTaskOperation

property id: str

property task_id: str

class yandexcloudmlsdk.chat.BaseChatclass yandex_cloud_ml_sdk._chat.BaseChat

A class for Chat API domain operations.

This class provides functionality for working with the Yandex Cloud OpenAI Compatible API_BaseChat_URL. It serves as the foundation for chat operations.

completions: BaseChatCompletions

Chat API subdomain for working with text-generation models

text_embeddings: BaseChatEmbeddings

class yandexcloudmlsdk.chat.completions.function.BaseChatCompletionsclass yandex_cloud_ml_sdk._chat.completions.function.BaseChatCompletions

A class for working with chat completions models.

This class provides the core functionality for creating chat model instances and managing completions. It handles model URI construction and provides methods for listing available models.

__call__(model_name, *, model_version='latest')

Create a model instance in selected chat subdomain (completions, embeddings, etc)

Constructs the model URI based on the provided name and version. If the name contains ‘://’, it is treated as a full URI. Otherwise constructs a URI in the form ‘gpt://<folder_id>//’.

Parameters

  • model_name (str) – The name or URI of the model.
  • model_version (str) – The version of the model to use. Defaults to ‘latest’.

Return type

ModelTypeT

class yandexcloudmlsdk.chat.completions.model.BaseChatModelclass yandex_cloud_ml_sdk._chat.completions.model.BaseChatModel

A class for working with chat models providing inference functionality.

This class provides the foundation for chat model implementations, handling configuration, request building, and response processing.

configure(*, temperature=Undefined, max_tokens=Undefined, reasoning_mode=Undefined, response_format=Undefined, tools=Undefined, parallel_tool_calls=Undefined, tool_choice=Undefined, extra_query=Undefined)

Configure the model with specified parameters.

Parameters

  • temperature (UndefinedOr[float] | None) – Sampling temperature (0-1). Higher values produce more random results.
  • max_tokens (UndefinedOr[int] | None) – Maximum number of tokens to generate in the response.
  • reasoning_mode (UndefinedOr[ChatReasoningModeType] | None) – Reasoning mode for internal processing before responding.
  • response_format (UndefinedOr[ResponseType] | None) – Format of the response (JsonSchema, JSON string, or pydantic model). See structured output documentation_BaseChatModel_URL.
  • tools (UndefinedOr[Sequence[CompletionTool] | CompletionTool]) – Tools available for completion. Can be a sequence or single tool.
  • parallel_tool_calls (UndefinedOr[bool]) – Whether to allow parallel tool calls. Defaults to ‘true’.
  • tool_choice (UndefinedOr[ToolChoiceType]) – Strategy for tool selection. There are several ways to configure tool_choice for query processing: - no tools to call (tool_choice='none'); - required to call any tool (tool_choice='required'); - call a specific tool (tool_choice={'type': 'function', 'function': {'name': 'another_calculator'}} or directly passing a tool object).
  • extra_query (UndefinedOr[QueryType]) – Additional experimental model parameters.

Return type

Self

property config: ConfigTypeT

property uri: str

class yandexcloudmlsdk.chat.textembeddings.function.BaseChatEmbeddingsclass yandex_cloud_ml_sdk._chat.text_embeddings.function.BaseChatEmbeddings

__call__(model_name, *, model_version='latest')

Create a model instance in selected chat subdomain (completions, embeddings, etc)

Constructs the model URI based on the provided name and version. If the name contains ‘://’, it is treated as a full URI. Otherwise constructs a URI in the form ‘gpt://<folder_id>//’.

Parameters

  • model_name (str) – The name or URI of the model.
  • model_version (str) – The version of the model to use. Defaults to ‘latest’.

Return type

ModelTypeT

class yandexcloudmlsdk.chat.textembeddings.model.BaseChatEmbeddingsModelclass yandex_cloud_ml_sdk._chat.text_embeddings.model.BaseChatEmbeddingsModel

configure(*, dimensions=Undefined, encoding_format=Undefined, extra_query=Undefined)

Parameters

  • dimensions (UndefinedOr[int])
  • encoding_format (UndefinedOr[EncodingFormatType])
  • extra_query (UndefinedOr[QueryType])

Return type

Self

property config: ConfigTypeT

property uri: str

class yandexcloudmlsdk.searchapi.web.function.BaseWebSearchFunctionclass yandex_cloud_ml_sdk._search_api.web.function.BaseWebSearchFunction

Web search function for creating search object which provides methods for invoking web search.

__call__(search_type, *, family_mode=Undefined, fix_typo_mode=Undefined, localization=Undefined, sort_order=Undefined, sort_mode=Undefined, group_mode=Undefined, groups_on_page=Undefined, docs_in_group=Undefined, max_passages=Undefined, region=Undefined, user_agent=Undefined, metadata=Undefined)

Creates web search object which provides methods for web search.

To learn more about parameters and their formats and possible values, refer to web search documentation

Parameters

  • search_type (SearchType | UnknownEnumValue[SearchType] | str | int) – Search type.
  • family_mode (FamilyMode | UnknownEnumValue[FamilyMode] | str | int | Undefined) – Results filtering.
  • fix_typo_mode (FixTypoMode | UnknownEnumValue[FixTypoMode] | str | int | Undefined) – Search query typo correction setting
  • localization (Localization | UnknownEnumValue[Localization] | str | int | Undefined) – Search response notifications language. Affects the text in the found-docs-human tag and error messages
  • sort_order (SortOrder | UnknownEnumValue[SortOrder] | str | int | Undefined) – Search results sorting order
  • sort_mode (SortMode | UnknownEnumValue[SortMode] | str | int | Undefined) – Search results sorting mode rule
  • group_mode (GroupMode | UnknownEnumValue[GroupMode] | str | int | Undefined) – Result grouping method.
  • groups_on_page (int | Undefined) – Maximum number of groups that can be returned per page.
  • docs_in_group (int | Undefined) – Maximum number of documents that can be returned per group.
  • max_passages (int | Undefined) – Maximum number of passages that can be used when generating a document.
  • region (str | Undefined) – Search country or region ID that affects the document ranking rules.
  • user_agent (str | Undefined) – String containing the User-Agent header. Use this parameter to have your search results optimized for a specific device and browser, including mobile search results.
  • metadata (Mapping[str, str] | Undefined)

Return type

WebSearchTypeT

class yandexcloudmlsdk.searchapi.image.function.BaseImageSearchFunctionclass yandex_cloud_ml_sdk._search_api.image.function.BaseImageSearchFunction

Image search function for creating search object which provides methods for invoking image search.

__call__(search_type, *, family_mode=Undefined, fix_typo_mode=Undefined, format=Undefined, size=Undefined, orientation=Undefined, color=Undefined, site=Undefined, docs_on_page=Undefined, user_agent=Undefined)

Creates image search object which provides methods for image search.

To learn more about parameters and their formats and possible values, refer to image search documentation

Parameters

  • search_type (SearchType | UnknownEnumValue[SearchType] | str | int) – Search type.
  • family_mode (FamilyMode | UnknownEnumValue[FamilyMode] | str | int | Undefined) – Results filtering.
  • fix_typo_mode (FixTypoMode | UnknownEnumValue[FixTypoMode] | str | int | Undefined) – Search query typo correction setting.
  • format (ImageFormat | UnknownEnumValue[ImageFormat] | str | int | Undefined) – Searching for images in a particular format.
  • size (ImageSize | UnknownEnumValue[ImageSize] | str | int | Undefined) – Searching for images of a particular size.
  • orientation (ImageOrientation | UnknownEnumValue[ImageOrientation] | str | int | Undefined) – Searching for images with a particular orientation.
  • color (ImageColor | UnknownEnumValue[ImageColor] | str | int | Undefined) – Searching for images containing a particular color.
  • site (str | Undefined) – Number of results per search result page.
  • docs_on_page (int | Undefined) – Number of results per search result page.
  • user_agent (str | Undefined) – String containing the User-Agent header. Use this parameter to have your search results optimized for a specific device and browser, including mobile search results.

Return type

ImageSearchTypeT

class yandexcloudmlsdk.searchapi.byimage.function.BaseByImageSearchFunctionclass yandex_cloud_ml_sdk._search_api.by_image.function.BaseByImageSearchFunction

ByImage search function for creating search object which provides methods for invoking by_image search.

__call__(*, family_mode=Undefined, site=Undefined)

Creates by_image search object which provides methods for search by image.

To learn more about parameters and their formats and possible values, refer to search by image documentation

Parameters

  • family_mode (FamilyMode | UnknownEnumValue[FamilyMode] | str | int | Undefined) – Results filtering.
  • site (str | Undefined) – Restricts the search to the specific website.

Return type

ByImageSearchTypeT

Was the article helpful?

© 2025 Direct Cursus Technology L.L.C.