Assistant types
- class yandex_cloud_ml_sdk._types.expiration.ExpirationPolicy
- class yandex_cloud_ml_sdk._types.expiration.ExpirationConfig
- class yandex_cloud_ml_sdk._types.expiration.ExpirationPolicyAlias
- class yandex_cloud_ml_sdk._assistants.prompt_truncation_options.PromptTruncationOptions
- class yandex_cloud_ml_sdk._assistants.prompt_truncation_options.BasePromptTruncationStrategy
- class yandex_cloud_ml_sdk._assistants.prompt_truncation_options.AutoPromptTruncationStrategy
- class yandex_cloud_ml_sdk._assistants.prompt_truncation_options.LastMessagesPromptTruncationStrategy
- class yandex_cloud_ml_sdk._assistants.prompt_truncation_options.PromptTruncationStrategyType
- class yandex_cloud_ml_sdk._assistants.assistant.ReadOnlyAssistant
- class yandex_cloud_ml_sdk._assistants.assistant.AssistantVersion
yandex_cloud_ml_sdk._types.expiration.ExpirationProtoTypeT_contra = TypeVar(ExpirationProtoTypeT_contra, bound=Union, contravariant=True)
Type:TypeVar
Contravariant TypeVar
class yandex_cloud_ml_sdk._types.expiration.ExpirationPolicy
STATIC = 1
SINCE_LAST_ACTIVE = 2
class yandex_cloud_ml_sdk._types.expiration.ExpirationConfig
ExpirationConfig(ttl_days: ‘int | None’ = None, expiration_policy: ‘ExpirationPolicy | None’ = None)
expiration_policy: ExpirationPolicy | None
classmethod coerce(ttl_days, expiration_policy)
|
Parameters |
|
|
Return type |
to_proto()
|
Return type |
ExpirationConfig | None |
__init__(ttl_days=None, expiration_policy=None)
|
Parameters |
|
|
Return type |
None |
yandex_cloud_ml_sdk._types.expiration.ExpirationPolicyAlias
alias of ExpirationPolicy | Literal
class yandex_cloud_ml_sdk._types.expiration.ExpirationPolicyAlias
class yandex_cloud_ml_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
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
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 yandex_cloud_ml_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 yandex_cloud_ml_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 yandex_cloud_ml_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_cloud_ml_sdk._assistants.prompt_truncation_options.PromptTruncationStrategyType
alias of Literal
class yandex_cloud_ml_sdk._assistants.prompt_truncation_options.PromptTruncationStrategyType
class yandex_cloud_ml_sdk._assistants.assistant.ReadOnlyAssistant
Base class providing read-only access to Yandex Cloud ML Assistant configuration and metadata.
This class implements the core interface for interacting with Yandex Cloud ML Assistant API in a read-only manner. It serves as the parent class for both synchronous (Assistant) and asynchronous (AsyncAssistant) implementations.
The name of the assistant.
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.
Additional labels associated with the assistant.
property max_prompt_tokens: int
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.
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 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 yandex_cloud_ml_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.
Mask specifying which fields were updated in this version. Mask also have a custom JSON encoding