Assistants domain
class yandex_cloud_ml_sdk._assistants.domain.AsyncAssistants
Base class for assistants management.
Provides common functionality for creating, getting and listing assistants.
async create(model, *, temperature=Undefined, max_tokens=Undefined, instruction=Undefined, max_prompt_tokens=Undefined, prompt_truncation_strategy=Undefined, name=Undefined, description=Undefined, labels=Undefined, ttl_days=Undefined, tools=Undefined, expiration_policy=Undefined, response_format=Undefined, timeout=60)
Create a new assistant instance.
|
Parameters |
|
|
Return type |
async get(assistant_id, *, timeout=60)
Get an existing assistant by ID.
|
Parameters |
|
|
Return type |
async list(*, page_size=Undefined, timeout=60)
List all assistants.
|
Parameters |
|
|
Return type |
class yandex_cloud_ml_sdk._assistants.assistant.AsyncAssistant
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.
async update(*, model=Undefined, temperature=Undefined, max_tokens=Undefined, instruction=Undefined, max_prompt_tokens=Undefined, prompt_truncation_strategy=Undefined, name=Undefined, description=Undefined, labels=Undefined, ttl_days=Undefined, tools=Undefined, expiration_policy=Undefined, response_format=Undefined, timeout=60)
Update the assistant’s configuration with new parameters.
This method sends an update request to Yandex Cloud ML API to modify the assistant’s configuration. Only specified parameters will be updated, others remain unchanged.
|
Parameters |
|
|
Return type |
Self |
async delete(*, timeout=60)
Delete the assistant from Yandex Cloud ML.
Sends a delete request to the Yandex Cloud ML API to remove the assistant. After successful deletion, marks the assistant as deleted internally.
|
Parameters |
timeout (float |
|
Return type |
None |
async list_versions(page_size=Undefined, page_token=Undefined, timeout=60)
List all versions of the assistant.
This method retrieves historical versions of the assistant in a paginated manner.
|
Parameters |
|
|
Return type |
async run(thread, *, custom_temperature=Undefined, custom_max_tokens=Undefined, custom_max_prompt_tokens=Undefined, custom_prompt_truncation_strategy=Undefined, custom_response_format=Undefined, timeout=60)
Execute a non-streaming run with the assistant on the given thread.
|
Parameters |
|
|
Return type |
async run_stream(thread, *, custom_temperature=Undefined, custom_max_tokens=Undefined, custom_max_prompt_tokens=Undefined, custom_prompt_truncation_strategy=Undefined, custom_response_format=Undefined, timeout=60)
Execute a streaming run with the assistant on the given thread.
|
Parameters |
|
|
Return type |
property max_prompt_tokens: int
Returns the maximum number of prompt tokens allowed for the assistant.
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.
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