o
    ùT·j¬X  ã                   @  sP  d dl mZ 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mZmZ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ƒZ0G dd„ dƒZ1G dd„ dƒZ2dS )é    )Úannotations)ÚOptional)ÚLiteralNé   )Ú_legacy_response)ÚBodyÚOmitÚQueryÚHeadersÚNotGivenÚomitÚ	not_given)Úpath_templateÚmaybe_transform)Úcached_property)ÚSyncAPIResourceÚAsyncAPIResource)ÚStreamedBinaryAPIResponseÚAsyncStreamedBinaryAPIResponseÚto_streamed_response_wrapperÚ"async_to_streamed_response_wrapperÚ#to_custom_streamed_response_wrapperÚ)async_to_custom_streamed_response_wrapper)ÚSyncCursorPageÚAsyncCursorPage)ÚAsyncPaginatorÚmake_request_options)Úartifact_list_params)ÚSessionArtifact)ÚSessionArtifactDeletedÚ	ArtifactsÚAsyncArtifactsc                	   @  óˆ   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dded	œd-d$d%„Z
ddded	œd.d'd(„ZdS )/r    ÚreturnÚArtifactsWithRawResponsec                 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)   úr/home/dinkstrade/pdmp-scanner/venv/lib/python3.10/site-packages/openai/resources/beta/agents/sessions/artifacts.pyÚwith_raw_response!   ó   zArtifacts.with_raw_responseÚArtifactsWithStreamingResponsec                 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!Artifacts.with_streaming_responseN©Úextra_headersÚextra_queryÚ
extra_bodyÚtimeoutÚartifact_idÚstrÚ
session_idr2   úHeaders | Noner3   úQuery | Noner4   úBody | Noner5   ú(float | httpx2.Timeout | None | NotGivenr   c             	   C  ó`   |s	t d|›�ƒ‚|st d|›�ƒ‚ddi|pi ¥}| jtd||d�t||||ddid	�td
�S )áø  Retrieves immutable metadata for one durable session artifact.

        See
        [session artifacts](https://developers.openai.com/api/docs/guides/agents-api/environments/files#openai-hosted-artifacts).

        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
        ú9Expected a non-empty value for `session_id` but received ú:Expected a non-empty value for `artifact_id` but received úOpenAI-Betaú	agents=v1ú5/agents/sessions/{session_id}/artifacts/{artifact_id}©r8   r6   Úbearer_authT©r2   r3   r4   r5   Úsecurity©ÚoptionsÚcast_to©Ú
ValueErrorÚ_getr   r   r   ©r(   r6   r8   r2   r3   r4   r5   r)   r)   r*   Úretrieve4   ó$   ÿûõzArtifacts.retrieve©ÚafterÚenvironment_idÚlimitÚorderr2   r3   r4   r5   rR   úOptional[str] | OmitrS   rT   úOptional[int] | OmitrU   úLiteral['asc', 'desc'] | OmitúSyncCursorPage[SessionArtifact]c          
      C  óf   |s	t d|›�ƒ‚ddi|pi ¥}| jtd|d�tt t||||	t||||dœtjƒddid	�td
�S ©a·  Lists immutable artifacts published by completed hosted session turns.

        See
        [session artifacts](https://developers.openai.com/api/docs/guides/agents-api/environments/files#openai-hosted-artifacts).

        Args:
          after: Return artifacts after this immutable artifact ID.

          environment_id: Restrict the listing to artifacts produced by this environment.

          limit: The maximum number of artifacts to return, between 1 and 100.

          order: Sort by creation time and ID. Defaults to descending.

              - `asc` - Returns resources in ascending order.
              - `desc` - Returns resources in descending order.

          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?   rA   rB   z'/agents/sessions/{session_id}/artifacts)r8   )rR   rS   rT   rU   rE   T)r2   r3   r4   r5   ÚqueryrG   )ÚpagerI   Úmodel)	rL   Ú_get_api_listr   r   r   r   r   r   ÚArtifactListParams©
r(   r8   rR   rS   rT   rU   r2   r3   r4   r5   r)   r)   r*   Úlista   ó.   (
üù	òízArtifacts.listr   c             	   C  r=   )á0  
        Deletes an immutable session artifact without deleting its live environment file
        or original Files API object. See
        [session artifacts](https://developers.openai.com/api/docs/guides/agents-api/environments/files#openai-hosted-artifacts).

        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
        r?   r@   rA   rB   rC   rD   rE   TrF   rH   ©rL   Ú_deleter   r   r   rN   r)   r)   r*   Údelete¢   rP   zArtifacts.deleteú+_legacy_response.HttpxBinaryResponseContentc             	   C  sr   |s	t d|›�ƒ‚|st d|›�ƒ‚ddi|pi ¥}ddi|p i ¥}| jtd||d�t||||d	d
id�tjd�S )á  
        Downloads immutable session artifact bytes after the execution environment
        expires. See
        [session artifacts](https://developers.openai.com/api/docs/guides/agents-api/environments/files#openai-hosted-artifacts).

        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
        r?   r@   ÚAcceptúapplication/octet-streamrA   rB   ú=/agents/sessions/{session_id}/artifacts/{artifact_id}/contentrD   rE   TrF   rH   ©rL   rM   r   r   r   ÚHttpxBinaryResponseContentrN   r)   r)   r*   ÚcontentÏ   s*   ýûózArtifacts.content)r#   r$   )r#   r-   ©r6   r7   r8   r7   r2   r9   r3   r:   r4   r;   r5   r<   r#   r   )r8   r7   rR   rV   rS   rV   rT   rW   rU   rX   r2   r9   r3   r:   r4   r;   r5   r<   r#   rY   ©r6   r7   r8   r7   r2   r9   r3   r:   r4   r;   r5   r<   r#   r   ©r6   r7   r8   r7   r2   r9   r3   r:   r4   r;   r5   r<   r#   rh   ©Ú__name__Ú
__module__Ú__qualname__r   r+   r/   r   rO   r   rb   rg   ro   r)   r)   r)   r*   r        ó:    	ö1óHö4öc                	   @  r"   )/r!   r#   ÚAsyncArtifactsWithRawResponsec                 C  r%   r&   )rx   r'   r)   r)   r*   r+     r,   z AsyncArtifacts.with_raw_responseÚ#AsyncArtifactsWithStreamingResponsec                 C  r%   r.   )ry   r'   r)   r)   r*   r/     r0   z&AsyncArtifacts.with_streaming_responseNr1   r6   r7   r8   r2   r9   r3   r:   r4   r;   r5   r<   r   c             	   Ã  óh   �|s
t d|›�ƒ‚|st d|›�ƒ‚ddi|pi ¥}| jtd||d�t||||ddid	�td
�I dH S )r>   r?   r@   rA   rB   rC   rD   rE   TrF   rH   NrK   rN   r)   r)   r*   rO     ó&   €ÿûõzAsyncArtifacts.retrieverQ   rR   rV   rS   rT   rW   rU   rX   úAAsyncPaginator[SessionArtifact, AsyncCursorPage[SessionArtifact]]c          
      C  rZ   r[   )	rL   r_   r   r   r   r   r   r   r`   ra   r)   r)   r*   rb   A  rc   zAsyncArtifacts.listr   c             	   Ã  rz   )rd   r?   r@   rA   rB   rC   rD   rE   TrF   rH   Nre   rN   r)   r)   r*   rg   ‚  r{   zAsyncArtifacts.deleterh   c             	   Ã  sz   �|s
t d|›�ƒ‚|st d|›�ƒ‚ddi|pi ¥}ddi|p!i ¥}| jtd||d�t||||d	d
id�tjd�I dH S )ri   r?   r@   rj   rk   rA   rB   rl   rD   rE   TrF   rH   Nrm   rN   r)   r)   r*   ro   ¯  s,   €ýûózAsyncArtifacts.content)r#   rx   )r#   ry   rp   )r8   r7   rR   rV   rS   rV   rT   rW   rU   rX   r2   r9   r3   r:   r4   r;   r5   r<   r#   r|   rq   rr   rs   r)   r)   r)   r*   r!      rw   c                   @  ó   e Zd Zddd„ZdS )	r$   Ú	artifactsr    r#   ÚNonec                 C  óB   || _ t |j¡| _t |j¡| _t |j¡| _t |j¡| _d S ©N)Ú
_artifactsr   Úto_raw_response_wrapperrO   rb   rg   ro   ©r(   r~   r)   r)   r*   Ú__init__á  ó   ÿÿÿ
ÿz!ArtifactsWithRawResponse.__init__N©r~   r    r#   r   ©rt   ru   rv   r…   r)   r)   r)   r*   r$   à  ó    r$   c                   @  r}   )	rx   r~   r!   r#   r   c                 C  r€   r�   )r‚   r   Úasync_to_raw_response_wrapperrO   rb   rg   ro   r„   r)   r)   r*   r…   ó  r†   z&AsyncArtifactsWithRawResponse.__init__N©r~   r!   r#   r   rˆ   r)   r)   r)   r*   rx   ò  r‰   rx   c                   @  r}   )	r-   r~   r    r#   r   c                 C  ó<   || _ t|jƒ| _t|jƒ| _t|jƒ| _t|jtƒ| _d S r�   )r‚   r   rO   rb   rg   r   ro   r   r„   r)   r)   r*   r…     ó   ÿÿÿ
þz'ArtifactsWithStreamingResponse.__init__Nr‡   rˆ   r)   r)   r)   r*   r-     r‰   r-   c                   @  r}   )	ry   r~   r!   r#   r   c                 C  rŒ   r�   )r‚   r   rO   rb   rg   r   ro   r   r„   r)   r)   r*   r…     r�   z,AsyncArtifactsWithStreamingResponse.__init__Nr‹   rˆ   r)   r)   r)   r*   ry     r‰   ry   )3Ú
__future__r   Útypingr   Útyping_extensionsr   Úhttpx2Ú r   Ú_typesr   r   r	   r
   r   r   r   Ú_utilsr   r   Ú_compatr   Ú	_resourcer   r   Ú	_responser   r   r   r   r   r   Ú
paginationr   r   Ú_base_clientr   r   Útypes.beta.agents.sessionsr   Ú+types.beta.agents.sessions.session_artifactr   Ú3types.beta.agents.sessions.session_artifact_deletedr   Ú__all__r    r!   r$   rx   r-   ry   r)   r)   r)   r*   Ú<module>   s0   $  a a