Yandex Cloud
Search
Contact UsGet started
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • AI for business
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
© 2025 Direct Cursus Technology L.L.C.
Yandex AI Studio
    • About Yandex AI Studio
    • Yandex Workflows
    • Quotas and limits
    • Terms and definitions
  • Compatibility with OpenAI
    • About Yandex Cloud ML SDK
      • Overview
        • Overview
        • Models domain
        • Assistants domain
        • Tools domain
        • Files domain
        • Threads domain
        • Runs domain
        • Search indexes domain
        • Search API domain
        • Datasets domain
        • Tuning domain
        • Batch domain
        • Chat domain
      • Authentication
      • Request retries
  • Access management
  • Pricing policy
  • Audit Trails events
  • Public materials
  • Release notes

In this article:

  • class yandex_cloud_ml_sdk._runs.domain.AsyncRuns
  • class yandex_cloud_ml_sdk._runs.run.AsyncRun
  1. Yandex Cloud ML SDK
  2. SDK reference
  3. Async SDK
  4. Runs domain

Runs domain

Written by
Yandex Cloud
Updated at November 7, 2025
  • class yandex_cloud_ml_sdk._runs.domain.AsyncRuns
  • class yandex_cloud_ml_sdk._runs.run.AsyncRun

class yandexcloudmlsdk.runs.domain.AsyncRunsclass 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

  • run_id (str) – Run ID
  • timeout (float) – The timeout, or the maximum time to wait for the request to complete in seconds. Defaults to 60 seconds.

Return type

AsyncRun

async get_last_by_thread(thread, *, timeout=60)

Get the last run for a thread.

Parameters

  • thread (str | BaseThread) – Thread ID or instance
  • timeout (float) – The timeout, or the maximum time to wait for the request to complete in seconds. Defaults to 60 seconds.

Return type

AsyncRun

async list(*, page_size=Undefined, timeout=60)

List runs. Returns an async iterator to retrieve all runs.

Parameters

  • page_size (int | Undefined) – Number of items per page. Larger values reduce the number of network calls but increase memory consumption per request.
  • timeout (float) – The timeout, or the maximum time to wait for each network request to complete in seconds. Defaults to 60 seconds. This affects the network behavior but not the total time for iteration.

Return type

AsyncIterator[AsyncRun]

class yandexcloudmlsdk.runs.run.AsyncRunclass 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

  • events_start_idx (int) – Starting event index
  • timeout (float) – The timeout, or the maximum time to wait for the request to complete in seconds. Defaults to 60 seconds.

Return type

AsyncIterator[RunStreamEvent[AsyncToolCall]]

async submit_tool_results(tool_results, *, timeout=60)

Submit tool execution results to continue the run.

Parameters

  • tool_results (FunctionResultDict | Iterable[FunctionResultDict]) – Tool call results to submit
  • timeout (float) – The timeout, or the maximum time to wait for the request to complete in seconds. Defaults to 60 seconds.

Return type

None

async cancel(*, timeout=60)

Parameters

timeout (float)

Return type

None

property custom_max_prompt_tokens: int | None

Get max prompt tokens from truncation options if set.

async get_result(*, timeout=60)

Parameters

timeout (float)

Return type

AnyResultTypeT_co

async get_status(*, timeout=60)

Parameters

timeout (float)

Return type

OperationStatusTypeT

async wait(*, timeout=60, poll_timeout=None, poll_interval=None)

Parameters

  • timeout (float)
  • poll_timeout (int | None)
  • poll_interval (float | None)

Return type

AnyResultTypeT_co

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

labels: dict[str, str] | None

Optional metadata labels

custom_temperature: float | None

Custom temperature setting

custom_max_tokens: int | None

Custom max tokens setting

custom_prompt_truncation_options: PromptTruncationOptions | None

Custom prompt truncation options

custom_response_format: ResponseType | None

Custom response format

Was the article helpful?

Previous
Threads domain
Next
Search indexes domain
© 2025 Direct Cursus Technology L.L.C.