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%   b/home/kim/smarthome/.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-   optionsZ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   rH   
str | OmitrI   
int | OmitrJ   Literal['asc', 'desc'] | OmitrK   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   )rH   rI   rJ   rK   )r.   r/   r0   r1   query)pagerA   model)	rC   _get_api_listr   r   r   r   r   r   OutputItemListParamsr$   r5   r4   rH   rI   rJ   rK   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   rH   rL   rI   rM   rJ   rN   rK   rO   r.   r6   r/   r7   r0   r8   r1   r9   r   rP   __name__
__module____qualname____doc__r   r'   r+   r   rF   r   rY   r%   r%   r%   r&   r      (    	1c                	   @  r   )*r   r   r   AsyncOutputItemsWithRawResponsec                 C  r!   r"   )rb   r#   r%   r%   r&   r'      r(   z"AsyncOutputItems.with_raw_response%AsyncOutputItemsWithStreamingResponsec                 C  r!   r*   )rc   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@   NrB   rE   r%   r%   r&   rF      s&   zAsyncOutputItems.retrieverG   rH   rL   rI   rM   rJ   rN   rK   rO   OAsyncPaginator[OutputItemListResponse, AsyncCursorPage[OutputItemListResponse]]c       	         C  rQ   rR   )	rC   rV   r   r   r   r   r   r   rW   rX   r%   r%   r&   rY      rZ   zAsyncOutputItems.list)r   rb   )r   rc   r[   )r5   r3   r4   r3   rH   rL   rI   rM   rJ   rN   rK   rO   r.   r6   r/   r7   r0   r8   r1   r9   r   rd   r\   r%   r%   r%   r&   r      ra   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   Zto_raw_response_wrapperrF   rY   r$   rf   r%   r%   r&   __init__     
z#OutputItemsWithRawResponse.__init__Nrf   r   r   rg   r]   r^   r_   rl   r%   r%   r%   r&   r          r    c                   @  re   )	rb   rf   r   r   rg   c                 C  rh   ri   )rj   r   Zasync_to_raw_response_wrapperrF   rY   rk   r%   r%   r&   rl   )  rm   z(AsyncOutputItemsWithRawResponse.__init__Nrf   r   r   rg   ro   r%   r%   r%   r&   rb   (  rp   rb   c                   @  re   )	r)   rf   r   r   rg   c                 C  "   || _ t|j| _t|j| _d S ri   )rj   r   rF   rY   rk   r%   r%   r&   rl   5     
z)OutputItemsWithStreamingResponse.__init__Nrn   ro   r%   r%   r%   r&   r)   4  rp   r)   c                   @  re   )	rc   rf   r   r   rg   c                 C  rr   ri   )rj   r   rF   rY   rk   r%   r%   r&   rl   A  rs   z.AsyncOutputItemsWithStreamingResponse.__init__Nrq   ro   r%   r%   r%   r&   rc   @  rp   rc   )-
__future__r   Ztyping_extensionsr   Zhttpx r   _typesr   r   r   r	   r
   r   r   Z_utilsr   r   Z_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    rb   r)   rc   r%   r%   r%   r&   <module>   s.   $  