
    .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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>y)#    )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            	      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    a/var/www/html/axiom-chatbot/venv/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    r1   with_raw_responsezRuns.with_raw_response*   s     #4((r3   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    r1   with_streaming_responsezRuns.with_streaming_response4   s     )..r3   Nmetadatanameextra_headersextra_query
extra_bodytimeoutc          
         |st        d|      | j                  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data_sourcer=   r>   r?   r@   rA   rB   bodyoptionscast_to)
ValueError_postr   r    RunCreateParamsr"   r&   	r0   eval_idrI   r=   r>   r?   r@   rA   rB   s	            r1   createzRuns.create=   sz    N UV]U`abbzzgYe$ #. ( 
 "11 )+Q[el &  
 	
r3   rJ   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
        rE   5Expected a non-empty value for `run_id` but received rF   /runs/rJ   rM   rN   rO   _getr"   r(   r0   run_idrS   r?   r@   rA   rB   s          r1   retrievezRuns.retrievev   sr    0 UV]U`abbTU[T^_``yygYfVH-(+Q[el (  
 	
r3   afterlimitorderstatusr?   r@   rA   rB   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
        rE   rF   rG   )r`   ra   rb   rc   )r?   r@   rA   rB   query)pagerM   model)rO   _get_api_listr   r$   r"   r   r   RunListParams
r0   rS   r`   ra   rb   rc   r?   r@   rA   rB   s
             r1   listz	Runs.list   s    J UV]U`abb!!gYe$0(+'%%!&!&!&"(	 $11 "% " 
 	
r3   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
        rE   rW   rF   rX   rJ   rY   rO   _deleter"   r'   r\   s          r1   deletezRuns.delete   sr    0 UV]U`abbTU[T^_``||gYfVH-(+Q[el &  
 	
r3   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
        rE   rW   rF   rX   rJ   rY   rO   rP   r"   r%   r\   s          r1   cancelzRuns.cancel   sr    0 UV]U`abbTU[T^_``zzgYfVH-(+Q[el &  
 	
r3   )returnr   )rv   r6   )rv   r:   rS   strrI   zrun_create_params.DataSourcer=   zOptional[Metadata] | Omitr>   
str | Omitr?   Headers | Noner@   Query | NonerA   Body | NonerB   'float | httpx.Timeout | None | NotGivenrv   r&   r]   rx   rS   rx   r?   rz   r@   r{   rA   r|   rB   r}   rv   r(   )rS   rx   r`   ry   ra   
int | Omitrb   Literal['asc', 'desc'] | Omitrc   JLiteral['queued', 'in_progress', 'completed', 'canceled', 'failed'] | Omitr?   rz   r@   r{   rA   r|   rB   r}   rv   zSyncCursorPage[RunListResponse]r]   rx   rS   rx   r?   rz   r@   r{   rA   r|   rB   r}   rv   r'   r]   rx   rS   rx   r?   rz   r@   r{   rA   r|   rB   r}   rv   r%   __name__
__module____qualname__r   r2   r7   r;   r   r   rT   r^   rl   rq   ru    r3   r1   r)   r)   %   s<   ) ) ) ) / / /3 )-$("&;D7
7
 2	7

 ,7
 7
 &7
 "7
  7
 97
 
7
@ )-$("&;D"
"
 	"
 &"
 ""
  "
 9"
 
"
P ! /3]a )-$("&;D:
:
 	:

 :
 -:
 [:
 &:
 ":
  :
 9:
 
):
F )-$("&;D"
"
 	"
 &"
 ""
  "
 9"
 
"
V )-$("&;D"
"
 	"
 &"
 ""
  "
 9"
 
"
r3   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    r1   r2   zAsyncRuns.output_items   s    --r3   c                    t        |       S r5   )AsyncRunsWithRawResponser/   s    r1   r7   zAsyncRuns.with_raw_response$  s     (--r3   c                    t        |       S r9   )AsyncRunsWithStreamingResponser/   s    r1   r;   z!AsyncRuns.with_streaming_response.  s     .d33r3   Nr<   c          
        K   |st        d|      | j                  d| dt        |||dt        j                         d{   t        ||||      t               d{   S 7 $7 w)rD   rE   rF   rG   rH   NrJ   rK   )rO   rP   r   r    rQ   r"   r&   rR   s	            r1   rT   zAsyncRuns.create7  s     N UV]U`abbZZgYe$,#. ( 
 "11  )+Q[el &   
 
 	

s$   AA-A)
A-$A+%A-+A-rJ   c          	        K   |st        d|      |st        d|      | j                  d| d| t        ||||      t               d{   S 7 w)rV   rE   rW   rF   rX   rJ   rY   NrZ   r\   s          r1   r^   zAsyncRuns.retrievep  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 re   )rO   ri   r   r$   r"   r   r   rj   rk   s
             r1   rl   zAsyncRuns.list  s    J UV]U`abb!!gYe$ 1(+'%%!&!&!&"(	 $11 "% " 
 	
r3   c          	        K   |st        d|      |st        d|      | j                  d| d| t        ||||      t               d{   S 7 w)rn   rE   rW   rF   rX   rJ   rY   Nro   r\   s          r1   rq   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)rs   rE   rW   rF   rX   rJ   rY   Nrt   r\   s          r1   ru   zAsyncRuns.cancel  s     0 UV]U`abbTU[T^_``ZZgYfVH-(+Q[el &   
 
 	
 
r   )rv   r   )rv   r   )rv   r   rw   r~   )rS   rx   r`   ry   ra   r   rb   r   rc   r   r?   rz   r@   r{   rA   r|   rB   r}   rv   zAAsyncPaginator[RunListResponse, AsyncCursorPage[RunListResponse]]r   r   r   r   r3   r1   r*   r*     s=   . . . . 4 4 /3 )-$("&;D7
7
 2	7

 ,7
 7
 &7
 "7
  7
 97
 
7
@ )-$("&;D"
"
 	"
 &"
 ""
  "
 9"
 
"
P ! /3]a )-$("&;D:
:
 	:

 :
 -:
 [:
 &:
 ":
  :
 9:
 
K:
F )-$("&;D"
"
 	"
 &"
 ""
  "
 9"
 
"
V )-$("&;D"
"
 	"
 &"
 ""
  "
 9"
 
"
r3   c                  &    e Zd ZddZedd       Zy)r6   c                z   || _         t        j                  |j                        | _        t        j                  |j                        | _        t        j                  |j
                        | _        t        j                  |j                        | _        t        j                  |j                        | _        y r-   )_runsr   to_raw_response_wrapperrT   r^   rl   rq   ru   r0   runss     r1   __init__zRunsWithRawResponse.__init__  s    
&>>KK
 )@@MM
 %<<II
	 '>>KK
 '>>KK
r3   c                @    t        | j                  j                        S r-   )r   r   r2   r/   s    r1   r2   z RunsWithRawResponse.output_items-  s    )$***A*ABBr3   Nr   r)   rv   None)rv   r   r   r   r   r   r   r2   r   r3   r1   r6   r6     s    
& C Cr3   r6   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_wrapperrT   r^   rl   rq   ru   r   s     r1   r   z!AsyncRunsWithRawResponse.__init__3  s    
&DDKK
 )FFMM
 %BBII
	 'DDKK
 'DDKK
r3   c                @    t        | j                  j                        S r-   )r   r   r2   r/   s    r1   r2   z%AsyncRunsWithRawResponse.output_itemsF  s    .tzz/F/FGGr3   Nr   r*   rv   r   )rv   r   r   r   r3   r1   r   r   2  s    
& H Hr3   r   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   rT   r^   rl   rq   ru   r   s     r1   r   z"RunsWithStreamingResponse.__init__L  sp    
2KK
 5MM
 1II
	 3KK
 3KK
r3   c                @    t        | j                  j                        S r-   )r   r   r2   r/   s    r1   r2   z&RunsWithStreamingResponse.output_items_  s    /

0G0GHHr3   Nr   )rv   r   r   r   r3   r1   r:   r:   K  s    
& I Ir3   r:   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   rT   r^   rl   rq   ru   r   s     r1   r   z'AsyncRunsWithStreamingResponse.__init__e  sp    
8KK
 ;MM
 7II
	 9KK
 9KK
r3   c                @    t        | j                  j                        S r-   )r   r   r2   r/   s    r1   r2   z+AsyncRunsWithStreamingResponse.output_itemsx  s    4TZZ5L5LMMr3   Nr   )rv   r   r   r   r3   r1   r   r   d  s    
& N Nr3   r   )?
__future__r   typingr   typing_extensionsr   httpx r   _typesr   r	   r
   r   r   r   r   _utilsr   r   _compatr   	_resourcer   r   	_responser   r   r2   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*   r6   r   r:   r   r   r3   r1   <module>r      s    #  %  ! L L L = ' ; Z  ; > A 5 = A A A E;
w
? w
tw
  w
tC C2H H2I I2N Nr3   