a
    _g=                     @  s<  d dl mZ 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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!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)List)LiteralN   )_legacy_response)	NOT_GIVENBodyQueryHeadersNotGiven)maybe_transformasync_maybe_transform)cached_property)SyncAPIResourceAsyncAPIResource)to_streamed_response_wrapper"async_to_streamed_response_wrapper)SyncCursorPageAsyncCursorPage)AsyncPaginatormake_request_options)step_list_paramsstep_retrieve_params)RunStep)RunStepIncludeSteps
AsyncStepsc                   @  s   e Zd ZeddddZeddddZeddded	d
d
d
ddddddd	ddZeeeeeddded	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 a  
        This property can be used as a prefix for any HTTP method call to return
        the raw response object instead of the parsed content.

        For more information, see https://www.github.com/openai/openai-python#accessing-raw-response-data-eg-headers
        )r   self r#   v/var/www/html/cobodadashboardai.evdpl.com/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 z
        An alternative to `.with_raw_response` that doesn't eagerly read the response body.

        For more information, see https://www.github.com/openai/openai-python#with_streaming_response
        )r&   r!   r#   r#   r$   with_streaming_response'   s    zSteps.with_streaming_responseNincludeextra_headersextra_query
extra_bodytimeoutstrList[RunStepInclude] | NotGivenHeaders | NoneQuery | NoneBody | None'float | httpx.Timeout | None | NotGivenr   	step_id	thread_idrun_idr*   r+   r,   r-   r.   r   c          	   
   C  s   |st d||s$t d||s6t d|ddi|pBi }| jd| d| d| t||||td	|itjd
tdS )  
        Retrieves a run step.

        Args:
          include: A list of additional fields to include in the response. Currently the only
              supported value is `step_details.tool_calls[*].file_search.results[*].content`
              to fetch the file search result content.

              See the
              [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings)
              for more information.

          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*   r+   r,   r-   r.   queryoptionsZcast_to)
ValueError_getr   r   r   StepRetrieveParamsr   	r"   r6   r7   r8   r*   r+   r,   r-   r.   r#   r#   r$   retrieve0   s$    "zSteps.retrieve	afterbeforer*   limitorderr+   r,   r-   r.   str | NotGivenint | NotGiven!Literal['asc', 'desc'] | NotGivenzSyncCursorPage[RunStep]r8   r7   rL   rM   r*   rN   rO   r+   r,   r-   r.   r   c       
         C  sz   |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,
              starting with obj_foo, your subsequent call can include before=obj_foo in order
              to fetch the previous page of the list.

          include: A list of additional fields to include in the response. Currently the only
              supported value is `step_details.tool_calls[*].file_search.results[*].content`
              to fetch the file search result content.

              See the
              [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings)
              for more information.

          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
        r:   r;   r=   r>   r?   r@   z/steps)rL   rM   r*   rN   rO   rB   )pagerE   model)rF   _get_api_listr   r   r   r   r   StepListParamsr"   r8   r7   rL   rM   r*   rN   rO   r+   r,   r-   r.   r#   r#   r$   liste   s2    5z
Steps.list	__name__
__module____qualname__r   r%   r(   r   rJ   rZ   r#   r#   r#   r$   r      s(   	":c                   @  s   e Zd ZeddddZeddddZeddded	d
d
d
ddddddd	ddZeeeeeddded	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    )r_   r!   r#   r#   r$   r%      s    zAsyncSteps.with_raw_responseAsyncStepsWithStreamingResponsec                 C  s   t | S r'   )r`   r!   r#   r#   r$   r(      s    z"AsyncSteps.with_streaming_responseNr)   r/   r0   r1   r2   r3   r4   r   r5   c          	   
     s   |st d||s$t d||s6t d|ddi|pBi }| jd| d| d| t||||td	|itjI d
H dtdI d
H S )r9   r:   r;   r<   r=   r>   r?   r@   rA   r*   NrB   rD   )rF   rG   r   r   r   rH   r   rI   r#   r#   r$   rJ      s$    "zAsyncSteps.retrieverK   rP   rQ   rR   z1AsyncPaginator[RunStep, AsyncCursorPage[RunStep]]rS   c       
         C  sz   |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 rT   )rF   rW   r   r   r   r   r   rX   rY   r#   r#   r$   rZ      s2    5zAsyncSteps.listr[   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 N)_stepsr   Zto_raw_response_wrapperrJ   rZ   r"   rc   r#   r#   r$   __init__Q  s    zStepsWithRawResponse.__init__Nr\   r]   r^   rg   r#   r#   r#   r$   r   P  s   r   c                   @  s   e Zd ZdddddZdS )r_   r   ra   rb   c                 C  s&   || _ t|j| _t|j| _d S rd   )re   r   Zasync_to_raw_response_wrapperrJ   rZ   rf   r#   r#   r$   rg   ]  s    z"AsyncStepsWithRawResponse.__init__Nrh   r#   r#   r#   r$   r_   \  s   r_   c                   @  s   e Zd ZdddddZdS )r&   r   ra   rb   c                 C  s"   || _ t|j| _t|j| _d S rd   )re   r   rJ   rZ   rf   r#   r#   r$   rg   i  s    z#StepsWithStreamingResponse.__init__Nrh   r#   r#   r#   r$   r&   h  s   r&   c                   @  s   e Zd ZdddddZdS )r`   r   ra   rb   c                 C  s"   || _ t|j| _t|j| _d S rd   )re   r   rJ   rZ   rf   r#   r#   r$   rg   u  s    z(AsyncStepsWithStreamingResponse.__init__Nrh   r#   r#   r#   r$   r`   t  s   r`   ).
__future__r   typingr   Ztyping_extensionsr   Zhttpx r   _typesr   r   r	   r
   r   _utilsr   r   Z_compatr   Z	_resourcer   r   	_responser   r   Z
paginationr   r   Z_base_clientr   r   Ztypes.beta.threads.runsr   r   Z types.beta.threads.runs.run_stepr   Z(types.beta.threads.runs.run_step_includer   __all__r   r   r   r_   r&   r`   r#   r#   r#   r$   <module>   s.     