Yandex Cloud
Поиск
Связаться с намиПопробовать бесплатно
  • Истории успеха
  • Документация
  • Блог
  • Все сервисы
  • Статус работы сервисов
  • Marketplace
    • Доступны в регионе
    • Инфраструктура и сеть
    • Платформа данных
    • Искусственный интеллект
    • Безопасность
    • Инструменты DevOps
    • Бессерверные вычисления
    • Управление ресурсами
  • Все решения
    • По отраслям
    • По типу задач
    • Экономика платформы
    • Безопасность
    • Техническая поддержка
    • Каталог партнёров
    • Обучение и сертификация
    • Облако для стартапов
    • Облако для крупного бизнеса
    • Центр технологий для общества
    • Партнёрская программа
    • Поддержка IT-бизнеса
    • Облако для фрилансеров
    • Обучение и сертификация
    • Блог
    • Документация
    • Мероприятия и вебинары
    • Контакты, чаты и сообщества
    • Идеи
    • Калькулятор цен
    • Тарифы
    • Акции и free tier
  • Истории успеха
  • Документация
  • Блог
Создавайте контент и получайте гранты!Готовы написать своё руководство? Участвуйте в контент-программе и получайте гранты на работу с облачными сервисами!
Подробнее о программе
Проект Яндекса
© 2026 ТОО «Облачные Сервисы Казахстан»
Yandex AI Studio
  • О сервисе Yandex AI Studio
  • Начало работы с Model Gallery
  • Yandex Workflows
  • Переход с AI Assistant API на Responses API
  • Совместимость с OpenAI
  • Квоты и лимиты
  • Правила тарификации
  • Управление доступом
  • Аудитные логи Audit Trails
  • Публичные материалы
  • История изменений
  • Термины и определения

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

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

Base classes

Статья создана
Yandex Cloud
Обновлена 28 января 2026 г.
  • class yandex_ai_studio_sdk._sdk.BaseSDK
  • class yandex_ai_studio_sdk._types.domain.BaseDomain
  • class yandex_ai_studio_sdk._types.model.BaseModel
  • class yandex_ai_studio_sdk._types.model_config.BaseModelConfig
  • class yandex_ai_studio_sdk._auth.BaseAuth
  • class yandex_ai_studio_sdk._tools.domain.BaseTools
  • class yandex_ai_studio_sdk._tools.function.BaseFunctionTools
  • class yandex_ai_studio_sdk._tools.tool.BaseTool
  • class yandex_ai_studio_sdk._tools.tool_call.BaseToolCall
  • class yandex_ai_studio_sdk._tools.tool_call_list.ToolCallList
  • class yandex_ai_studio_sdk._tools.function_call.BaseFunctionCall
  • class yandex_ai_studio_sdk._models.BaseModels
  • class yandex_ai_studio_sdk._models.completions.function.BaseCompletions
  • class yandex_ai_studio_sdk._models.completions.model.BaseGPTModel
  • class yandex_ai_studio_sdk._models.text_classifiers.function.BaseTextClassifiers
  • class yandex_ai_studio_sdk._models.text_embeddings.function.BaseTextEmbeddings
  • class yandex_ai_studio_sdk._models.image_generation.function.BaseImageGeneration
  • class yandex_ai_studio_sdk._threads.domain.BaseThreads
  • class yandex_ai_studio_sdk._threads.thread.BaseThread
  • class yandex_ai_studio_sdk._files.domain.BaseFiles
  • class yandex_ai_studio_sdk._files.file.BaseFile
  • class yandex_ai_studio_sdk._assistants.domain.BaseAssistants
  • class yandex_ai_studio_sdk._assistants.assistant.BaseAssistant
  • class yandex_ai_studio_sdk._runs.domain.BaseRuns
  • class yandex_ai_studio_sdk._runs.run.BaseRun
  • class yandex_ai_studio_sdk._search_api.domain.BaseSearchAPIDomain
  • class yandex_ai_studio_sdk._search_api.generative.function.BaseGenerativeSearchFunction
  • class yandex_ai_studio_sdk._search_api.generative.generative.BaseGenerativeSearch
  • class yandex_ai_studio_sdk._search_indexes.domain.BaseSearchIndexes
  • class yandex_ai_studio_sdk._search_indexes.search_index.BaseSearchIndex
  • class yandex_ai_studio_sdk._datasets.domain.BaseDatasets
  • class yandex_ai_studio_sdk._datasets.dataset.BaseDataset
  • class yandex_ai_studio_sdk._datasets.draft.BaseDatasetDraft
  • class yandex_ai_studio_sdk._tuning.domain.BaseTuning
  • class yandex_ai_studio_sdk._types.batch.domain.BaseBatchSubdomain
  • class yandex_ai_studio_sdk._messages.base.BaseMessage
  • class yandex_ai_studio_sdk._batch.domain.BaseBatch
  • class yandex_ai_studio_sdk._types.batch.operation.BaseBatchTaskOperation
  • class yandex_ai_studio_sdk._chat.BaseChat
  • class yandex_ai_studio_sdk._chat.completions.function.BaseChatCompletions
  • class yandex_ai_studio_sdk._chat.completions.model.BaseChatModel
  • class yandex_ai_studio_sdk._chat.text_embeddings.function.BaseChatEmbeddings
  • class yandex_ai_studio_sdk._chat.text_embeddings.model.BaseChatEmbeddingsModel
  • class yandex_ai_studio_sdk._search_api.web.function.BaseWebSearchFunction
  • class yandex_ai_studio_sdk._search_api.image.function.BaseImageSearchFunction
  • class yandex_ai_studio_sdk._search_api.by_image.function.BaseByImageSearchFunction
  • class yandex_ai_studio_sdk._speechkit.domain.BaseSpeechKitDomain
  • class yandex_ai_studio_sdk._speechkit.text_to_speech.function.BaseTextToSpeechFunction
  • class yandex_ai_studio_sdk._speechkit.text_to_speech.tts.BaseTextToSpeech
  • class yandex_ai_studio_sdk._speechkit.text_to_speech.bistream.BaseTTSBidirectionalStream

class yandexaistudiosdk.sdk.BaseSDKclass yandex_ai_studio_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.

speechkit: BaseSpeechKitDomain

Domain for working with Yandex SpeechKit services.

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 yandexaistudiosdk.types.domain.BaseDomainclass yandex_ai_studio_sdk._types.domain.BaseDomain

class yandexaistudiosdk.types.model.BaseModelclass yandex_ai_studio_sdk._types.model.BaseModel

property uri: str

property config: ConfigTypeT

property owner: str | None

property name: str | None

property version: str | None

property fine_tuned: bool | None

configure(**kwargs)

Return type

Self

class yandexaistudiosdk.types.modelconfig.BaseModelConfigclass yandex_ai_studio_sdk._types.model_config.BaseModelConfig

BaseModelConfig()

class yandexaistudiosdk.auth.BaseAuthclass yandex_ai_studio_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 yandexaistudiosdk.tools.domain.BaseToolsclass yandex_ai_studio_sdk._tools.domain.BaseTools

Class for tools functionality.

Tools are specialized utilities that extend the capabilities of language models and AI assistants by providing access to external functions, data sources, and computational resources. They enable models to perform actions beyond text generation, such as searching through knowledge bases, executing custom functions, and processing structured data.

This class serves as the foundation for tool management in both synchronous and asynchronous contexts, providing a unified interface for tools. For more information see the description of members of this class.

Tools are particularly useful in:

  • AI Assistants: Extending conversational agents with external capabilities like web search, database queries, or API calls
  • Completions: Enabling language models to invoke functions during text generation for dynamic content creation and problem-solving

The tools framework supports both streaming and non-streaming operations, making it suitable for real-time applications and batch processing scenarios.

property function: FunctionToolsTypeT

Get the function sub-domain for creating function tools.

property rephraser: RephraserFunction

Get the rephraser for creating query transformation models.

The rephraser provides access to specialized language models designed to intelligently rewrite and enhance user search queries by incorporating conversational context. This is particularly useful in multi-turn conversations where the latest user message may lack context from previous exchanges.

The rephraser works by: - Analyzing the conversation history and current user query - Reformulating the query to be more specific and contextually complete - Improving search relevance by expanding abbreviated or ambiguous terms - Maintaining semantic intent while adding necessary context

The rephraser returns a factory that can create Rephraser model instances with different configurations, supporting various model types including the default ‘rephraser’ model or custom rephrasing models.

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_ai_studio_sdk._tools.search_index.rephraser.model.Rephraser | ~yandex_ai_studio_sdk._types.misc.Undefined) – setting for rephrasing user queries; refer to Rephraser documentation for details.
  • call_strategy (Literal['always'] | ~yandex_ai_studio_sdk._types.tools.function.FunctionDictType | ~yandex_ai_studio_sdk._tools.search_index.call_strategy.CallStrategy | ~yandex_ai_studio_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 yandexaistudiosdk.tools.function.BaseFunctionToolsclass yandex_ai_studio_sdk._tools.function.BaseFunctionTools

Class for function tools.

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

Create a function tool with given parameters.

Parameters

  • parameters (dict[str, None | bool | str | float | int | TypeAliasForwardRef('yandex_ai_studio_sdk._types.schemas.JsonArray') | dict[str, None | bool | str | float | int | TypeAliasForwardRef('yandex_ai_studio_sdk._types.schemas.JsonArray') | JsonObject]] | type) – Function parameters specification. Can be one of: - JSON Schema dict: A dictionary containing a valid JSON schema that describes the function parameters, their types, descriptions, and validation rules. - Pydantic BaseModel class: A class inheriting from pydantic.BaseModel. The JSON schema will be automatically generated from the model definition. - Pydantic dataclass: A dataclass decorated with @pydantic.dataclasses.dataclass. The JSON schema will be automatically generated from the dataclass definition.
  • name (str | Undefined) – Optional function name. If not provided: - For JSON Schema dict: must be provided explicitly or error will be raised. - For Pydantic models: automatically inferred from the class __name__ attribute.
  • description (str | Undefined) – Optional function description. If not provided: - For JSON Schema dict: taken from the ‘description’ field in the schema if present. - For Pydantic models: automatically inferred from the class docstring if present.
  • strict (bool | Undefined) – Whether to enforce strict parameter validation. When True, the function call will strictly validate that only the defined parameters are provided.

Return type

FunctionTool

class yandexaistudiosdk.tools.tool.BaseToolclass yandex_ai_studio_sdk._tools.tool.BaseTool

Сlass for all tools.

This class serves as the foundation for all tool implementations that can be used with AI models.

class yandexaistudiosdk.tools.toolcall.BaseToolCallclass yandex_ai_studio_sdk._tools.tool_call.BaseToolCall

A tool call returned by models as a result of server-side tool calls.

This class encapsulates the response from language models when they invoke tools during conversation or completion. It contains information about the specific tool that was called, including its unique identifier and the associated function call with parameters and results.

id: str | None

Unique tool call identifier

function: FunctionCallTypeT | None

Function call associated with this tool call

class yandexaistudiosdk.tools.toolcalllist.ToolCallListclass yandex_ai_studio_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]... ,

Collections of tool calls

class yandexaistudiosdk.tools.functioncall.BaseFunctionCallclass yandex_ai_studio_sdk._tools.function_call.BaseFunctionCall

Represents a function call returned by models as a result of server-side tool calls.

This class encapsulates the details of a function call that was invoked by the model during processing, including the function name and the arguments passed to it.

name: str

Name of the function being called

arguments: JsonObject

Arguments passed to the function

class yandexaistudiosdk.models.BaseModelsclass yandex_ai_studio_sdk._models.BaseModels

Domain for working with Yandex Foundation Models.

completions: BaseCompletions

text_classifiers: BaseTextClassifiers

image_generation: BaseImageGeneration

text_embeddings: BaseTextEmbeddings

class yandexaistudiosdk.models.completions.function.BaseCompletionsclass yandex_ai_studio_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 yandexaistudiosdk.models.completions.model.BaseGPTModelclass yandex_ai_studio_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_ai_studio_sdk._types.schemas.JsonSchemaResponseType | type | ~yandex_ai_studio_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_ai_studio_sdk._types.tools.function.FunctionDictType | ~yandex_ai_studio_sdk._tools.tool.FunctionTool | ~yandex_ai_studio_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 fine_tuned: bool | None

property name: str | None

property owner: str | None

property uri: str

property version: str | None

class yandexaistudiosdk.models.textclassifiers.function.BaseTextClassifiersclass yandex_ai_studio_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’.

Return type

ModelTypeT

class yandexaistudiosdk.models.textembeddings.function.BaseTextEmbeddingsclass yandex_ai_studio_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’.

Return type

ModelTypeT

class yandexaistudiosdk.models.imagegeneration.function.BaseImageGenerationclass yandex_ai_studio_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’.

Return type

ModelTypeT

class yandexaistudiosdk.threads.domain.BaseThreadsclass yandex_ai_studio_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 yandexaistudiosdk.threads.thread.BaseThreadclass yandex_ai_studio_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 yandexaistudiosdk.files.domain.BaseFilesclass yandex_ai_studio_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 yandexaistudiosdk.files.file.BaseFileclass yandex_ai_studio_sdk._files.file.BaseFile

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

expiration_config: ExpirationConfig

id: str

class yandexaistudiosdk.assistants.domain.BaseAssistantsclass yandex_ai_studio_sdk._assistants.domain.BaseAssistants

Base class for assistants management.

Provides common functionality for creating, getting and listing assistants.

class yandexaistudiosdk.assistants.assistant.BaseAssistantclass yandex_ai_studio_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 yandexaistudiosdk.runs.domain.BaseRunsclass yandex_ai_studio_sdk._runs.domain.BaseRuns

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

For usage examples see runs example.

class yandexaistudiosdk.runs.run.BaseRunclass yandex_ai_studio_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 yandexaistudiosdk.searchapi.domain.BaseSearchAPIDomainclass yandex_ai_studio_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 yandexaistudiosdk.searchapi.generative.function.BaseGenerativeSearchFunctionclass yandex_ai_studio_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 yandexaistudiosdk.searchapi.generative.generative.BaseGenerativeSearchclass yandex_ai_studio_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 fine_tuned: bool | None

property name: str | None

property owner: str | None

property uri: str

property version: str | None

class yandexaistudiosdk.searchindexes.domain.BaseSearchIndexesclass yandex_ai_studio_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 yandexaistudiosdk.searchindexes.searchindex.BaseSearchIndexclass yandex_ai_studio_sdk._search_indexes.search_index.BaseSearchIndex

This class represents a search index with associated operations.

expiration_config: ExpirationConfig

id: str

class yandexaistudiosdk.datasets.domain.BaseDatasetsclass yandex_ai_studio_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 yandexaistudiosdk.datasets.dataset.BaseDatasetclass yandex_ai_studio_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 yandexaistudiosdk.datasets.draft.BaseDatasetDraftclass yandex_ai_studio_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 yandexaistudiosdk.tuning.domain.BaseTuningclass yandex_ai_studio_sdk._tuning.domain.BaseTuning

Class for model tuning operations.

This class serves as the foundation for all model fine-tuning operations, providing comprehensive functionality.

class yandexaistudiosdk.types.batch.domain.BaseBatchSubdomainclass yandex_ai_studio_sdk._types.batch.domain.BaseBatchSubdomain

class yandexaistudiosdk.messages.base.BaseMessageclass yandex_ai_studio_sdk._messages.base.BaseMessage

Abstract class for messages in Yandex AI Studio 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 yandexaistudiosdk.batch.domain.BaseBatchclass yandex_ai_studio_sdk._batch.domain.BaseBatch

Сlass for managing batch operations in Yandex AI Studio SDK.

For usage examples see batch example.

class yandexaistudiosdk.types.batch.operation.BaseBatchTaskOperationclass yandex_ai_studio_sdk._types.batch.operation.BaseBatchTaskOperation

property id: str

property task_id: str

class yandexaistudiosdk.chat.BaseChatclass yandex_ai_studio_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 yandexaistudiosdk.chat.completions.function.BaseChatCompletionsclass yandex_ai_studio_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 yandexaistudiosdk.chat.completions.model.BaseChatModelclass yandex_ai_studio_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 fine_tuned: bool | None

property name: str | None

property owner: str | None

property uri: str

property version: str | None

class yandexaistudiosdk.chat.textembeddings.function.BaseChatEmbeddingsclass yandex_ai_studio_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 yandexaistudiosdk.chat.textembeddings.model.BaseChatEmbeddingsModelclass yandex_ai_studio_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 fine_tuned: bool | None

property name: str | None

property owner: str | None

property uri: str

property version: str | None

class yandexaistudiosdk.searchapi.web.function.BaseWebSearchFunctionclass yandex_ai_studio_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 yandexaistudiosdk.searchapi.image.function.BaseImageSearchFunctionclass yandex_ai_studio_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 yandexaistudiosdk.searchapi.byimage.function.BaseByImageSearchFunctionclass yandex_ai_studio_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

class yandexaistudiosdk.speechkit.domain.BaseSpeechKitDomainclass yandex_ai_studio_sdk._speechkit.domain.BaseSpeechKitDomain

Domain for working with Yandex SpeechKit services.

text_to_speech: BaseTextToSpeechFunction

API for text to speech service

tts: BaseTextToSpeechFunction

Synonym for text_to_speech function

class yandexaistudiosdk.speechkit.texttospeech.function.BaseTextToSpeechFunctionclass yandex_ai_studio_sdk._speechkit.text_to_speech.function.BaseTextToSpeechFunction

Text to Speech function for creating synthesis object which provides methods for invoking voice synthesizing.

__call__(*, loudness_normalization=Undefined, audio_format=Undefined, model=Undefined, voice=Undefined, role=Undefined, speed=Undefined, volume=Undefined, pitch_shift=Undefined, duration_ms=Undefined, duration_min_ms=Undefined, duration_max_ms=Undefined, single_chunk_mode=Undefined)

Creates TextToSpeech object with provides methods for voice synthesizing.

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

Parameters

  • loudness_normalization (LoudnessNormalization | UnknownEnumValue[LoudnessNormalization] | str | int | Undefined) – Specifies type of loudness normalization. Default: LUFS.
  • audio_format (AudioFormat | UnknownEnumValue[AudioFormat] | str | int | Undefined) – Specifies output audio format. Default: 22050Hz, linear 16-bit signed little-endian PCM, with WAV header.
  • model (str | Undefined) – The name of the TTS model to use for synthesis. Currently should be empty. Do not use it.
  • voice (str | Undefined) – The voice to use for speech synthesis.
  • role (str | Undefined) – The role or speaking style. Can be used to specify pronunciation character for the speaker.
  • speed (float | Undefined) – Speed multiplier (default: 1.0).
  • volume (float | Undefined) – Volume adjustment: * For MAX_PEAK: range is (0, 1], default 0.7. * For LUFS: range is [-145, 0), default -19.
  • pitch_shift (float | Undefined) – Pitch adjustment, in Hz, range [-1000, 1000], default 0.
  • duration_ms (int | Undefined) – Limit audio duration to exact value.
  • duration_min_ms (int | Undefined) – Limit the minimum audio duration.
  • duration_max_ms (int | Undefined) – Limit the maximum audio duration
  • single_chunk_mode (bool | Undefined) – Automatically split long text to several utterances and bill accordingly. Some degradation in service quality is possible

Return type

TextToSpeechTypeT

class yandexaistudiosdk.speechkit.texttospeech.tts.BaseTextToSpeechclass yandex_ai_studio_sdk._speechkit.text_to_speech.tts.BaseTextToSpeech

Text to Speech class which provides concrete methods for working with SpeechKit TTS API and incapsulates sintesis setting.

class AudioFormatclass AudioFormat

classmethod Unknown(name, value)

Parameters

  • name (str)
  • value (int)

__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

classmethod PCM16(sample_rate_hertz, channels=1)

Audio bit depth 16-bit signed little-endian (Linear PCM).

Parameters

  • sample_rate_hertz (int)
  • channels (int)

Return type

PCM16

MP3 = 3

Data is encoded using MPEG-1/2 Layer III and compressed using the MP3 container format

WAV = 1

Audio bit depth 16-bit signed little-endian (Linear PCM) paked into WAV container format

OGG_OPUS = 2

Data is encoded using the OPUS audio codec and compressed using the OGG container format

__init__(*args, **kwds)

class LoudnessNormalizationclass LoudnessNormalization

classmethod Unknown(name, value)

Parameters

  • name (str)
  • value (int)

__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

MAX_PEAK = 1

The type of normalization, wherein the gain is changed to bring the highest PCM sample value or analog signal peak to a given level.

LUFS = 2

The type of normalization based on EBU R 128 recommendation

__init__(*args, **kwds)

configure(*, loudness_normalization=Undefined, audio_format=Undefined, model=Undefined, voice=Undefined, role=Undefined, speed=Undefined, volume=Undefined, pitch_shift=Undefined, duration_ms=Undefined, duration_min_ms=Undefined, duration_max_ms=Undefined, single_chunk_mode=Undefined)

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

To return set value back to default, pass None value.

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

Parameters

  • loudness_normalization (LoudnessNormalization | UnknownEnumValue[LoudnessNormalization] | str | int | Undefined | None) – Specifies type of loudness normalization. Default: LUFS.
  • audio_format (AudioFormat | UnknownEnumValue[AudioFormat] | str | int | Undefined | None) – Specifies output audio format. Default: 22050Hz, linear 16-bit signed little-endian PCM, with WAV header.
  • model (str | Undefined | None) – The name of the TTS model to use for synthesis. Currently should be empty. Do not use it.
  • voice (str | Undefined | None) – The voice to use for speech synthesis.
  • role (str | Undefined | None) – The role or speaking style. Can be used to specify pronunciation character for the speaker.
  • speed (float | Undefined | None) – Speed multiplier (default: 1.0).
  • volume (float | Undefined | None) – Volume adjustment: * For MAX_PEAK: range is (0, 1], default 0.7. * For LUFS: range is [-145, 0), default -19.
  • pitch_shift (float | Undefined | None) – Pitch adjustment, in Hz, range [-1000, 1000], default 0.
  • duration_ms (int | Undefined | None) – Limit audio duration to exact value.
  • duration_min_ms (int | Undefined | None) – Limit the minimum audio duration.
  • duration_max_ms (int | Undefined | None) – Limit the maximum audio duration.
  • single_chunk_mode (bool | Undefined | None) – Automatically split long text to several utterances and bill accordingly. Some degradation in service quality is possible

Return type

Self

create_bistream(*, timeout=600)

Creates a bidirectional stream object for using Yandex SpeechKit Streaming synthesis.

Parameters

timeout (float) – GRPC timeout in seconds that defines the maximum lifetime of the entire stream. The timeout countdown begins from the moment of the first stream interaction.

Return type

TTSBidirectionalStreamTypeT

__init__(*, sdk, uri, config=None, owner=None)

Parameters

  • sdk (yandex_ai_studio_sdk._sdk.BaseSDK)
  • uri (str)
  • config (ConfigTypeT | None)
  • owner (str | None)

property config: ConfigTypeT

property fine_tuned: bool | None

property name: str | None

property owner: str | None

property uri: str

property version: str | None

class yandexaistudiosdk.speechkit.texttospeech.bistream.BaseTTSBidirectionalStreamclass yandex_ai_studio_sdk._speechkit.text_to_speech.bistream.BaseTTSBidirectionalStream

Bidirectional SpeechKit TTS API which allows to write requests and read synthesized result in realtime

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

Создавайте контент и получайте гранты!Готовы написать своё руководство? Участвуйте в контент-программе и получайте гранты на работу с облачными сервисами!
Подробнее о программе
Проект Яндекса
© 2026 ТОО «Облачные Сервисы Казахстан»