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

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

  • Completions
  • class yandex_cloud_ml_sdk._models.completions.result.GPTModelResult
  • class yandex_cloud_ml_sdk._models.completions.result.Alternative
  • class yandex_cloud_ml_sdk._models.completions.result.AlternativeStatus
  • class yandex_cloud_ml_sdk._models.completions.result.Usage
  • class yandex_cloud_ml_sdk._models.completions.result.CompletionUsage
  • Embeddings
  • class yandex_cloud_ml_sdk._models.text_embeddings.result.TextEmbeddingsModelResult
  • class yandex_cloud_ml_sdk._chat.text_embeddings.result.ChatEmbeddingsModelResult
  • class yandex_cloud_ml_sdk._chat.text_embeddings.result.EmbeddingsUsage
  • Text classifiers
  • class yandex_cloud_ml_sdk._models.text_classifiers.result.TextClassifiersModelResultBase
  • class yandex_cloud_ml_sdk._models.text_classifiers.result.TextClassifiersModelResult
  • class yandex_cloud_ml_sdk._models.text_classifiers.result.FewShotTextClassifiersModelResult
  • class yandex_cloud_ml_sdk._models.text_classifiers.types.TextClassificationLabel
  • Image generation
  • class yandex_cloud_ml_sdk._models.image_generation.result.ImageGenerationModelResult
  • Chat completions
  • class yandex_cloud_ml_sdk._chat.completions.result.ChatModelResult
  • class yandex_cloud_ml_sdk._chat.completions.result.ChatChoice
  • class yandex_cloud_ml_sdk._chat.completions.result.FinishReason
  • class yandex_cloud_ml_sdk._chat.completions.result.ChatUsage
  1. Yandex Cloud ML SDK
  2. Справочник SDK (англ.)
  3. Types
  4. Result types for models

Result types for models

Статья создана
Yandex Cloud
Обновлена 7 ноября 2025 г.
  • Completions
    • class yandex_cloud_ml_sdk._models.completions.result.GPTModelResult
    • class yandex_cloud_ml_sdk._models.completions.result.Alternative
    • class yandex_cloud_ml_sdk._models.completions.result.AlternativeStatus
    • class yandex_cloud_ml_sdk._models.completions.result.Usage
    • class yandex_cloud_ml_sdk._models.completions.result.CompletionUsage
  • Embeddings
    • class yandex_cloud_ml_sdk._models.text_embeddings.result.TextEmbeddingsModelResult
    • class yandex_cloud_ml_sdk._chat.text_embeddings.result.ChatEmbeddingsModelResult
    • class yandex_cloud_ml_sdk._chat.text_embeddings.result.EmbeddingsUsage
  • Text classifiers
    • class yandex_cloud_ml_sdk._models.text_classifiers.result.TextClassifiersModelResultBase
    • class yandex_cloud_ml_sdk._models.text_classifiers.result.TextClassifiersModelResult
    • class yandex_cloud_ml_sdk._models.text_classifiers.result.FewShotTextClassifiersModelResult
    • class yandex_cloud_ml_sdk._models.text_classifiers.types.TextClassificationLabel
  • Image generation
    • class yandex_cloud_ml_sdk._models.image_generation.result.ImageGenerationModelResult
  • Chat completions
    • class yandex_cloud_ml_sdk._chat.completions.result.ChatModelResult
    • class yandex_cloud_ml_sdk._chat.completions.result.ChatChoice
    • class yandex_cloud_ml_sdk._chat.completions.result.FinishReason
    • class yandex_cloud_ml_sdk._chat.completions.result.ChatUsage

CompletionsCompletions

class yandexcloudmlsdk.models.completions.result.GPTModelResultclass yandex_cloud_ml_sdk._models.completions.result.GPTModelResult

A class representing the result of a GPT model completion request.

alternatives: tuple[Alternative[ToolCallTypeT]... ,]

a tuple of alternatives generated by the model

usage: CompletionUsage

a usage statistics related to the completion request

model_version: str

the version of the GPT model used for generating the result

property role: str

property text: str

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.

property status: AlternativeStatus

property tool_calls: ToolCallList[ToolCallList, ToolCallTypeT] | None

class yandexcloudmlsdk.models.completions.result.Alternativeclass yandex_cloud_ml_sdk._models.completions.result.Alternative

A class representing one of the generated completion alternatives, including its content and generation status.

status: AlternativeStatus

the status of the alternative

tool_calls: ToolCallList[ToolCallList, ToolCallTypeT] | None

a list of tool calls associated with this alternative, or None if no tool calls are present

role: str

text: str

class yandexcloudmlsdk.models.completions.result.AlternativeStatusclass yandex_cloud_ml_sdk._models.completions.result.AlternativeStatus

A class with an enumeration representing the status of an alternative. This enum defines various statuses that an alternative can have during processing.

UNSPECIFIED = 0

the status is not specified

PARTIAL = 1

the alternative is partially complete

TRUNCATED_FINAL = 2

the alternative is truncated but considered final

FINAL = 3

the alternative is complete and final

CONTENT_FILTER = 4

the alternative has been filtered for content

TOOL_CALLS = 5

the alternative involves tool calls

UNKNOWN = -1

represents an unknown status (-1)

USAGE = -2

special status for message with only usage data; used in some SDK places

__new__(value)

class yandexcloudmlsdk.models.completions.result.Usageclass yandex_cloud_ml_sdk._models.completions.result.Usage

A class representing usage statistics for a completion request.

completion_tokens: int

the number of tokens generated in the completion

input_text_tokens: int

the number of tokens in the input text

total_tokens: int

the total number of tokens used

class yandexcloudmlsdk.models.completions.result.CompletionUsageclass yandex_cloud_ml_sdk._models.completions.result.CompletionUsage

A class representing detailed usage statistics for a completion request, including reasoning tokens. Inherits from Usage and includes additional information about reasoning tokens.

reasoning_tokens: int

the number of tokens used for reasoning in the completion

completion_tokens: int

the number of tokens generated in the completion

input_text_tokens: int

the number of tokens in the input text

total_tokens: int

the total number of tokens used

EmbeddingsEmbeddings

class yandexcloudmlsdk.models.textembeddings.result.TextEmbeddingsModelResultclass yandex_cloud_ml_sdk._models.text_embeddings.result.TextEmbeddingsModelResult

Represents the result of a text embeddings model.

It holds the embedding vector, the number of tokens, and the version of the model that is used to generate embeggings.

embedding: tuple[float]... ,

the embedding vector as a tuple of floats

num_tokens: int

the number of tokens processed by the model

model_version: str

the version of the model used for generating embeddings

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.

class yandexcloudmlsdk.chat.textembeddings.result.ChatEmbeddingsModelResultclass yandex_cloud_ml_sdk._chat.text_embeddings.result.ChatEmbeddingsModelResult

Represents the result of a text embeddings model.

It holds the embedding vector, the number of tokens, and the version of the model that is used to generate embeggings.

embedding: tuple[float]... ,

the embedding vector as a tuple of floats

model: str

URI of the chat model used for generating the result

usage: EmbeddingsUsage | None

Usage statistics for the embedding request

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.

class yandexcloudmlsdk.chat.textembeddings.result.EmbeddingsUsageclass yandex_cloud_ml_sdk._chat.text_embeddings.result.EmbeddingsUsage

A class representing usage statistics for chat embedding requests.

property prompt_tokens: int

Alias for input_text_tokens for compatibility with chat naming.

input_text_tokens: int

the number of tokens in the input text

total_tokens: int

the total number of tokens used

Text classifiersText classifiers

class yandexcloudmlsdk.models.textclassifiers.result.TextClassifiersModelResultBaseclass yandex_cloud_ml_sdk._models.text_classifiers.result.TextClassifiersModelResultBase

A class for text classifiers model results. It represents the common structure for the results returned by text classification models.

predictions: tuple[TextClassificationLabel]... ,

a tuple containing the predicted labels

model_version: str

the version of the model used for prediction

input_tokens: int

Number of input tokens provided to the model.

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.

class yandexcloudmlsdk.models.textclassifiers.result.TextClassifiersModelResultclass yandex_cloud_ml_sdk._models.text_classifiers.result.TextClassifiersModelResult

TextClassifiersModelResult(predictions: ‘tuple[TextClassificationLabel, …]’, model_version: ‘str’, input_tokens: ‘int’)

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.

predictions: tuple[TextClassificationLabel]... ,

a tuple containing the predicted labels

model_version: str

the version of the model used for prediction

input_tokens: int

Number of input tokens provided to the model.

class yandexcloudmlsdk.models.textclassifiers.result.FewShotTextClassifiersModelResultclass yandex_cloud_ml_sdk._models.text_classifiers.result.FewShotTextClassifiersModelResult

FewShotTextClassifiersModelResult(predictions: ‘tuple[TextClassificationLabel, …]’, model_version: ‘str’, input_tokens: ‘int’)

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.

predictions: tuple[TextClassificationLabel]... ,

a tuple containing the predicted labels

model_version: str

the version of the model used for prediction

input_tokens: int

Number of input tokens provided to the model.

yandex_cloud_ml_sdk._models.text_classifiers.result.TextClassificationResponseT = TypeVar(TextClassificationResponseT, TextClassificationResponse, FewShotTextClassificationResponse)

Type:TypeVar

Invariant TypeVar constrained to yandex.cloud.ai.foundation_models.v1.text_classification.text_classification_service_pb2.TextClassificationResponse and yandex.cloud.ai.foundation_models.v1.text_classification.text_classification_service_pb2.FewShotTextClassificationResponse.

class yandexcloudmlsdk.models.textclassifiers.types.TextClassificationLabelclass yandex_cloud_ml_sdk._models.text_classifiers.types.TextClassificationLabel

This class represents a label for text classification with an associated confidence score.

label: str

the label for the classification

confidence: float

the confidence score associated with the label

get(k[, d]) → D[k] if k in D, else d. d defaults to None.

items() → a set-like object providing a view on D's items

keys() → a set-like object providing a view on D's keys

values() → an object providing a view on D's values

typeddict yandex_cloud_ml_sdk._models.text_classifiers.types.TextClassificationSample

This class represents a sample of text for classification.

Required Keys

  • text (str) – the text to be classified
  • label (str) – the expected label for the classification

Image generationImage generation

class yandexcloudmlsdk.models.imagegeneration.result.ImageGenerationModelResultclass yandex_cloud_ml_sdk._models.image_generation.result.ImageGenerationModelResult

This class represents the result of an image generation model inference.

image_bytes: bytes

the generated image in bytes

model_version: str

the version of the model used for generation

_repr_jpeg_()

Return type

bytes | None

Chat completionsChat completions

class yandexcloudmlsdk.chat.completions.result.ChatModelResultclass yandex_cloud_ml_sdk._chat.completions.result.ChatModelResult

Result of a chat model completion request.

Contains all completion choices, usage statistics, and metadata from the chat completion API response.

choices: tuple[ChatChoice[ToolCallTypeT]... ,]

Tuple of choices/alternatives generated by the model

usage: ChatUsage | None

Usage statistics for the completion request

created: datetime

Date and time when completion request was performed

model: str

URI of the chat model used for generating the result

id: str

ID of the completion request (for debugging purposes)

property alternatives: tuple[ChatChoice[ToolCallTypeT]... ,]

Synonym for choices attribute for compatibility with sdk.models.completions naming.

property role: str

Shortcut for result.choice[0].role

property content: str

Shortcut for result.choice[0].content

property text: str

Shortcut for result.choice[0].text

property reasoning_text: str | None

Shortcut for result.choice[0].reasoning_text

property reasoning_content: str | None

Shortcut for result.choice[0].reasoning_content

property status: AlternativeStatus

Shortcut for result.choice[0].status

count(value) → integer -- return number of occurrences of value

property finish_reason: FinishReason

Shortcut for result.choice[0].finish_reason

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.

property tool_calls: HttpToolCallList[ToolCallTypeT] | None

Shortcut for result.choice[0].tool_calls

class yandexcloudmlsdk.chat.completions.result.ChatChoiceclass yandex_cloud_ml_sdk._chat.completions.result.ChatChoice

A class representing one completion choice/alternative from a chat model.

Contains the generated text, tool calls, reasoning text, and metadata about how the completion was finished.

finish_reason: FinishReason

Reason why completion request was finished

status: AlternativeStatus

Request status (semantic synonym for finish_reason), but with sdk.models.completions flavour

tool_calls: HttpToolCallList[ToolCallTypeT] | None

Tool call objects if model returned them

reasoning_text: str | None

Reasoning text if model generated any

property content: str

Alias for text property for compatibility with chat naming.

property reasoning_content: str | None

Alias for reasoning_text property for compatibility with chat naming.

role: str

text: str

class yandexcloudmlsdk.chat.completions.result.FinishReasonclass yandex_cloud_ml_sdk._chat.completions.result.FinishReason

Enumeration of possible completion request finish reasons.

Defines all possible reasons why a chat completion request was terminated.

STOP = 'stop'

Completion request completed successfully

LENGTH = 'length'

Completion request was terminated due to max_tokens limit

CONTENT_FILTER = 'content_filter'

Completion request was terminated by content filter

TOOL_CALLS = 'tool_calls'

Completion request returned tool calls

NULL = 'null'

Streaming completion request in progress

USAGE = 'usage'

Special finish reason for streaming messages with only usage information

class yandexcloudmlsdk.chat.completions.result.ChatUsageclass yandex_cloud_ml_sdk._chat.completions.result.ChatUsage

A class representing usage statistics for chat completion requests.

Extends the base Usage class with chat-specific convenience properties.

property prompt_tokens: int

Alias for input_text_tokens for compatibility with chat naming.

completion_tokens: int

the number of tokens generated in the completion

input_text_tokens: int

the number of tokens in the input text

total_tokens: int

the total number of tokens used

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

Предыдущая
Tuning
Следующая
Datasets
Проект Яндекса
© 2025 ООО «Яндекс.Облако»