o
    ùT·j+4  ã                   @  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%   úk/home/dinkstrade/pdmp-scanner/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 | httpx2.Timeout | None | NotGivenr   c             	   C  sd   |s	t d|›�ƒ‚|st d|›�ƒ‚|st d|›�ƒ‚| jtd|||d�t||||ddi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   Úbearer_authT©r.   r/   r0   r1   Úsecurity©Ú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   rL   ú
str | OmitrM   ú
int | OmitrN   úLiteral['asc', 'desc'] | OmitrO   úLiteral['fail', 'pass'] | Omitú&SyncCursorPage[OutputItemListResponse]c       	         C  ój   |s	t d|›�ƒ‚|st d|›�ƒ‚| jtd||d�tt t|||	|
t||||dœtjƒddi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   )rL   rM   rN   rO   r@   T)r.   r/   r0   r1   ÚqueryrB   )ÚpagerD   Úmodel)	rG   Ú_get_api_listr   r   r   r   r   r   ÚOutputItemListParams©r$   r5   r4   rL   rM   rN   rO   r.   r/   r0   r1   r%   r%   r&   Úlist^   ó0   &üù	òí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   rL   rP   rM   rQ   rN   rR   rO   rS   r.   r6   r/   r7   r0   r8   r1   r9   r   rT   ©Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r'   r+   r   rJ   r   r]   r%   r%   r%   r&   r      ó(    	õ5òc                	   @  r   )*r   r   r   ÚAsyncOutputItemsWithRawResponsec                 C  r!   r"   )rf   r#   r%   r%   r&   r'   ¢   r(   z"AsyncOutputItems.with_raw_responseÚ%AsyncOutputItemsWithStreamingResponsec                 C  r!   r*   )rg   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             	   Ã  sl   �|s
t d|›�ƒ‚|st d|›�ƒ‚|st d|›�ƒ‚| jtd|||d�t||||ddid�td	�I d
H S )r:   r;   r<   r=   r>   r?   r@   TrA   rC   NrF   rI   r%   r%   r&   rJ   µ   s.   €üûòzAsyncOutputItems.retrieverK   rL   rP   rM   rQ   rN   rR   rO   rS   úOAsyncPaginator[OutputItemListResponse, AsyncCursorPage[OutputItemListResponse]]c       	         C  rU   rV   )	rG   rZ   r   r   r   r   r   r   r[   r\   r%   r%   r&   r]   å   r^   zAsyncOutputItems.list)r   rf   )r   rg   r_   )r5   r3   r4   r3   rL   rP   rM   rQ   rN   rR   rO   rS   r.   r6   r/   r7   r0   r8   r1   r9   r   rh   r`   r%   r%   r%   r&   r   Ÿ   re   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_wrapperrJ   r]   ©r$   rj   r%   r%   r&   Ú__init__'  ó   ÿ
ÿz#OutputItemsWithRawResponse.__init__N©rj   r   r   rk   ©ra   rb   rc   rq   r%   r%   r%   r&   r    &  ó    r    c                   @  ri   )	rf   rj   r   r   rk   c                 C  rl   rm   )rn   r   Úasync_to_raw_response_wrapperrJ   r]   rp   r%   r%   r&   rq   3  rr   z(AsyncOutputItemsWithRawResponse.__init__N©rj   r   r   rk   rt   r%   r%   r%   r&   rf   2  ru   rf   c                   @  ri   )	r)   rj   r   r   rk   c                 C  ó"   || _ t|jƒ| _t|jƒ| _d S rm   )rn   r   rJ   r]   rp   r%   r%   r&   rq   ?  ó   ÿ
ÿz)OutputItemsWithStreamingResponse.__init__Nrs   rt   r%   r%   r%   r&   r)   >  ru   r)   c                   @  ri   )	rg   rj   r   r   rk   c                 C  rx   rm   )rn   r   rJ   r]   rp   r%   r%   r&   rq   K  ry   z.AsyncOutputItemsWithStreamingResponse.__init__Nrw   rt   r%   r%   r%   r&   rg   J  ru   rg   )-Ú
__future__r   Útyping_extensionsr   Úhttpx2Ú 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    rf   r)   rg   r%   r%   r%   r&   Ú<module>   s.   $  