Index
Modules:
| Name | Description | 
|---|---|
runs | 
          
             | 
        
steps | 
          
             | 
        
Classes:
          AsyncRuns
AsyncRuns(client: AsyncOpenAI)
Methods:
| Name | Description | 
|---|---|
cancel | 
            
               Cancels a run that is   | 
          
create | 
            
               | 
          
create_and_stream | 
            
               Create a Run stream  | 
          
list | 
            
               Returns a list of runs belonging to a thread.  | 
          
retrieve | 
            
               Retrieves a run.  | 
          
steps | 
            
               | 
          
submit_tool_outputs | 
            
               | 
          
submit_tool_outputs_stream | 
            
               Submit the tool outputs from a previous run and stream the run to a terminal  | 
          
update | 
            
               Modifies a run.  | 
          
with_raw_response | 
            
               | 
          
with_streaming_response | 
            
               | 
          
          cancel
  
  
      async
  
cancel(
    run_id: str,
    *,
    thread_id: str,
    extra_headers: Headers | None = None,
    extra_query: Query | None = None,
    extra_body: Body | None = None,
    timeout: float | Timeout | None | NotGiven = NOT_GIVEN
) -> Run
Cancels a run that is in_progress.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
              extra_headers
           | 
          
                Headers | None
           | 
          
             Send extra headers  | 
          
                None
           | 
        
              extra_query
           | 
          
                Query | None
           | 
          
             Add additional query parameters to the request  | 
          
                None
           | 
        
              extra_body
           | 
          
                Body | None
           | 
          
             Add additional JSON properties to the request  | 
          
                None
           | 
        
              timeout
           | 
          
                float | Timeout | None | NotGiven
           | 
          
             Override the client-level default timeout for this request, in seconds  | 
          
                NOT_GIVEN
           | 
        
          create
  
  
      async
  
        create(
    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,
    stream: Optional[Literal[False]] | NotGiven = NOT_GIVEN,
    tools: (
        Optional[Iterable[AssistantToolParam]] | NotGiven
    ) = NOT_GIVEN,
    extra_headers: Headers | None = None,
    extra_query: Query | None = None,
    extra_body: Body | None = None,
    timeout: float | Timeout | None | NotGiven = NOT_GIVEN
) -> Run
create(
    thread_id: str,
    *,
    assistant_id: str,
    stream: Literal[True],
    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[Iterable[AssistantToolParam]] | NotGiven
    ) = NOT_GIVEN,
    extra_headers: Headers | None = None,
    extra_query: Query | None = None,
    extra_body: Body | None = None,
    timeout: float | Timeout | None | NotGiven = NOT_GIVEN
) -> AsyncStream[AssistantStreamEvent]
create(
    thread_id: str,
    *,
    assistant_id: str,
    stream: bool,
    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[Iterable[AssistantToolParam]] | NotGiven
    ) = NOT_GIVEN,
    extra_headers: Headers | None = None,
    extra_query: Query | None = None,
    extra_body: Body | None = None,
    timeout: float | Timeout | None | NotGiven = NOT_GIVEN
) -> Run | AsyncStream[AssistantStreamEvent]
create(
    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,
    stream: (
        Optional[Literal[False]] | Literal[True] | NotGiven
    ) = NOT_GIVEN,
    tools: (
        Optional[Iterable[AssistantToolParam]] | NotGiven
    ) = NOT_GIVEN,
    extra_headers: Headers | None = None,
    extra_query: Query | None = None,
    extra_body: Body | None = None,
    timeout: float | Timeout | None | NotGiven = NOT_GIVEN
) -> Run | AsyncStream[AssistantStreamEvent]
          create_and_stream
        create_and_stream(
    *,
    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[Iterable[AssistantToolParam]] | NotGiven
    ) = NOT_GIVEN,
    thread_id: str,
    extra_headers: Headers | None = None,
    extra_query: Query | None = None,
    extra_body: Body | None = None,
    timeout: float | Timeout | None | NotGiven = NOT_GIVEN
) -> AsyncAssistantStreamManager[
    AsyncAssistantEventHandler
]
create_and_stream(
    *,
    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[Iterable[AssistantToolParam]] | NotGiven
    ) = NOT_GIVEN,
    thread_id: str,
    event_handler: AsyncAssistantEventHandlerT,
    extra_headers: Headers | None = None,
    extra_query: Query | None = None,
    extra_body: Body | None = None,
    timeout: float | Timeout | None | NotGiven = NOT_GIVEN
) -> AsyncAssistantStreamManager[
    AsyncAssistantEventHandlerT
]
create_and_stream(
    *,
    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[Iterable[AssistantToolParam]] | NotGiven
    ) = NOT_GIVEN,
    thread_id: str,
    event_handler: (
        AsyncAssistantEventHandlerT | None
    ) = None,
    extra_headers: Headers | None = None,
    extra_query: Query | None = None,
    extra_body: Body | None = None,
    timeout: float | Timeout | None | NotGiven = NOT_GIVEN
) -> (
    AsyncAssistantStreamManager[AsyncAssistantEventHandler]
    | AsyncAssistantStreamManager[
        AsyncAssistantEventHandlerT
    ]
)
Create a Run stream
          list
list(
    thread_id: str,
    *,
    after: str | NotGiven = NOT_GIVEN,
    before: str | NotGiven = NOT_GIVEN,
    limit: int | NotGiven = NOT_GIVEN,
    order: Literal["asc", "desc"] | NotGiven = NOT_GIVEN,
    extra_headers: Headers | None = None,
    extra_query: Query | None = None,
    extra_body: Body | None = None,
    timeout: float | Timeout | None | NotGiven = NOT_GIVEN
) -> AsyncPaginator[Run, AsyncCursorPage[Run]]
Returns a list of runs belonging to a thread.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
              after
           | 
          
                str | NotGiven
           | 
          
             A cursor for use in pagination.   | 
          
                NOT_GIVEN
           | 
        
              before
           | 
          
                str | NotGiven
           | 
          
             A cursor for use in pagination.   | 
          
                NOT_GIVEN
           | 
        
              limit
           | 
          
                int | NotGiven
           | 
          
             A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.  | 
          
                NOT_GIVEN
           | 
        
              order
           | 
          
                Literal['asc', 'desc'] | NotGiven
           | 
          
             Sort order by the   | 
          
                NOT_GIVEN
           | 
        
              extra_headers
           | 
          
                Headers | None
           | 
          
             Send extra headers  | 
          
                None
           | 
        
              extra_query
           | 
          
                Query | None
           | 
          
             Add additional query parameters to the request  | 
          
                None
           | 
        
              extra_body
           | 
          
                Body | None
           | 
          
             Add additional JSON properties to the request  | 
          
                None
           | 
        
              timeout
           | 
          
                float | Timeout | None | NotGiven
           | 
          
             Override the client-level default timeout for this request, in seconds  | 
          
                NOT_GIVEN
           | 
        
          retrieve
  
  
      async
  
retrieve(
    run_id: str,
    *,
    thread_id: str,
    extra_headers: Headers | None = None,
    extra_query: Query | None = None,
    extra_body: Body | None = None,
    timeout: float | Timeout | None | NotGiven = NOT_GIVEN
) -> Run
Retrieves a run.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
              extra_headers
           | 
          
                Headers | None
           | 
          
             Send extra headers  | 
          
                None
           | 
        
              extra_query
           | 
          
                Query | None
           | 
          
             Add additional query parameters to the request  | 
          
                None
           | 
        
              extra_body
           | 
          
                Body | None
           | 
          
             Add additional JSON properties to the request  | 
          
                None
           | 
        
              timeout
           | 
          
                float | Timeout | None | NotGiven
           | 
          
             Override the client-level default timeout for this request, in seconds  | 
          
                NOT_GIVEN
           | 
        
          submit_tool_outputs
  
  
      async
  
        submit_tool_outputs(
    run_id: str,
    *,
    thread_id: str,
    tool_outputs: Iterable[ToolOutput],
    stream: Optional[Literal[False]] | NotGiven = NOT_GIVEN,
    extra_headers: Headers | None = None,
    extra_query: Query | None = None,
    extra_body: Body | None = None,
    timeout: float | Timeout | None | NotGiven = NOT_GIVEN
) -> Run
submit_tool_outputs(
    run_id: str,
    *,
    thread_id: str,
    stream: Literal[True],
    tool_outputs: Iterable[ToolOutput],
    extra_headers: Headers | None = None,
    extra_query: Query | None = None,
    extra_body: Body | None = None,
    timeout: float | Timeout | None | NotGiven = NOT_GIVEN
) -> AsyncStream[AssistantStreamEvent]
submit_tool_outputs(
    run_id: str,
    *,
    thread_id: str,
    stream: bool,
    tool_outputs: Iterable[ToolOutput],
    extra_headers: Headers | None = None,
    extra_query: Query | None = None,
    extra_body: Body | None = None,
    timeout: float | Timeout | None | NotGiven = NOT_GIVEN
) -> Run | AsyncStream[AssistantStreamEvent]
submit_tool_outputs(
    run_id: str,
    *,
    thread_id: str,
    tool_outputs: Iterable[ToolOutput],
    stream: (
        Optional[Literal[False]] | Literal[True] | NotGiven
    ) = NOT_GIVEN,
    extra_headers: Headers | None = None,
    extra_query: Query | None = None,
    extra_body: Body | None = None,
    timeout: float | Timeout | None | NotGiven = NOT_GIVEN
) -> Run | AsyncStream[AssistantStreamEvent]
          submit_tool_outputs_stream
        submit_tool_outputs_stream(
    *,
    tool_outputs: Iterable[ToolOutput],
    run_id: str,
    thread_id: str,
    extra_headers: Headers | None = None,
    extra_query: Query | None = None,
    extra_body: Body | None = None,
    timeout: float | Timeout | None | NotGiven = NOT_GIVEN
) -> AsyncAssistantStreamManager[
    AsyncAssistantEventHandler
]
submit_tool_outputs_stream(
    *,
    tool_outputs: Iterable[ToolOutput],
    run_id: str,
    thread_id: str,
    event_handler: AsyncAssistantEventHandlerT,
    extra_headers: Headers | None = None,
    extra_query: Query | None = None,
    extra_body: Body | None = None,
    timeout: float | Timeout | None | NotGiven = NOT_GIVEN
) -> AsyncAssistantStreamManager[
    AsyncAssistantEventHandlerT
]
submit_tool_outputs_stream(
    *,
    tool_outputs: Iterable[ToolOutput],
    run_id: str,
    thread_id: str,
    event_handler: (
        AsyncAssistantEventHandlerT | None
    ) = None,
    extra_headers: Headers | None = None,
    extra_query: Query | None = None,
    extra_body: Body | None = None,
    timeout: float | Timeout | None | NotGiven = NOT_GIVEN
) -> (
    AsyncAssistantStreamManager[AsyncAssistantEventHandler]
    | AsyncAssistantStreamManager[
        AsyncAssistantEventHandlerT
    ]
)
Submit the tool outputs from a previous run and stream the run to a terminal state.
          update
  
  
      async
  
update(
    run_id: str,
    *,
    thread_id: str,
    metadata: Optional[object] | NotGiven = NOT_GIVEN,
    extra_headers: Headers | None = None,
    extra_query: Query | None = None,
    extra_body: Body | None = None,
    timeout: float | Timeout | None | NotGiven = NOT_GIVEN
) -> Run
Modifies a run.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
              metadata
           | 
          
                Optional[object] | NotGiven
           | 
          
             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.  | 
          
                NOT_GIVEN
           | 
        
              extra_headers
           | 
          
                Headers | None
           | 
          
             Send extra headers  | 
          
                None
           | 
        
              extra_query
           | 
          
                Query | None
           | 
          
             Add additional query parameters to the request  | 
          
                None
           | 
        
              extra_body
           | 
          
                Body | None
           | 
          
             Add additional JSON properties to the request  | 
          
                None
           | 
        
              timeout
           | 
          
                float | Timeout | None | NotGiven
           | 
          
             Override the client-level default timeout for this request, in seconds  | 
          
                NOT_GIVEN
           | 
        
          AsyncRunsWithRawResponse
AsyncRunsWithRawResponse(runs: AsyncRuns)
          AsyncRunsWithStreamingResponse
AsyncRunsWithStreamingResponse(runs: AsyncRuns)
          AsyncSteps
AsyncSteps(client: AsyncOpenAI)
Methods:
| Name | Description | 
|---|---|
list | 
            
               Returns a list of run steps belonging to a run.  | 
          
retrieve | 
            
               Retrieves a run step.  | 
          
with_raw_response | 
            
               | 
          
with_streaming_response | 
            
               | 
          
          list
list(
    run_id: str,
    *,
    thread_id: str,
    after: str | NotGiven = NOT_GIVEN,
    before: str | NotGiven = NOT_GIVEN,
    limit: int | NotGiven = NOT_GIVEN,
    order: Literal["asc", "desc"] | NotGiven = NOT_GIVEN,
    extra_headers: Headers | None = None,
    extra_query: Query | None = None,
    extra_body: Body | None = None,
    timeout: float | Timeout | None | NotGiven = NOT_GIVEN
) -> AsyncPaginator[RunStep, AsyncCursorPage[RunStep]]
Returns a list of run steps belonging to a run.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
              after
           | 
          
                str | NotGiven
           | 
          
             A cursor for use in pagination.   | 
          
                NOT_GIVEN
           | 
        
              before
           | 
          
                str | NotGiven
           | 
          
             A cursor for use in pagination.   | 
          
                NOT_GIVEN
           | 
        
              limit
           | 
          
                int | NotGiven
           | 
          
             A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.  | 
          
                NOT_GIVEN
           | 
        
              order
           | 
          
                Literal['asc', 'desc'] | NotGiven
           | 
          
             Sort order by the   | 
          
                NOT_GIVEN
           | 
        
              extra_headers
           | 
          
                Headers | None
           | 
          
             Send extra headers  | 
          
                None
           | 
        
              extra_query
           | 
          
                Query | None
           | 
          
             Add additional query parameters to the request  | 
          
                None
           | 
        
              extra_body
           | 
          
                Body | None
           | 
          
             Add additional JSON properties to the request  | 
          
                None
           | 
        
              timeout
           | 
          
                float | Timeout | None | NotGiven
           | 
          
             Override the client-level default timeout for this request, in seconds  | 
          
                NOT_GIVEN
           | 
        
          retrieve
  
  
      async
  
retrieve(
    step_id: str,
    *,
    thread_id: str,
    run_id: str,
    extra_headers: Headers | None = None,
    extra_query: Query | None = None,
    extra_body: Body | None = None,
    timeout: float | Timeout | None | NotGiven = NOT_GIVEN
) -> RunStep
Retrieves a run step.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
              extra_headers
           | 
          
                Headers | None
           | 
          
             Send extra headers  | 
          
                None
           | 
        
              extra_query
           | 
          
                Query | None
           | 
          
             Add additional query parameters to the request  | 
          
                None
           | 
        
              extra_body
           | 
          
                Body | None
           | 
          
             Add additional JSON properties to the request  | 
          
                None
           | 
        
              timeout
           | 
          
                float | Timeout | None | NotGiven
           | 
          
             Override the client-level default timeout for this request, in seconds  | 
          
                NOT_GIVEN
           | 
        
          AsyncStepsWithRawResponse
AsyncStepsWithRawResponse(steps: AsyncSteps)
          AsyncStepsWithStreamingResponse
AsyncStepsWithStreamingResponse(steps: AsyncSteps)
          Runs
Runs(client: OpenAI)
Methods:
| Name | Description | 
|---|---|
cancel | 
            
               Cancels a run that is   | 
          
create | 
            
               | 
          
create_and_stream | 
            
               Create a Run stream  | 
          
list | 
            
               Returns a list of runs belonging to a thread.  | 
          
retrieve | 
            
               Retrieves a run.  | 
          
steps | 
            
               | 
          
submit_tool_outputs | 
            
               | 
          
submit_tool_outputs_stream | 
            
               Submit the tool outputs from a previous run and stream the run to a terminal  | 
          
update | 
            
               Modifies a run.  | 
          
with_raw_response | 
            
               | 
          
with_streaming_response | 
            
               | 
          
          cancel
cancel(
    run_id: str,
    *,
    thread_id: str,
    extra_headers: Headers | None = None,
    extra_query: Query | None = None,
    extra_body: Body | None = None,
    timeout: float | Timeout | None | NotGiven = NOT_GIVEN
) -> Run
Cancels a run that is in_progress.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
              extra_headers
           | 
          
                Headers | None
           | 
          
             Send extra headers  | 
          
                None
           | 
        
              extra_query
           | 
          
                Query | None
           | 
          
             Add additional query parameters to the request  | 
          
                None
           | 
        
              extra_body
           | 
          
                Body | None
           | 
          
             Add additional JSON properties to the request  | 
          
                None
           | 
        
              timeout
           | 
          
                float | Timeout | None | NotGiven
           | 
          
             Override the client-level default timeout for this request, in seconds  | 
          
                NOT_GIVEN
           | 
        
          create
        create(
    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,
    stream: Optional[Literal[False]] | NotGiven = NOT_GIVEN,
    tools: (
        Optional[Iterable[AssistantToolParam]] | NotGiven
    ) = NOT_GIVEN,
    extra_headers: Headers | None = None,
    extra_query: Query | None = None,
    extra_body: Body | None = None,
    timeout: float | Timeout | None | NotGiven = NOT_GIVEN
) -> Run
create(
    thread_id: str,
    *,
    assistant_id: str,
    stream: Literal[True],
    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[Iterable[AssistantToolParam]] | NotGiven
    ) = NOT_GIVEN,
    extra_headers: Headers | None = None,
    extra_query: Query | None = None,
    extra_body: Body | None = None,
    timeout: float | Timeout | None | NotGiven = NOT_GIVEN
) -> Stream[AssistantStreamEvent]
create(
    thread_id: str,
    *,
    assistant_id: str,
    stream: bool,
    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[Iterable[AssistantToolParam]] | NotGiven
    ) = NOT_GIVEN,
    extra_headers: Headers | None = None,
    extra_query: Query | None = None,
    extra_body: Body | None = None,
    timeout: float | Timeout | None | NotGiven = NOT_GIVEN
) -> Run | Stream[AssistantStreamEvent]
create(
    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,
    stream: (
        Optional[Literal[False]] | Literal[True] | NotGiven
    ) = NOT_GIVEN,
    tools: (
        Optional[Iterable[AssistantToolParam]] | NotGiven
    ) = NOT_GIVEN,
    extra_headers: Headers | None = None,
    extra_query: Query | None = None,
    extra_body: Body | None = None,
    timeout: float | Timeout | None | NotGiven = NOT_GIVEN
) -> Run | Stream[AssistantStreamEvent]
          create_and_stream
        create_and_stream(
    *,
    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[Iterable[AssistantToolParam]] | NotGiven
    ) = NOT_GIVEN,
    thread_id: str,
    extra_headers: Headers | None = None,
    extra_query: Query | None = None,
    extra_body: Body | None = None,
    timeout: float | Timeout | None | NotGiven = NOT_GIVEN
) -> AssistantStreamManager[AssistantEventHandler]
create_and_stream(
    *,
    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[Iterable[AssistantToolParam]] | NotGiven
    ) = NOT_GIVEN,
    thread_id: str,
    event_handler: AssistantEventHandlerT,
    extra_headers: Headers | None = None,
    extra_query: Query | None = None,
    extra_body: Body | None = None,
    timeout: float | Timeout | None | NotGiven = NOT_GIVEN
) -> AssistantStreamManager[AssistantEventHandlerT]
create_and_stream(
    *,
    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[Iterable[AssistantToolParam]] | NotGiven
    ) = NOT_GIVEN,
    thread_id: str,
    event_handler: AssistantEventHandlerT | None = None,
    extra_headers: Headers | None = None,
    extra_query: Query | None = None,
    extra_body: Body | None = None,
    timeout: float | Timeout | None | NotGiven = NOT_GIVEN
) -> (
    AssistantStreamManager[AssistantEventHandler]
    | AssistantStreamManager[AssistantEventHandlerT]
)
Create a Run stream
          list
list(
    thread_id: str,
    *,
    after: str | NotGiven = NOT_GIVEN,
    before: str | NotGiven = NOT_GIVEN,
    limit: int | NotGiven = NOT_GIVEN,
    order: Literal["asc", "desc"] | NotGiven = NOT_GIVEN,
    extra_headers: Headers | None = None,
    extra_query: Query | None = None,
    extra_body: Body | None = None,
    timeout: float | Timeout | None | NotGiven = NOT_GIVEN
) -> SyncCursorPage[Run]
Returns a list of runs belonging to a thread.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
              after
           | 
          
                str | NotGiven
           | 
          
             A cursor for use in pagination.   | 
          
                NOT_GIVEN
           | 
        
              before
           | 
          
                str | NotGiven
           | 
          
             A cursor for use in pagination.   | 
          
                NOT_GIVEN
           | 
        
              limit
           | 
          
                int | NotGiven
           | 
          
             A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.  | 
          
                NOT_GIVEN
           | 
        
              order
           | 
          
                Literal['asc', 'desc'] | NotGiven
           | 
          
             Sort order by the   | 
          
                NOT_GIVEN
           | 
        
              extra_headers
           | 
          
                Headers | None
           | 
          
             Send extra headers  | 
          
                None
           | 
        
              extra_query
           | 
          
                Query | None
           | 
          
             Add additional query parameters to the request  | 
          
                None
           | 
        
              extra_body
           | 
          
                Body | None
           | 
          
             Add additional JSON properties to the request  | 
          
                None
           | 
        
              timeout
           | 
          
                float | Timeout | None | NotGiven
           | 
          
             Override the client-level default timeout for this request, in seconds  | 
          
                NOT_GIVEN
           | 
        
          retrieve
retrieve(
    run_id: str,
    *,
    thread_id: str,
    extra_headers: Headers | None = None,
    extra_query: Query | None = None,
    extra_body: Body | None = None,
    timeout: float | Timeout | None | NotGiven = NOT_GIVEN
) -> Run
Retrieves a run.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
              extra_headers
           | 
          
                Headers | None
           | 
          
             Send extra headers  | 
          
                None
           | 
        
              extra_query
           | 
          
                Query | None
           | 
          
             Add additional query parameters to the request  | 
          
                None
           | 
        
              extra_body
           | 
          
                Body | None
           | 
          
             Add additional JSON properties to the request  | 
          
                None
           | 
        
              timeout
           | 
          
                float | Timeout | None | NotGiven
           | 
          
             Override the client-level default timeout for this request, in seconds  | 
          
                NOT_GIVEN
           | 
        
          submit_tool_outputs
        submit_tool_outputs(
    run_id: str,
    *,
    thread_id: str,
    tool_outputs: Iterable[ToolOutput],
    stream: Optional[Literal[False]] | NotGiven = NOT_GIVEN,
    extra_headers: Headers | None = None,
    extra_query: Query | None = None,
    extra_body: Body | None = None,
    timeout: float | Timeout | None | NotGiven = NOT_GIVEN
) -> Run
submit_tool_outputs(
    run_id: str,
    *,
    thread_id: str,
    stream: Literal[True],
    tool_outputs: Iterable[ToolOutput],
    extra_headers: Headers | None = None,
    extra_query: Query | None = None,
    extra_body: Body | None = None,
    timeout: float | Timeout | None | NotGiven = NOT_GIVEN
) -> Stream[AssistantStreamEvent]
submit_tool_outputs(
    run_id: str,
    *,
    thread_id: str,
    stream: bool,
    tool_outputs: Iterable[ToolOutput],
    extra_headers: Headers | None = None,
    extra_query: Query | None = None,
    extra_body: Body | None = None,
    timeout: float | Timeout | None | NotGiven = NOT_GIVEN
) -> Run | Stream[AssistantStreamEvent]
submit_tool_outputs(
    run_id: str,
    *,
    thread_id: str,
    tool_outputs: Iterable[ToolOutput],
    stream: (
        Optional[Literal[False]] | Literal[True] | NotGiven
    ) = NOT_GIVEN,
    extra_headers: Headers | None = None,
    extra_query: Query | None = None,
    extra_body: Body | None = None,
    timeout: float | Timeout | None | NotGiven = NOT_GIVEN
) -> Run | Stream[AssistantStreamEvent]
          submit_tool_outputs_stream
        submit_tool_outputs_stream(
    *,
    tool_outputs: Iterable[ToolOutput],
    run_id: str,
    thread_id: str,
    extra_headers: Headers | None = None,
    extra_query: Query | None = None,
    extra_body: Body | None = None,
    timeout: float | Timeout | None | NotGiven = NOT_GIVEN
) -> AssistantStreamManager[AssistantEventHandler]
submit_tool_outputs_stream(
    *,
    tool_outputs: Iterable[ToolOutput],
    run_id: str,
    thread_id: str,
    event_handler: AssistantEventHandlerT,
    extra_headers: Headers | None = None,
    extra_query: Query | None = None,
    extra_body: Body | None = None,
    timeout: float | Timeout | None | NotGiven = NOT_GIVEN
) -> AssistantStreamManager[AssistantEventHandlerT]
submit_tool_outputs_stream(
    *,
    tool_outputs: Iterable[ToolOutput],
    run_id: str,
    thread_id: str,
    event_handler: AssistantEventHandlerT | None = None,
    extra_headers: Headers | None = None,
    extra_query: Query | None = None,
    extra_body: Body | None = None,
    timeout: float | Timeout | None | NotGiven = NOT_GIVEN
) -> (
    AssistantStreamManager[AssistantEventHandler]
    | AssistantStreamManager[AssistantEventHandlerT]
)
Submit the tool outputs from a previous run and stream the run to a terminal state.
          update
update(
    run_id: str,
    *,
    thread_id: str,
    metadata: Optional[object] | NotGiven = NOT_GIVEN,
    extra_headers: Headers | None = None,
    extra_query: Query | None = None,
    extra_body: Body | None = None,
    timeout: float | Timeout | None | NotGiven = NOT_GIVEN
) -> Run
Modifies a run.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
              metadata
           | 
          
                Optional[object] | NotGiven
           | 
          
             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.  | 
          
                NOT_GIVEN
           | 
        
              extra_headers
           | 
          
                Headers | None
           | 
          
             Send extra headers  | 
          
                None
           | 
        
              extra_query
           | 
          
                Query | None
           | 
          
             Add additional query parameters to the request  | 
          
                None
           | 
        
              extra_body
           | 
          
                Body | None
           | 
          
             Add additional JSON properties to the request  | 
          
                None
           | 
        
              timeout
           | 
          
                float | Timeout | None | NotGiven
           | 
          
             Override the client-level default timeout for this request, in seconds  | 
          
                NOT_GIVEN
           | 
        
          RunsWithRawResponse
RunsWithRawResponse(runs: Runs)
          RunsWithStreamingResponse
RunsWithStreamingResponse(runs: Runs)
          Steps
Steps(client: OpenAI)
Methods:
| Name | Description | 
|---|---|
list | 
            
               Returns a list of run steps belonging to a run.  | 
          
retrieve | 
            
               Retrieves a run step.  | 
          
with_raw_response | 
            
               | 
          
with_streaming_response | 
            
               | 
          
          list
list(
    run_id: str,
    *,
    thread_id: str,
    after: str | NotGiven = NOT_GIVEN,
    before: str | NotGiven = NOT_GIVEN,
    limit: int | NotGiven = NOT_GIVEN,
    order: Literal["asc", "desc"] | NotGiven = NOT_GIVEN,
    extra_headers: Headers | None = None,
    extra_query: Query | None = None,
    extra_body: Body | None = None,
    timeout: float | Timeout | None | NotGiven = NOT_GIVEN
) -> SyncCursorPage[RunStep]
Returns a list of run steps belonging to a run.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
              after
           | 
          
                str | NotGiven
           | 
          
             A cursor for use in pagination.   | 
          
                NOT_GIVEN
           | 
        
              before
           | 
          
                str | NotGiven
           | 
          
             A cursor for use in pagination.   | 
          
                NOT_GIVEN
           | 
        
              limit
           | 
          
                int | NotGiven
           | 
          
             A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.  | 
          
                NOT_GIVEN
           | 
        
              order
           | 
          
                Literal['asc', 'desc'] | NotGiven
           | 
          
             Sort order by the   | 
          
                NOT_GIVEN
           | 
        
              extra_headers
           | 
          
                Headers | None
           | 
          
             Send extra headers  | 
          
                None
           | 
        
              extra_query
           | 
          
                Query | None
           | 
          
             Add additional query parameters to the request  | 
          
                None
           | 
        
              extra_body
           | 
          
                Body | None
           | 
          
             Add additional JSON properties to the request  | 
          
                None
           | 
        
              timeout
           | 
          
                float | Timeout | None | NotGiven
           | 
          
             Override the client-level default timeout for this request, in seconds  | 
          
                NOT_GIVEN
           | 
        
          retrieve
retrieve(
    step_id: str,
    *,
    thread_id: str,
    run_id: str,
    extra_headers: Headers | None = None,
    extra_query: Query | None = None,
    extra_body: Body | None = None,
    timeout: float | Timeout | None | NotGiven = NOT_GIVEN
) -> RunStep
Retrieves a run step.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
              extra_headers
           | 
          
                Headers | None
           | 
          
             Send extra headers  | 
          
                None
           | 
        
              extra_query
           | 
          
                Query | None
           | 
          
             Add additional query parameters to the request  | 
          
                None
           | 
        
              extra_body
           | 
          
                Body | None
           | 
          
             Add additional JSON properties to the request  | 
          
                None
           | 
        
              timeout
           | 
          
                float | Timeout | None | NotGiven
           | 
          
             Override the client-level default timeout for this request, in seconds  | 
          
                NOT_GIVEN
           | 
        
          StepsWithRawResponse
StepsWithRawResponse(steps: Steps)