
    _j,E                    t   S SK Jr  S SKrS SKJr  S SKJr  S SKrSSKJr  SSK	J
r
JrJrJrJrJrJr  SSKJrJrJr  SS	KJr  SS
KJrJr  SSKJrJr  SSKJrJr  SSK J!r!J"r"  SSK#J$r$J%r%  SSK&J'r'  SSK(J)r)  SS/r* " S S\5      r+ " S S\5      r, " S S5      r- " S S5      r. " S S5      r/ " S S5      r0g)    )annotationsN)List)Literal   )_legacy_response)BodyOmitQueryHeadersNotGivenomit	not_given)path_template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                      \ rS rSrSr\SS j5       r\SS j5       r\R                  " S5      \
SSS\S.                 SS jj5       r\R                  " S5      \
\
\
\
\
SSS\S	.	                       SS
 jj5       rSrg)r      4Build Assistants that can call models and use tools.c                    [        U 5      $ z
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
)StepsWithRawResponseselfs    ]/home/rurouni/.local/lib/python3.13/site-packages/openai/resources/beta/threads/runs/steps.pywith_raw_responseSteps.with_raw_response   s     $D))    c                    [        U 5      $ 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
)StepsWithStreamingResponser'   s    r)   with_streaming_responseSteps.with_streaming_response'   s     *$//r,   >The Assistants API is deprecated in favor of the Responses APINincludeextra_headersextra_query
extra_bodytimeoutc               2   U(       d  [        SU< 35      eU(       d  [        SU< 35      eU(       d  [        SU< 35      eSS0U=(       d    0 EnU R                  [        SUUUS9[        UUUU[	        SU0[
        R                  5      S	S
0S9[        S9$ )  
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=v22/threads/{thread_id}/runs/{run_id}/steps/{step_id}	thread_idrun_idstep_idr4   bearer_authTr5   r6   r7   r8   querysecurityoptionscast_to)
ValueError_getr   r   r   r   StepRetrieveParamsr   	r(   rD   rB   rC   r4   r5   r6   r7   r8   s	            r)   retrieveSteps.retrieve0   s    F WXaWdeffTU[T^_``UV]U`abb&QM<ORQyyD#	 )+'%%y'&:<P<c<cd'.   
 	
r,   	afterbeforer4   limitorderr5   r6   r7   r8   c       
        "   U(       d  [        SU< 35      eU(       d  [        SU< 35      eSS0U=(       d    0 EnU R                  [        SX!S9[        [           [        UU	U
U[        UUUUUS.[        R                  5      SS	0S
9[        S9$ 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?   z(/threads/{thread_id}/runs/{run_id}/steps)rB   rC   )rS   rT   r4   rU   rV   rE   TrF   )pagerJ   model)	rL   _get_api_listr   r   r   r   r   r   StepListParamsr(   rC   rB   rS   rT   r4   rU   rV   r5   r6   r7   r8   s               r)   list
Steps.listl   s    l WXaWdeffTU[T^_``&QM<ORQ!!DPYi((+'%%!&"(#*!&!& %33	 (." ) " 
 	
r,    )returnr&   )ra   r/   rD   strrB   rc   rC   rc   r4   List[RunStepInclude] | Omitr5   Headers | Noner6   Query | Noner7   Body | Noner8   'float | httpx.Timeout | None | NotGivenra   r   )rC   rc   rB   rc   rS   
str | OmitrT   ri   r4   rd   rU   
int | OmitrV   Literal['asc', 'desc'] | Omitr5   re   r6   rf   r7   rg   r8   rh   ra   zSyncCursorPage[RunStep]__name__
__module____qualname____firstlineno____doc__r   r*   r0   typing_extensions
deprecatedr   r   rP   r^   __static_attributes__r`   r,   r)   r   r      s|   >* * 0 0 !!"bc 04 )-$("&;D9
9
 	9

 9
 -9
 &9
 "9
  9
 99
 
9
 d9
v !!"bc !!/3 /3 )-$("&;DO
O
 	O

 O
 O
 -O
 O
 -O
 &O
 "O
  O
 9O
  
!!O
 dO
r,   c                      \ rS rSrSr\SS j5       r\SS j5       r\R                  " S5      \
SSS\S.                 SS jj5       r\R                  " S5      \
\
\
\
\
SSS\S	.	                       SS
 jj5       rSrg)r       r#   c                    [        U 5      $ r%   )AsyncStepsWithRawResponser'   s    r)   r*   AsyncSteps.with_raw_response   s     )..r,   c                    [        U 5      $ r.   )AsyncStepsWithStreamingResponser'   s    r)   r0   "AsyncSteps.with_streaming_response   s     /t44r,   r2   Nr3   c               b  #    U(       d  [        SU< 35      eU(       d  [        SU< 35      eU(       d  [        SU< 35      eSS0U=(       d    0 EnU R                  [        SUUUS9[        UUUU[	        SU0[
        R                  5      I S	h  vN S
S0S9[        S9I S	h  vN $  N N7f)r:   r;   r<   r=   r>   r?   r@   rA   r4   NrE   TrF   rI   )rL   rM   r   r   r   r   rN   r   rO   s	            r)   rP   AsyncSteps.retrieve   s     F WXaWdeffTU[T^_``UV]U`abb&QM<ORQYYD#	 )+'%19g2FH\HoHopp'.   
 
 	
 q
s$   BB/B+B/&B-'B/-B/rR   c       
        "   U(       d  [        SU< 35      eU(       d  [        SU< 35      eSS0U=(       d    0 EnU R                  [        SX!S9[        [           [        UU	U
U[        UUUUUS.[        R                  5      SS	0S
9[        S9$ rX   )	rL   r[   r   r   r   r   r   r   r\   r]   s               r)   r^   AsyncSteps.list  s    l WXaWdeffTU[T^_``&QM<ORQ!!DPYi )(+'%%!&"(#*!&!& %33	 (." ) " 
 	
r,   r`   )ra   rx   )ra   r{   rb   )rC   rc   rB   rc   rS   ri   rT   ri   r4   rd   rU   rj   rV   rk   r5   re   r6   rf   r7   rg   r8   rh   ra   z1AsyncPaginator[RunStep, AsyncCursorPage[RunStep]]rl   r`   r,   r)   r    r       s|   >/ / 5 5 !!"bc 04 )-$("&;D9
9
 	9

 9
 -9
 &9
 "9
  9
 99
 
9
 d9
v !!"bc !!/3 /3 )-$("&;DO
O
 	O

 O
 O
 -O
 O
 -O
 &O
 "O
  O
 9O
  
;!O
 dO
r,   c                      \ rS rSrSS jrSrg)r&   id  c                    Xl         [        R                  " UR                  5      U l        [        R                  " UR                  5      U l        g N)_stepsr   to_raw_response_wrapperrP   r^   r(   stepss     r)   __init__StepsWithRawResponse.__init__e  sC     44 	 44

 		r,   r   r^   rP   Nr   r   ra   Nonerm   rn   ro   rp   r   rt   r`   r,   r)   r&   r&   d      
r,   r&   c                      \ rS rSrSS jrSrg)rx   it  c                    Xl         [        R                  " UR                  5      U l        [        R                  " UR                  5      U l        g r   )r   r   async_to_raw_response_wrapperrP   r^   r   s     r)   r   "AsyncStepsWithRawResponse.__init__u  sC     :: 	 ::

 		r,   r   Nr   r    ra   r   r   r`   r,   r)   rx   rx   t  r   r,   rx   c                      \ rS rSrSS jrSrg)r/   i  c                x    Xl         [        UR                  5      U l        [        UR                  5      U l        g r   )r   r   rP   r^   r   s     r)   r   #StepsWithStreamingResponse.__init__  s7     ) 	 )

 		r,   r   Nr   r   r`   r,   r)   r/   r/     r   r,   r/   c                      \ rS rSrSS jrSrg)r{   i  c                x    Xl         [        UR                  5      U l        [        UR                  5      U l        g r   )r   r   rP   r^   r   s     r)   r   (AsyncStepsWithStreamingResponse.__init__  s7     / 	 /

 		r,   r   Nr   r   r`   r,   r)   r{   r{     r   r,   r{   )1
__future__r   rr   typingr   r   httpx r   _typesr   r	   r
   r   r   r   r   _utilsr   r   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&   rx   r/   r{   r`   r,   r)   <module>r      s    #   %  " M M M M M ( < [ ; B O 9 HL
!b
O b
Jb
! b
J
 
 
 
 
 
 
 
r,   