docstr: Create a run.
  
  Args:
    assistant_id: The ID of the
        [assistant](https://platform.openai.com/docs/api-reference/assistants) to use to
        execute this run.
  
    additional_instructions: Appends additional instructions at the end of the instructions for the run. This
        is useful for modifying the behavior on a per-run basis without overriding other
        instructions.
  
    instructions: Overrides the
        [instructions](https://platform.openai.com/docs/api-reference/assistants/createAssistant)
        of the assistant. This is useful for modifying the behavior on a per-run basis.
  
    metadata: Set of 16 key-value pairs that can be attached to an object. This can be useful
        for storing additional information about the object in a structured format. Keys
        can be a maximum of 64 characters long and values can be a maxium of 512
        characters long.
  
    model: The ID of the [Model](https://platform.openai.com/docs/api-reference/models) to
        be used to execute this run. If a value is provided here, it will override the
        model associated with the assistant. If not, the model associated with the
        assistant will be used.
  
    tools: Override the tools the assistant can use for this run. This is useful for
        modifying the behavior on a per-run basis.
  
    extra_headers: Send extra headers
  
    extra_query: Add additional query parameters to the request
  
    extra_body: Add additional JSON properties to the request
  
    timeout: Override the client-level default timeout for this request, in seconds
code: def create(
      self,
      thread_id: str,
      *,
      assistant_id: str,
      additional_instructions: Optional[str] | NotGiven = NOT_GIVEN,
      instructions: Optional[str] | NotGiven = NOT_GIVEN,
      metadata: Optional[object] | NotGiven = NOT_GIVEN,
      model: Optional[str] | NotGiven = NOT_GIVEN,
      tools: Optional[List[run_create_params.Tool]]
      | NotGiven = NOT_GIVEN,
      # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
      # The extra values given here take precedence over values defined on the client or passed to this method.
      extra_headers: Headers | None = None,
      extra_query: Query | None = None,
      extra_body: Body | None = None,
      timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
  ) -> Run:
      """
      Create a run.
  
      Args:
        assistant_id: The ID of the
            [assistant](https://platform.openai.com/docs/api-reference/assistants) to use to
            execute this run.
  
        additional_instructions: Appends additional instructions at the end of the instructions for the run. This
            is useful for modifying the behavior on a per-run basis without overriding other
            instructions.
  
        instructions: Overrides the
            [instructions](https://platform.openai.com/docs/api-reference/assistants/createAssistant)
            of the assistant. This is useful for modifying the behavior on a per-run basis.
  
        metadata: Set of 16 key-value pairs that can be attached to an object. This can be useful
            for storing additional information about the object in a structured format. Keys
            can be a maximum of 64 characters long and values can be a maxium of 512
            characters long.
  
        model: The ID of the [Model](https://platform.openai.com/docs/api-reference/models) to
            be used to execute this run. If a value is provided here, it will override the
            model associated with the assistant. If not, the model associated with the
            assistant will be used.
  
        tools: Override the tools the assistant can use for this run. This is useful for
            modifying the behavior on a per-run basis.
  
        extra_headers: Send extra headers
  
        extra_query: Add additional query parameters to the request
  
        extra_body: Add additional JSON properties to the request
  
        timeout: Override the client-level default timeout for this request, in seconds
      """
      if not thread_id:
          raise ValueError(
              f"Expected a non-empty value for `thread_id` but received {thread_id!r}"
          )
      extra_headers = {
          "OpenAI-Beta": "assistants=v1",
          **(extra_headers or {}),
      }
      return self._post(
          f"/threads/{thread_id}/runs",
          body=maybe_transform(
              {
                  "assistant_id": assistant_id,
                  "additional_instructions": additional_instructions,
                  "instructions": instructions,
                  "metadata": metadata,
                  "model": model,
                  "tools": tools,
              },
              run_create_params.RunCreateParams,
          ),
          options=make_request_options(
              extra_headers=extra_headers,
              extra_query=extra_query,
              extra_body=extra_body,
              timeout=timeout,
          ),
          cast_to=Run,
      )
  
imports: from __future__ import annotations
  from typing import List, Optional
  from typing_extensions import Literal
  import httpx
  from .....None import _legacy_response
  from .steps import Steps, AsyncSteps, StepsWithRawResponse, AsyncStepsWithRawResponse, StepsWithStreamingResponse, AsyncStepsWithStreamingResponse
  from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven
  from ....._utils import maybe_transform
  from ....._compat import cached_property
  from ....._resource import SyncAPIResource, AsyncAPIResource
  from ....._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper
  from .....pagination import SyncCursorPage, AsyncCursorPage
  from ....._base_client import AsyncPaginator, make_request_options
  from .....types.beta.threads import Run, run_list_params, run_create_params, run_update_params, run_submit_tool_outputs_params
label_desc: Use image node_id 4 for calling the Runs obj's underlying member method code with example usage: obj.create(thread_id) and returns: self