
    i f                       d dl m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mZmZ ddlmZ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m Z m!Z!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/m0Z0 ddl1m2Z2 ddl3m4Z4 ddl5m6Z6 ddl7m8Z8 ddgZ9 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 )#    )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            	          e Zd ZdZed/d            Zed0d            Zed1d            Zeed	d	d	e	d
d2dZ
d	d	d	e	dd3d Zeeeed	d	d	e	d!d4d*Zd	d	d	e	dd5d,Zd	d	d	e	dd6d.Zd	S )7r*   ,Manage and run evals in the OpenAI platform.returnr   c                *    t          | j                  S r-   )r   _clientselfs    g/home/piyush/.hermes/hermes-agent/venv/lib/python3.11/site-packages/openai/resources/evals/runs/runs.pyoutput_itemszRuns.output_items(   s     4<(((    RunsWithRawResponsec                     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
        )r7   r2   s    r4   with_raw_responsezRuns.with_raw_response-   s     #4(((r6   RunsWithStreamingResponsec                     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;   r2   s    r4   with_streaming_responsezRuns.with_streaming_response7   s     )...r6   Nmetadatanameextra_headersextra_query
extra_bodytimeouteval_idstrdata_sourcerun_create_params.DataSourcer@   Optional[Metadata] | OmitrA   
str | OmitrB   Headers | NonerC   Query | NonerD   Body | NonerE   'float | httpx.Timeout | None | NotGivenr'   c                   |st          d|          |                     t          d|          t          |||dt          j                  t          ||||ddi          t                    S )	  
        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rF   rH   r@   rA   bearer_authTrB   rC   rD   rE   securitybodyoptionscast_to)
ValueError_postr   r   r!   RunCreateParamsr#   r'   	r3   rF   rH   r@   rA   rB   rC   rD   rE   s	            r4   createzRuns.create@   s    N  	caV]aabbbzz17CCC #. (  
 "1  )+'%'.   &#  
 
 	
r6   rB   rC   rD   rE   run_idr)   c                   |st          d|          |st          d|          |                     t          d||          t          ||||ddi          t                    S )	P  
        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
        rR   5Expected a non-empty value for `run_id` but received /evals/{eval_id}/runs/{run_id}rF   rc   rV   TrW   r[   r\   r]   _getr   r#   r)   r3   rc   rF   rB   rC   rD   rE   s          r4   retrievezRuns.retrieve}   s    0  	caV]aabbb 	a_U[__```yy:GTZ[[[(+'%'.   (  

 

 
	
r6   afterlimitorderstatusrB   rC   rD   rE   ro   rp   
int | Omitrq   Literal['asc', 'desc'] | Omitrr   JLiteral['queued', 'in_progress', 'completed', 'canceled', 'failed'] | OmitSyncCursorPage[RunListResponse]c                  |st          d|          |                     t          d|          t          t                   t          ||||	t          ||||dt          j                  ddi          t                    S 	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
        rR   rS   rT   )ro   rp   rq   rr   rV   T)rB   rC   rD   rE   queryrX   )pager[   model)	r]   _get_api_listr   r   r%   r#   r   r    RunListParams
r3   rF   ro   rp   rq   rr   rB   rC   rD   rE   s
             r4   listz	Runs.list   s    J  	caV]aabbb!!17CCC0(+'%%!&!&!&"(	  $1  (.    "' " 
 
 	
r6   r(   c                   |st          d|          |st          d|          |                     t          d||          t          ||||ddi          t                    S )	G  
        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
        rR   rf   rg   rh   rV   TrW   ri   r]   _deleter   r#   r(   rl   s          r4   deletezRuns.delete   s    0  	caV]aabbb 	a_U[__```||:GTZ[[[(+'%'.   &  

 

 
	
r6   r&   c                   |st          d|          |st          d|          |                     t          d||          t          ||||ddi          t                    S )	U  
        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
        rR   rf   rg   rh   rV   TrW   ri   r]   r^   r   r#   r&   rl   s          r4   cancelzRuns.cancel
  s    0  	caV]aabbb 	a_U[__```zz:GTZ[[[(+'%'.   &  

 

 
	
r6   )r.   r   )r.   r7   )r.   r;   rF   rG   rH   rI   r@   rJ   rA   rK   rB   rL   rC   rM   rD   rN   rE   rO   r.   r'   rc   rG   rF   rG   rB   rL   rC   rM   rD   rN   rE   rO   r.   r)   )rF   rG   ro   rK   rp   rs   rq   rt   rr   ru   rB   rL   rC   rM   rD   rN   rE   rO   r.   rv   rc   rG   rF   rG   rB   rL   rC   rM   rD   rN   rE   rO   r.   r(   rc   rG   rF   rG   rB   rL   rC   rM   rD   rN   rE   rO   r.   r&   __name__
__module____qualname____doc__r   r5   r:   r>   r   r   ra   rm   r   r   r    r6   r4   r*   r*   %   sn       66) ) ) _) ) ) ) _) / / / _/ /3 )-$("&;D;
 ;
 ;
 ;
 ;
 ;
H )-$("&;D&
 &
 &
 &
 &
 &
X ! /3]a )-$("&;D;
 ;
 ;
 ;
 ;
 ;
H )-$("&;D&
 &
 &
 &
 &
 &
^ )-$("&;D&
 &
 &
 &
 &
 &
 &
 &
r6   c            	          e Zd ZdZed/d            Zed0d            Zed1d            Zeed	d	d	e	d
d2dZ
d	d	d	e	dd3d Zeeeed	d	d	e	d!d4d*Zd	d	d	e	dd5d,Zd	d	d	e	dd6d.Zd	S )7r+   r-   r.   r   c                *    t          | j                  S r0   )r   r1   r2   s    r4   r5   zAsyncRuns.output_items6  s      ---r6   AsyncRunsWithRawResponsec                     t          |           S r9   )r   r2   s    r4   r:   zAsyncRuns.with_raw_response;  s     (---r6   AsyncRunsWithStreamingResponsec                     t          |           S r=   )r   r2   s    r4   r>   z!AsyncRuns.with_streaming_responseE  s     .d333r6   Nr?   rF   rG   rH   rI   r@   rJ   rA   rK   rB   rL   rC   rM   rD   rN   rE   rO   r'   c                  K   |st          d|          |                     t          d|          t          |||dt          j                   d{V t          ||||ddi          t          	           d{V S )
rQ   rR   rS   rT   rU   NrV   TrW   rY   )r]   r^   r   r   r!   r_   r#   r'   r`   s	            r4   ra   zAsyncRuns.createN  s      N  	caV]aabbbZZ17CCC,#. (  
 "1        )+'%'.   &#   
 
 
 
 
 
 
 
 	
r6   rb   rc   r)   c                  K   |st          d|          |st          d|          |                     t          d||          t          ||||ddi          t                     d	{V S )
re   rR   rf   rg   rh   rV   TrW   ri   Nrj   rl   s          r4   rm   zAsyncRuns.retrieve  s      0  	caV]aabbb 	a_U[__```YY:GTZ[[[(+'%'.   (  

 

 

 

 

 

 

 

 
	
r6   rn   ro   rp   rs   rq   rt   rr   ru   AAsyncPaginator[RunListResponse, AsyncCursorPage[RunListResponse]]c                  |st          d|          |                     t          d|          t          t                   t          ||||	t          ||||dt          j                  ddi          t                    S rx   )	r]   r|   r   r   r%   r#   r   r    r}   r~   s
             r4   r   zAsyncRuns.list  s    J  	caV]aabbb!!17CCC 1(+'%%!&!&!&"(	  $1  (.    "' " 
 
 	
r6   r(   c                  K   |st          d|          |st          d|          |                     t          d||          t          ||||ddi          t                     d	{V S )
r   rR   rf   rg   rh   rV   TrW   ri   Nr   rl   s          r4   r   zAsyncRuns.delete  s      0  	caV]aabbb 	a_U[__```\\:GTZ[[[(+'%'.   & " 

 

 

 

 

 

 

 

 
	
r6   r&   c                  K   |st          d|          |st          d|          |                     t          d||          t          ||||ddi          t                     d	{V S )
r   rR   rf   rg   rh   rV   TrW   ri   Nr   rl   s          r4   r   zAsyncRuns.cancel  s      0  	caV]aabbb 	a_U[__```ZZ:GTZ[[[(+'%'.   &   

 

 

 

 

 

 

 

 
	
r6   )r.   r   )r.   r   )r.   r   r   r   )rF   rG   ro   rK   rp   rs   rq   rt   rr   ru   rB   rL   rC   rM   rD   rN   rE   rO   r.   r   r   r   r   r   r6   r4   r+   r+   3  sn       66. . . _. . . . _. 4 4 4 _4 /3 )-$("&;D;
 ;
 ;
 ;
 ;
 ;
H )-$("&;D&
 &
 &
 &
 &
 &
X ! /3]a )-$("&;D;
 ;
 ;
 ;
 ;
 ;
H )-$("&;D&
 &
 &
 &
 &
 &
^ )-$("&;D&
 &
 &
 &
 &
 &
 &
 &
r6   c                  .    e Zd Zd	dZed
d            ZdS )r7   runsr*   r.   Nonec                @   || _         t          j        |j                  | _        t          j        |j                  | _        t          j        |j                  | _        t          j        |j                  | _        t          j        |j                  | _        d S N)_runsr   to_raw_response_wrapperra   rm   r   r   r   r3   r   s     r4   __init__zRunsWithRawResponse.__init__B  s    
&>K
 
 )@M
 
 %<I
 
	 '>K
 
 '>K
 
r6   r   c                4    t          | j        j                  S r0   )r   r   r5   r2   s    r4   r5   z RunsWithRawResponse.output_itemsU  s     *$**ABBBr6   Nr   r*   r.   r   )r.   r   r   r   r   r   r   r5   r   r6   r4   r7   r7   A  sN        
 
 
 
& C C C _C C Cr6   r7   c                  .    e Zd Zd	dZed
d            ZdS )r   r   r+   r.   r   c                @   || _         t          j        |j                  | _        t          j        |j                  | _        t          j        |j                  | _        t          j        |j                  | _        t          j        |j                  | _        d S r   )r   r   async_to_raw_response_wrapperra   rm   r   r   r   r   s     r4   r   z!AsyncRunsWithRawResponse.__init__\  s    
&DK
 
 )FM
 
 %BI
 
	 'DK
 
 'DK
 
r6   r   c                4    t          | j        j                  S r0   )r   r   r5   r2   s    r4   r5   z%AsyncRunsWithRawResponse.output_itemso  s     /tz/FGGGr6   Nr   r+   r.   r   )r.   r   r   r   r6   r4   r   r   [  sN        
 
 
 
& H H H _H H Hr6   r   c                  .    e Zd Zd	dZed
d            ZdS )r;   r   r*   r.   r   c                   || _         t          |j                  | _        t          |j                  | _        t          |j                  | _        t          |j                  | _        t          |j                  | _        d S r   )r   r   ra   rm   r   r   r   r   s     r4   r   z"RunsWithStreamingResponse.__init__v  s    
2K
 
 5M
 
 1I
 
	 3K
 
 3K
 
r6   r   c                4    t          | j        j                  S r0   )r   r   r5   r2   s    r4   r5   z&RunsWithStreamingResponse.output_items  s     0
0GHHHr6   Nr   )r.   r   r   r   r6   r4   r;   r;   u  sN        
 
 
 
& I I I _I I Ir6   r;   c                  .    e Zd Zd	dZed
d            ZdS )r   r   r+   r.   r   c                   || _         t          |j                  | _        t          |j                  | _        t          |j                  | _        t          |j                  | _        t          |j                  | _        d S r   )r   r   ra   rm   r   r   r   r   s     r4   r   z'AsyncRunsWithStreamingResponse.__init__  s    
8K
 
 ;M
 
 7I
 
	 9K
 
 9K
 
r6   r   c                4    t          | j        j                  S r0   )r   r   r5   r2   s    r4   r5   z+AsyncRunsWithStreamingResponse.output_items  s     5TZ5LMMMr6   Nr   )r.   r   r   r   r6   r4   r   r     sN        
 
 
 
& N N N _N N Nr6   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+   r7   r   r;   r   r   r6   r4   <module>r      s1   # " " " " "       % % % % % %  ! ! ! ! ! ! L L L L L L L L L L L L L L L L L L L L L L L L L L L L ' ' ' ' ' ' ; ; ; ; ; ; ; ; Z Z Z Z Z Z Z Z                ; : : : : : : : > > > > > > > > A A A A A A A A 5 5 5 5 5 5 = = = = = = A A A A A A A A A A A A A A A A A A E E E E E E;
K
 K
 K
 K
 K
? K
 K
 K
\K
 K
 K
 K
 K
  K
 K
 K
\C C C C C C C C4H H H H H H H H4I I I I I I I I4N N N N N N N N N Nr6   