
    	hB                       d dl mZ d dl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e          Z( G d de          Z) G d d          Z* G d d          Z+ G d d          Z, G d d          Z-dS )    )annotationsN)List)Literal   )_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                      e Zd Zed#d            Zed$d            Z ej        d          edddedd%d            Z	 ej        d          eeeeeddded	d&d"            Z
dS )'r   returnStepsWithRawResponsec                     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    selfs    u/var/www/html/web-builder-api.evdpl.com/venv/lib/python3.11/site-packages/openai/resources/beta/threads/runs/steps.pywith_raw_responsezSteps.with_raw_response   s     $D)))    StepsWithStreamingResponsec                     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#   s    r%   with_streaming_responsezSteps.with_streaming_response%   s     *$///r'   >The Assistants API is deprecated in favor of the Responses APINincludeextra_headersextra_query
extra_bodytimeoutstep_idstr	thread_idrun_idr.   List[RunStepInclude] | NotGivenr/   Headers | Noner0   Query | Noner1   Body | Noner2   'float | httpx.Timeout | None | NotGivenr   c               .   |st          d|          |st          d|          |st          d|          ddi|pi }|                     d| d| d| t          ||||t          d	|it          j                  
          t                    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/   r0   r1   r2   queryoptionscast_to)
ValueError_getr   r   r   StepRetrieveParamsr   	r$   r3   r5   r6   r.   r/   r0   r1   r2   s	            r%   retrievezSteps.retrieve.   s    F  	geXaeefff 	a_U[__``` 	caV]aabbb&QM<ORQyyA	AAAAAA(+'%%y'&:<P<cdd     

 

 
	
r'   	afterbeforer.   limitorderr/   r0   r1   r2   rQ   str | NotGivenrR   rS   int | NotGivenrT   !Literal['asc', 'desc'] | NotGivenSyncCursorPage[RunStep]c       
        ,   |st          d|          |st          d|          ddi|pi }|                     d| d| dt          t                   t	          ||	|
|t          |||||dt          j                  	          t          
          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?   rA   rB   rC   rD   z/steps)rQ   rR   r.   rS   rT   rF   )pagerI   model)rK   _get_api_listr   r   r   r   r   StepListParamsr$   r6   r5   rQ   rR   r.   rS   rT   r/   r0   r1   r2   s               r%   listz
Steps.listd   s    l  	geXaeefff 	a_U[__```&QM<ORQ!!7	77777((+'%%!&"(#*!&!&  %3	 	    ' " 
 
 	
r'   )r   r    )r   r(   r3   r4   r5   r4   r6   r4   r.   r7   r/   r8   r0   r9   r1   r:   r2   r;   r   r   )r6   r4   r5   r4   rQ   rU   rR   rU   r.   r7   rS   rV   rT   rW   r/   r8   r0   r9   r1   r:   r2   r;   r   rX   __name__
__module____qualname__r   r&   r+   typing_extensions
deprecatedr   rO   r`    r'   r%   r   r      s       * * * _* 0 0 0 _0 "!"bcc 4= )-$("&;D3
 3
 3
 3
 3
 dc3
j "!"bcc !*!*3< )3< )-$("&;DN
 N
 N
 N
 N
 dcN
 N
 N
r'   c                      e Zd Zed#d            Zed$d            Z ej        d          edddedd%d            Z	 ej        d          eeeeeddded	d&d"            Z
dS )'r   r   AsyncStepsWithRawResponsec                     t          |           S r"   )rj   r#   s    r%   r&   zAsyncSteps.with_raw_response   s     )...r'   AsyncStepsWithStreamingResponsec                     t          |           S r*   )rl   r#   s    r%   r+   z"AsyncSteps.with_streaming_response   s     /t444r'   r,   Nr-   r3   r4   r5   r6   r.   r7   r/   r8   r0   r9   r1   r:   r2   r;   r   c               J  K   |st          d|          |st          d|          |st          d|          ddi|pi }|                     d| d| d| t          ||||t          d	|it          j                   d
{V           t                     d
{V S )r=   r>   r?   r@   rA   rB   rC   rD   rE   r.   NrF   rH   )rK   rL   r   r   r   rM   r   rN   s	            r%   rO   zAsyncSteps.retrieve   s     F  	geXaeefff 	a_U[__``` 	caV]aabbb&QM<ORQYYA	AAAAAA(+'%19g2FH\Hopppppppp     

 

 

 

 

 

 

 

 
	
r'   rP   rQ   rU   rR   rS   rV   rT   rW   1AsyncPaginator[RunStep, AsyncCursorPage[RunStep]]c       
        ,   |st          d|          |st          d|          ddi|pi }|                     d| d| dt          t                   t	          ||	|
|t          |||||dt          j                  	          t          
          S rZ   )rK   r]   r   r   r   r   r   r^   r_   s               r%   r`   zAsyncSteps.list   s    l  	geXaeefff 	a_U[__```&QM<ORQ!!7	77777 )(+'%%!&"(#*!&!&  %3	 	    ' " 
 
 	
r'   )r   rj   )r   rl   ra   )r6   r4   r5   r4   rQ   rU   rR   rU   r.   r7   rS   rV   rT   rW   r/   r8   r0   r9   r1   r:   r2   r;   r   ro   rb   rh   r'   r%   r   r      s       / / / _/ 5 5 5 _5 "!"bcc 4= )-$("&;D3
 3
 3
 3
 3
 dc3
j "!"bcc !*!*3< )3< )-$("&;DN
 N
 N
 N
 N
 dcN
 N
 N
r'   c                      e Zd ZddZdS )r    stepsr   r   Nonec                    || _         t          j        |j                  | _        t          j        |j                  | _        d S N)_stepsr   to_raw_response_wrapperrO   r`   r$   rr   s     r%   __init__zStepsWithRawResponse.__init__S  sI     4  	 4
  				r'   Nrr   r   r   rs   rc   rd   re   ry   rh   r'   r%   r    r    R  (        
 
 
 
 
 
r'   r    c                      e Zd ZddZdS )rj   rr   r   r   rs   c                    || _         t          j        |j                  | _        t          j        |j                  | _        d S ru   )rv   r   async_to_raw_response_wrapperrO   r`   rx   s     r%   ry   z"AsyncStepsWithRawResponse.__init__c  sI     :  	 :
  				r'   Nrr   r   r   rs   r{   rh   r'   r%   rj   rj   b  r|   r'   rj   c                      e Zd ZddZdS )r(   rr   r   r   rs   c                x    || _         t          |j                  | _        t          |j                  | _        d S ru   )rv   r   rO   r`   rx   s     r%   ry   z#StepsWithStreamingResponse.__init__s  sC     )  	 )
  				r'   Nrz   r{   rh   r'   r%   r(   r(   r  r|   r'   r(   c                      e Zd ZddZdS )rl   rr   r   r   rs   c                x    || _         t          |j                  | _        t          |j                  | _        d S ru   )rv   r   rO   r`   rx   s     r%   ry   z(AsyncStepsWithStreamingResponse.__init__  sC     /  	 /
  				r'   Nr   r{   rh   r'   r%   rl   rl     r|   r'   rl   ).
__future__r   rf   typingr   r   httpx r   _typesr   r	   r
   r   r   _utilsr   r   _compatr   	_resourcer   r   	_responser   r   
paginationr   r   _base_clientr   r   types.beta.threads.runsr   r    types.beta.threads.runs.run_stepr   (types.beta.threads.runs.run_step_includer   __all__r   r   r    rj   r(   rl   rh   r'   r%   <module>r      so   # " " " " "           % % % % % %  " " " " " " A A A A A A A A A A A A A A > > > > > > > > ( ( ( ( ( ( < < < < < < < < [ [ [ [ [ [ [ [ ; ; ; ; ; ; ; ; B B B B B B B B O O O O O O O O 9 9 9 9 9 9 H H H H H HL
!Y
 Y
 Y
 Y
 Y
O Y
 Y
 Y
xY
 Y
 Y
 Y
 Y
! Y
 Y
 Y
x
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
r'   