
    -2i'_                       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 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.m/Z/ ddl0m1Z1 ddl2m3Z3 ddl4m5Z5 ddl6m7Z7 ddgZ8 G d de          Z9 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)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ed.d            Zed/d            Zed0d            Zeeddded	d1dZ	dddedd2dZ
eeeeddded d3d)Zdddedd4d+Zdddedd5d-ZdS )6r)   returnr   c                *    t          | j                  S N)r   _clientselfs    _/var/www/html/pixcura-vrs/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
        )r5   r0   s    r2   with_raw_responsezRuns.with_raw_response*   s     #4(((r4   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
        )r9   r0   s    r2   with_streaming_responsezRuns.with_streaming_response4   s     )...r4   Nmetadatanameextra_headersextra_query
extra_bodytimeouteval_idstrdata_sourcerun_create_params.DataSourcer>   Optional[Metadata] | Omitr?   
str | Omitr@   Headers | NonerA   Query | NonerB   Body | NonerC   'float | httpx.Timeout | None | NotGivenr&   c          
         |st          d|          |                     d| dt          |||dt          j                  t          ||||          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//runsrF   r>   r?   r@   rA   rB   rC   bodyoptionscast_to)
ValueError_postr   r    RunCreateParamsr"   r&   	r1   rD   rF   r>   r?   r@   rA   rB   rC   s	            r2   createzRuns.create=   s    N  	caV]aabbbzz$g$$$ #. (  
 "1  )+Q[el   &  
 
 	
r4   rT   run_idr(   c          	         |st          d|          |st          d|          |                     d| d| t          ||||          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
        rP   5Expected a non-empty value for `run_id` but received rQ   /runs/rT   rW   rX   rY   _getr"   r(   r1   r^   rD   r@   rA   rB   rC   s          r2   retrievezRuns.retrievev   s    0  	caV]aabbb 	a_U[__```yy-g--V--(+Q[el   (  
 
 	
r4   afterlimitorderstatusr@   rA   rB   rC   ri   rj   
int | Omitrk   Literal['asc', 'desc'] | Omitrl   JLiteral['queued', 'in_progress', 'completed', 'canceled', 'failed'] | OmitSyncCursorPage[RunListResponse]c                   |st          d|          |                     d| dt          t                   t	          ||||	t          ||||dt          j                            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
        rP   rQ   rR   )ri   rj   rk   rl   )r@   rA   rB   rC   query)pagerW   model)rY   _get_api_listr   r$   r"   r   r   RunListParams
r1   rD   ri   rj   rk   rl   r@   rA   rB   rC   s
             r2   listz	Runs.list   s    J  	caV]aabbb!!$g$$$0(+'%%!&!&!&"(	  $1    "% " 
 
 	
r4   r'   c          	         |st          d|          |st          d|          |                     d| d| t          ||||          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
        rP   ra   rQ   rb   rT   rc   rY   _deleter"   r'   rf   s          r2   deletezRuns.delete   s    0  	caV]aabbb 	a_U[__```||-g--V--(+Q[el   &  
 
 	
r4   r%   c          	         |st          d|          |st          d|          |                     d| d| t          ||||          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
        rP   ra   rQ   rb   rT   rc   rY   rZ   r"   r%   rf   s          r2   cancelzRuns.cancel   s    0  	caV]aabbb 	a_U[__```zz-g--V--(+Q[el   &  
 
 	
r4   )r,   r   )r,   r5   )r,   r9   rD   rE   rF   rG   r>   rH   r?   rI   r@   rJ   rA   rK   rB   rL   rC   rM   r,   r&   r^   rE   rD   rE   r@   rJ   rA   rK   rB   rL   rC   rM   r,   r(   )rD   rE   ri   rI   rj   rm   rk   rn   rl   ro   r@   rJ   rA   rK   rB   rL   rC   rM   r,   rp   r^   rE   rD   rE   r@   rJ   rA   rK   rB   rL   rC   rM   r,   r'   r^   rE   rD   rE   r@   rJ   rA   rK   rB   rL   rC   rM   r,   r%   __name__
__module____qualname__r   r3   r8   r<   r   r   r]   rg   ry   r~   r    r4   r2   r)   r)   %   sh       ) ) ) _) ) ) ) _) / / / _/ /3 )-$("&;D7
 7
 7
 7
 7
 7
@ )-$("&;D"
 "
 "
 "
 "
 "
P ! /3]a )-$("&;D:
 :
 :
 :
 :
 :
F )-$("&;D"
 "
 "
 "
 "
 "
V )-$("&;D"
 "
 "
 "
 "
 "
 "
 "
r4   c            	          e Zd Zed.d            Zed/d            Zed0d            Zeeddded	d1dZ	dddedd2dZ
eeeeddded d3d)Zdddedd4d+Zdddedd5d-ZdS )6r*   r,   r   c                *    t          | j                  S r.   )r   r/   r0   s    r2   r3   zAsyncRuns.output_items   s    ---r4   AsyncRunsWithRawResponsec                     t          |           S r7   )r   r0   s    r2   r8   zAsyncRuns.with_raw_response$  s     (---r4   AsyncRunsWithStreamingResponsec                     t          |           S r;   )r   r0   s    r2   r<   z!AsyncRuns.with_streaming_response.  s     .d333r4   Nr=   rD   rE   rF   rG   r>   rH   r?   rI   r@   rJ   rA   rK   rB   rL   rC   rM   r&   c          
        K   |st          d|          |                     d| dt          |||dt          j                   d{V t          ||||          t                     d{V S )rO   rP   rQ   rR   rS   NrT   rU   )rY   rZ   r   r    r[   r"   r&   r\   s	            r2   r]   zAsyncRuns.create7  s      N  	caV]aabbbZZ$g$$$,#. (  
 "1        )+Q[el   &   
 
 
 
 
 
 
 
 	
r4   rT   r^   r(   c          	        K   |st          d|          |st          d|          |                     d| d| t          ||||          t                     d{V S )r`   rP   ra   rQ   rb   rT   rc   Nrd   rf   s          r2   rg   zAsyncRuns.retrievep  s      0  	caV]aabbb 	a_U[__```YY-g--V--(+Q[el   (  
 
 
 
 
 
 
 
 	
r4   rh   ri   rj   rm   rk   rn   rl   ro   AAsyncPaginator[RunListResponse, AsyncCursorPage[RunListResponse]]c                   |st          d|          |                     d| dt          t                   t	          ||||	t          ||||dt          j                            t                    S rr   )rY   rv   r   r$   r"   r   r   rw   rx   s
             r2   ry   zAsyncRuns.list  s    J  	caV]aabbb!!$g$$$ 1(+'%%!&!&!&"(	  $1    "% " 
 
 	
r4   r'   c          	        K   |st          d|          |st          d|          |                     d| d| t          ||||          t                     d{V S )r{   rP   ra   rQ   rb   rT   rc   Nr|   rf   s          r2   r~   zAsyncRuns.delete  s      0  	caV]aabbb 	a_U[__```\\-g--V--(+Q[el   & " 
 
 
 
 
 
 
 
 	
r4   r%   c          	        K   |st          d|          |st          d|          |                     d| d| t          ||||          t                     d{V S )r   rP   ra   rQ   rb   rT   rc   Nr   rf   s          r2   r   zAsyncRuns.cancel  s      0  	caV]aabbb 	a_U[__```ZZ-g--V--(+Q[el   &   
 
 
 
 
 
 
 
 	
r4   )r,   r   )r,   r   )r,   r   r   r   )rD   rE   ri   rI   rj   rm   rk   rn   rl   ro   r@   rJ   rA   rK   rB   rL   rC   rM   r,   r   r   r   r   r   r4   r2   r*   r*     sh       . . . _. . . . _. 4 4 4 _4 /3 )-$("&;D7
 7
 7
 7
 7
 7
@ )-$("&;D"
 "
 "
 "
 "
 "
P ! /3]a )-$("&;D:
 :
 :
 :
 :
 :
F )-$("&;D"
 "
 "
 "
 "
 "
V )-$("&;D"
 "
 "
 "
 "
 "
 "
 "
r4   c                  .    e Zd Zd	dZed
d            ZdS )r5   runsr)   r,   Nonec                @   || _         t          j        |j                  | _        t          j        |j                  | _        t          j        |j                  | _        t          j        |j                  | _        t          j        |j                  | _        d S r.   )_runsr   to_raw_response_wrapperr]   rg   ry   r~   r   r1   r   s     r2   __init__zRunsWithRawResponse.__init__  s    
&>K
 
 )@M
 
 %<I
 
	 '>K
 
 '>K
 
r4   r   c                4    t          | j        j                  S r.   )r   r   r3   r0   s    r2   r3   z RunsWithRawResponse.output_items-  s    )$**ABBBr4   Nr   r)   r,   r   )r,   r   r   r   r   r   r   r3   r   r4   r2   r5   r5     sN        
 
 
 
& C C C _C C Cr4   r5   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_wrapperr]   rg   ry   r~   r   r   s     r2   r   z!AsyncRunsWithRawResponse.__init__3  s    
&DK
 
 )FM
 
 %BI
 
	 'DK
 
 'DK
 
r4   r   c                4    t          | j        j                  S r.   )r   r   r3   r0   s    r2   r3   z%AsyncRunsWithRawResponse.output_itemsF  s    .tz/FGGGr4   Nr   r*   r,   r   )r,   r   r   r   r4   r2   r   r   2  sN        
 
 
 
& H H H _H H Hr4   r   c                  .    e Zd Zd	dZed
d            ZdS )r9   r   r)   r,   r   c                   || _         t          |j                  | _        t          |j                  | _        t          |j                  | _        t          |j                  | _        t          |j                  | _        d S r.   )r   r   r]   rg   ry   r~   r   r   s     r2   r   z"RunsWithStreamingResponse.__init__L  s    
2K
 
 5M
 
 1I
 
	 3K
 
 3K
 
r4   r   c                4    t          | j        j                  S r.   )r   r   r3   r0   s    r2   r3   z&RunsWithStreamingResponse.output_items_  s    /
0GHHHr4   Nr   )r,   r   r   r   r4   r2   r9   r9   K  sN        
 
 
 
& I I I _I I Ir4   r9   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   r]   rg   ry   r~   r   r   s     r2   r   z'AsyncRunsWithStreamingResponse.__init__e  s    
8K
 
 ;M
 
 7I
 
	 9K
 
 9K
 
r4   r   c                4    t          | j        j                  S r.   )r   r   r3   r0   s    r2   r3   z+AsyncRunsWithStreamingResponse.output_itemsx  s    4TZ5LMMMr4   Nr   )r,   r   r   r   r4   r2   r   r   d  sN        
 
 
 
& N N N _N N Nr4   r   )?
__future__r   typingr   typing_extensionsr   httpx r   _typesr   r	   r
   r   r   r   r   _utilsr   r   _compatr   	_resourcer   r   	_responser   r   r3   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*   r5   r   r9   r   r   r4   r2   <module>r      s+   # " " " " "       % % % % % %  ! ! ! ! ! ! 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;
w
 w
 w
 w
 w
? w
 w
 w
tw
 w
 w
 w
 w
  w
 w
 w
tC C C C C C C C2H H H H H H H H2I I I I I I I I2N N N N N N N N N Nr4   