
    hY%h[^                       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 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l.m/Z/ ddl0m1Z1 ddl2m3Z3 ddl4m5Z5 ddgZ6 G d de      Z7 G d de      Z8 G d d      Z9 G d d      Z: G d d       Z; G d! d"      Z<y)#    )annotations)Optional)LiteralN   )_legacy_response)	NOT_GIVENBodyQueryHeadersNotGiven)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            	      H   e Zd Zedd       Zedd       Zedd       Zeeddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZddded	 	 	 	 	 	 	 	 	 	 	 	 	 ddZ	eeeeddded		 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd
Z
ddded	 	 	 	 	 	 	 	 	 	 	 	 	 ddZddded	 	 	 	 	 	 	 	 	 	 	 	 	 ddZy)r'   c                ,    t        | j                        S N)r   _clientselfs    v/var/www/pru.catia.catastroantioquia-mas.com/valormas/lib/python3.12/site-packages/openai/resources/evals/runs/runs.pyoutput_itemszRuns.output_items&   s    4<<((    c                    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
        )RunsWithRawResponser-   s    r/   with_raw_responsezRuns.with_raw_response*   s     #4((r1   c                    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
        )RunsWithStreamingResponser-   s    r/   with_streaming_responsezRuns.with_streaming_response4   s     )..r1   Nmetadatanameextra_headersextra_query
extra_bodytimeoutc          
         |st        d|      | j                  d| dt        |||dt        j                        t        ||||      t              S )v  Create a new evaluation run.

        This is the endpoint that will kick off grading.

        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data_sourcer;   r<   r=   r>   r?   r@   bodyoptionscast_to)
ValueError_postr   r   RunCreateParamsr    r$   	r.   eval_idrG   r;   r<   r=   r>   r?   r@   s	            r/   createzRuns.create=   sz    L UV]U`abbzzgYe$ #. ( 
 "11 )+Q[el &  
 	
r1   rH   c          	         |st        d|      |st        d|      | j                  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
        rC   5Expected a non-empty value for `run_id` but received rD   /runs/rH   rK   rL   rM   _getr    r&   r.   run_idrQ   r=   r>   r?   r@   s          r/   retrievezRuns.retrieveu   sr    0 UV]U`abbTU[T^_``yygYfVH-(+Q[el (  
 	
r1   afterlimitorderstatusr=   r>   r?   r@   c                   |st        d|      | j                  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
        rC   rD   rE   )r^   r_   r`   ra   )r=   r>   r?   r@   query)pagerK   model)rM   _get_api_listr   r"   r    r   r   RunListParams
r.   rQ   r^   r_   r`   ra   r=   r>   r?   r@   s
             r/   listz	Runs.list   s    J UV]U`abb!!gYe$0(+'%%!&!&!&"(	 $11 "% " 
 	
r1   c          	         |st        d|      |st        d|      | j                  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
        rC   rU   rD   rV   rH   rW   rM   _deleter    r%   rZ   s          r/   deletezRuns.delete   sr    0 UV]U`abbTU[T^_``||gYfVH-(+Q[el &  
 	
r1   c          	         |st        d|      |st        d|      | j                  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
        rC   rU   rD   rV   rH   rW   rM   rN   r    r#   rZ   s          r/   cancelzRuns.cancel   sr    0 UV]U`abbTU[T^_``zzgYfVH-(+Q[el &  
 	
r1   )returnr   )rt   r4   )rt   r8   rQ   strrG   zrun_create_params.DataSourcer;   zOptional[Metadata] | NotGivenr<   str | NotGivenr=   Headers | Noner>   Query | Noner?   Body | Noner@   'float | httpx.Timeout | None | NotGivenrt   r$   r[   rv   rQ   rv   r=   rx   r>   ry   r?   rz   r@   r{   rt   r&   )rQ   rv   r^   rw   r_   int | NotGivenr`   !Literal['asc', 'desc'] | NotGivenra   NLiteral['queued', 'in_progress', 'completed', 'canceled', 'failed'] | NotGivenr=   rx   r>   ry   r?   rz   r@   r{   rt   zSyncCursorPage[RunListResponse]r[   rv   rQ   rv   r=   rx   r>   ry   r?   rz   r@   r{   rt   r%   r[   rv   rQ   rv   r=   rx   r>   ry   r?   rz   r@   r{   rt   r#   __name__
__module____qualname__r   r0   r5   r9   r   rR   r\   rj   ro   rs    r1   r/   r'   r'   %   s<   ) ) ) ) / / 3<( )-$("&;D6
6
 2	6

 06
 6
 &6
 "6
  6
 96
 
6
~ )-$("&;D"
"
 	"
 &"
 ""
  "
 9"
 
"
P !* )3<aj )-$("&;D:
:
 	:

 :
 1:
 _:
 &:
 ":
  :
 9:
 
):
F )-$("&;D"
"
 	"
 &"
 ""
  "
 9"
 
"
V )-$("&;D"
"
 	"
 &"
 ""
  "
 9"
 
"
r1   c            	      H   e Zd Zedd       Zedd       Zedd       Zeeddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZddded	 	 	 	 	 	 	 	 	 	 	 	 	 ddZ	eeeeddded		 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd
Z
ddded	 	 	 	 	 	 	 	 	 	 	 	 	 ddZddded	 	 	 	 	 	 	 	 	 	 	 	 	 ddZy)r(   c                ,    t        | j                        S r+   )r   r,   r-   s    r/   r0   zAsyncRuns.output_items  s    --r1   c                    t        |       S r3   )AsyncRunsWithRawResponser-   s    r/   r5   zAsyncRuns.with_raw_response#  s     (--r1   c                    t        |       S r7   )AsyncRunsWithStreamingResponser-   s    r/   r9   z!AsyncRuns.with_streaming_response-  s     .d33r1   Nr:   c          
        K   |st        d|      | j                  d| dt        |||dt        j                         d{   t        ||||      t               d{   S 7 $7 w)rB   rC   rD   rE   rF   NrH   rI   )rM   rN   r   r   rO   r    r$   rP   s	            r/   rR   zAsyncRuns.create6  s     L UV]U`abbZZgYe$,#. ( 
 "11  )+Q[el &   
 
 	

s$   AA-A)
A-$A+%A-+A-rH   c          	        K   |st        d|      |st        d|      | j                  d| d| t        ||||      t               d{   S 7 w)rT   rC   rU   rD   rV   rH   rW   NrX   rZ   s          r/   r\   zAsyncRuns.retrieven  s     0 UV]U`abbTU[T^_``YYgYfVH-(+Q[el (  
 
 	
 
   AAAAr]   c                   |st        d|      | j                  d| dt        t           t	        ||||	t        ||||dt        j                              t              S rc   )rM   rg   r   r"   r    r   r   rh   ri   s
             r/   rj   zAsyncRuns.list  s    J UV]U`abb!!gYe$ 1(+'%%!&!&!&"(	 $11 "% " 
 	
r1   c          	        K   |st        d|      |st        d|      | j                  d| d| t        ||||      t               d{   S 7 w)rl   rC   rU   rD   rV   rH   rW   Nrm   rZ   s          r/   ro   zAsyncRuns.delete  s     0 UV]U`abbTU[T^_``\\gYfVH-(+Q[el & " 
 
 	
 
r   c          	        K   |st        d|      |st        d|      | j                  d| d| t        ||||      t               d{   S 7 w)rq   rC   rU   rD   rV   rH   rW   Nrr   rZ   s          r/   rs   zAsyncRuns.cancel  s     0 UV]U`abbTU[T^_``ZZgYfVH-(+Q[el &   
 
 	
 
r   )rt   r   )rt   r   )rt   r   ru   r|   )rQ   rv   r^   rw   r_   r}   r`   r~   ra   r   r=   rx   r>   ry   r?   rz   r@   r{   rt   zAAsyncPaginator[RunListResponse, AsyncCursorPage[RunListResponse]]r   r   r   r   r1   r/   r(   r(     s=   . . . . 4 4 3<( )-$("&;D6
6
 2	6

 06
 6
 &6
 "6
  6
 96
 
6
~ )-$("&;D"
"
 	"
 &"
 ""
  "
 9"
 
"
P !* )3<aj )-$("&;D:
:
 	:

 :
 1:
 _:
 &:
 ":
  :
 9:
 
K:
F )-$("&;D"
"
 	"
 &"
 ""
  "
 9"
 
"
V )-$("&;D"
"
 	"
 &"
 ""
  "
 9"
 
"
r1   c                  &    e Zd ZddZedd       Zy)r4   c                z   || _         t        j                  |j                        | _        t        j                  |j                        | _        t        j                  |j
                        | _        t        j                  |j                        | _        t        j                  |j                        | _        y r+   )_runsr   to_raw_response_wrapperrR   r\   rj   ro   rs   r.   runss     r/   __init__zRunsWithRawResponse.__init__  s    
&>>KK
 )@@MM
 %<<II
	 '>>KK
 '>>KK
r1   c                @    t        | j                  j                        S r+   )r   r   r0   r-   s    r/   r0   z RunsWithRawResponse.output_items+  s    )$***A*ABBr1   Nr   r'   rt   None)rt   r   r   r   r   r   r   r0   r   r1   r/   r4   r4     s    
& C Cr1   r4   c                  &    e Zd ZddZedd       Zy)r   c                z   || _         t        j                  |j                        | _        t        j                  |j                        | _        t        j                  |j
                        | _        t        j                  |j                        | _        t        j                  |j                        | _        y r+   )r   r   async_to_raw_response_wrapperrR   r\   rj   ro   rs   r   s     r/   r   z!AsyncRunsWithRawResponse.__init__1  s    
&DDKK
 )FFMM
 %BBII
	 'DDKK
 'DDKK
r1   c                @    t        | j                  j                        S r+   )r   r   r0   r-   s    r/   r0   z%AsyncRunsWithRawResponse.output_itemsD  s    .tzz/F/FGGr1   Nr   r(   rt   r   )rt   r   r   r   r1   r/   r   r   0  s    
& H Hr1   r   c                  &    e Zd ZddZedd       Zy)r8   c                   || _         t        |j                        | _        t        |j                        | _        t        |j                        | _        t        |j
                        | _        t        |j                        | _        y r+   )r   r   rR   r\   rj   ro   rs   r   s     r/   r   z"RunsWithStreamingResponse.__init__J  sp    
2KK
 5MM
 1II
	 3KK
 3KK
r1   c                @    t        | j                  j                        S r+   )r   r   r0   r-   s    r/   r0   z&RunsWithStreamingResponse.output_items]  s    /

0G0GHHr1   Nr   )rt   r   r   r   r1   r/   r8   r8   I  s    
& I Ir1   r8   c                  &    e Zd ZddZedd       Zy)r   c                   || _         t        |j                        | _        t        |j                        | _        t        |j                        | _        t        |j
                        | _        t        |j                        | _        y r+   )r   r   rR   r\   rj   ro   rs   r   s     r/   r   z'AsyncRunsWithStreamingResponse.__init__c  sp    
8KK
 ;MM
 7II
	 9KK
 9KK
r1   c                @    t        | j                  j                        S r+   )r   r   r0   r-   s    r/   r0   z+AsyncRunsWithStreamingResponse.output_itemsv  s    4TZZ5L5LMMr1   Nr   )rt   r   r   r   r1   r/   r   r   b  s    
& N Nr1   r   )=
__future__r   typingr   typing_extensionsr   httpx r   _typesr   r	   r
   r   r   _utilsr   r   _compatr   	_resourcer   r   	_responser   r   r0   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(   r4   r   r8   r   r   r1   r/   <module>r      s    #  %  ! @ @ = ' ; Z  ; > A 5 = A A A E;
v
? v
rv
  v
rC C2H H2I I2N Nr1   