Messages
- Assistant-related message types
- class yandex_cloud_ml_sdk._messages.message.Message
- class yandex_cloud_ml_sdk._messages.message.PartialMessage
- class yandex_cloud_ml_sdk._messages.message.Author
- class yandex_cloud_ml_sdk._messages.message.MessageStatus
- class yandex_cloud_ml_sdk._messages.citations.Citation
- class yandex_cloud_ml_sdk._messages.citations.Source
- Completions-related message types
- Chat completions related message types
- Image generation messages
Assistant-related message types
class yandex_cloud_ml_sdk._messages.message.Message
Represents a message in a conversation thread.
thread_id: str
ID of the thread containing this message
created_by: str
ID of the user/assistant who created the message
created_at: datetime
Timestamp when the message was created
A set of labels for the message.
author: Author
Author information
citations: tuple
Tuple of citations in this message
status: MessageStatus
Current status of the message
property role: str
Get the role of the message author.
property text: str
Get concatenated string of all text parts in the message by joining all string parts.
parts: tuple
Tuple containing message parts (can be strings or other types)
id: str
class yandex_cloud_ml_sdk._messages.message.PartialMessage
Represents a partial message. Used for streaming responses where content arrives in chunks.
property text: str
Get concatenated string of all text parts in the message by joining all string parts.
parts: tuple
Tuple containing message parts (can be strings or other types)
id: str
class yandex_cloud_ml_sdk._messages.message.Author
Represents the author of a message.
id: str
Unique identifier of the message author
role: str
Role of the author (e.g., ‘user’, ‘assistant’)
class yandex_cloud_ml_sdk._messages.message.MessageStatus
Enum representing possible message statuses.
Примечание
Values are inherited from protobuf definitions.
MESSAGE_STATUS_UNSPECIFIED = 0
COMPLETED = 1
Message was successfully created by a user or generated by an assistant.
TRUNCATED = 2
Message generation was truncated due to reaching the maximum allowed number of tokens.
FILTERED_CONTENT = 3
Message generation was stopped because potentially sensitive content was detected either in the prompt or in the generated response.
__new__(value)
class yandex_cloud_ml_sdk._messages.citations.Citation
Represents a citation from search results with multiple sources.
A citation contains references to one or more sources from search indexes that were used to generate or support the content. This is typically used in generative AI responses to provide attribution for factual information.
Tuple of Source objects referenced in this citation
class yandex_cloud_ml_sdk._messages.citations.Source
Abstract base class for citation sources.
abstract property type: str
Get the type identifier of this source.
Completions-related message types
class yandex_cloud_ml_sdk._types.message.TextMessage
TextMessage(role: ‘str’, text: ‘str’)
role: str
text: str
class yandex_cloud_ml_sdk._types.message.TextMessageProtocol
property role: str
property text: str
typeddict yandex_cloud_ml_sdk._types.message.TextMessageDict
|
Required Keys |
yandex_cloud_ml_sdk._types.message.coerce_to_text_message_dict(message)
|
Parameters |
message (TextMessage | TextMessageDict | TextMessageProtocol | str |
|
Return type |
typeddict yandex_cloud_ml_sdk._models.completions.message.FunctionResultMessageDict
A class with the TypedDict representing the structure of a function result message. The dictionary contains the role of the message sender and the results of tool calls.
|
Required Keys |
|
typeddict yandex_cloud_ml_sdk._tools.tool_result.FunctionResultDict
|
Required Keys |
typeddict yandex_cloud_ml_sdk._types.tools.function.FunctionDictType
|
Required Keys |
|
typeddict yandex_cloud_ml_sdk._types.tools.function.FunctionNameType
|
Required Keys |
class yandex_cloud_ml_sdk._models.completions.token.Token
This class encapsulates the properties of a token and represents it in a text processing context.
id: int
a unique identifier for the token
special: bool
a flag indicating if the token is a special one
text: str
the textual representation of the token
Chat completions related message types
typeddict yandex_cloud_ml_sdk._chat.completions.message.ChatFunctionResultMessageDict
Function call result message in chat domain format.
Used to represent the result of a function/tool call in chat conversations.
|
Required Keys |
typeddict yandex_cloud_ml_sdk._chat.completions.message.MultimodalMessageDict
Multimodal message supporting both text and image content.
Allows passing multiple content types (text and images) in a single message.
|
Required Keys |
|
typeddict yandex_cloud_ml_sdk._chat.completions.message.TextContent
Text content type for multimodal messages.
Used to include text data in multimodal chat messages.
|
Required Keys |
|
typeddict yandex_cloud_ml_sdk._chat.completions.message.ImageUrlContent
Image content type for multimodal messages.
Used to include image data in multimodal chat messages.
|
Required Keys |
|
typeddict yandex_cloud_ml_sdk._chat.completions.message.ImageUrlDict
Dictionary for passing image URL in multimodal messages.
|
Required Keys |
|
Image generation messages
class yandex_cloud_ml_sdk._models.image_generation.message.ImageMessage
This class represents a message for using in image generation models with optional weight field.
text: str
the text content of the message for using in image generation models
the weight associated with the message
typeddict yandex_cloud_ml_sdk._models.image_generation.message.ImageMessageDict
The class with TypedDict representing the structure of an image message.
|
Required Keys |
class yandex_cloud_ml_sdk._models.image_generation.message.AnyMessage
The class with a protocol which defines an object with a text field. The protocol can be used to check if an object has a text attribute.
text: str
yandex_cloud_ml_sdk._models.image_generation.message.ImageMessageType
type alias for different types of messages that can be processed by image generation models
Alias of Union
yandex_cloud_ml_sdk._models.image_generation.message.ImageMessageInputType
type alias for input types accepted by the messages_to_proto function
Alias of Union