
    b6i                       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 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jR                  r@ddl*m+Z+m,Z, ddl-m.Z.m/Z/ ddl0m1Z1m2Z2 ddl3m4Z4m5Z5 ddl6m7Z7m8Z8 ddl9m:Z:m;Z; ddl<m=Z=m>Z> ddl?m@Z@mAZA  ej                  ej                  d      ZD G d  d!      ZE G d" d#      ZFy)$    )annotationsN   )AsyncClientWrapperSyncClientWrapper)RequestOptions)+AdhocAgentConfigOverrideForTestRequestModel)!AgentPlatformSettingsRequestModel)#AgentSimulatedChatTestResponseModel)AgentSortBy)AgentWorkflowRequestModel)#ConversationSimulationSpecification)ConversationalConfig)CreateAgentResponseModel)GetAgentResponseModel)GetAgentsPageResponseModel)#GetTestSuiteInvocationResponseModel)PromptEvaluationCriteria)SingleTestRunRequestModel)SortDirection   )AsyncRawAgentsClientRawAgentsClient)EBodyPatchesAnAgentSettingsV1ConvaiAgentsAgentIdPatchProcedureRefsItem)AsyncBranchesClientBranchesClient)AsyncDeploymentsClientDeploymentsClient)AsyncDraftsClientDraftsClient)AsyncKnowledgeBaseClientKnowledgeBaseClient)AsyncLinkClient
LinkClient)AsyncLlmUsageClientLlmUsageClient)AsyncSummariesClientSummariesClient)AsyncWidgetClientWidgetClient.c            
      $   e Zd ZddZedd       Zeeeedd	 	 	 	 	 	 	 	 	 	 	 	 	 ddZdddd	 	 	 	 	 	 	 	 	 d dZddd!d	Z	deeeeeeedd
		 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d"dZ
ddddddddd	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d#dZedd	 	 	 	 	 	 	 d$dZeedd	 	 	 	 	 	 	 	 	 	 	 d%dZeedd	 	 	 	 	 	 	 	 	 	 	 d&dZeedd	 	 	 	 	 	 	 	 	 	 	 d'dZed        Zed        Zed        Zed        Zed        Zed        Zed        Zed        Zy)(AgentsClientc                   t        |      | _        || _        d | _        d | _        d | _        d | _        d | _        d | _        d | _	        d | _
        y Nclient_wrapper)r   _raw_client_client_wrapper
_summaries_widget_link_knowledge_base
_llm_usage	_branches_deployments_draftsselfr/   s     u/root/.openclaw/workspace/visionaryfx/venv/lib/python3.12/site-packages/elevenlabs/conversational_ai/agents/client.py__init__zAgentsClient.__init__*   sQ    *.I-<@6:26
EI;?:>@D6:    c                    | j                   S )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        RawAgentsClient
        r0   r;   s    r<   with_raw_responsezAgentsClient.with_raw_response6        r>   Nplatform_settingsworkflownametagsrequest_optionsc               \    | j                   j                  ||||||      }|j                  S )a  
        Create an agent from a config object

        Parameters
        ----------
        conversation_config : ConversationalConfig
            Conversation configuration for an agent

        platform_settings : typing.Optional[AgentPlatformSettingsRequestModel]
            Platform settings for the agent are all settings that aren't related to the conversation orchestration and content.

        workflow : typing.Optional[AgentWorkflowRequestModel]
            Workflow for the agent. This is used to define the flow of the conversation and how the agent interacts with tools.

        name : typing.Optional[str]
            A name to make the agent easier to find

        tags : typing.Optional[typing.Sequence[str]]
            Tags to help classify and filter the agent

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

        Returns
        -------
        CreateAgentResponseModel
            Successful Response

        Examples
        --------
        from elevenlabs import ConversationalConfig, ElevenLabs

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.conversational_ai.agents.create(
            conversation_config=ConversationalConfig(),
        )
        conversation_configrE   rF   rG   rH   rI   r0   createdatar;   rL   rE   rF   rG   rH   rI   	_responses           r<   rN   zAgentsClient.createA   s>    b $$++ 3/+ , 
	 ~~r>   
version_id	branch_idrI   c               X    | j                   j                  ||||      }|j                  S )au  
        Retrieve config for an agent

        Parameters
        ----------
        agent_id : str
            The id of an agent. This is returned on agent creation.

        version_id : typing.Optional[str]
            The ID of the agent version to use

        branch_id : typing.Optional[str]
            The ID of the branch to use

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

        Returns
        -------
        GetAgentResponseModel
            Successful Response

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.conversational_ai.agents.get(
            agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz",
            version_id="version_id",
            branch_id="branch_id",
        )
        rR   r0   getrO   r;   agent_idrS   rT   rI   rQ   s         r<   rW   zAgentsClient.get|   s6    V $$((yRa ) 
	 ~~r>   rI   c               T    | j                   j                  ||      }|j                  S )aF  
        Delete an agent

        Parameters
        ----------
        agent_id : str
            The id of an agent. This is returned on agent creation.

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

        Returns
        -------
        None

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.conversational_ai.agents.delete(
            agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz",
        )
        rZ   r0   deleterO   r;   rY   rI   rQ   s       r<   r]   zAgentsClient.delete   s)    6 $$++Ho+V	~~r>   	rT   rL   rE   rF   rG   rH   version_descriptionprocedure_refsrI   c       	        d    | j                   j                  |||||||||	|

      }|j                  S )a"  
        Patches an Agent settings

        Parameters
        ----------
        agent_id : str
            The id of an agent. This is returned on agent creation.

        branch_id : typing.Optional[str]
            The ID of the branch to use

        conversation_config : typing.Optional[ConversationalConfig]
            Conversation configuration for an agent

        platform_settings : typing.Optional[AgentPlatformSettingsRequestModel]
            Platform settings for the agent are all settings that aren't related to the conversation orchestration and content.

        workflow : typing.Optional[AgentWorkflowRequestModel]
            Workflow for the agent. This is used to define the flow of the conversation and how the agent interacts with tools.

        name : typing.Optional[str]
            A name to make the agent easier to find

        tags : typing.Optional[typing.Sequence[str]]
            Tags to help classify and filter the agent

        version_description : typing.Optional[str]
            Description for this version when publishing changes (only applicable for versioned agents)

        procedure_refs : typing.Optional[typing.Sequence[BodyPatchesAnAgentSettingsV1ConvaiAgentsAgentIdPatchProcedureRefsItem]]
            List of procedure refs used for this agent version.

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

        Returns
        -------
        GetAgentResponseModel
            Successful Response

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.conversational_ai.agents.update(
            agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz",
            branch_id="branch_id",
        )
        r_   r0   updaterO   r;   rY   rT   rL   rE   rF   rG   rH   r`   ra   rI   rQ   s               r<   rd   zAgentsClient.update   sJ    H $$++ 3/ 3)+ , 
	 ~~r>   	page_sizesearcharchivedshow_only_owned_agentssort_directionsort_bycursorrI   c          
     `    | j                   j                  ||||||||      }	|	j                  S )a  
        Returns a list of your agents and their metadata.

        Parameters
        ----------
        page_size : typing.Optional[int]
            How many Agents to return at maximum. Can not exceed 100, defaults to 30.

        search : typing.Optional[str]
            Search by agents name.

        archived : typing.Optional[bool]
            Filter agents by archived status

        show_only_owned_agents : typing.Optional[bool]
            If set to true, the endpoint will omit any agents that were shared with you by someone else and include only the ones you own

        sort_direction : typing.Optional[SortDirection]
            The direction to sort the results

        sort_by : typing.Optional[AgentSortBy]
            The field to sort the results by

        cursor : typing.Optional[str]
            Used for fetching next page. Cursor is returned in the response.

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

        Returns
        -------
        GetAgentsPageResponseModel
            Successful Response

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.conversational_ai.agents.list(
            page_size=1,
            search="search",
            archived=True,
            show_only_owned_agents=True,
            sort_direction="asc",
            sort_by="name",
            cursor="cursor",
        )
        rf   r0   listrO   
r;   rg   rh   ri   rj   rk   rl   rm   rI   rQ   s
             r<   rp   zAgentsClient.list  sD    ~ $$))#9)+ * 	
	 ~~r>   rG   rI   c               V    | j                   j                  |||      }|j                  S )a  
        Create a new agent by duplicating an existing one

        Parameters
        ----------
        agent_id : str
            The id of an agent. This is returned on agent creation.

        name : typing.Optional[str]
            A name to make the agent easier to find

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

        Returns
        -------
        CreateAgentResponseModel
            Successful Response

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.conversational_ai.agents.duplicate(
            agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz",
        )
        rr   r0   	duplicaterO   r;   rY   rG   rI   rQ   s        r<   ru   zAgentsClient.duplicateg  s-    J $$..xdTc.d	~~r>   extra_evaluation_criterianew_turns_limitrI   c               Z    | j                   j                  |||||      }|j                  S )a  
        Run a conversation between the agent and a simulated user.

        Parameters
        ----------
        agent_id : str
            The id of an agent. This is returned on agent creation.

        simulation_specification : ConversationSimulationSpecification
            A specification detailing how the conversation should be simulated

        extra_evaluation_criteria : typing.Optional[typing.Sequence[PromptEvaluationCriteria]]
            A list of evaluation criteria to test

        new_turns_limit : typing.Optional[int]
            Maximum number of new turns to generate in the conversation simulation

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

        Returns
        -------
        AgentSimulatedChatTestResponseModel
            Successful Response

        Examples
        --------
        from elevenlabs import (
            AgentConfig,
            ConversationSimulationSpecification,
            ElevenLabs,
        )

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.conversational_ai.agents.simulate_conversation(
            agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz",
            simulation_specification=ConversationSimulationSpecification(
                simulated_user_config=AgentConfig(
                    first_message="Hello, how can I help you today?",
                    language="en",
                    disable_first_message_interruptions=False,
                ),
            ),
        )
        simulation_specificationrx   ry   rI   r0   simulate_conversationrO   r;   rY   r|   rx   ry   rI   rQ   s          r<   r~   z"AgentsClient.simulate_conversation  s;    p $$::%=&?++ ; 
	 ~~r>   c               Z    | j                   j                  |||||      }|j                  S )a  
        Run a conversation between the agent and a simulated user and stream back the response. Response is streamed back as partial lists of messages that should be concatenated and once the conversation has complete a single final message with the conversation analysis will be sent.

        Parameters
        ----------
        agent_id : str
            The id of an agent. This is returned on agent creation.

        simulation_specification : ConversationSimulationSpecification
            A specification detailing how the conversation should be simulated

        extra_evaluation_criteria : typing.Optional[typing.Sequence[PromptEvaluationCriteria]]
            A list of evaluation criteria to test

        new_turns_limit : typing.Optional[int]
            Maximum number of new turns to generate in the conversation simulation

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

        Returns
        -------
        None

        Examples
        --------
        from elevenlabs import (
            AgentConfig,
            ConversationSimulationSpecification,
            ElevenLabs,
        )

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.conversational_ai.agents.simulate_conversation_stream(
            agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz",
            simulation_specification=ConversationSimulationSpecification(
                simulated_user_config=AgentConfig(
                    first_message="Hello, how can I help you today?",
                    language="en",
                    disable_first_message_interruptions=False,
                ),
            ),
        )
        r{   r0   simulate_conversation_streamrO   r   s          r<   r   z)AgentsClient.simulate_conversation_stream  s<    n $$AA%=&?++ B 
	 ~~r>   agent_config_overriderT   rI   c               Z    | j                   j                  |||||      }|j                  S )a  
        Run selected tests on the agent with provided configuration. If the agent configuration is provided, it will be used to override default agent configuration.

        Parameters
        ----------
        agent_id : str
            The id of an agent. This is returned on agent creation.

        tests : typing.Sequence[SingleTestRunRequestModel]
            List of tests to run on the agent

        agent_config_override : typing.Optional[AdhocAgentConfigOverrideForTestRequestModel]
            Configuration overrides to use for testing. If not provided, the agent's default configuration will be used.

        branch_id : typing.Optional[str]
            ID of the branch to run the tests on. If not provided, the tests will be run on the agent default configuration.

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

        Returns
        -------
        GetTestSuiteInvocationResponseModel
            Successful Response

        Examples
        --------
        from elevenlabs import ElevenLabs, SingleTestRunRequestModel

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.conversational_ai.agents.run_tests(
            agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz",
            tests=[
                SingleTestRunRequestModel(
                    test_id="test_id",
                )
            ],
        )
        testsr   rT   rI   r0   	run_testsrO   r;   rY   r   r   rT   rI   rQ   s          r<   r   zAgentsClient.run_tests  s;    d $$.."7+ / 
	 ~~r>   c                n    | j                   ddlm}  || j                        | _         | j                   S )Nr   )r'   r.   )r2   summaries.clientr'   r1   )r;   r'   s     r<   	summarieszAgentsClient.summariesK  s+    ??"9-T=Q=QRDOr>   c                n    | j                   ddlm}  || j                        | _         | j                   S )Nr   )r)   r.   )r3   widget.clientr)   r1   )r;   r)   s     r<   widgetzAgentsClient.widgetS  +    <<3't7K7KLDL||r>   c                n    | j                   ddlm}  || j                        | _         | j                   S )Nr   )r#   r.   )r4   link.clientr#   r1   )r;   r#   s     r<   linkzAgentsClient.link[  s+    ::/#43G3GHDJzzr>   c                n    | j                   ddlm}  || j                        | _         | j                   S )Nr   )r!   r.   )r5   knowledge_base.clientr!   r1   )r;   r!   s     r<   knowledge_basezAgentsClient.knowledge_basec  s0    'B#6dFZFZ#[D ###r>   c                n    | j                   ddlm}  || j                        | _         | j                   S )Nr   )r%   r.   )r6   llm_usage.clientr%   r1   )r;   r%   s     r<   	llm_usagezAgentsClient.llm_usagek  s+    ??"8,D<P<PQDOr>   c                n    | j                   ddlm}  || j                        | _         | j                   S )Nr   )r   r.   )r7   branches.clientr   r1   )r;   r   s     r<   brancheszAgentsClient.branchess  s+    >>!7+4;O;OPDN~~r>   c                n    | j                   ddlm}  || j                        | _         | j                   S )Nr   )r   r.   )r8   deployments.clientr   r1   )r;   r   s     r<   deploymentszAgentsClient.deployments{  s0    $= 1AUAU VD   r>   c                n    | j                   ddlm}  || j                        | _         | j                   S )Nr   )r   r.   )r9   drafts.clientr   r1   )r;   r   s     r<   draftszAgentsClient.drafts  r   r>   )r/   r   )returnr   rL   r   rE   2typing.Optional[AgentPlatformSettingsRequestModel]rF   *typing.Optional[AgentWorkflowRequestModel]rG   typing.Optional[str]rH   %typing.Optional[typing.Sequence[str]]rI   typing.Optional[RequestOptions]r   r   
rY   strrS   r   rT   r   rI   r   r   r   rY   r   rI   r   r   NonerY   r   rT   r   rL   z%typing.Optional[ConversationalConfig]rE   r   rF   r   rG   r   rH   r   r`   r   ra   zgtyping.Optional[typing.Sequence[BodyPatchesAnAgentSettingsV1ConvaiAgentsAgentIdPatchProcedureRefsItem]]rI   r   r   r   rg   typing.Optional[int]rh   r   ri   typing.Optional[bool]rj   r   rk   ztyping.Optional[SortDirection]rl   ztyping.Optional[AgentSortBy]rm   r   rI   r   r   r   rY   r   rG   r   rI   r   r   r   rY   r   r|   r   rx   :typing.Optional[typing.Sequence[PromptEvaluationCriteria]]ry   r   rI   r   r   r
   rY   r   r|   r   rx   r   ry   r   rI   r   r   r   rY   r   r   z*typing.Sequence[SingleTestRunRequestModel]r   z<typing.Optional[AdhocAgentConfigOverrideForTestRequestModel]rT   r   rI   r   r   r   __name__
__module____qualname__r=   propertyrB   OMITrN   rW   r]   rd   rp   ru   r~   r   r   r   r   r   r   r   r   r   r    r>   r<   r+   r+   )   s   
;     QU?C%)6:;?9 29 N	9
 =9 #9 49 99 
"9~ ,0*.;?.. )	.
 (. 9. 
.` [_ D +/EIPT?C%)6:48 ;?PP (	P
 CP NP =P #P 4P 2P
P 9P 
Pj +/'+*.8<9=04'+;?I (I %	I
 (I !6I 7I .I %I 9I 
$I^ &*;?&& #	&
 9& 
"&Z ae04;??? #F	?
 $^? .? 9? 
-?L ae04;?>> #F	>
 $^> .> 9> 
>J _c*.;?99 :	9
  \9 (9 99 
-9v       $ $     ! !  r>   r+   c            
      $   e Zd ZddZedd       Zeeeedd	 	 	 	 	 	 	 	 	 	 	 	 	 ddZdddd	 	 	 	 	 	 	 	 	 d dZddd!d	Z	deeeeeeedd
		 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d"dZ
ddddddddd	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d#dZedd	 	 	 	 	 	 	 d$dZeedd	 	 	 	 	 	 	 	 	 	 	 d%dZeedd	 	 	 	 	 	 	 	 	 	 	 d&dZeedd	 	 	 	 	 	 	 	 	 	 	 d'dZed        Zed        Zed        Zed        Zed        Zed        Zed        Zed        Zy)(AsyncAgentsClientc                   t        |      | _        || _        d | _        d | _        d | _        d | _        d | _        d | _        d | _	        d | _
        y r-   )r   r0   r1   r2   r3   r4   r5   r6   r7   r8   r9   r:   s     r<   r=   zAsyncAgentsClient.__init__  sQ    /~N-AE;?7;
JN@D?CEI;?r>   c                    | j                   S )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        AsyncRawAgentsClient
        r@   rA   s    r<   rB   z#AsyncAgentsClient.with_raw_response  rC   r>   NrD   c               x   K   | j                   j                  ||||||       d{   }|j                  S 7 w)ay  
        Create an agent from a config object

        Parameters
        ----------
        conversation_config : ConversationalConfig
            Conversation configuration for an agent

        platform_settings : typing.Optional[AgentPlatformSettingsRequestModel]
            Platform settings for the agent are all settings that aren't related to the conversation orchestration and content.

        workflow : typing.Optional[AgentWorkflowRequestModel]
            Workflow for the agent. This is used to define the flow of the conversation and how the agent interacts with tools.

        name : typing.Optional[str]
            A name to make the agent easier to find

        tags : typing.Optional[typing.Sequence[str]]
            Tags to help classify and filter the agent

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

        Returns
        -------
        CreateAgentResponseModel
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs, ConversationalConfig

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.conversational_ai.agents.create(
                conversation_config=ConversationalConfig(),
            )


        asyncio.run(main())
        rK   NrM   rP   s           r<   rN   zAsyncAgentsClient.create  sL     r **11 3/+ 2 
 
	 ~~
s   %:8:rR   c               t   K   | j                   j                  ||||       d{   }|j                  S 7 w)a  
        Retrieve config for an agent

        Parameters
        ----------
        agent_id : str
            The id of an agent. This is returned on agent creation.

        version_id : typing.Optional[str]
            The ID of the agent version to use

        branch_id : typing.Optional[str]
            The ID of the branch to use

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

        Returns
        -------
        GetAgentResponseModel
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.conversational_ai.agents.get(
                agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz",
                version_id="version_id",
                branch_id="branch_id",
            )


        asyncio.run(main())
        rR   NrV   rX   s         r<   rW   zAsyncAgentsClient.get  sD     f **..yRa / 
 
	 ~~
s   #868rZ   c               p   K   | j                   j                  ||       d{   }|j                  S 7 w)a  
        Delete an agent

        Parameters
        ----------
        agent_id : str
            The id of an agent. This is returned on agent creation.

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

        Returns
        -------
        None

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


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


        asyncio.run(main())
        rZ   Nr\   r^   s       r<   r]   zAsyncAgentsClient.delete  s7     F **11(O1\\	~~ ]s   !646r_   c       	           K   | j                   j                  |||||||||	|

       d{   }|j                  S 7 w)a  
        Patches an Agent settings

        Parameters
        ----------
        agent_id : str
            The id of an agent. This is returned on agent creation.

        branch_id : typing.Optional[str]
            The ID of the branch to use

        conversation_config : typing.Optional[ConversationalConfig]
            Conversation configuration for an agent

        platform_settings : typing.Optional[AgentPlatformSettingsRequestModel]
            Platform settings for the agent are all settings that aren't related to the conversation orchestration and content.

        workflow : typing.Optional[AgentWorkflowRequestModel]
            Workflow for the agent. This is used to define the flow of the conversation and how the agent interacts with tools.

        name : typing.Optional[str]
            A name to make the agent easier to find

        tags : typing.Optional[typing.Sequence[str]]
            Tags to help classify and filter the agent

        version_description : typing.Optional[str]
            Description for this version when publishing changes (only applicable for versioned agents)

        procedure_refs : typing.Optional[typing.Sequence[BodyPatchesAnAgentSettingsV1ConvaiAgentsAgentIdPatchProcedureRefsItem]]
            List of procedure refs used for this agent version.

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

        Returns
        -------
        GetAgentResponseModel
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.conversational_ai.agents.update(
                agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz",
                branch_id="branch_id",
            )


        asyncio.run(main())
        r_   Nrc   re   s               r<   rd   zAsyncAgentsClient.updateE  sX     X **11 3/ 3)+ 2 
 
	 ~~
s   )><>rf   c          
     |   K   | j                   j                  ||||||||       d{   }	|	j                  S 7 w)a  
        Returns a list of your agents and their metadata.

        Parameters
        ----------
        page_size : typing.Optional[int]
            How many Agents to return at maximum. Can not exceed 100, defaults to 30.

        search : typing.Optional[str]
            Search by agents name.

        archived : typing.Optional[bool]
            Filter agents by archived status

        show_only_owned_agents : typing.Optional[bool]
            If set to true, the endpoint will omit any agents that were shared with you by someone else and include only the ones you own

        sort_direction : typing.Optional[SortDirection]
            The direction to sort the results

        sort_by : typing.Optional[AgentSortBy]
            The field to sort the results by

        cursor : typing.Optional[str]
            Used for fetching next page. Cursor is returned in the response.

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

        Returns
        -------
        GetAgentsPageResponseModel
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.conversational_ai.agents.list(
                page_size=1,
                search="search",
                archived=True,
                show_only_owned_agents=True,
                sort_direction="asc",
                sort_by="name",
                cursor="cursor",
            )


        asyncio.run(main())
        rf   Nro   rq   s
             r<   rp   zAsyncAgentsClient.list  sR     N **//#9)+ 0 	
 	
	 ~~	
s   '<:<rr   c               r   K   | j                   j                  |||       d{   }|j                  S 7 w)an  
        Create a new agent by duplicating an existing one

        Parameters
        ----------
        agent_id : str
            The id of an agent. This is returned on agent creation.

        name : typing.Optional[str]
            A name to make the agent easier to find

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

        Returns
        -------
        CreateAgentResponseModel
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


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


        asyncio.run(main())
        rr   Nrt   rv   s        r<   ru   zAsyncAgentsClient.duplicate  s:     Z **44XDZi4jj	~~ ks   "757rw   c               v   K   | j                   j                  |||||       d{   }|j                  S 7 w)a  
        Run a conversation between the agent and a simulated user.

        Parameters
        ----------
        agent_id : str
            The id of an agent. This is returned on agent creation.

        simulation_specification : ConversationSimulationSpecification
            A specification detailing how the conversation should be simulated

        extra_evaluation_criteria : typing.Optional[typing.Sequence[PromptEvaluationCriteria]]
            A list of evaluation criteria to test

        new_turns_limit : typing.Optional[int]
            Maximum number of new turns to generate in the conversation simulation

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

        Returns
        -------
        AgentSimulatedChatTestResponseModel
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import (
            AgentConfig,
            AsyncElevenLabs,
            ConversationSimulationSpecification,
        )

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.conversational_ai.agents.simulate_conversation(
                agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz",
                simulation_specification=ConversationSimulationSpecification(
                    simulated_user_config=AgentConfig(
                        first_message="Hello, how can I help you today?",
                        language="en",
                        disable_first_message_interruptions=False,
                    ),
                ),
            )


        asyncio.run(main())
        r{   Nr}   r   s          r<   r~   z'AsyncAgentsClient.simulate_conversation"  sJ     @ **@@%=&?++ A 
 
	 ~~
   $979c               v   K   | j                   j                  |||||       d{   }|j                  S 7 w)aJ  
        Run a conversation between the agent and a simulated user and stream back the response. Response is streamed back as partial lists of messages that should be concatenated and once the conversation has complete a single final message with the conversation analysis will be sent.

        Parameters
        ----------
        agent_id : str
            The id of an agent. This is returned on agent creation.

        simulation_specification : ConversationSimulationSpecification
            A specification detailing how the conversation should be simulated

        extra_evaluation_criteria : typing.Optional[typing.Sequence[PromptEvaluationCriteria]]
            A list of evaluation criteria to test

        new_turns_limit : typing.Optional[int]
            Maximum number of new turns to generate in the conversation simulation

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

        Returns
        -------
        None

        Examples
        --------
        import asyncio

        from elevenlabs import (
            AgentConfig,
            AsyncElevenLabs,
            ConversationSimulationSpecification,
        )

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.conversational_ai.agents.simulate_conversation_stream(
                agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz",
                simulation_specification=ConversationSimulationSpecification(
                    simulated_user_config=AgentConfig(
                        first_message="Hello, how can I help you today?",
                        language="en",
                        disable_first_message_interruptions=False,
                    ),
                ),
            )


        asyncio.run(main())
        r{   Nr   r   s          r<   r   z.AsyncAgentsClient.simulate_conversation_streamk  sJ     ~ **GG%=&?++ H 
 
	 ~~
r   r   c               v   K   | j                   j                  |||||       d{   }|j                  S 7 w)a*  
        Run selected tests on the agent with provided configuration. If the agent configuration is provided, it will be used to override default agent configuration.

        Parameters
        ----------
        agent_id : str
            The id of an agent. This is returned on agent creation.

        tests : typing.Sequence[SingleTestRunRequestModel]
            List of tests to run on the agent

        agent_config_override : typing.Optional[AdhocAgentConfigOverrideForTestRequestModel]
            Configuration overrides to use for testing. If not provided, the agent's default configuration will be used.

        branch_id : typing.Optional[str]
            ID of the branch to run the tests on. If not provided, the tests will be run on the agent default configuration.

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

        Returns
        -------
        GetTestSuiteInvocationResponseModel
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs, SingleTestRunRequestModel

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.conversational_ai.agents.run_tests(
                agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz",
                tests=[
                    SingleTestRunRequestModel(
                        test_id="test_id",
                    )
                ],
            )


        asyncio.run(main())
        r   Nr   r   s          r<   r   zAsyncAgentsClient.run_tests  sI     t **44"7+ 5 
 
	 ~~
r   c                n    | j                   ddlm}  || j                        | _         | j                   S )Nr   )r&   r.   )r2   r   r&   r1   )r;   r&   s     r<   r   zAsyncAgentsClient.summaries  s+    ??">2$BVBVWDOr>   c                n    | j                   ddlm}  || j                        | _         | j                   S )Nr   )r(   r.   )r3   r   r(   r1   )r;   r(   s     r<   r   zAsyncAgentsClient.widget  +    <<8,D<P<PQDL||r>   c                n    | j                   ddlm}  || j                        | _         | j                   S )Nr   )r"   r.   )r4   r   r"   r1   )r;   r"   s     r<   r   zAsyncAgentsClient.link  s+    ::4(8L8LMDJzzr>   c                n    | j                   ddlm}  || j                        | _         | j                   S )Nr   )r    r.   )r5   r   r    r1   )r;   r    s     r<   r   z AsyncAgentsClient.knowledge_base  s0    'G#;4K_K_#`D ###r>   c                n    | j                   ddlm}  || j                        | _         | j                   S )Nr   )r$   r.   )r6   r   r$   r1   )r;   r$   s     r<   r   zAsyncAgentsClient.llm_usage  s+    ??"=1AUAUVDOr>   c                n    | j                   ddlm}  || j                        | _         | j                   S )Nr   )r   r.   )r7   r   r   r1   )r;   r   s     r<   r   zAsyncAgentsClient.branches  s+    >>!<0@T@TUDN~~r>   c                n    | j                   ddlm}  || j                        | _         | j                   S )Nr   )r   r.   )r8   r   r   r1   )r;   r   s     r<   r   zAsyncAgentsClient.deployments&  s0    $B 6dFZFZ [D   r>   c                n    | j                   ddlm}  || j                        | _         | j                   S )Nr   )r   r.   )r9   r   r   r1   )r;   r   s     r<   r   zAsyncAgentsClient.drafts.  r   r>   )r/   r   )r   r   r   r   r   r   r   r   r   r   r   r   r   r>   r<   r   r     s   
@     QU?C%)6:;?A 2A N	A
 =A #A 4A 9A 
"AN ,0*.;?66 )	6
 (6 96 
6p ae $T +/EIPT?C%)6:48 ;?XX (	X
 CX NX =X #X 4X 2X
X 9X 
Xz +/'+*.8<9=04'+;?Q (Q %	Q
 (Q !6Q 7Q .Q %Q 9Q 
$Qn &*;?.. #	.
 9. 
".j ae04;?GG #F	G
 $^G .G 9G 
-G\ ae04;?FF #F	F
 $^F .F 9F 
FZ _c*.;?AA :	A
  \A (A 9A 
-AF       $ $     ! !  r>   r   )G
__future__r   typingcore.client_wrapperr   r   core.request_optionsr   8types.adhoc_agent_config_override_for_test_request_modelr   +types.agent_platform_settings_request_modelr	   .types.agent_simulated_chat_test_response_modelr
   types.agent_sort_byr   "types.agent_workflow_request_modelr   +types.conversation_simulation_specificationr   types.conversational_configr   !types.create_agent_response_modelr   types.get_agent_response_modelr   $types.get_agents_page_response_modelr   .types.get_test_suite_invocation_response_modelr    types.prompt_evaluation_criteriar   #types.single_test_run_request_modelr   types.sort_directionr   
raw_clientr   r   Ytypes.body_patches_an_agent_settings_v_1_convai_agents_agent_id_patch_procedure_refs_itemr   TYPE_CHECKINGr   r   r   r   r   r   r   r   r   r   r    r!   r   r"   r#   r   r$   r%   r   r&   r'   r   r(   r)   castAnyr   r+   r   r   r>   r<   <module>r      s    #  H 2 s \ a . K ^ ? I C N a H L 1 = 
DM>T8EG>v{{6::s#`	 `	Fh
 h
r>   