o
    ¨Ýj!J  ã                   @  s„  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 dd	lmZmZmZmZmZmZ dd
lmZmZmZmZmZmZmZmZ ddl m!Z!m"Z"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l0m1Z1m2Z2 ddl3m4Z4m5Z5 ddl6m7Z7 ddgZ8G dd„ de(ƒZ9G 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)ÚOptional)ÚLiteralNé   )Ú_legacy_responseé   )ÚFilesÚ
AsyncFilesÚFilesWithRawResponseÚAsyncFilesWithRawResponseÚFilesWithStreamingResponseÚAsyncFilesWithStreamingResponse)Ú	TemplatesÚAsyncTemplatesÚTemplatesWithRawResponseÚAsyncTemplatesWithRawResponseÚTemplatesWithStreamingResponseÚ#AsyncTemplatesWithStreamingResponse)ÚBodyÚOmitÚQueryÚHeadersÚNotGivenÚSequenceNotStrÚomitÚ	not_given)Úpath_templateÚmaybe_transformÚstrip_not_givenÚasync_maybe_transform)Úcached_property)ÚSyncAPIResourceÚAsyncAPIResource)Úto_streamed_response_wrapperÚ"async_to_streamed_response_wrapper)ÚSyncCursorPageÚAsyncCursorPage)ÚAsyncPaginatorÚmake_request_options)Úenvironment_list_paramsÚenvironment_create_params)ÚEnvironmentInfoÚEnvironmentsÚAsyncEnvironmentsc                	   @  ó’   e Zd Zed1dd„ƒZed2dd„ƒZed3d	d
„ƒZed4dd„ƒZeeddde	dœd5dd „Z
ddde	d!œd6d$d%„Zeeeeddde	d&œd7d/d0„ZdS )8r,   Úreturnr   c                 C  ó
   t | jƒS ©N)r   Ú_client©Úself© r5   úq/var/www/html/chatgpt/venv/lib/python3.10/site-packages/openai/resources/beta/agents/environments/environments.pyÚfiles)   ó   
zEnvironments.filesr   c                 C  r0   r1   )r   r2   r3   r5   r5   r6   Ú	templates-   r8   zEnvironments.templatesÚEnvironmentsWithRawResponsec                 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:   r3   r5   r5   r6   Úwith_raw_response1   ó   zEnvironments.with_raw_responseÚ!EnvironmentsWithStreamingResponsec                 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?   r3   r5   r5   r6   Úwith_streaming_response;   ó   z$Environments.with_streaming_responseN©Ú	vault_idsÚidempotency_keyÚextra_headersÚextra_queryÚ
extra_bodyÚtimeoutÚenvironmentú%environment_create_params.EnvironmentrD   ú$Optional[SequenceNotStr[str]] | OmitrE   ú
str | OmitrF   úHeaders | NonerG   úQuery | NonerH   úBody | NonerI   ú(float | httpx2.Timeout | None | NotGivenr+   c             
   C  sZ   i t d|iƒ¥|p
i ¥}ddi|pi ¥}| jdt||dœtjƒt||||ddid�td	�S )
áM  Creates an OpenAI-hosted environment before creating a session.

        Requires access
        to the prewarming beta.

        Args:
          environment: The required hosting type and its configuration.

          vault_ids: The IDs of up to 10 vaults made available to an OpenAI-hosted environment.

          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
        úIdempotency-KeyúOpenAI-Betaú	agents=v1ú/agents/environments©rJ   rD   Úbearer_authT©rF   rG   rH   rI   Úsecurity©ÚbodyÚoptionsÚcast_to)r   Ú_postr   r*   ÚEnvironmentCreateParamsr(   r+   ©r4   rJ   rD   rE   rF   rG   rH   rI   r5   r5   r6   ÚcreateD   s&   þûûðzEnvironments.create©rF   rG   rH   rI   Úenvironment_idÚstrc             	   C  sL   |s	t d|›�ƒ‚ddi|pi ¥}| jtd|d�t||||ddid�td	�S )
á  
        Retrieves an execution environment's connection status and safe installed
        metadata. See
        [environment lifecycle](https://developers.openai.com/api/docs/guides/agents-api/environments/lifecycle).

        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
        ú=Expected a non-empty value for `environment_id` but received rT   rU   ú%/agents/environments/{environment_id}©rd   rX   TrY   ©r]   r^   ©Ú
ValueErrorÚ_getr   r(   r+   ©r4   rd   rF   rG   rH   rI   r5   r5   r6   Úretrievex   s   
û÷zEnvironments.retrieve©ÚafterÚlimitÚorderÚtyperF   rG   rH   rI   rq   rr   ú
int | Omitrs   úLiteral['asc', 'desc'] | Omitrt   úLiteral['openai_hosted'] | OmitúSyncCursorPage[EnvironmentInfo]c          	      C  óL   ddi|pi ¥}| j dtt t||||t||||dœtjƒddid�td�S ©	as  Lists OpenAI-hosted environments owned by the authenticated principal.

        Requires
        access to the prewarming beta.

        Args:
          after: Return resources after this resource ID in the selected order.

          limit: The maximum number of resources to return, between 1 and 100. Defaults to 20.

          order: The order in which resources are returned. Defaults to `desc`.

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

          type: The hosting type to list. Defaults to `openai_hosted`.

          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
        rT   rU   rV   )rq   rr   rs   rt   rX   T)rF   rG   rH   rI   ÚqueryrZ   )Úpager]   Úmodel)Ú_get_api_listr%   r+   r(   r   r)   ÚEnvironmentListParams©	r4   rq   rr   rs   rt   rF   rG   rH   rI   r5   r5   r6   Úlist    ó*   'üù	òízEnvironments.list)r/   r   )r/   r   )r/   r:   )r/   r?   ©rJ   rK   rD   rL   rE   rM   rF   rN   rG   rO   rH   rP   rI   rQ   r/   r+   ©rd   re   rF   rN   rG   rO   rH   rP   rI   rQ   r/   r+   )rq   rM   rr   ru   rs   rv   rt   rw   rF   rN   rG   rO   rH   rP   rI   rQ   r/   rx   ©Ú__name__Ú
__module__Ú__qualname__r    r7   r9   r=   rA   r   r   rb   ro   r�   r5   r5   r5   r6   r,   (   ó<    	õ:÷+ôc                	   @  r.   )8r-   r/   r	   c                 C  r0   r1   )r	   r2   r3   r5   r5   r6   r7   à   r8   zAsyncEnvironments.filesr   c                 C  r0   r1   )r   r2   r3   r5   r5   r6   r9   ä   r8   zAsyncEnvironments.templatesÚ AsyncEnvironmentsWithRawResponsec                 C  r;   r<   )rŠ   r3   r5   r5   r6   r=   è   r>   z#AsyncEnvironments.with_raw_responseÚ&AsyncEnvironmentsWithStreamingResponsec                 C  r;   r@   )r‹   r3   r5   r5   r6   rA   ò   rB   z)AsyncEnvironments.with_streaming_responseNrC   rJ   rK   rD   rL   rE   rM   rF   rN   rG   rO   rH   rP   rI   rQ   r+   c             
   Ã  sh   �i t d|iƒ¥|pi ¥}ddi|pi ¥}| jdt||dœtjƒI dH t||||ddid	�td
�I dH S )rR   rS   rT   rU   rV   rW   NrX   TrY   r[   )r   r_   r   r*   r`   r(   r+   ra   r5   r5   r6   rb   û   s(   €þûûðzAsyncEnvironments.createrc   rd   re   c             	   Ã  sT   �|s
t d|›�ƒ‚ddi|pi ¥}| jtd|d�t||||ddid�td	�I d
H S )rf   rg   rT   rU   rh   ri   rX   TrY   rj   Nrk   rn   r5   r5   r6   ro   /  s   €
û÷zAsyncEnvironments.retrieverp   rq   rr   ru   rs   rv   rt   rw   úAAsyncPaginator[EnvironmentInfo, AsyncCursorPage[EnvironmentInfo]]c          	      C  ry   rz   )r~   r&   r+   r(   r   r)   r   r€   r5   r5   r6   r�   W  r‚   zAsyncEnvironments.list)r/   r	   )r/   r   )r/   rŠ   )r/   r‹   rƒ   r„   )rq   rM   rr   ru   rs   rv   rt   rw   rF   rN   rG   rO   rH   rP   rI   rQ   r/   rŒ   r…   r5   r5   r5   r6   r-   ß   r‰   c                   @  ó2   e Zd Zddd„Zeddd	„ƒZeddd„ƒZdS )r:   Úenvironmentsr,   r/   ÚNonec                 C  ó4   || _ t |j¡| _t |j¡| _t |j¡| _d S r1   )Ú_environmentsr   Zto_raw_response_wrapperrb   ro   r�   ©r4   rŽ   r5   r5   r6   Ú__init__—  ó   ÿÿ
ÿz$EnvironmentsWithRawResponse.__init__r
   c                 C  ó   t | jjƒS r1   )r
   r‘   r7   r3   r5   r5   r6   r7   ¤  ó   z!EnvironmentsWithRawResponse.filesr   c                 C  r•   r1   )r   r‘   r9   r3   r5   r5   r6   r9   ¨  r–   z%EnvironmentsWithRawResponse.templatesN©rŽ   r,   r/   r�   )r/   r
   )r/   r   ©r†   r‡   rˆ   r“   r    r7   r9   r5   r5   r5   r6   r:   –  ó    
r:   c                   @  r�   )rŠ   rŽ   r-   r/   r�   c                 C  r�   r1   )r‘   r   Zasync_to_raw_response_wrapperrb   ro   r�   r’   r5   r5   r6   r“   ®  r”   z)AsyncEnvironmentsWithRawResponse.__init__r   c                 C  r•   r1   )r   r‘   r7   r3   r5   r5   r6   r7   »  r–   z&AsyncEnvironmentsWithRawResponse.filesr   c                 C  r•   r1   )r   r‘   r9   r3   r5   r5   r6   r9   ¿  r–   z*AsyncEnvironmentsWithRawResponse.templatesN©rŽ   r-   r/   r�   )r/   r   )r/   r   r˜   r5   r5   r5   r6   rŠ   ­  r™   rŠ   c                   @  r�   )r?   rŽ   r,   r/   r�   c                 C  ó.   || _ t|jƒ| _t|jƒ| _t|jƒ| _d S r1   )r‘   r#   rb   ro   r�   r’   r5   r5   r6   r“   Å  ó   ÿÿ
ÿz*EnvironmentsWithStreamingResponse.__init__r   c                 C  r•   r1   )r   r‘   r7   r3   r5   r5   r6   r7   Ò  r–   z'EnvironmentsWithStreamingResponse.filesr   c                 C  r•   r1   )r   r‘   r9   r3   r5   r5   r6   r9   Ö  r–   z+EnvironmentsWithStreamingResponse.templatesNr—   )r/   r   )r/   r   r˜   r5   r5   r5   r6   r?   Ä  r™   r?   c                   @  r�   )r‹   rŽ   r-   r/   r�   c                 C  r›   r1   )r‘   r$   rb   ro   r�   r’   r5   r5   r6   r“   Ü  rœ   z/AsyncEnvironmentsWithStreamingResponse.__init__r   c                 C  r•   r1   )r   r‘   r7   r3   r5   r5   r6   r7   é  r–   z,AsyncEnvironmentsWithStreamingResponse.filesr   c                 C  r•   r1   )r   r‘   r9   r3   r5   r5   r6   r9   í  r–   z0AsyncEnvironmentsWithStreamingResponse.templatesNrš   )r/   r   )r/   r   r˜   r5   r5   r5   r6   r‹   Û  r™   r‹   )?Ú
__future__r   Útypingr   Ztyping_extensionsr   Zhttpx2Ú r   r7   r   r	   r
   r   r   r   r9   r   r   r   r   r   r   Ú_typesr   r   r   r   r   r   r   r   Z_utilsr   r   r   r   Z_compatr    Z	_resourcer!   r"   Ú	_responser#   r$   Z
paginationr%   r&   Z_base_clientr'   r(   Ztypes.beta.agentsr)   r*   Z"types.beta.agents.environment_infor+   Ú__all__r,   r-   r:   rŠ   r?   r‹   r5   r5   r5   r6   Ú<module>   s2     ( 8 8