Runs domain
class yandex_cloud_ml_sdk._runs.domain.AsyncRuns
Class for Runs operations. Provides core functionality for managing assistant execution in streams.
For usage examples see runs example
async get(run_id, *, timeout=60)
Get a run by ID.
|
Parameters |
|
|
Return type |
async get_last_by_thread(thread, *, timeout=60)
Get the last run for a thread.
|
Parameters |
|
|
Return type |
async list(*, page_size=Undefined, timeout=60)
List runs. Returns an async iterator to retrieve all runs.
|
Parameters |
|
|
Return type |
class yandex_cloud_ml_sdk._runs.run.AsyncRun
Asynchronous implementation of Run operations.
Represents a server-side Run object that has been started by an assistant on a specific thread. It implements the Operation interface, allowing you to monitor the Run’s execution on the server, track its progress, and retrieve its results.
The AsyncRun provides asynchronous methods to: - Listen to real-time events from the running assistant - Submit tool execution results back to continue the conversation - Monitor the Run’s status and retrieve final results - Handle the complete lifecycle of an assistant conversation session
async listen(*, events_start_idx=0, timeout=60)
Listen to run events stream.
|
Parameters |
|
|
Return type |
async submit_tool_results(tool_results, *, timeout=60)
Submit tool execution results to continue the run.
|
Parameters |
|
|
Return type |
None |
async cancel(*, timeout=60)
|
Parameters |
timeout (float |
|
Return type |
None |
property custom_max_prompt_tokens: int
Get max prompt tokens from truncation options if set.
async get_result(*, timeout=60)
|
Parameters |
timeout (float |
|
Return type |
async get_status(*, timeout=60)
|
Parameters |
timeout (float |
|
Return type |
async wait(*, timeout=60, poll_timeout=None, poll_interval=None)
|
Parameters |
|
|
Return type |
id: str
Unique run identifier
assistant_id: str
ID of the assistant used
thread_id: str
ID of the thread used
created_by: str
Creator of the run
created_at: datetime
Creation timestamp
Optional metadata labels
custom_temperature: float
Custom temperature setting
Custom max tokens setting
custom_prompt_truncation_options: PromptTruncationOptions | None
Custom prompt truncation options
custom_response_format: ResponseType | None
Custom response format