
    _j f                       S SK J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J r J!r!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/J0r0  SSK1J2r2  SSK3J4r4  SSK5J6r6  SSK7J8r8  SS/r9 " S S\5      r: " S S\5      r; " S S5      r< " S S5      r= " S S 5      r> " S! S"5      r?g)#    )annotations)Optional)LiteralN   )_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   )OutputItemsAsyncOutputItemsOutputItemsWithRawResponseAsyncOutputItemsWithRawResponse OutputItemsWithStreamingResponse%AsyncOutputItemsWithStreamingResponse)SyncCursorPageAsyncCursorPage)run_list_paramsrun_create_params)AsyncPaginatormake_request_options)Metadata)RunListResponse)RunCancelResponse)RunCreateResponse)RunDeleteResponse)RunRetrieveResponseRuns	AsyncRunsc            	      n   \ rS rSrSr\SS j5       r\SS j5       r\SS j5       r\	\	SSS\
S.                 SS jjrSSS\
S	.             SS
 jjr\	\	\	\	SSS\
S.                   SS jjrSSS\
S	.             SS jjrSSS\
S	.             SS jjrSrg)r*   %   ,Manage and run evals in the OpenAI platform.c                ,    [        U R                  5      $ r.   )r   _clientselfs    U/home/rurouni/.local/lib/python3.13/site-packages/openai/resources/evals/runs/runs.pyoutput_itemsRuns.output_items(   s     4<<((    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
)RunsWithRawResponser2   s    r4   with_raw_responseRuns.with_raw_response-   s     #4((r7   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
)RunsWithStreamingResponser2   s    r4   with_streaming_responseRuns.with_streaming_response7   s     )..r7   Nmetadatanameextra_headersextra_query
extra_bodytimeoutc                   U(       d  [        SU< 35      eU R                  [        SUS9[        UUUS.[        R
                  5      [        UUUUSS0S9[        S9$ )	  
Kicks off a new run for a given evaluation, specifying the data source, and what
model configuration to use to test. The datasource will be validated against the
schema specified in the config of the evaluation.

Args:
  data_source: Details about the run's data source.

  metadata: 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, and
      querying for objects via API or the dashboard.

      Keys are strings with a maximum length of 64 characters. Values are strings with
      a maximum length of 512 characters.

  name: The name of the run.

  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
6Expected a non-empty value for `eval_id` but received /evals/{eval_id}/runseval_iddata_sourcerC   rD   bearer_authTrE   rF   rG   rH   securitybodyoptionscast_to)
ValueError_postr   r   r!   RunCreateParamsr#   r'   	r3   rN   rP   rC   rD   rE   rF   rG   rH   s	            r4   createRuns.create@   s    N UV]U`abbzz17C #. ( 
 "11 )+'%'. &#  
 	
r7   rE   rF   rG   rH   c                   U(       d  [        SU< 35      eU(       d  [        SU< 35      eU R                  [        SX!S9[        UUUUSS0S9[        S9$ )	  
Get an evaluation run by ID.

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
rK   5Expected a non-empty value for `run_id` but received /evals/{eval_id}/runs/{run_id}rN   run_idrQ   TrR   rV   rW   rX   _getr   r#   r)   r3   rd   rN   rE   rF   rG   rH   s          r4   retrieveRuns.retrieve}   sv    0 UV]U`abbTU[T^_``yy:G[(+'%'. (  

 
	
r7   afterlimitorderstatusrE   rF   rG   rH   c                   U(       d  [        SU< 35      eU R                  [        SUS9[        [           [        UUUU	[        UUUUS.[        R                  5      SS0S9[        S9$ 	a  
Get a list of runs for an evaluation.

Args:
  after: Identifier for the last run from the previous pagination request.

  limit: Number of runs to retrieve.

  order: Sort order for runs by timestamp. Use `asc` for ascending order or `desc` for
      descending order. Defaults to `asc`.

  status: Filter runs by status. One of `queued` | `in_progress` | `failed` | `completed`
      | `canceled`.

  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
rK   rL   rM   )rl   rm   rn   ro   rQ   T)rE   rF   rG   rH   queryrS   )pagerV   model)	rX   _get_api_listr   r   r%   r#   r   r    RunListParams
r3   rN   rl   rm   rn   ro   rE   rF   rG   rH   s
             r4   list	Runs.list   s    J UV]U`abb!!17C0(+'%%!&!&!&"(	 $11 (.  "' " 
 	
r7   c                   U(       d  [        SU< 35      eU(       d  [        SU< 35      eU R                  [        SX!S9[        UUUUSS0S9[        S9$ )	  
Delete an eval run.

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
rK   ra   rb   rc   rQ   TrR   re   rX   _deleter   r#   r(   rh   s          r4   deleteRuns.delete   sv    0 UV]U`abbTU[T^_``||:G[(+'%'. &  

 
	
r7   c                   U(       d  [        SU< 35      eU(       d  [        SU< 35      eU R                  [        SX!S9[        UUUUSS0S9[        S9$ )	  
Cancel an ongoing evaluation run.

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
rK   ra   rb   rc   rQ   TrR   re   rX   rY   r   r#   r&   rh   s          r4   cancelRuns.cancel
  sv    0 UV]U`abbTU[T^_``zz:G[(+'%'. &  

 
	
r7    )returnr   )r   r:   )r   r?   rN   strrP   zrun_create_params.DataSourcerC   zOptional[Metadata] | OmitrD   
str | OmitrE   Headers | NonerF   Query | NonerG   Body | NonerH   'float | httpx.Timeout | None | NotGivenr   r'   rd   r   rN   r   rE   r   rF   r   rG   r   rH   r   r   r)   )rN   r   rl   r   rm   
int | Omitrn   Literal['asc', 'desc'] | Omitro   JLiteral['queued', 'in_progress', 'completed', 'canceled', 'failed'] | OmitrE   r   rF   r   rG   r   rH   r   r   zSyncCursorPage[RunListResponse]rd   r   rN   r   rE   r   rF   r   rG   r   rH   r   r   r(   rd   r   rN   r   rE   r   rF   r   rG   r   rH   r   r   r&   __name__
__module____qualname____firstlineno____doc__r   r5   r;   r@   r   r   r\   ri   rx   r~   r   __static_attributes__r   r7   r4   r*   r*   %   sD   6) ) ) ) / / /3 )-$("&;D;
;
 2	;

 ,;
 ;
 &;
 ";
  ;
 9;
 
;
H )-$("&;D&
&
 	&
 &&
 "&
  &
 9&
 
&
X ! /3]a )-$("&;D;
;
 	;

 ;
 -;
 [;
 &;
 ";
  ;
 9;
 
);
H )-$("&;D&
&
 	&
 &&
 "&
  &
 9&
 
&
^ )-$("&;D&
&
 	&
 &&
 "&
  &
 9&
 
&
 &
r7   c            	      n   \ rS rSrSr\SS j5       r\SS j5       r\SS j5       r\	\	SSS\
S.                 SS jjrSSS\
S	.             SS
 jjr\	\	\	\	SSS\
S.                   SS jjrSSS\
S	.             SS jjrSSS\
S	.             SS jjrSrg)r+   i3  r.   c                ,    [        U R                  5      $ r0   )r   r1   r2   s    r4   r5   AsyncRuns.output_items6  s      --r7   c                    [        U 5      $ r9   )AsyncRunsWithRawResponser2   s    r4   r;   AsyncRuns.with_raw_response;  s     (--r7   c                    [        U 5      $ r>   )AsyncRunsWithStreamingResponser2   s    r4   r@   !AsyncRuns.with_streaming_responseE  s     .d33r7   NrB   c                  #    U(       d  [        SU< 35      eU R                  [        SUS9[        UUUS.[        R
                  5      I Sh  vN [        UUUUSS0S9[        S	9I Sh  vN $  N! N7f)
rJ   rK   rL   rM   rO   NrQ   TrR   rT   )rX   rY   r   r   r!   rZ   r#   r'   r[   s	            r4   r\   AsyncRuns.createN  s     N UV]U`abbZZ17C,#. ( 
 "11  )+'%'. &#   
 
 	

s$   AA4A0
A4+A2,A42A4r^   c                  #    U(       d  [        SU< 35      eU(       d  [        SU< 35      eU R                  [        SX!S9[        UUUUSS0S9[        S9I S	h  vN $  N7f)
r`   rK   ra   rb   rc   rQ   TrR   re   Nrf   rh   s          r4   ri   AsyncRuns.retrieve  s     0 UV]U`abbTU[T^_``YY:G[(+'%'. (  

 

 
	
 

   AA#A!A#rk   c                   U(       d  [        SU< 35      eU R                  [        SUS9[        [           [        UUUU	[        UUUUS.[        R                  5      SS0S9[        S9$ rq   )	rX   ru   r   r   r%   r#   r   r    rv   rw   s
             r4   rx   AsyncRuns.list  s    J UV]U`abb!!17C 1(+'%%!&!&!&"(	 $11 (.  "' " 
 	
r7   c                  #    U(       d  [        SU< 35      eU(       d  [        SU< 35      eU R                  [        SX!S9[        UUUUSS0S9[        S9I S	h  vN $  N7f)
r{   rK   ra   rb   rc   rQ   TrR   re   Nr|   rh   s          r4   r~   AsyncRuns.delete  s     0 UV]U`abbTU[T^_``\\:G[(+'%'. & " 

 

 
	
 

r   c                  #    U(       d  [        SU< 35      eU(       d  [        SU< 35      eU R                  [        SX!S9[        UUUUSS0S9[        S9I S	h  vN $  N7f)
r   rK   ra   rb   rc   rQ   TrR   re   Nr   rh   s          r4   r   AsyncRuns.cancel  s     0 UV]U`abbTU[T^_``ZZ:G[(+'%'. &   

 

 
	
 

r   r   )r   r   )r   r   )r   r   r   r   )rN   r   rl   r   rm   r   rn   r   ro   r   rE   r   rF   r   rG   r   rH   r   r   zAAsyncPaginator[RunListResponse, AsyncCursorPage[RunListResponse]]r   r   r   r   r7   r4   r+   r+   3  sE   6. . . . 4 4 /3 )-$("&;D;
;
 2	;

 ,;
 ;
 &;
 ";
  ;
 9;
 
;
H )-$("&;D&
&
 	&
 &&
 "&
  &
 9&
 
&
X ! /3]a )-$("&;D;
;
 	;

 ;
 -;
 [;
 &;
 ";
  ;
 9;
 
K;
H )-$("&;D&
&
 	&
 &&
 "&
  &
 9&
 
&
^ )-$("&;D&
&
 	&
 &&
 "&
  &
 9&
 
&
 &
r7   c                  2    \ rS rSrSS jr\SS j5       rSrg)r:   iA  c                   Xl         [        R                  " UR                  5      U l        [        R                  " UR                  5      U l        [        R                  " UR
                  5      U l        [        R                  " UR                  5      U l        [        R                  " UR                  5      U l        g N)_runsr   to_raw_response_wrapperr\   ri   rx   r~   r   r3   runss     r4   __init__RunsWithRawResponse.__init__B  s    
&>>KK
 )@@MM
 %<<II
	 '>>KK
 '>>KK
r7   c                @    [        U R                  R                  5      $ r0   )r   r   r5   r2   s    r4   r5    RunsWithRawResponse.output_itemsU  s     *$***A*ABBr7   r   r   r\   r~   rx   ri   Nr   r*   r   None)r   r   r   r   r   r   r   r   r5   r   r   r7   r4   r:   r:   A  s    
& C Cr7   r:   c                  2    \ rS rSrSS jr\SS j5       rSrg)r   i[  c                   Xl         [        R                  " UR                  5      U l        [        R                  " UR                  5      U l        [        R                  " UR
                  5      U l        [        R                  " UR                  5      U l        [        R                  " UR                  5      U l        g r   )r   r   async_to_raw_response_wrapperr\   ri   rx   r~   r   r   s     r4   r   !AsyncRunsWithRawResponse.__init__\  s    
&DDKK
 )FFMM
 %BBII
	 'DDKK
 'DDKK
r7   c                @    [        U R                  R                  5      $ r0   )r   r   r5   r2   s    r4   r5   %AsyncRunsWithRawResponse.output_itemso  s     /tzz/F/FGGr7   r   Nr   r+   r   r   )r   r   r   r   r7   r4   r   r   [  s    
& H Hr7   r   c                  2    \ rS rSrSS jr\SS j5       rSrg)r?   iu  c                   Xl         [        UR                  5      U l        [        UR                  5      U l        [        UR                  5      U l        [        UR
                  5      U l        [        UR                  5      U l        g r   )r   r   r\   ri   rx   r~   r   r   s     r4   r   "RunsWithStreamingResponse.__init__v  sn    
2KK
 5MM
 1II
	 3KK
 3KK
r7   c                @    [        U R                  R                  5      $ r0   )r   r   r5   r2   s    r4   r5   &RunsWithStreamingResponse.output_items  s     0

0G0GHHr7   r   Nr   )r   r   r   r   r7   r4   r?   r?   u  s    
& I Ir7   r?   c                  2    \ rS rSrSS jr\SS j5       rSrg)r   i  c                   Xl         [        UR                  5      U l        [        UR                  5      U l        [        UR                  5      U l        [        UR
                  5      U l        [        UR                  5      U l        g r   )r   r   r\   ri   rx   r~   r   r   s     r4   r   'AsyncRunsWithStreamingResponse.__init__  sn    
8KK
 ;MM
 7II
	 9KK
 9KK
r7   c                @    [        U R                  R                  5      $ r0   )r   r   r5   r2   s    r4   r5   +AsyncRunsWithStreamingResponse.output_items  s     5TZZ5L5LMMr7   r   Nr   )r   r   r   r   r7   r4   r   r     s    
& N Nr7   r   )@
__future__r   typingr   typing_extensionsr   httpx r   _typesr   r	   r
   r   r   r   r   _utilsr   r   r   _compatr   	_resourcer   r   	_responser   r   r5   r   r   r   r   r   r   
paginationr   r   types.evalsr    r!   _base_clientr"   r#   types.shared_params.metadatar$   types.evals.run_list_responser%   types.evals.run_cancel_responser&   types.evals.run_create_responser'   types.evals.run_delete_responser(   !types.evals.run_retrieve_responser)   __all__r*   r+   r:   r   r?   r   r   r7   r4   <module>r      s    #  %  ! L L L L L ' ; Z  ; > A 5 = A A A E;
K
? K
\K
  K
\C C4H H4I I4N Nr7   