
    h%d                       S SK Jr  S SKJr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  SSKJrJrJrJrJr  SS	KJrJr  SS
K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*J+r+  SSK,J-r-  SSK.J/r/  SSK0J1r1  SSK2J3r3  SSK4J5r5  SSK6J7r7  SS/r8 " S S\!5      r9 " S S\"5      r: " S S5      r; " S S5      r< " S S 5      r= " S! S"5      r>g)#    )annotations)IterableOptional)LiteralN   )_legacy_response)eval_list_paramseval_create_paramseval_update_params)	NOT_GIVENBodyQueryHeadersNotGiven)maybe_transformasync_maybe_transform)cached_property   )Runs	AsyncRunsRunsWithRawResponseAsyncRunsWithRawResponseRunsWithStreamingResponseAsyncRunsWithStreamingResponse)SyncAPIResourceAsyncAPIResource)to_streamed_response_wrapper"async_to_streamed_response_wrapper)SyncCursorPageAsyncCursorPage)AsyncPaginatormake_request_options)EvalListResponse)EvalCreateResponse)EvalDeleteResponse)EvalUpdateResponse)EvalRetrieveResponse)MetadataEvals
AsyncEvalsc            	      l   \ 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)   (   c                ,    [        U R                  5      $ N)r   _clientselfs    N/var/www/html/env/lib/python3.13/site-packages/openai/resources/evals/evals.pyruns
Evals.runs)   s    DLL!!    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
)EvalsWithRawResponser0   s    r2   with_raw_responseEvals.with_raw_response-   s     $D))r5   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
)EvalsWithStreamingResponser0   s    r2   with_streaming_responseEvals.with_streaming_response7   s     *$//r5   Nmetadatanameshare_with_openaiextra_headersextra_query
extra_bodytimeoutc       	        z    U R                  S[        UUUUUS.[        R                  5      [	        XgXS9[
        S9$ )  
Create the structure of an evaluation that can be used to test a model's
performance. An evaluation is a set of testing criteria and a datasource. After
creating an evaluation, you can run it on different models and model parameters.
We support several types of graders and datasources. For more information, see
the [Evals guide](https://platform.openai.com/docs/guides/evals).

Args:
  data_source_config: The configuration for the data source used for the evaluation runs.

  testing_criteria: A list of graders for all eval runs in this group.

  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 evaluation.

  share_with_openai: Indicates whether the evaluation is shared with OpenAI.

  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
/evalsdata_source_configtesting_criteriarA   rB   rC   rD   rE   rF   rG   bodyoptionscast_to)_postr   r
   EvalCreateParamsr"   r$   
r1   rL   rM   rA   rB   rC   rD   rE   rF   rG   s
             r2   createEvals.create@   sZ    \ zz *<(8 ( ): #33	 )+Q[ '  
 	
r5   rN   c          
     n    U(       d  [        SU< 35      eU R                  SU 3[        X#XES9[        S9$ )  
Get an evaluation 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
6Expected a non-empty value for `eval_id` but received /evals/rN   rQ   rR   
ValueError_getr"   r'   r1   eval_idrD   rE   rF   rG   s         r2   retrieveEvals.retrieve   sO    . UV]U`abbyygY(+Q[ )  
 	
r5   rA   rB   rD   rE   rF   rG   c                   U(       d  [        SU< 35      eU R                  SU 3[        UUS.[        R                  5      [        XEXgS9[        S9$ )  
Update certain properties of an evaluation.

Args:
  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: Rename the evaluation.

  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
rZ   r[   rA   rB   rN   rO   )r^   rS   r   r   EvalUpdateParamsr"   r&   r1   ra   rA   rB   rD   rE   rF   rG   s           r2   updateEvals.update   sp    D UV]U`abbzzgY  (  #33 )+Q[ '  
 	
r5   afterlimitorderorder_byrD   rE   rF   rG   c                   U R                  S[        [           [        UUUU[	        UUUUS.[
        R                  5      S9[        S9$ a  
List evaluations for a project.

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

  limit: Number of evals to retrieve.

  order: Sort order for evals by timestamp. Use `asc` for ascending order or `desc` for
      descending order.

  order_by: Evals can be ordered by creation time or last updated time. Use `created_at` for
      creation time or `updated_at` for last updated time.

  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
rJ   )rm   rn   ro   rp   )rD   rE   rF   rG   query)pagerQ   model)_get_api_listr   r#   r"   r   r	   EvalListParams	r1   rm   rn   ro   rp   rD   rE   rF   rG   s	            r2   list
Evals.list   sf    H !! 01(+'%%!&!&!&$,	 %33 #% " 
 	
r5   c          
     n    U(       d  [        SU< 35      eU R                  SU 3[        X#XES9[        S9$ )  
Delete an evaluation.

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
rZ   r[   rN   r\   r^   _deleter"   r%   r`   s         r2   deleteEvals.delete  sO    . UV]U`abb||gY(+Q[ '  
 	
r5    )returnr   )r   r8   )r   r=   rL   z#eval_create_params.DataSourceConfigrM   z-Iterable[eval_create_params.TestingCriterion]rA   Optional[Metadata] | NotGivenrB   str | NotGivenrC   zbool | NotGivenrD   Headers | NonerE   Query | NonerF   Body | NonerG   'float | httpx.Timeout | None | NotGivenr   r$   ra   strrD   r   rE   r   rF   r   rG   r   r   r'   ra   r   rA   r   rB   r   rD   r   rE   r   rF   r   rG   r   r   r&   )rm   r   rn   int | NotGivenro   !Literal['asc', 'desc'] | NotGivenrp   .Literal['created_at', 'updated_at'] | NotGivenrD   r   rE   r   rF   r   rG   r   r   z SyncCursorPage[EvalListResponse]ra   r   rD   r   rE   r   rF   r   rG   r   r   r%   __name__
__module____qualname____firstlineno__r   r3   r9   r>   r   rV   rb   rj   ry   r   __static_attributes__r   r5   r2   r)   r)   (   sH   " " * * 0 0 3<(-6 )-$("&;D>
 @>
 H	>

 0>
 >
 +>
 &>
 ">
  >
 9>
 
>
L )-$("&;D

 &
 "
  
 9
 

J 3<( )-$("&;D1
1
 0	1

 1
 &1
 "1
  1
 91
 
1
l !* )3<CL )-$("&;D7
 7
 	7

 17
 A7
 &7
 "7
  7
 97
 
*7
~ )-$("&;D

 &
 "
  
 9
 

 
r5   c            	      l   \ 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*   i/  c                ,    [        U R                  5      $ r.   )r   r/   r0   s    r2   r3   AsyncEvals.runs0  s    &&r5   c                    [        U 5      $ r7   )AsyncEvalsWithRawResponser0   s    r2   r9   AsyncEvals.with_raw_response4  s     )..r5   c                    [        U 5      $ r<   )AsyncEvalsWithStreamingResponser0   s    r2   r>   "AsyncEvals.with_streaming_response>  s     /t44r5   Nr@   c       	           #    U R                  S[        UUUUUS.[        R                  5      I Sh  vN [	        XgXS9[
        S9I Sh  vN $  N N7f)rI   rJ   rK   NrN   rO   )rS   r   r
   rT   r"   r$   rU   s
             r2   rV   AsyncEvals.createG  sq     \ ZZ,*<(8 ( ): #33	 	 )+Q[ '   
 
 	
	
s!   0AA
A
AAArN   c          
        #    U(       d  [        SU< 35      eU R                  SU 3[        X#XES9[        S9I Sh  vN $  N7f)rY   rZ   r[   rN   r\   Nr]   r`   s         r2   rb   AsyncEvals.retrieve  s\     . UV]U`abbYYgY(+Q[ )  
 
 	
 
   :AAArd   c                  #    U(       d  [        SU< 35      eU R                  SU 3[        UUS.[        R                  5      I Sh  vN [        XEXgS9[        S9I Sh  vN $  N N7f)rf   rZ   r[   rg   NrN   rO   )r^   rS   r   r   rh   r"   r&   ri   s           r2   rj   AsyncEvals.update  s     D UV]U`abbZZgY, (  #33  )+Q[ '   
 
 	

s$   AA)A%
	A) A'!A)'A)rl   c                   U R                  S[        [           [        UUUU[	        UUUUS.[
        R                  5      S9[        S9$ rr   )rv   r    r#   r"   r   r	   rw   rx   s	            r2   ry   AsyncEvals.list  sf    H !! !12(+'%%!&!&!&$,	 %33 #% " 
 	
r5   c          
        #    U(       d  [        SU< 35      eU R                  SU 3[        X#XES9[        S9I Sh  vN $  N7f)r|   rZ   r[   rN   r\   Nr}   r`   s         r2   r   AsyncEvals.delete  s\     . UV]U`abb\\gY(+Q[ ' " 
 
 	
 
r   r   )r   r   )r   r   )r   r   r   r   r   )rm   r   rn   r   ro   r   rp   r   rD   r   rE   r   rF   r   rG   r   r   zCAsyncPaginator[EvalListResponse, AsyncCursorPage[EvalListResponse]]r   r   r   r5   r2   r*   r*   /  sI   ' ' / / 5 5 3<(-6 )-$("&;D>
 @>
 H	>

 0>
 >
 +>
 &>
 ">
  >
 9>
 
>
L )-$("&;D

 &
 "
  
 9
 

J 3<( )-$("&;D1
1
 0	1

 1
 &1
 "1
  1
 91
 
1
l !* )3<CL )-$("&;D7
 7
 	7

 17
 A7
 &7
 "7
  7
 97
 
M7
~ )-$("&;D

 &
 "
  
 9
 

 
r5   c                  2    \ rS rSrSS jr\SS j5       rSrg)r8   i6  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.   )_evalsr   to_raw_response_wrapperrV   rb   rj   ry   r   r1   evalss     r2   __init__EvalsWithRawResponse.__init__7  s    &>>LL
 )@@NN
 '>>LL
 %<<JJ
	 '>>LL
r5   c                @    [        U R                  R                  5      $ r.   )r   r   r3   r0   s    r2   r3   EvalsWithRawResponse.runsJ  s    "4;;#3#344r5   r   rV   r   ry   rb   rj   Nr   r)   r   None)r   r   r   r   r   r   r   r   r3   r   r   r5   r2   r8   r8   6  s    
& 5 5r5   r8   c                  2    \ rS rSrSS jr\SS j5       rSrg)r   iO  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_wrapperrV   rb   rj   ry   r   r   s     r2   r   "AsyncEvalsWithRawResponse.__init__P  s    &DDLL
 )FFNN
 'DDLL
 %BBJJ
	 'DDLL
r5   c                @    [        U R                  R                  5      $ r.   )r   r   r3   r0   s    r2   r3   AsyncEvalsWithRawResponse.runsc  s    '(8(899r5   r   Nr   r*   r   r   )r   r   r   r   r5   r2   r   r   O  s    
& : :r5   r   c                  2    \ rS rSrSS jr\SS j5       rSrg)r=   ih  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   rV   rb   rj   ry   r   r   s     r2   r   #EvalsWithStreamingResponse.__init__i  sn    2LL
 5NN
 3LL
 1JJ
	 3LL
r5   c                @    [        U R                  R                  5      $ r.   )r   r   r3   r0   s    r2   r3   EvalsWithStreamingResponse.runs|  s    ()9)9::r5   r   Nr   )r   r   r   r   r5   r2   r=   r=   h  s    
& ; ;r5   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   rV   rb   rj   ry   r   r   s     r2   r   (AsyncEvalsWithStreamingResponse.__init__  sn    8LL
 ;NN
 9LL
 7JJ
	 9LL
r5   c                @    [        U R                  R                  5      $ r.   )r   r   r3   r0   s    r2   r3   $AsyncEvalsWithStreamingResponse.runs  s    -dkk.>.>??r5   r   Nr   )r   r   r   r   r5   r2   r   r     s    
& @ @r5   r   )?
__future__r   typingr   r   typing_extensionsr   httpx r   typesr	   r
   r   _typesr   r   r   r   r   _utilsr   r   _compatr   	runs.runsr   r   r   r   r   r   	_resourcer   r   	_responser   r   
paginationr   r    _base_clientr!   r"   types.eval_list_responser#   types.eval_create_responser$   types.eval_delete_responser%   types.eval_update_responser&   types.eval_retrieve_responser'   types.shared_params.metadatar(   __all__r)   r*   r8   r   r=   r   r   r5   r2   <module>r      s    # % %    M M ? ? '  ; Y 9 @ 8 < < < @ 4L
!D
O D
ND
! D
N5 52: :2; ;2@ @r5   