Threads domain
class yandex_cloud_ml_sdk._threads.domain.AsyncThreads
A class for managing threads. It is a part of Assistants API.
This class provides methods to create, retrieve, and list threads.
async create(*, name=Undefined, description=Undefined, labels=Undefined, ttl_days=Undefined, expiration_policy=Undefined, timeout=60)
Create a new thread.
This method creates a new thread with the specified parameters.
|
Parameters |
|
|
Return type |
async get(thread_id, *, timeout=60)
Retrieve a thread by its id.
This method fetches an already created thread using its unique identifier.
|
Parameters |
|
|
Return type |
async list(*, page_size=Undefined, timeout=60)
List threads in the specified folder.
This method retrieves a list of threads. It continues to fetch threads until there are no more available.
|
Parameters |
|
|
Return type |
class yandex_cloud_ml_sdk._threads.thread.AsyncThread
async update(*, name=Undefined, description=Undefined, labels=Undefined, ttl_days=Undefined, expiration_policy=Undefined, timeout=60)
Update the thread’s properties, including the name, the description, labels, ttl days, and the expiration policy of the thread.
|
Parameters |
|
|
Return type |
async delete(*, timeout=60)
Delete the thread.
This method deletes the thread and marks it as deleted. Raises an exception if the deletion fails.
|
Parameters |
timeout (float |
|
Return type |
None |
async write(message, *, labels=Undefined, timeout=60)
Write a message to the thread.
This method allows sending a message to the thread with optional labels.
|
Parameters |
|
|
Return type |
async read(*, timeout=60)
Read messages from the thread.
This method allows iterating over messages in the thread.
|
Parameters |
timeout (float |
|
Return type |
the name of the thread
the description of the thread
created_by: str
the identifier of the user who created the thread
created_at: datetime
the timestamp when the thread was created
updated_by: str
the identifier of the user who last updated the thread
updated_at: datetime
the timestamp when the thread was last updated
expires_at: datetime
the timestamp when the thread will expire
additional labels associated with the thread
expiration_config: ExpirationConfig
id: str