o
    $i0                     @  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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   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#   h/var/www/html/flask_server/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 | Noner/   '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"   r0   r2   r3   r,   r-   r.   r/   r#   r#   r$   retrieve,   s   zOutputItems.retrieveafterlimitorderstatusr,   r-   r.   r/   rH   
str | OmitrI   
int | OmitrJ   Literal['asc', 'desc'] | OmitrK   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
        r9   r:   r<   r=   z/output_items)rH   rI   rJ   rK   )r,   r-   r.   r/   query)pager@   model)rC   _get_api_listr   r   r   r   r   OutputItemListParamsr"   r3   r2   rH   rI   rJ   rK   r,   r-   r.   r/   r#   r#   r$   listS   .   &zOutputItems.list)r   r   )r   r'   r0   r1   r2   r1   r3   r1   r,   r4   r-   r5   r.   r6   r/   r7   r   r   )r3   r1   r2   r1   rH   rL   rI   rM   rJ   rN   rK   rO   r,   r4   r-   r5   r.   r6   r/   r7   r   rP   
__name__
__module____qualname__r   r%   r)   r   rF   r   rY   r#   r#   r#   r$   r      &    	,c                	   @  r   ))r   r   AsyncOutputItemsWithRawResponsec                 C  r   r    )ra   r!   r#   r#   r$   r%      r&   z"AsyncOutputItems.with_raw_response%AsyncOutputItemsWithStreamingResponsec                 C  r   r(   )rb   r!   r#   r#   r$   r)      r*   z(AsyncOutputItems.with_streaming_responseNr+   r0   r1   r2   r3   r,   r4   r-   r5   r.   r6   r/   r7   r   c                  sl   |s
t d||st d||st d|| jd| d| d| t||||dtdI d	H S )
r8   r9   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   rW   rX   r#   r#   r$   rY      rZ   zAsyncOutputItems.list)r   ra   )r   rb   r[   )r3   r1   r2   r1   rH   rL   rI   rM   rJ   rN   rK   rO   r,   r4   r-   r5   r.   r6   r/   r7   r   rc   r\   r#   r#   r#   r$   r      r`   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_wrapperrF   rY   r"   re   r#   r#   r$   __init__     
z#OutputItemsWithRawResponse.__init__Nre   r   r   rf   r]   r^   r_   rl   r#   r#   r#   r$   r         r   c                   @  rd   )	ra   re   r   r   rf   c                 C  rg   rh   )ri   r   async_to_raw_response_wrapperrF   rY   rk   r#   r#   r$   rl     rm   z(AsyncOutputItemsWithRawResponse.__init__Nre   r   r   rf   ro   r#   r#   r#   r$   ra     rp   ra   c                   @  rd   )	r'   re   r   r   rf   c                 C  "   || _ t|j| _t|j| _d S rh   )ri   r   rF   rY   rk   r#   r#   r$   rl   '     
z)OutputItemsWithStreamingResponse.__init__Nrn   ro   r#   r#   r#   r$   r'   &  rp   r'   c                   @  rd   )	rb   re   r   r   rf   c                 C  rs   rh   )ri   r   rF   rY   rk   r#   r#   r$   rl   3  rt   z.AsyncOutputItemsWithStreamingResponse.__init__Nrr   ro   r#   r#   r#   r$   rb   2  rp   rb   ),
__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   ra   r'   rb   r#   r#   r#   r$   <module>   s*   ${{