o
    lWi&Z                     @  s  d dl mZ d dlZddl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	lmZ dd
lmZ ddlmZmZ ejrd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#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/m0Z0 ddl1m2Z2m3Z3 ddl4m5Z5m6Z6 ddl7m8Z8m9Z9 ddl:m;Z;m<Z< ddl=m>Z>m?Z? ddl@mAZAmBZB eCejDdZEG dd dZFG dd  d ZGdS )!    )annotationsN   )core)AsyncClientWrapperSyncClientWrapper)RequestOptions)AddKnowledgeBaseResponseModel)RagDocumentIndexResponseModel)RagDocumentIndexesResponseModel)RagIndexOverviewResponseModel   )AsyncRawConversationalAiClientRawConversationalAiClient)AgentsClientAsyncAgentsClient)AnalyticsClientAsyncAnalyticsClient)AsyncBatchCallsClientBatchCallsClient)AsyncConversationsClientConversationsClient)AsyncDashboardClientDashboardClient)AsyncKnowledgeBaseClientKnowledgeBaseClient)AsyncLlmUsageClientLlmUsageClient)AsyncMcpServersClientMcpServersClient)AsyncPhoneNumbersClientPhoneNumbersClient)AsyncSecretsClientSecretsClient)AsyncSettingsClientSettingsClient)AsyncSipTrunkClientSipTrunkClient)AsyncTestsClientTestsClient)AsyncToolsClientToolsClient)AsyncTwilioClientTwilioClient.c                   @     e Zd ZdAddZedBddZd	eeed	d
dCddZd	ddDddZd	ddEddZ	d	ddFd!d"Z
ed#d$ Zed%d& Zed'd( Zed)d* Zed+d, Zed-d. Zed/d0 Zed1d2 Zed3d4 Zed5d6 Zed7d8 Zed9d: Zed;d< Zed=d> Zed?d@ Zd	S )GConversationalAiClientclient_wrapperr   c                C  p   t |d| _|| _d | _d | _d | _d | _d | _d | _d | _	d | _
d | _d | _d | _d | _d | _d | _d | _d S Nr/   )r   _raw_client_client_wrapper_conversations_twilio_agents_tests_phone_numbers
_llm_usage_knowledge_base_tools	_settings_secrets_batch_calls
_sip_trunk_mcp_servers
_analytics
_dashboardselfr/    rF   g/var/www/html/asistente-voz-ia/venv/lib/python3.10/site-packages/elevenlabs/conversational_ai/client.py__init__%   "   
zConversationalAiClient.__init__returnr   c                 C     | j S )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        RawConversationalAiClient
        r3   rE   rF   rF   rG   with_raw_response8      	z(ConversationalAiClient.with_raw_responseNagent_idnameurlfilerequest_optionsrQ   typing.Optional[str]rR   rS   rT   typing.Optional[core.File]rU   typing.Optional[RequestOptions]r   c                C  s   | j j|||||d}|jS )aM  
        Upload a file or webpage URL to create a knowledge base document. <br> <Note> After creating the document, update the agent's knowledge base by calling [Update agent](/docs/api-reference/agents/update). </Note>

        Parameters
        ----------
        agent_id : typing.Optional[str]

        name : typing.Optional[str]
            A custom, human-readable name for the document.

        url : typing.Optional[str]
            URL to a page of documentation that the agent will have access to in order to interact with users.

        file : typing.Optional[core.File]
            See core.File for more documentation

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

        Returns
        -------
        AddKnowledgeBaseResponseModel
            Successful Response

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.conversational_ai.add_to_knowledge_base(
            agent_id="agent_id",
        )
        rP   r3   add_to_knowledge_basedatarE   rQ   rR   rS   rT   rU   	_responserF   rF   rG   rZ   C   s   ,
z,ConversationalAiClient.add_to_knowledge_baserU   r   c                C  s   | j j|d}|jS )a-  
        Provides total size and other information of RAG indexes used by knowledgebase documents

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

        Returns
        -------
        RagIndexOverviewResponseModel
            Successful Response

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.conversational_ai.rag_index_overview()
        r^   r3   rag_index_overviewr[   rE   rU   r]   rF   rF   rG   r`   t   s   z)ConversationalAiClient.rag_index_overviewdocumentation_idstrr
   c                C  s   | j j||d}|jS )a  
        Provides information about all RAG indexes of the specified knowledgebase document.

        Parameters
        ----------
        documentation_id : str
            The id of a document from the knowledge base. This is returned on document addition.

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

        Returns
        -------
        RagDocumentIndexesResponseModel
            Successful Response

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.conversational_ai.get_document_rag_indexes(
            documentation_id="21m00Tcm4TlvDq8ikWAM",
        )
        r^   r3   get_document_rag_indexesr[   rE   rb   rU   r]   rF   rF   rG   re      s   z/ConversationalAiClient.get_document_rag_indexesrag_index_idr	   c                C  s   | j j|||d}|jS )a]  
        Delete RAG index for the knowledgebase document.

        Parameters
        ----------
        documentation_id : str
            The id of a document from the knowledge base. This is returned on document addition.

        rag_index_id : str
            The id of RAG index of document from the knowledge base.

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

        Returns
        -------
        RagDocumentIndexResponseModel
            Successful Response

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.conversational_ai.delete_document_rag_index(
            documentation_id="21m00Tcm4TlvDq8ikWAM",
            rag_index_id="21m00Tcm4TlvDq8ikWAM",
        )
        r^   r3   delete_document_rag_indexr[   rE   rb   rg   rU   r]   rF   rF   rG   ri      s   "z0ConversationalAiClient.delete_document_rag_indexc                 C  *   | j d u rddlm} || jd| _ | j S )Nr   )r   r2   )r5   conversations.clientr   r4   )rE   r   rF   rF   rG   conversations      
z$ConversationalAiClient.conversationsc                 C  rk   )Nr   )r,   r2   )r6   twilio.clientr,   r4   )rE   r,   rF   rF   rG   twilio   rn   zConversationalAiClient.twilioc                 C  rk   )Nr   )r   r2   )r7   agents.clientr   r4   )rE   r   rF   rF   rG   agents   rn   zConversationalAiClient.agentsc                 C  rk   )Nr   )r(   r2   )r8   tests.clientr(   r4   )rE   r(   rF   rF   rG   tests   rn   zConversationalAiClient.testsc                 C  rk   )Nr   )r    r2   )r9   phone_numbers.clientr    r4   )rE   r    rF   rF   rG   phone_numbers   rn   z$ConversationalAiClient.phone_numbersc                 C  rk   )Nr   )r   r2   )r:   llm_usage.clientr   r4   )rE   r   rF   rF   rG   	llm_usage   rn   z ConversationalAiClient.llm_usagec                 C  rk   )Nr   )r   r2   )r;   knowledge_base.clientr   r4   )rE   r   rF   rF   rG   knowledge_base  rn   z%ConversationalAiClient.knowledge_basec                 C  rk   )Nr   )r*   r2   )r<   tools.clientr*   r4   )rE   r*   rF   rF   rG   tools  rn   zConversationalAiClient.toolsc                 C  rk   )Nr   )r$   r2   )r=   settings.clientr$   r4   )rE   r$   rF   rF   rG   settings  rn   zConversationalAiClient.settingsc                 C  rk   )Nr   )r"   r2   )r>   secrets.clientr"   r4   )rE   r"   rF   rF   rG   secrets   rn   zConversationalAiClient.secretsc                 C  rk   )Nr   )r   r2   )r?   batch_calls.clientr   r4   )rE   r   rF   rF   rG   batch_calls(  rn   z"ConversationalAiClient.batch_callsc                 C  rk   )Nr   )r&   r2   )r@   sip_trunk.clientr&   r4   )rE   r&   rF   rF   rG   	sip_trunk0  rn   z ConversationalAiClient.sip_trunkc                 C  rk   )Nr   )r   r2   )rA   mcp_servers.clientr   r4   )rE   r   rF   rF   rG   mcp_servers8  rn   z"ConversationalAiClient.mcp_serversc                 C  rk   )Nr   )r   r2   )rB   analytics.clientr   r4   )rE   r   rF   rF   rG   	analytics@  rn   z ConversationalAiClient.analyticsc                 C  rk   )Nr   )r   r2   )rC   dashboard.clientr   r4   )rE   r   rF   rF   rG   	dashboardH  rn   z ConversationalAiClient.dashboard)r/   r   )rJ   r   rQ   rV   rR   rV   rS   rV   rT   rW   rU   rX   rJ   r   rU   rX   rJ   r   rb   rc   rU   rX   rJ   r
   rb   rc   rg   rc   rU   rX   rJ   r	   __name__
__module____qualname__rH   propertyrN   OMITrZ   r`   re   ri   rm   rp   rr   rt   rv   rx   rz   r|   r~   r   r   r   r   r   r   rF   rF   rF   rG   r.   $   s\    
2"'













r.   c                   @  r-   )GAsyncConversationalAiClientr/   r   c                C  r0   r1   )r   r3   r4   r5   r6   r7   r8   r9   r:   r;   r<   r=   r>   r?   r@   rA   rB   rC   rD   rF   rF   rG   rH   R  rI   z$AsyncConversationalAiClient.__init__rJ   r   c                 C  rK   )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        AsyncRawConversationalAiClient
        rL   rM   rF   rF   rG   rN   e  rO   z-AsyncConversationalAiClient.with_raw_responseNrP   rQ   rV   rR   rS   rT   rW   rU   rX   r   c                  s$   | j j|||||dI dH }|jS )a  
        Upload a file or webpage URL to create a knowledge base document. <br> <Note> After creating the document, update the agent's knowledge base by calling [Update agent](/docs/api-reference/agents/update). </Note>

        Parameters
        ----------
        agent_id : typing.Optional[str]

        name : typing.Optional[str]
            A custom, human-readable name for the document.

        url : typing.Optional[str]
            URL to a page of documentation that the agent will have access to in order to interact with users.

        file : typing.Optional[core.File]
            See core.File for more documentation

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

        Returns
        -------
        AddKnowledgeBaseResponseModel
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.conversational_ai.add_to_knowledge_base(
                agent_id="agent_id",
            )


        asyncio.run(main())
        rP   NrY   r\   rF   rF   rG   rZ   p  s
   4
z1AsyncConversationalAiClient.add_to_knowledge_baser^   r   c                  s   | j j|dI dH }|jS )a  
        Provides total size and other information of RAG indexes used by knowledgebase documents

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

        Returns
        -------
        RagIndexOverviewResponseModel
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


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


        asyncio.run(main())
        r^   Nr_   ra   rF   rF   rG   r`     s   !z.AsyncConversationalAiClient.rag_index_overviewrb   rc   r
   c                  s   | j j||dI dH }|jS )ae  
        Provides information about all RAG indexes of the specified knowledgebase document.

        Parameters
        ----------
        documentation_id : str
            The id of a document from the knowledge base. This is returned on document addition.

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

        Returns
        -------
        RagDocumentIndexesResponseModel
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.conversational_ai.get_document_rag_indexes(
                documentation_id="21m00Tcm4TlvDq8ikWAM",
            )


        asyncio.run(main())
        r^   Nrd   rf   rF   rF   rG   re     s   &z4AsyncConversationalAiClient.get_document_rag_indexesrg   r	   c                  s    | j j|||dI dH }|jS )a  
        Delete RAG index for the knowledgebase document.

        Parameters
        ----------
        documentation_id : str
            The id of a document from the knowledge base. This is returned on document addition.

        rag_index_id : str
            The id of RAG index of document from the knowledge base.

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

        Returns
        -------
        RagDocumentIndexResponseModel
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.conversational_ai.delete_document_rag_index(
                documentation_id="21m00Tcm4TlvDq8ikWAM",
                rag_index_id="21m00Tcm4TlvDq8ikWAM",
            )


        asyncio.run(main())
        r^   Nrh   rj   rF   rF   rG   ri     s
   *z5AsyncConversationalAiClient.delete_document_rag_indexc                 C  rk   )Nr   )r   r2   )r5   rl   r   r4   )rE   r   rF   rF   rG   rm   %  rn   z)AsyncConversationalAiClient.conversationsc                 C  rk   )Nr   )r+   r2   )r6   ro   r+   r4   )rE   r+   rF   rF   rG   rp   -  rn   z"AsyncConversationalAiClient.twilioc                 C  rk   )Nr   )r   r2   )r7   rq   r   r4   )rE   r   rF   rF   rG   rr   5  rn   z"AsyncConversationalAiClient.agentsc                 C  rk   )Nr   )r'   r2   )r8   rs   r'   r4   )rE   r'   rF   rF   rG   rt   =  rn   z!AsyncConversationalAiClient.testsc                 C  rk   )Nr   )r   r2   )r9   ru   r   r4   )rE   r   rF   rF   rG   rv   E  rn   z)AsyncConversationalAiClient.phone_numbersc                 C  rk   )Nr   )r   r2   )r:   rw   r   r4   )rE   r   rF   rF   rG   rx   M  rn   z%AsyncConversationalAiClient.llm_usagec                 C  rk   )Nr   )r   r2   )r;   ry   r   r4   )rE   r   rF   rF   rG   rz   U  rn   z*AsyncConversationalAiClient.knowledge_basec                 C  rk   )Nr   )r)   r2   )r<   r{   r)   r4   )rE   r)   rF   rF   rG   r|   ]  rn   z!AsyncConversationalAiClient.toolsc                 C  rk   )Nr   )r#   r2   )r=   r}   r#   r4   )rE   r#   rF   rF   rG   r~   e  rn   z$AsyncConversationalAiClient.settingsc                 C  rk   )Nr   )r!   r2   )r>   r   r!   r4   )rE   r!   rF   rF   rG   r   m  rn   z#AsyncConversationalAiClient.secretsc                 C  rk   )Nr   )r   r2   )r?   r   r   r4   )rE   r   rF   rF   rG   r   u  rn   z'AsyncConversationalAiClient.batch_callsc                 C  rk   )Nr   )r%   r2   )r@   r   r%   r4   )rE   r%   rF   rF   rG   r   }  rn   z%AsyncConversationalAiClient.sip_trunkc                 C  rk   )Nr   )r   r2   )rA   r   r   r4   )rE   r   rF   rF   rG   r     rn   z'AsyncConversationalAiClient.mcp_serversc                 C  rk   )Nr   )r   r2   )rB   r   r   r4   )rE   r   rF   rF   rG   r     rn   z%AsyncConversationalAiClient.analyticsc                 C  rk   )Nr   )r   r2   )rC   r   r   r4   )rE   r   rF   rF   rG   r     rn   z%AsyncConversationalAiClient.dashboard)r/   r   )rJ   r   r   r   r   r   r   rF   rF   rF   rG   r   Q  s\    
:%*/













r   )H
__future__r   typing r   core.client_wrapperr   r   core.request_optionsr   'types.add_knowledge_base_response_modelr   'types.rag_document_index_response_modelr	   )types.rag_document_indexes_response_modelr
   'types.rag_index_overview_response_modelr   
raw_clientr   r   TYPE_CHECKINGrq   r   r   r   r   r   r   r   r   rl   r   r   r   r   r   ry   r   r   rw   r   r   r   r   r   ru   r   r    r   r!   r"   r}   r#   r$   r   r%   r&   rs   r'   r(   r{   r)   r*   ro   r+   r,   castAnyr   r.   r   rF   rF   rF   rG   <module>   s>     /