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._chat.completions.function.ChatCompletions
  • class yandex_cloud_ml_sdk._chat.completions.model.ChatModel

Domain

Written by
Yandex Cloud
Updated at November 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

Was the article helpful?

© 2025 Direct Cursus Technology L.L.C.