Yandex Cloud
Поиск
Связаться с намиПопробовать бесплатно
  • Истории успеха
  • Документация
  • Блог
  • Все сервисы
  • Статус работы сервисов
  • Marketplace
    • Популярные
    • Инфраструктура и сеть
    • Платформа данных
    • Искусственный интеллект
    • Безопасность
    • Инструменты DevOps
    • Бессерверные вычисления
    • Управление ресурсами
  • Все решения
    • По отраслям
    • По типу задач
    • Экономика платформы
    • Безопасность
    • Техническая поддержка
    • Каталог партнёров
    • Обучение и сертификация
    • Облако для стартапов
    • Облако для крупного бизнеса
    • Центр технологий для общества
    • Облако для интеграторов
    • Поддержка IT-бизнеса
    • Облако для фрилансеров
    • Обучение и сертификация
    • Блог
    • Документация
    • Контент-программа
    • Мероприятия и вебинары
    • Контакты, чаты и сообщества
    • Идеи
    • Калькулятор цен
    • Тарифы
    • Акции и free tier
  • Истории успеха
  • Документация
  • Блог
Создавайте контент и получайте гранты!Готовы написать своё руководство? Участвуйте в контент-программе и получайте гранты на работу с облачными сервисами!
Подробнее о программе
Проект Яндекса
© 2026 ООО «Яндекс.Облако»
Yandex AI Studio
  • О сервисе Yandex AI Studio
  • Начало работы с Model Gallery
  • Yandex Workflows
  • Переход с AI Assistant API на Responses API
  • Совместимость с OpenAI
    • О Yandex AI Studio SDK
      • Overview
      • Authentication
        • Overview
        • Assistant types
        • Tools
        • Operation
        • Tuning
        • Result types for models
        • Datasets
        • Search API
        • Messages
        • Run types
        • Search index types
        • Other types
        • Batch
        • Speechkit
      • Request retries
  • Квоты и лимиты
  • Правила тарификации
  • Управление доступом
  • Аудитные логи Audit Trails
  • Публичные материалы
  • История изменений
  • Термины и определения

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

  • class yandex_ai_studio_sdk._types.expiration.ExpirationPolicy
  • class yandex_ai_studio_sdk._types.expiration.ExpirationConfig
  • class yandex_ai_studio_sdk._types.expiration.ExpirationPolicyAlias
  • class yandex_ai_studio_sdk._assistants.prompt_truncation_options.PromptTruncationOptions
  • class yandex_ai_studio_sdk._assistants.prompt_truncation_options.BasePromptTruncationStrategy
  • class yandex_ai_studio_sdk._assistants.prompt_truncation_options.AutoPromptTruncationStrategy
  • class yandex_ai_studio_sdk._assistants.prompt_truncation_options.LastMessagesPromptTruncationStrategy
  • class yandex_ai_studio_sdk._assistants.prompt_truncation_options.PromptTruncationStrategyType
  • class yandex_ai_studio_sdk._assistants.assistant.ReadOnlyAssistant
  • class yandex_ai_studio_sdk._assistants.assistant.AssistantVersion
  1. Yandex AI Studio SDK
  2. Справочник SDK (англ.)
  3. Types
  4. Assistant types

Assistant types

Статья создана
Yandex Cloud
Обновлена 28 января 2026 г.
  • class yandex_ai_studio_sdk._types.expiration.ExpirationPolicy
  • class yandex_ai_studio_sdk._types.expiration.ExpirationConfig
  • class yandex_ai_studio_sdk._types.expiration.ExpirationPolicyAlias
  • class yandex_ai_studio_sdk._assistants.prompt_truncation_options.PromptTruncationOptions
  • class yandex_ai_studio_sdk._assistants.prompt_truncation_options.BasePromptTruncationStrategy
  • class yandex_ai_studio_sdk._assistants.prompt_truncation_options.AutoPromptTruncationStrategy
  • class yandex_ai_studio_sdk._assistants.prompt_truncation_options.LastMessagesPromptTruncationStrategy
  • class yandex_ai_studio_sdk._assistants.prompt_truncation_options.PromptTruncationStrategyType
  • class yandex_ai_studio_sdk._assistants.assistant.ReadOnlyAssistant
  • class yandex_ai_studio_sdk._assistants.assistant.AssistantVersion

yandex_ai_studio_sdk._types.expiration.ExpirationProtoTypeT_contra = TypeVar(ExpirationProtoTypeT_contra, bound=Union, contravariant=True)

Type:TypeVar

Contravariant TypeVar bound to typing.Union[yandex.cloud.ai.assistants.v1.assistant_pb2.Assistant, yandex.cloud.ai.assistants.v1.searchindex.search_index_pb2.SearchIndex, yandex.cloud.ai.assistants.v1.threads.thread_pb2.Thread, yandex.cloud.ai.files.v1.file_pb2.File].

class yandexaistudiosdk.types.expiration.ExpirationPolicyclass yandex_ai_studio_sdk._types.expiration.ExpirationPolicy

STATIC = 1

SINCE_LAST_ACTIVE = 2

class yandexaistudiosdk.types.expiration.ExpirationConfigclass yandex_ai_studio_sdk._types.expiration.ExpirationConfig

ExpirationConfig(ttl_days: ‘int | None’ = None, expiration_policy: ‘ExpirationPolicy | None’ = None)

ttl_days: int | None = None

expiration_policy: ExpirationPolicy | None = None

classmethod coerce(ttl_days, expiration_policy)

Parameters

  • ttl_days (int | Undefined)
  • expiration_policy (ExpirationPolicy | Literal[1, 2] | ~typing.Literal['STATIC', 'SINCE_LAST_ACTIVE'] | ~typing.Literal['static', 'since_last_active'] | ~yandex_ai_studio_sdk._types.misc.Undefined)

Return type

ExpirationConfig

to_proto()

Return type

ExpirationConfig | None

__init__(ttl_days=None, expiration_policy=None)

Parameters

  • ttl_days (int | None)
  • expiration_policy (ExpirationPolicy | None)

Return type

None

yandex_ai_studio_sdk._types.expiration.ExpirationPolicyAlias

alias of ExpirationPolicy | Literal[1, 2] | Literal[‘STATIC’, ‘SINCE_LAST_ACTIVE’] | Literal[‘static’, ‘since_last_active’]

class yandexaistudiosdk.types.expiration.ExpirationPolicyAliasclass yandex_ai_studio_sdk._types.expiration.ExpirationPolicyAlias

class yandexaistudiosdk.assistants.prompttruncationoptions.PromptTruncationOptionsclass yandex_ai_studio_sdk._assistants.prompt_truncation_options.PromptTruncationOptions

Configuration options for prompt truncation in assistant conversations.

This class defines how to handle prompt truncation when the conversation exceeds the maximum token limit. It allows specifying both the maximum token limit and the strategy for truncation.

max_prompt_tokens: int | None = None

The maximum number of tokens allowed in the prompt. If the prompt exceeds this limit, the thread messages will be truncated. Default max_prompt_tokens: 7000

strategy: BasePromptTruncationStrategy | None = None

The truncation strategy to use when the prompt exceeds the token limit. Can be either ‘auto’ for automatic strategy or a specific strategy instance. If None, no truncation strategy is applied.

class yandexaistudiosdk.assistants.prompttruncationoptions.BasePromptTruncationStrategyclass yandex_ai_studio_sdk._assistants.prompt_truncation_options.BasePromptTruncationStrategy

Base class for prompt truncation strategies.

This abstract base class defines the interface for different truncation strategies that can be used when the prompt exceeds the maximum token limit. Concrete implementations should override the abstract methods to provide specific truncation behavior.

class yandexaistudiosdk.assistants.prompttruncationoptions.AutoPromptTruncationStrategyclass yandex_ai_studio_sdk._assistants.prompt_truncation_options.AutoPromptTruncationStrategy

Automatic prompt truncation strategy.

The system will handle truncation in a way that aims to preserve the most relevant context. This strategy lets the AI service automatically determine the best approach for truncating the prompt while maintaining conversation coherence.

class yandexaistudiosdk.assistants.prompttruncationoptions.LastMessagesPromptTruncationStrategyclass yandex_ai_studio_sdk._assistants.prompt_truncation_options.LastMessagesPromptTruncationStrategy

Last messages prompt truncation strategy.

This strategy specifies that when truncation is needed, the system should retain the most recent messages up to the specified number, and truncate older messages to fit within the token limit.

num_messages: int

The number of most recent messages to retain in the prompt. If these messages exceed max_prompt_tokens, older messages will be further truncated to fit the limit.

yandex_ai_studio_sdk._assistants.prompt_truncation_options.PromptTruncationStrategyType

alias of Literal[‘auto’] | BasePromptTruncationStrategy

class yandexaistudiosdk.assistants.prompttruncationoptions.PromptTruncationStrategyTypeclass yandex_ai_studio_sdk._assistants.prompt_truncation_options.PromptTruncationStrategyType

class yandexaistudiosdk.assistants.assistant.ReadOnlyAssistantclass yandex_ai_studio_sdk._assistants.assistant.ReadOnlyAssistant

Base class providing read-only access to Yandex AI Studio Assistant configuration and metadata.

This class implements the core interface for interacting with Yandex AI Studio Assistant API in a read-only manner. It serves as the parent class for both synchronous (Assistant) and asynchronous (AsyncAssistant) implementations.

name: str | None

The name of the assistant.

description: str | None

The description of the assistant.

created_by: str

The identifier of the user who created the assistant.

created_at: datetime

The timestamp when the assistant was created.

updated_by: str

The identifier of the user who last updated the assistant.

updated_at: datetime

The timestamp when the assistant was last updated.

expires_at: datetime

The timestamp when the assistant will expire.

labels: dict[str, str] | None

Additional labels associated with the assistant.

property max_prompt_tokens: int | None

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

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

id: str

class yandexaistudiosdk.assistants.assistant.AssistantVersionclass yandex_ai_studio_sdk._assistants.assistant.AssistantVersion

Represents a specific version of an Assistant.

id: str

ID of the assistant version.

assistant: ReadOnlyAssistant

The assistant instance for this version.

update_mask: tuple[str]... ,

Mask specifying which fields were updated in this version. Mask also have a custom JSON encoding

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

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