o
    lWiJ                     @  s  d dl mZ d dl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lmZ dd	lmZ dd
lmZ ddlmZ ddlmZ ddlmZmZ ddlmZ ejrsd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' e(ej)dZ*G dd dZ+G dd dZ,dS )    )annotationsN   )AsyncClientWrapperSyncClientWrapper)RequestOptions)McpApprovalPolicy)McpServerConfigInput)McpServerResponseModel)McpServersResponseModel)ToolCallSoundBehavior)ToolCallSoundType)ToolExecutionMode   )AsyncRawMcpServersClientRawMcpServersClient)4McpServerConfigUpdateRequestModelRequestHeadersValue)ApprovalPolicyClientAsyncApprovalPolicyClient)AsyncToolApprovalsClientToolApprovalsClient)AsyncToolConfigsClientToolConfigsClient)AsyncToolsClientToolsClient.c                	   @     e Zd Zd4ddZed5ddZd	d
d6ddZd	d
d7ddZd	d
d8ddZd	d
d9ddZ	e
e
e
e
e
e
e
d	dd:d*d+Zed,d- Zed.d/ Zed0d1 Zed2d3 Zd	S );McpServersClientclient_wrapperr   c                C  .   t |d| _|| _d | _d | _d | _d | _d S Nr   )r   _raw_client_client_wrapper_tools_approval_policy_tool_approvals_tool_configsselfr    r(   s/var/www/html/asistente-voz-ia/venv/lib/python3.10/site-packages/elevenlabs/conversational_ai/mcp_servers/client.py__init__      
zMcpServersClient.__init__returnr   c                 C     | j S )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        RawMcpServersClient
        r    r'   r(   r(   r)   with_raw_response'      	z"McpServersClient.with_raw_responseNrequest_optionsr3   typing.Optional[RequestOptions]r
   c                C  s   | j j|d}|jS )a  
        Retrieve all MCP server configurations available in the workspace.

        Parameters
        ----------
        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        McpServersResponseModel
            Successful Response

        Examples
        --------
        from elevenlabs import ElevenLabs

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.conversational_ai.mcp_servers.list()
        r2   r    listdatar'   r3   	_responser(   r(   r)   r6   2   s   zMcpServersClient.listconfigr   r	   c                C     | j j||d}|jS )a  
        Create a new MCP server configuration in the workspace.

        Parameters
        ----------
        config : McpServerConfigInput
            Configuration details for the MCP Server.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        McpServerResponseModel
            Successful Response

        Examples
        --------
        from elevenlabs import ElevenLabs, McpServerConfigInput

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.conversational_ai.mcp_servers.create(
            config=McpServerConfigInput(
                url="url",
                name="name",
            ),
        )
        r:   r3   r    creater7   r'   r:   r3   r9   r(   r(   r)   r>   L   s   !zMcpServersClient.createmcp_server_idstrc                C  r;   )a~  
        Retrieve a specific MCP server configuration from the workspace.

        Parameters
        ----------
        mcp_server_id : str
            ID of the MCP Server.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        McpServerResponseModel
            Successful Response

        Examples
        --------
        from elevenlabs import ElevenLabs

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.conversational_ai.mcp_servers.get(
            mcp_server_id="mcp_server_id",
        )
        r2   r    getr7   r'   r@   r3   r9   r(   r(   r)   rC   p   s   zMcpServersClient.get
typing.Anyc                C  r;   )as  
        Delete a specific MCP server configuration from the workspace.

        Parameters
        ----------
        mcp_server_id : str
            ID of the MCP Server.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        typing.Any
            Successful Response

        Examples
        --------
        from elevenlabs import ElevenLabs

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.conversational_ai.mcp_servers.delete(
            mcp_server_id="mcp_server_id",
        )
        r2   r    deleter7   rD   r(   r(   r)   rG      s   zMcpServersClient.deleteapproval_policyforce_pre_tool_speechdisable_interruptionstool_call_soundtool_call_sound_behaviorexecution_moderequest_headersr3   rI   "typing.Optional[McpApprovalPolicy]rJ   typing.Optional[bool]rK   rL   "typing.Optional[ToolCallSoundType]rM   &typing.Optional[ToolCallSoundBehavior]rN   "typing.Optional[ToolExecutionMode]rO   htyping.Optional[typing.Dict[str, typing.Optional[McpServerConfigUpdateRequestModelRequestHeadersValue]]]c                C  s$   | j j|||||||||	d	}
|
jS )a  
        Update the configuration settings for an MCP server.

        Parameters
        ----------
        mcp_server_id : str
            ID of the MCP Server.

        approval_policy : typing.Optional[McpApprovalPolicy]
            The approval mode to set for the MCP server

        force_pre_tool_speech : typing.Optional[bool]
            If set, overrides the server's force_pre_tool_speech setting for this tool

        disable_interruptions : typing.Optional[bool]
            If set, overrides the server's disable_interruptions setting for this tool

        tool_call_sound : typing.Optional[ToolCallSoundType]
            Predefined tool call sound type to play during tool execution for all tools from this MCP server

        tool_call_sound_behavior : typing.Optional[ToolCallSoundBehavior]
            Determines when the tool call sound should play for all tools from this MCP server

        execution_mode : typing.Optional[ToolExecutionMode]
            If set, overrides the server's execution_mode setting for this tool

        request_headers : typing.Optional[typing.Dict[str, typing.Optional[McpServerConfigUpdateRequestModelRequestHeadersValue]]]
            The headers to include in requests to the MCP server

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        McpServerResponseModel
            Successful Response

        Examples
        --------
        from elevenlabs import ElevenLabs

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.conversational_ai.mcp_servers.update(
            mcp_server_id="mcp_server_id",
        )
        rH   r    updater7   r'   r@   rI   rJ   rK   rL   rM   rN   rO   r3   r9   r(   r(   r)   rW      s   ?zMcpServersClient.updatec                 C  *   | j d u rddlm} || jd| _ | j S )Nr   )r   r   )r"   tools.clientr   r!   )r'   r   r(   r(   r)   tools      
zMcpServersClient.toolsc                 C  rY   )Nr   )r   r   )r#   approval_policy.clientr   r!   )r'   r   r(   r(   r)   rI     r\   z McpServersClient.approval_policyc                 C  rY   )Nr   )r   r   )r$   tool_approvals.clientr   r!   )r'   r   r(   r(   r)   tool_approvals  r\   zMcpServersClient.tool_approvalsc                 C  rY   )Nr   )r   r   )r%   tool_configs.clientr   r!   )r'   r   r(   r(   r)   tool_configs  r\   zMcpServersClient.tool_configs)r   r   )r,   r   r3   r4   r,   r
   r:   r   r3   r4   r,   r	   r@   rA   r3   r4   r,   r	   r@   rA   r3   r4   r,   rE   r@   rA   rI   rP   rJ   rQ   rK   rQ   rL   rR   rM   rS   rN   rT   rO   rU   r3   r4   r,   r	   __name__
__module____qualname__r*   propertyr0   r6   r>   rC   rG   OMITrW   r[   rI   r_   ra   r(   r(   r(   r)   r      s6    

%!#L


r   c                	   @  r   );AsyncMcpServersClientr   r   c                C  r   r   )r   r    r!   r"   r#   r$   r%   r&   r(   r(   r)   r*     r+   zAsyncMcpServersClient.__init__r,   r   c                 C  r-   )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        AsyncRawMcpServersClient
        r.   r/   r(   r(   r)   r0   &  r1   z'AsyncMcpServersClient.with_raw_responseNr2   r3   r4   r
   c                  s   | j j|dI dH }|jS )a}  
        Retrieve all MCP server configurations available in the workspace.

        Parameters
        ----------
        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        McpServersResponseModel
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.conversational_ai.mcp_servers.list()


        asyncio.run(main())
        r2   Nr5   r8   r(   r(   r)   r6   1  s   zAsyncMcpServersClient.listr:   r   r	   c                     | j j||dI dH }|jS )as  
        Create a new MCP server configuration in the workspace.

        Parameters
        ----------
        config : McpServerConfigInput
            Configuration details for the MCP Server.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        McpServerResponseModel
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs, McpServerConfigInput

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.conversational_ai.mcp_servers.create(
                config=McpServerConfigInput(
                    url="url",
                    name="name",
                ),
            )


        asyncio.run(main())
        r<   Nr=   r?   r(   r(   r)   r>   S  s   )zAsyncMcpServersClient.creater@   rA   c                  rn   )a  
        Retrieve a specific MCP server configuration from the workspace.

        Parameters
        ----------
        mcp_server_id : str
            ID of the MCP Server.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        McpServerResponseModel
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.conversational_ai.mcp_servers.get(
                mcp_server_id="mcp_server_id",
            )


        asyncio.run(main())
        r2   NrB   rD   r(   r(   r)   rC        &zAsyncMcpServersClient.getrE   c                  rn   )a  
        Delete a specific MCP server configuration from the workspace.

        Parameters
        ----------
        mcp_server_id : str
            ID of the MCP Server.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        typing.Any
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.conversational_ai.mcp_servers.delete(
                mcp_server_id="mcp_server_id",
            )


        asyncio.run(main())
        r2   NrF   rD   r(   r(   r)   rG     ro   zAsyncMcpServersClient.deleterH   rI   rP   rJ   rQ   rK   rL   rR   rM   rS   rN   rT   rO   rU   c                  s,   | j j|||||||||	d	I dH }
|
jS )a$  
        Update the configuration settings for an MCP server.

        Parameters
        ----------
        mcp_server_id : str
            ID of the MCP Server.

        approval_policy : typing.Optional[McpApprovalPolicy]
            The approval mode to set for the MCP server

        force_pre_tool_speech : typing.Optional[bool]
            If set, overrides the server's force_pre_tool_speech setting for this tool

        disable_interruptions : typing.Optional[bool]
            If set, overrides the server's disable_interruptions setting for this tool

        tool_call_sound : typing.Optional[ToolCallSoundType]
            Predefined tool call sound type to play during tool execution for all tools from this MCP server

        tool_call_sound_behavior : typing.Optional[ToolCallSoundBehavior]
            Determines when the tool call sound should play for all tools from this MCP server

        execution_mode : typing.Optional[ToolExecutionMode]
            If set, overrides the server's execution_mode setting for this tool

        request_headers : typing.Optional[typing.Dict[str, typing.Optional[McpServerConfigUpdateRequestModelRequestHeadersValue]]]
            The headers to include in requests to the MCP server

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        McpServerResponseModel
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.conversational_ai.mcp_servers.update(
                mcp_server_id="mcp_server_id",
            )


        asyncio.run(main())
        rH   NrV   rX   r(   r(   r)   rW     s   GzAsyncMcpServersClient.updatec                 C  rY   )Nr   )r   r   )r"   rZ   r   r!   )r'   r   r(   r(   r)   r[   %  r\   zAsyncMcpServersClient.toolsc                 C  rY   )Nr   )r   r   )r#   r]   r   r!   )r'   r   r(   r(   r)   rI   -  r\   z%AsyncMcpServersClient.approval_policyc                 C  rY   )Nr   )r   r   )r$   r^   r   r!   )r'   r   r(   r(   r)   r_   5  r\   z$AsyncMcpServersClient.tool_approvalsc                 C  rY   )Nr   )r   r   )r%   r`   r   r!   )r'   r   r(   r(   r)   ra   =  r\   z"AsyncMcpServersClient.tool_configs)r   r   )r,   r   rb   rc   rd   re   rf   rg   r(   r(   r(   r)   rm     s8    

#-*-T


rm   )-
__future__r   typingcore.client_wrapperr   r   core.request_optionsr   types.mcp_approval_policyr   types.mcp_server_config_inputr   types.mcp_server_response_modelr	    types.mcp_servers_response_modelr
   types.tool_call_sound_behaviorr   types.tool_call_sound_typer   types.tool_execution_moder   
raw_clientr   r   Btypes.mcp_server_config_update_request_model_request_headers_valuer   TYPE_CHECKINGr]   r   r   r^   r   r   r`   r   r   rZ   r   r   castAnyrl   r   rm   r(   r(   r(   r)   <module>   s.     