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

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

  • class yandex_cloud_ml_sdk._chat.completions.function.ChatCompletions
  • class yandex_cloud_ml_sdk._chat.completions.model.ChatModel

Domain

Статья создана
Yandex Cloud
Обновлена 7 ноября 2025 г.
  • class yandex_cloud_ml_sdk._chat.completions.function.ChatCompletions
  • class yandex_cloud_ml_sdk._chat.completions.model.ChatModel

class yandexcloudmlsdk.chat.completions.function.ChatCompletionsclass yandex_cloud_ml_sdk._chat.completions.function.ChatCompletions

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.

list(*, timeout=60)

Returns all available models in selected subdomain (completions, embeddings, etc)

Parameters

timeout (float) – The timeout, or the maximum time to wait for the request to complete in seconds.

Return type

tuple[ChatModel, …]

__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

Model

class yandexcloudmlsdk.chat.completions.model.ChatModelclass yandex_cloud_ml_sdk._chat.completions.model.ChatModel

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.

run(messages, *, timeout=180)

Executes the model with the provided messages.

Parameters

  • messages (TextMessage | TextMessageDict | TextMessageProtocol | str | ChatFunctionResultMessageDict | FunctionResultMessageDict | Iterable[TextMessage | TextMessageDict | TextMessageProtocol | str | FunctionResultMessageDict] | MultimodalMessageDict | Iterable[TextMessage | TextMessageDict | TextMessageProtocol | str | ChatFunctionResultMessageDict | FunctionResultMessageDict | Iterable[TextMessage | TextMessageDict | TextMessageProtocol | str | FunctionResultMessageDict] | MultimodalMessageDict]) – The input messages to process. Could be a string, a dictionary, or a result object. Read more about other possible message types in the corresponding documentation.
  • timeout – The timeout, or the maximum time to wait for the request to complete in seconds. Defaults to 180 seconds.

Return type

ChatModelResult[ToolCall]

run_stream(messages, *, timeout=180)

Executes the model with the provided messages and yields partial results as they become available.

Parameters

  • messages (TextMessage | TextMessageDict | TextMessageProtocol | str | ChatFunctionResultMessageDict | FunctionResultMessageDict | Iterable[TextMessage | TextMessageDict | TextMessageProtocol | str | FunctionResultMessageDict] | MultimodalMessageDict | Iterable[TextMessage | TextMessageDict | TextMessageProtocol | str | ChatFunctionResultMessageDict | FunctionResultMessageDict | Iterable[TextMessage | TextMessageDict | TextMessageProtocol | str | FunctionResultMessageDict] | MultimodalMessageDict]) – The input messages to process.
  • timeout – The timeout, or the maximum time to wait for the request to complete in seconds. Defaults to 180 seconds.

Return type

Iterator[ChatModelResult[ToolCall]]

property config: ConfigTypeT

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 uri: str

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

Проект Яндекса
© 2025 ООО «Яндекс.Облако»