o
    r)ib1                     @  s0  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 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)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$   l/var/www/html/voicebot/backend/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 | Noner/   Body | Noner0   'float | httpx.Timeout | None | NotGivenr   c                C  sd   |s	t d||st d||st 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,   optionscast_to
ValueError_getr   r   r#   r1   r3   r4   r-   r.   r/   r0   r$   r$   r%   retrieve.   s   zOutputItems.retrieveafterlimitorderstatusr-   r.   r/   r0   rI   
str | OmitrJ   
int | OmitrK   Literal['asc', 'desc'] | OmitrL   Literal['fail', 'pass'] | Omit&SyncCursorPage[OutputItemListResponse]c       	         C  h   |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
        r:   r;   r=   r>   z/output_items)rI   rJ   rK   rL   )r-   r.   r/   r0   query)pagerA   model)rD   _get_api_listr   r   r   r   r   OutputItemListParamsr#   r4   r3   rI   rJ   rK   rL   r-   r.   r/   r0   r$   r$   r%   listU   .   &zOutputItems.list)r   r   )r   r(   r1   r2   r3   r2   r4   r2   r-   r5   r.   r6   r/   r7   r0   r8   r   r   )r4   r2   r3   r2   rI   rM   rJ   rN   rK   rO   rL   rP   r-   r5   r.   r6   r/   r7   r0   r8   r   rQ   __name__
__module____qualname____doc__r   r&   r*   r   rG   r   rZ   r$   r$   r$   r%   r      (    	,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,   r1   r2   r3   r4   r-   r5   r.   r6   r/   r7   r0   r8   r   c                  sl   |s
t d||st d||st d|| jd| d| d| t||||dtdI d	H S )
r9   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   rX   rY   r$   r$   r%   rZ      r[   zAsyncOutputItems.list)r   rc   )r   rd   r\   )r4   r2   r3   r2   rI   rM   rJ   rN   rK   rO   rL   rP   r-   r5   r.   r6   r/   r7   r0   r8   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   +     
z)OutputItemsWithStreamingResponse.__init__Nrp   rq   r$   r$   r$   r%   r(   *  rr   r(   c                   @  rf   )	rd   rg   r   r   rh   c                 C  ru   rj   )rk   r   rG   rZ   rm   r$   r$   r%   rn   7  rv   z.AsyncOutputItemsWithStreamingResponse.__init__Nrt   rq   r$   r$   r$   r%   rd   6  rr   rd   ),
__future__r   typing_extensionsr   httpx r   _typesr   r   r   r	   r
   r   r   _utilsr   _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*   $}}