
    2he                       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            	      f   \ 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    T/var/www/auris/envauris/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_response4   s     *$//r5   Nmetadatanameextra_headersextra_query
extra_bodytimeoutc               x    U R                  S[        UUUUS.[        R                  5      [	        XVXxS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 the config for a
data source, which dictates the schema of the data used in the evaluation. 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. Dictates the
      schema of the data used in the evaluation.

  testing_criteria: A list of graders for all eval runs in this group. Graders can reference
      variables in the data source using double curly braces notation, like
      `{{item.variable_name}}`. To reference the model's output, use the `sample`
      namespace (ie, `{{sample.output_text}}`).

  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.

  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   bodyoptionscast_to)_postr   r
   EvalCreateParamsr"   r$   	r1   rK   rL   rA   rB   rC   rD   rE   rF   s	            r2   createEvals.create=   sW    ` zz *<(8 ( 	 #33 )+Q[ '  
 	
r5   rM   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/rM   rP   rQ   
ValueError_getr"   r'   r1   eval_idrC   rD   rE   rF   s         r2   retrieveEvals.retrieve~   sO    . UV]U`abbyygY(+Q[ )  
 	
r5   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
rY   rZ   rA   rB   rM   rN   )r]   rR   r   r   EvalUpdateParamsr"   r&   r1   r`   rA   rB   rC   rD   rE   rF   s           r2   updateEvals.update   sp    D UV]U`abbzzgY  (  #33 )+Q[ '  
 	
r5   afterlimitorderorder_byrC   rD   rE   rF   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
rI   )rk   rl   rm   rn   )rC   rD   rE   rF   query)pagerP   model)_get_api_listr   r#   r"   r   r	   EvalListParams	r1   rk   rl   rm   rn   rC   rD   rE   rF   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
rY   rZ   rM   r[   r]   _deleter"   r%   r_   s         r2   deleteEvals.delete  sO    . UV]U`abb||gY(+Q[ '  
 	
r5    )returnr   )r   r8   )r   r=   rK   z#eval_create_params.DataSourceConfigrL   z-Iterable[eval_create_params.TestingCriterion]rA   Optional[Metadata] | NotGivenrB   str | NotGivenrC   Headers | NonerD   Query | NonerE   Body | NonerF   'float | httpx.Timeout | None | NotGivenr   r$   r`   strrC   r   rD   r   rE   r   rF   r   r   r'   r`   r   rA   r   rB   r   rC   r   rD   r   rE   r   rF   r   r   r&   )rk   r   rl   int | NotGivenrm   !Literal['asc', 'desc'] | NotGivenrn   .Literal['created_at', 'updated_at'] | NotGivenrC   r   rD   r   rE   r   rF   r   r   z SyncCursorPage[EvalListResponse]r`   r   rC   r   rD   r   rE   r   rF   r   r   r%   __name__
__module____qualname____firstlineno__r   r3   r9   r>   r   rU   ra   rh   rw   r}   __static_attributes__r   r5   r2   r)   r)   %   s;   " " * * 0 0 3<( )-$("&;D?
 @?
 H	?

 0?
 ?
 &?
 "?
  ?
 9?
 
?
N )-$("&;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            	      f   \ 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.runs.  s    &&r5   c                    [        U 5      $ r7   )AsyncEvalsWithRawResponser0   s    r2   r9   AsyncEvals.with_raw_response2  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S.[        R                  5      I Sh  vN [	        XVXxS9[
        S9I Sh  vN $  N N7f)rH   rI   rJ   NrM   rN   )rR   r   r
   rS   r"   r$   rT   s	            r2   rU   AsyncEvals.createE  sn     ` ZZ,*<(8 ( 	 #33  )+Q[ '   
 
 	

s!   /AA
A	A
AArM   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)rX   rY   rZ   rM   r[   Nr\   r_   s         r2   ra   AsyncEvals.retrieve  s\     . UV]U`abbYYgY(+Q[ )  
 
 	
 
   :AAA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)rd   rY   rZ   re   NrM   rN   )r]   rR   r   r   rf   r"   r&   rg   s           r2   rh   AsyncEvals.update  s     D UV]U`abbZZgY, (  #33  )+Q[ '   
 
 	

s$   AA)A%
	A) A'!A)'A)rj   c                   U R                  S[        [           [        UUUU[	        UUUUS.[
        R                  5      S9[        S9$ rp   )rt   r    r#   r"   r   r	   ru   rv   s	            r2   rw   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)rz   rY   rZ   rM   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   )rk   r   rl   r   rm   r   rn   r   rC   r   rD   r   rE   r   rF   r   r   zCAsyncPaginator[EvalListResponse, AsyncCursorPage[EvalListResponse]]r   r   r   r5   r2   r*   r*   -  s<   ' ' / / 5 5 3<( )-$("&;D?
 @?
 H	?

 0?
 ?
 &?
 "?
  ?
 9?
 
?
N )-$("&;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   i5  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_wrapperrU   ra   rh   rw   r}   r1   evalss     r2   __init__EvalsWithRawResponse.__init__6  s    &>>LL
 )@@NN
 '>>LL
 %<<JJ
	 '>>LL
r5   c                @    [        U R                  R                  5      $ r.   )r   r   r3   r0   s    r2   r3   EvalsWithRawResponse.runsI  s    "4;;#3#344r5   r   rU   r}   rw   ra   rh   Nr   r)   r   None)r   r   r   r   r   r   r   r   r3   r   r   r5   r2   r8   r8   5  s    
& 5 5r5   r8   c                  2    \ rS rSrSS jr\SS j5       rSrg)r   iN  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_wrapperrU   ra   rh   rw   r}   r   s     r2   r   "AsyncEvalsWithRawResponse.__init__O  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.runsb  s    '(8(899r5   r   Nr   r*   r   r   )r   r   r   r   r5   r2   r   r   N  s    
& : :r5   r   c                  2    \ rS rSrSS jr\SS j5       rSrg)r=   ig  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   rU   ra   rh   rw   r}   r   s     r2   r   #EvalsWithStreamingResponse.__init__h  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=   g  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   rU   ra   rh   rw   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
!E
O E
PE
! E
P5 52: :2; ;2@ @r5   