U
    Zh.1                     @  s(  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 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)	NOT_GIVENBodyQueryHeadersNotGiven)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                   @  s   e Zd ZeddddZeddddZddded	d
d
d
ddddddddZeeeedddedd
d
ddddddddddddZdS )r   OutputItemsWithRawResponsereturnc                 C  s   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    L/tmp/pip-unpacked-wheel-693nel7n/openai/resources/evals/runs/output_items.pywith_raw_response   s    zOutputItems.with_raw_response OutputItemsWithStreamingResponsec                 C  s   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#   r   r    r    r!   with_streaming_response#   s    z#OutputItems.with_streaming_responseNextra_headersextra_query
extra_bodytimeoutstrHeaders | NoneQuery | NoneBody | None'float | httpx.Timeout | None | NotGivenr   output_item_ideval_idrun_idr'   r(   r)   r*   r   c                C  sd   |st d||s$t d||s6t d|| jd| 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//runs//output_items/r&   optionsZcast_to
ValueError_getr   r   r   r1   r2   r3   r'   r(   r)   r*   r    r    r!   retrieve,   s        zOutputItems.retrieveafterlimitorderstatusr'   r(   r)   r*   str | NotGivenint | NotGiven#Literal[('asc', 'desc')] | NotGiven$Literal[('fail', 'pass')] | NotGivenz&SyncCursorPage[OutputItemListResponse]r3   r2   rC   rD   rE   rF   r'   r(   r)   r*   r   c       	         C  sh   |st d||s$t d|| jd| 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
        r5   r6   r8   r9   z/output_items)rC   rD   rE   rF   )r'   r(   r)   r*   query)pager<   model)r>   _get_api_listr   r   r   r   r   OutputItemListParamsr   r3   r2   rC   rD   rE   rF   r'   r(   r)   r*   r    r    r!   listS   s.    &zOutputItems.list	__name__
__module____qualname__r   r"   r%   r   rA   rS   r    r    r    r!   r      s$   	 ,c                   @  s   e Zd ZeddddZeddddZddded	d
d
d
ddddddddZeeeedddedd
d
ddddddddddddZdS )r   AsyncOutputItemsWithRawResponser   c                 C  s   t | S r   )rX   r   r    r    r!   r"      s    z"AsyncOutputItems.with_raw_response%AsyncOutputItemsWithStreamingResponsec                 C  s   t | S r$   )rY   r   r    r    r!   r%      s    z(AsyncOutputItems.with_streaming_responseNr&   r+   r,   r-   r.   r/   r   r0   c                  sj   |st d||s$t d||s6t d|| jd| d| d| t||||dtdI d	H S )
r4   r5   r6   r7   r8   r9   r:   r&   r;   Nr=   r@   r    r    r!   rA      s        zAsyncOutputItems.retrieverB   rG   rH   rI   rJ   zOAsyncPaginator[OutputItemListResponse, AsyncCursorPage[OutputItemListResponse]]rK   c       	         C  sh   |st d||s$t d|| jd| d| dtt t|||	|
t||||dtjdtdS rL   )r>   rP   r   r   r   r   r   rQ   rR   r    r    r!   rS      s.    &zAsyncOutputItems.listrT   r    r    r    r!   r      s$   	 ,c                   @  s   e Zd ZdddddZdS )r   r   Noneoutput_itemsr   c                 C  s&   || _ t|j| _t|j| _d S N)_output_itemsr   Zto_raw_response_wrapperrA   rS   r   r\   r    r    r!   __init__  s    z#OutputItemsWithRawResponse.__init__NrU   rV   rW   r`   r    r    r    r!   r     s   r   c                   @  s   e Zd ZdddddZdS )rX   r   rZ   r[   c                 C  s&   || _ t|j| _t|j| _d S r]   )r^   r   Zasync_to_raw_response_wrapperrA   rS   r_   r    r    r!   r`     s    z(AsyncOutputItemsWithRawResponse.__init__Nra   r    r    r    r!   rX     s   rX   c                   @  s   e Zd ZdddddZdS )r#   r   rZ   r[   c                 C  s"   || _ t|j| _t|j| _d S r]   )r^   r   rA   rS   r_   r    r    r!   r`   '  s    z)OutputItemsWithStreamingResponse.__init__Nra   r    r    r    r!   r#   &  s   r#   c                   @  s   e Zd ZdddddZdS )rY   r   rZ   r[   c                 C  s"   || _ t|j| _t|j| _d S r]   )r^   r   rA   rS   r_   r    r    r!   r`   3  s    z.AsyncOutputItemsWithStreamingResponse.__init__Nra   r    r    r    r!   rY   2  s   rY   )*
__future__r   Ztyping_extensionsr   Zhttpx r   _typesr   r   r   r	   r
   _utilsr   _compatr   Z	_resourcer   r   	_responser   r   Z
paginationr   r   Z_base_clientr   r   Ztypes.evals.runsr   Z*types.evals.runs.output_item_list_responser   Z.types.evals.runs.output_item_retrieve_responser   __all__r   r   r   rX   r#   rY   r    r    r    r!   <module>   s(   {{