o
    ¨Ýj‘„  ã                   @  sˆ  d dl mZ d dlmZmZ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mZ ddl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l#m$Z$m%Z% ddl&m'Z' ddl(m)Z)m*Z*m+Z+ ddl,m-Z- ddl.m/Z/ ddl0m1Z1 ddl2m3Z3 ddl4m5Z5 ddgZ6G dd„ deƒZ7G dd„ deƒZ8G dd„ dƒZ9G dd„ dƒZ:G dd„ dƒZ;G dd „ d ƒZ<dS )!é    )Úannotations)ÚDictÚIterableÚOptional)ÚLiteralNé   )Ú_legacy_response)ÚBodyÚOmitÚQueryÚHeadersÚNotGivenÚSequenceNotStrÚomitÚ	not_given)Úpath_templateÚmaybe_transformÚasync_maybe_transform)Úcached_property)ÚSyncAPIResourceÚAsyncAPIResource)Úto_streamed_response_wrapperÚ"async_to_streamed_response_wrapper)ÚSyncCursorPageÚAsyncCursorPage)ÚAsyncPaginatorÚmake_request_options)ÚHostedSkillParam)Útemplate_list_paramsÚtemplate_create_paramsÚtemplate_update_params)ÚHostedPluginParam)ÚSetupCommandParam)ÚHostedEnvironmentFileParam)ÚEnvironmentTemplate)ÚEnvironmentTemplateDeletedÚ	TemplatesÚAsyncTemplatesc                   @  óÄ   e Zd Zed@dd„ƒZedAdd„ƒZeeeeeeeeeeddded	œdBd'd(„Zddded)œdCd,d-„Z	eeeeeeeeeeddded	œdDd1d2„Z
eeeddded3œdEd;d<„Zddded)œdFd>d?„ZdS )Gr&   ÚreturnÚTemplatesWithRawResponsec                 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/   ún/var/www/html/chatgpt/venv/lib/python3.10/site-packages/openai/resources/beta/agents/environments/templates.pyÚwith_raw_response   ó   zTemplates.with_raw_responseÚTemplatesWithStreamingResponsec                 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
        )r3   r-   r/   r/   r0   Úwith_streaming_response(   ó   z!Templates.with_streaming_responseN©Úcapability_directoriesÚdesktopÚenvÚfilesÚnameÚnetworkÚpackagesÚpluginsÚsetup_commandsÚskillsÚextra_headersÚextra_queryÚ
extra_bodyÚtimeoutr8   ú$Optional[SequenceNotStr[str]] | Omitr9   ú/Optional[template_create_params.Desktop] | Omitr:   úOptional[Dict[str, str]] | Omitr;   ú5Optional[Iterable[HostedEnvironmentFileParam]] | Omitr<   úOptional[str] | Omitr=   ú/Optional[template_create_params.Network] | Omitr>   ú0Optional[template_create_params.Packages] | Omitr?   ú,Optional[Iterable[HostedPluginParam]] | Omitr@   ú,Optional[Iterable[SetupCommandParam]] | OmitrA   ú+Optional[Iterable[HostedSkillParam]] | OmitrB   úHeaders | NonerC   úQuery | NonerD   úBody | NonerE   ú(float | httpx2.Timeout | None | NotGivenr$   c                C  sR   ddi|pi ¥}| j dt|||||||||	|
dœ
tjƒt||||ddid�td�S )	áO  
        Creates reusable environment configuration without returning confidential setup
        commands or environment values. See
        [reusing a hosted setup](https://developers.openai.com/api/docs/guides/agents-api/tools#reuse-a-hosted-plugin-setup).

        Args:
          capability_directories: Directories that contain capabilities exposed to the agent. Defaults to an empty
              list.

          desktop: Desktop provisioning. Omission or null inherits the template setting, or
              defaults to disabled.

          env: Environment variables made available to the agent.

          files: Files available before the agent starts. Defaults to an empty list.

          name: An optional human-readable display name for the template.

          network: Network access policy for the environment. If omitted, the API version
              determines whether network access is enabled or disabled.

          packages: Packages to install in the environment. Defaults to empty package lists.

          plugins: Plugins provided as inline ZIP archives. Defaults to an empty list.

          setup_commands: Ordered, confidential setup commands. Command bodies are never returned.

          skills: Skills referenced by ID or provided as inline ZIP archives. Defaults to an empty
              list.

          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
        úOpenAI-Betaú	agents=v1ú/agents/environments/templates©
r8   r9   r:   r;   r<   r=   r>   r?   r@   rA   Úbearer_authT©rB   rC   rD   rE   Úsecurity©ÚbodyÚoptionsÚcast_to)Ú_postr   r   ÚTemplateCreateParamsr   r$   ©r.   r8   r9   r:   r;   r<   r=   r>   r?   r@   rA   rB   rC   rD   rE   r/   r/   r0   Úcreate1   s4   :öóûèzTemplates.create©rB   rC   rD   rE   Úenvironment_template_idÚstrc             	   C  óL   |s	t d|›�ƒ‚ddi|pi ¥}| jtd|d�t||||ddid�td	�S )
á  
        Retrieves reusable environment configuration without returning confidential
        values. See
        [reusing a hosted setup](https://developers.openai.com/api/docs/guides/agents-api/tools#reuse-a-hosted-plugin-setup).

        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
        úFExpected a non-empty value for `environment_template_id` but received rU   rV   ú8/agents/environments/templates/{environment_template_id}©re   rY   TrZ   ©r^   r_   ©Ú
ValueErrorÚ_getr   r   r$   ©r.   re   rB   rC   rD   rE   r/   r/   r0   Úretrieve‡   ó&   ÿþûôzTemplates.retrieveú/Optional[template_update_params.Desktop] | Omitú/Optional[template_update_params.Network] | Omitú0Optional[template_update_params.Packages] | Omitc                C  sl   |s	t d|›�ƒ‚ddi|pi ¥}| jtd|d�t||||||||	|
|dœ
tjƒt||||ddid	�td
�S )á±  
        Updates reusable environment configuration without returning confidential
        values. See
        [reusing a hosted setup](https://developers.openai.com/api/docs/guides/agents-api/tools#reuse-a-hosted-plugin-setup).

        Args:
          capability_directories: Directories that expose capabilities to the agent.

          desktop: Replacement desktop configuration, or null to disable the desktop.

          env: Replacement confidential environment values.

          files: Replacement file configuration materialized for each new session.

          name: A replacement human-readable display name, or `null` to clear the name.

          network: Network access available after setup completes. Omit to preserve the current
              policy, or pass `null` to reset to the default policy.

          packages: Packages installed before the runtime network policy applies.

          plugins: Replacement plugin configuration installed for each new session.

          setup_commands: Replacement confidential setup commands, never included in returned resources.

          skills: Replacement skill configuration installed for each new session.

          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
        ri   rU   rV   rj   rk   rX   rY   TrZ   r\   )rn   r`   r   r   r    ÚTemplateUpdateParamsr   r$   ©r.   re   r8   r9   r:   r;   r<   r=   r>   r?   r@   rA   rB   rC   rD   rE   r/   r/   r0   Úupdate´   sB   8ÿþöóûåzTemplates.update©ÚafterÚlimitÚorderrB   rC   rD   rE   r{   ú
str | Omitr|   ú
int | Omitr}   úLiteral['asc', 'desc'] | Omitú#SyncCursorPage[EnvironmentTemplate]c                C  óJ   ddi|pi ¥}| j dtt t||||t|||dœtjƒddid�td�S ©	a‚  Lists reusable environment templates without returning confidential values.

        See
        [reusing a hosted setup](https://developers.openai.com/api/docs/guides/agents-api/tools#reuse-a-hosted-plugin-setup).

        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.

          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
        rU   rV   rW   )r{   r|   r}   rY   T)rB   rC   rD   rE   Úqueryr[   )Úpager^   Úmodel)Ú_get_api_listr   r$   r   r   r   ÚTemplateListParams©r.   r{   r|   r}   rB   rC   rD   rE   r/   r/   r0   Úlist  ó(   $ýúóîzTemplates.listr%   c             	   C  rg   )
á  
        Deletes reusable environment configuration and all confidential template inputs.
        See
        [reusing a hosted setup](https://developers.openai.com/api/docs/guides/agents-api/tools#reuse-a-hosted-plugin-setup).

        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
        ri   rU   rV   rj   rk   rY   TrZ   rl   ©rn   Ú_deleter   r   r%   rp   r/   r/   r0   ÚdeleteI  rr   zTemplates.delete)r)   r*   )r)   r3   ©r8   rF   r9   rG   r:   rH   r;   rI   r<   rJ   r=   rK   r>   rL   r?   rM   r@   rN   rA   rO   rB   rP   rC   rQ   rD   rR   rE   rS   r)   r$   ©re   rf   rB   rP   rC   rQ   rD   rR   rE   rS   r)   r$   © re   rf   r8   rF   r9   rs   r:   rH   r;   rI   r<   rJ   r=   rt   r>   ru   r?   rM   r@   rN   rA   rO   rB   rP   rC   rQ   rD   rR   rE   rS   r)   r$   )r{   r~   r|   r   r}   r€   rB   rP   rC   rQ   rD   rR   rE   rS   r)   r�   ©re   rf   rB   rP   rC   rQ   rD   rR   rE   rS   r)   r%   ©Ú__name__Ú
__module__Ú__qualname__r   r1   r5   r   r   rc   rq   ry   rŠ   r�   r/   r/   r/   r0   r&      ój    	î\÷1í^õ@÷c                   @  r(   )Gr'   r)   ÚAsyncTemplatesWithRawResponsec                 C  r+   r,   )r™   r-   r/   r/   r0   r1   x  r2   z AsyncTemplates.with_raw_responseÚ#AsyncTemplatesWithStreamingResponsec                 C  r+   r4   )rš   r-   r/   r/   r0   r5   ‚  r6   z&AsyncTemplates.with_streaming_responseNr7   r8   rF   r9   rG   r:   rH   r;   rI   r<   rJ   r=   rK   r>   rL   r?   rM   r@   rN   rA   rO   rB   rP   rC   rQ   rD   rR   rE   rS   r$   c                Ã  s`   �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 )
rT   rU   rV   rW   rX   NrY   TrZ   r\   )r`   r   r   ra   r   r$   rb   r/   r/   r0   rc   ‹  s6   €:öóûèzAsyncTemplates.createrd   re   rf   c             	   Ã  óT   �|s
t d|›�ƒ‚ddi|pi ¥}| jtd|d�t||||ddid�td	�I d
H S )rh   ri   rU   rV   rj   rk   rY   TrZ   rl   Nrm   rp   r/   r/   r0   rq   á  ó(   €ÿþûôzAsyncTemplates.retrievers   rt   ru   c                Ã  sz   �|s
t d|›�ƒ‚ddi|pi ¥}| jtd|d�t||||||||	|
|dœ
tjƒI dH t||||dd	id
�td�I dH S )rv   ri   rU   rV   rj   rk   rX   NrY   TrZ   r\   )rn   r`   r   r   r    rw   r   r$   rx   r/   r/   r0   ry     sD   €8ÿþöóûåzAsyncTemplates.updaterz   r{   r~   r|   r   r}   r€   úIAsyncPaginator[EnvironmentTemplate, AsyncCursorPage[EnvironmentTemplate]]c                C  r‚   rƒ   )r‡   r   r$   r   r   r   rˆ   r‰   r/   r/   r0   rŠ   i  r‹   zAsyncTemplates.listr%   c             	   Ã  r›   )rŒ   ri   rU   rV   rj   rk   rY   TrZ   rl   Nr�   rp   r/   r/   r0   r�   £  rœ   zAsyncTemplates.delete)r)   r™   )r)   rš   r�   r‘   r’   )r{   r~   r|   r   r}   r€   rB   rP   rC   rQ   rD   rR   rE   rS   r)   r�   r“   r”   r/   r/   r/   r0   r'   w  r˜   c                   @  ó   e Zd Zddd„ZdS )	r*   Ú	templatesr&   r)   ÚNonec                 C  óP   || _ t |j¡| _t |j¡| _t |j¡| _t |j¡| _t |j¡| _d S ©N)Ú
_templatesr   Zto_raw_response_wrapperrc   rq   ry   rŠ   r�   ©r.   rŸ   r/   r/   r0   Ú__init__Ò  ó    ÿÿÿÿ
ÿz!TemplatesWithRawResponse.__init__N©rŸ   r&   r)   r    ©r•   r–   r—   r¥   r/   r/   r/   r0   r*   Ñ  ó    r*   c                   @  rž   )	r™   rŸ   r'   r)   r    c                 C  r¡   r¢   )r£   r   Zasync_to_raw_response_wrapperrc   rq   ry   rŠ   r�   r¤   r/   r/   r0   r¥   ç  r¦   z&AsyncTemplatesWithRawResponse.__init__N©rŸ   r'   r)   r    r¨   r/   r/   r/   r0   r™   æ  r©   r™   c                   @  rž   )	r3   rŸ   r&   r)   r    c                 C  óF   || _ t|jƒ| _t|jƒ| _t|jƒ| _t|jƒ| _t|jƒ| _d S r¢   )r£   r   rc   rq   ry   rŠ   r�   r¤   r/   r/   r0   r¥   ü  ó    ÿÿÿÿ
ÿz'TemplatesWithStreamingResponse.__init__Nr§   r¨   r/   r/   r/   r0   r3   û  r©   r3   c                   @  rž   )	rš   rŸ   r'   r)   r    c                 C  r«   r¢   )r£   r   rc   rq   ry   rŠ   r�   r¤   r/   r/   r0   r¥     r¬   z,AsyncTemplatesWithStreamingResponse.__init__Nrª   r¨   r/   r/   r/   r0   rš     r©   rš   )=Ú
__future__r   Útypingr   r   r   Ztyping_extensionsr   Zhttpx2Ú r   Ú_typesr	   r
   r   r   r   r   r   r   Z_utilsr   r   r   Z_compatr   Z	_resourcer   r   Ú	_responser   r   Z
paginationr   r   Z_base_clientr   r   Ztypes.beta.hosted_skill_paramr   Ztypes.beta.agents.environmentsr   r   r    Ztypes.beta.hosted_plugin_paramr!   Ztypes.beta.setup_command_paramr"   Z(types.beta.hosted_environment_file_paramr#   Z3types.beta.agents.environments.environment_templater$   Z;types.beta.agents.environments.environment_template_deletedr%   Ú__all__r&   r'   r*   r™   r3   rš   r/   r/   r/   r0   Ú<module>   s<   (  \  \