o
    ٘i3                     @  s4  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 ddlmZmZ ddl m!Z! ddl"m#Z# ddl$m%Z% ddgZ&G dd deZ'G dd deZ(G dd dZ)G dd dZ*G dd dZ+G dd dZ,dS )    )annotations)LiteralN   )_legacy_response)BodyOmitQueryHeadersNotGivenomit	not_given)path_templatemaybe_transform)cached_property)SyncAPIResourceAsyncAPIResource)to_streamed_response_wrapper"async_to_streamed_response_wrapper)SyncCursorPageAsyncCursorPage)AsyncPaginatormake_request_options)output_item_list_params)OutputItemListResponse)OutputItemRetrieveResponseOutputItemsAsyncOutputItemsc                	   @  `   e Zd ZdZed&ddZed'ddZd	d	d	ed
d(ddZe	e	e	e	d	d	d	edd)d$d%Z
d	S )*r   ,Manage and run evals in the OpenAI platform.returnOutputItemsWithRawResponsec                 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
        )r    self r%   `/home/livre-enfant/venv/lib/python3.10/site-packages/openai/resources/evals/runs/output_items.pywith_raw_response      zOutputItems.with_raw_response OutputItemsWithStreamingResponsec                 C  r!   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)   r#   r%   r%   r&   with_streaming_response%      z#OutputItems.with_streaming_responseNextra_headersextra_query
extra_bodytimeoutoutput_item_idstreval_idrun_idr.   Headers | Noner/   Query | Noner0   Body | Noner1   'float | httpx.Timeout | None | NotGivenr   c                C  s^   |s	t d||st d||st d|| jtd|||dt||||dtdS )\  
        Get an evaluation run output item 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 5Expected a non-empty value for `run_id` but received =Expected a non-empty value for `output_item_id` but received </evals/{eval_id}/runs/{run_id}/output_items/{output_item_id}r4   r5   r2   r-   optionscast_to
ValueError_getr   r   r   r$   r2   r4   r5   r.   r/   r0   r1   r%   r%   r&   retrieve.   s$   zOutputItems.retrieveafterlimitorderstatusr.   r/   r0   r1   rI   
str | OmitrJ   
int | OmitrK   Literal['asc', 'desc'] | OmitrL   Literal['fail', 'pass'] | Omit&SyncCursorPage[OutputItemListResponse]c       	         C  d   |s	t d||st d|| jtd||dtt t|||	|
t||||dtjdtdS a,  
        Get a list of output items for an evaluation run.

        Args:
          after: Identifier for the last output item from the previous pagination request.

          limit: Number of output items to retrieve.

          order: Sort order for output items by timestamp. Use `asc` for ascending order or
              `desc` for descending order. Defaults to `asc`.

          status: Filter output items by status. Use `failed` to filter by failed output items or
              `pass` to filter by passed output items.

          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
        r;   r<   z+/evals/{eval_id}/runs/{run_id}/output_items)r4   r5   )rI   rJ   rK   rL   )r.   r/   r0   r1   query)pagerA   model)	rD   _get_api_listr   r   r   r   r   r   OutputItemListParamsr$   r5   r4   rI   rJ   rK   rL   r.   r/   r0   r1   r%   r%   r&   listZ   .   &zOutputItems.list)r   r    )r   r)   r2   r3   r4   r3   r5   r3   r.   r6   r/   r7   r0   r8   r1   r9   r   r   )r5   r3   r4   r3   rI   rM   rJ   rN   rK   rO   rL   rP   r.   r6   r/   r7   r0   r8   r1   r9   r   rQ   __name__
__module____qualname____doc__r   r'   r+   r   rG   r   rZ   r%   r%   r%   r&   r      (    	1c                	   @  r   )*r   r   r   AsyncOutputItemsWithRawResponsec                 C  r!   r"   )rc   r#   r%   r%   r&   r'      r(   z"AsyncOutputItems.with_raw_response%AsyncOutputItemsWithStreamingResponsec                 C  r!   r*   )rd   r#   r%   r%   r&   r+      r,   z(AsyncOutputItems.with_streaming_responseNr-   r2   r3   r4   r5   r.   r6   r/   r7   r0   r8   r1   r9   r   c                  sf   |s
t d||st d||st d|| jtd|||dt||||dtdI dH S )	r:   r;   r<   r=   r>   r?   r-   r@   NrC   rF   r%   r%   r&   rG      s&   zAsyncOutputItems.retrieverH   rI   rM   rJ   rN   rK   rO   rL   rP   OAsyncPaginator[OutputItemListResponse, AsyncCursorPage[OutputItemListResponse]]c       	         C  rR   rS   )	rD   rW   r   r   r   r   r   r   rX   rY   r%   r%   r&   rZ      r[   zAsyncOutputItems.list)r   rc   )r   rd   r\   )r5   r3   r4   r3   rI   rM   rJ   rN   rK   rO   rL   rP   r.   r6   r/   r7   r0   r8   r1   r9   r   re   r]   r%   r%   r%   r&   r      rb   c                   @     e Zd ZdddZdS )	r    output_itemsr   r   Nonec                 C  &   || _ t|j| _t|j| _d S N)_output_itemsr   to_raw_response_wrapperrG   rZ   r$   rg   r%   r%   r&   __init__     
z#OutputItemsWithRawResponse.__init__Nrg   r   r   rh   r^   r_   r`   rn   r%   r%   r%   r&   r          r    c                   @  rf   )	rc   rg   r   r   rh   c                 C  ri   rj   )rk   r   async_to_raw_response_wrapperrG   rZ   rm   r%   r%   r&   rn   )  ro   z(AsyncOutputItemsWithRawResponse.__init__Nrg   r   r   rh   rq   r%   r%   r%   r&   rc   (  rr   rc   c                   @  rf   )	r)   rg   r   r   rh   c                 C  "   || _ t|j| _t|j| _d S rj   )rk   r   rG   rZ   rm   r%   r%   r&   rn   5     
z)OutputItemsWithStreamingResponse.__init__Nrp   rq   r%   r%   r%   r&   r)   4  rr   r)   c                   @  rf   )	rd   rg   r   r   rh   c                 C  ru   rj   )rk   r   rG   rZ   rm   r%   r%   r&   rn   A  rv   z.AsyncOutputItemsWithStreamingResponse.__init__Nrt   rq   r%   r%   r%   r&   rd   @  rr   rd   )-
__future__r   typing_extensionsr   httpx r   _typesr   r   r   r	   r
   r   r   _utilsr   r   _compatr   	_resourcer   r   	_responser   r   
paginationr   r   _base_clientr   r   types.evals.runsr   *types.evals.runs.output_item_list_responser   .types.evals.runs.output_item_retrieve_responser   __all__r   r   r    rc   r)   rd   r%   r%   r%   r&   <module>   s.   $  