a
    f/                     @  s  d dl mZ d dlmZ d dlZddlmZ ddlmZm	Z	m
Z
mZmZ ddlmZ ddlmZ dd	lmZmZ dd
lmZmZ ddlmZmZ ddlmZmZ ddlmZ ddlm Z  ddgZ!G dd deZ"G dd deZ#G dd dZ$G dd dZ%G dd dZ&G dd dZ'dS )    )annotations)LiteralN   )_legacy_response)	NOT_GIVENBodyQueryHeadersNotGiven)maybe_transform)cached_property)SyncAPIResourceAsyncAPIResource)to_streamed_response_wrapper"async_to_streamed_response_wrapper)SyncCursorPageAsyncCursorPage)AsyncPaginatormake_request_options)step_list_params)RunStepSteps
AsyncStepsc                   @  s   e Zd ZeddddZeddddZddded	d
d
d
ddddddddZeeeedddedd
d
ddddddddddddZdS )r   StepsWithRawResponsereturnc                 C  s   t | S N)r   self r   a/var/www/ai-form-bot/venv/lib/python3.9/site-packages/openai/resources/beta/threads/runs/steps.pywith_raw_response   s    zSteps.with_raw_responseStepsWithStreamingResponsec                 C  s   t | S r   )r"   r   r   r   r    with_streaming_response   s    zSteps.with_streaming_responseNextra_headersextra_query
extra_bodytimeoutstrHeaders | NoneQuery | NoneBody | None'float | httpx.Timeout | None | NotGivenr   step_id	thread_idrun_idr%   r&   r'   r(   r   c                C  st   |st d||s$t d||s6t d|ddi|pBi }| jd| d| d| t||||d	td
S )I  
        Retrieves a run step.

        Args:
          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
        8Expected a non-empty value for `thread_id` but received 5Expected a non-empty value for `run_id` but received 6Expected a non-empty value for `step_id` but received OpenAI-Betaassistants=v2	/threads//runs//steps/r$   optionsZcast_to
ValueError_getr   r   r   r/   r0   r1   r%   r&   r'   r(   r   r   r    retrieve#   s    zSteps.retrieveafterbeforelimitorderr%   r&   r'   r(   str | NotGivenint | NotGiven!Literal['asc', 'desc'] | NotGivenzSyncCursorPage[RunStep]r1   r0   rC   rD   rE   rF   r%   r&   r'   r(   r   c       	         C  sx   |st d||s$t d|ddi|p0i }| jd| d| dtt t|||	|
t||||dtjd	td
S a!  
        Returns a list of run steps belonging to a run.

        Args:
          after: A cursor for use in pagination. `after` is an object ID that defines your place
              in the list. For instance, if you make a list request and receive 100 objects,
              ending with obj_foo, your subsequent call can include after=obj_foo in order to
              fetch the next page of the list.

          before: A cursor for use in pagination. `before` is an object ID that defines your place
              in the list. For instance, if you make a list request and receive 100 objects,
              ending with obj_foo, your subsequent call can include before=obj_foo in order to
              fetch the previous page of the list.

          limit: A limit on the number of objects to be returned. Limit can range between 1 and
              100, and the default is 20.

          order: Sort order by the `created_at` timestamp of the objects. `asc` for ascending
              order and `desc` for descending order.

          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
        r3   r4   r6   r7   r8   r9   z/steps)rC   rD   rE   rF   )r%   r&   r'   r(   query)pager<   model)r>   _get_api_listr   r   r   r   r   StepListParamsr   r1   r0   rC   rD   rE   rF   r%   r&   r'   r(   r   r   r    listK   s0    ,z
Steps.list	__name__
__module____qualname__r   r!   r#   r   rA   rR   r   r   r   r    r      s$    -c                   @  s   e Zd ZeddddZeddddZddded	d
d
d
ddddddddZeeeedddedd
d
ddddddddddddZdS )r   AsyncStepsWithRawResponser   c                 C  s   t | S r   )rW   r   r   r   r    r!      s    zAsyncSteps.with_raw_responseAsyncStepsWithStreamingResponsec                 C  s   t | S r   )rX   r   r   r   r    r#      s    z"AsyncSteps.with_streaming_responseNr$   r)   r*   r+   r,   r-   r   r.   c                  sz   |st d||s$t d||s6t d|ddi|pBi }| jd| d| d| t||||d	td
I dH S )r2   r3   r4   r5   r6   r7   r8   r9   r:   r$   r;   Nr=   r@   r   r   r    rA      s    zAsyncSteps.retrieverB   rG   rH   rI   z1AsyncPaginator[RunStep, AsyncCursorPage[RunStep]]rJ   c       	         C  sx   |st d||s$t d|ddi|p0i }| jd| d| dtt t|||	|
t||||dtjd	td
S rK   )r>   rO   r   r   r   r   r   rP   rQ   r   r   r    rR      s0    ,zAsyncSteps.listrS   r   r   r   r    r      s$    -c                   @  s   e Zd ZdddddZdS )r   r   Nonestepsr   c                 C  s&   || _ t|j| _t|j| _d S r   )_stepsr   Zto_raw_response_wrapperrA   rR   r   r[   r   r   r    __init__  s    zStepsWithRawResponse.__init__NrT   rU   rV   r^   r   r   r   r    r   
  s   r   c                   @  s   e Zd ZdddddZdS )rW   r   rY   rZ   c                 C  s&   || _ t|j| _t|j| _d S r   )r\   r   Zasync_to_raw_response_wrapperrA   rR   r]   r   r   r    r^     s    z"AsyncStepsWithRawResponse.__init__Nr_   r   r   r   r    rW     s   rW   c                   @  s   e Zd ZdddddZdS )r"   r   rY   rZ   c                 C  s"   || _ t|j| _t|j| _d S r   )r\   r   rA   rR   r]   r   r   r    r^   #  s    z#StepsWithStreamingResponse.__init__Nr_   r   r   r   r    r"   "  s   r"   c                   @  s   e Zd ZdddddZdS )rX   r   rY   rZ   c                 C  s"   || _ t|j| _t|j| _d S r   )r\   r   rA   rR   r]   r   r   r    r^   /  s    z(AsyncStepsWithStreamingResponse.__init__Nr_   r   r   r   r    rX   .  s   rX   )(
__future__r   typing_extensionsr   Zhttpx r   _typesr   r   r   r	   r
   Z_utilsr   _compatr   Z	_resourcer   r   	_responser   r   Z
paginationr   r   Z_base_clientr   r   Ztypes.beta.threads.runsr   Z types.beta.threads.runs.run_stepr   __all__r   r   r   rW   r"   rX   r   r   r   r    <module>   s&   xx