
    b6iI                         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mZ  e j&                  e j(                  d      Z G d d      Z G d d      Zy)    N   )AsyncClientWrapperSyncClientWrapper)RequestOptions)AgentBranchResponse)AgentWorkflowRequestModel)BranchProtectionStatus)CreateAgentBranchResponseModel)ListResponseAgentBranchSummary   )AsyncRawBranchesClientRawBranchesClient.c                      e Zd ZdefdZedefd       Zdddddede	j                  e   d	e	j                  e   d
e	j                  e   def
dZeeedddedededede	j                  e	j"                  ee	j$                  f      de	j                  e	j"                  ee	j$                  f      de	j                  e   d
e	j                  e   defdZdddeded
e	j                  e   defdZeeedddedede	j                  e   de	j                  e   de	j                  e   d
e	j                  e   defdZedddededede	j                  e   d
e	j                  e   de	j$                  fdZy) BranchesClientclient_wrapperc                &    t        |      | _        y N)r   )r   _raw_clientselfr   s     ~/root/.openclaw/workspace/visionaryfx/venv/lib/python3.12/site-packages/elevenlabs/conversational_ai/agents/branches/client.py__init__zBranchesClient.__init__   s    ,NK    returnc                     | j                   S )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        RawBranchesClient
        r   r   s    r   with_raw_responsez BranchesClient.with_raw_response        r   Ninclude_archivedlimitrequest_optionsagent_idr!   r"   r#   c                X    | j                   j                  ||||      }|j                  S )a  
        Returns a list of branches an agent has

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

        include_archived : typing.Optional[bool]
            Whether archived branches should be included

        limit : typing.Optional[int]
            How many results at most should be returned

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

        Returns
        -------
        ListResponseAgentBranchSummary
            Successful Response

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.conversational_ai.agents.branches.list(
            agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz",
            include_archived=True,
            limit=1,
        )
        r    r   listdatar   r$   r!   r"   r#   	_responses         r   r'   zBranchesClient.list!   s7    V $$))'7uVe * 
	 ~~r   conversation_configplatform_settingsworkflowr#   parent_version_idnamedescriptionr,   r-   r.   c          
      `    | j                   j                  ||||||||      }	|	j                  S )al  
        Create a new branch from a given version of main branch

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

        parent_version_id : str
            ID of the version to branch from

        name : str
            Name of the branch. It is unique within the agent.

        description : str
            Description for the branch

        conversation_config : typing.Optional[typing.Dict[str, typing.Any]]
            Changes to apply to conversation config

        platform_settings : typing.Optional[typing.Dict[str, typing.Any]]
            Changes to apply to platform settings

        workflow : typing.Optional[AgentWorkflowRequestModel]
            Updated workflow definition

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

        Returns
        -------
        CreateAgentBranchResponseModel
            Successful Response

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.conversational_ai.agents.branches.create(
            agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz",
            parent_version_id="parent_version_id",
            name="name",
            description="description",
        )
        r/   r0   r1   r,   r-   r.   r#   r   creater(   
r   r$   r/   r0   r1   r,   r-   r.   r#   r*   s
             r   r5   zBranchesClient.createQ   sD    x $$++/# 3/+ , 	
	 ~~r   r#   	branch_idc                V    | j                   j                  |||      }|j                  S )a  
        Get information about a single agent branch

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

        branch_id : str
            Unique identifier for the branch.

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

        Returns
        -------
        AgentBranchResponse
            Successful Response

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.conversational_ai.agents.branches.get(
            agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz",
            branch_id="agtbranch_0901k4aafjxxfxt93gd841r7tv5t",
        )
        r7   r   getr(   r   r$   r8   r#   r*   s        r   r;   zBranchesClient.get   s,    D $$((9o(^	~~r   r0   is_archivedprotection_statusr#   r>   r?   c                \    | j                   j                  ||||||      }|j                  S )a  
        Update agent branch properties such as archiving status and protection level

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

        branch_id : str
            Unique identifier for the branch.

        name : typing.Optional[str]
            New name for the branch. Must be unique within the agent.

        is_archived : typing.Optional[bool]
            Whether the branch should be archived

        protection_status : typing.Optional[BranchProtectionStatus]
            The protection level for the branch

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

        Returns
        -------
        AgentBranchResponse
            Successful Response

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.conversational_ai.agents.branches.update(
            agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz",
            branch_id="agtbranch_0901k4aafjxxfxt93gd841r7tv5t",
        )
        r=   r   updater(   r   r$   r8   r0   r>   r?   r#   r*   s           r   rB   zBranchesClient.update   s>    d $$++#/+ , 
	 ~~r   archive_source_branchr#   source_branch_idtarget_branch_idrE   c                Z    | j                   j                  |||||      }|j                  S )a\  
        Merge a branch into a target branch

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

        source_branch_id : str
            Unique identifier for the source branch to merge from.

        target_branch_id : str
            The ID of the target branch to merge into (must be the main branch).

        archive_source_branch : typing.Optional[bool]
            Whether to archive the source branch after merging

        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.agents.branches.merge(
            agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz",
            source_branch_id="agtbrch_8901k4t9z5defmb8vh3e9361y7nj",
            target_branch_id="agtbrch_8901k4t9z5defmb8vh3e9361y7nj",
        )
        rG   rE   r#   r   merger(   r   r$   rF   rG   rE   r#   r*   s          r   rK   zBranchesClient.merge   s;    ^ $$**-"7+ + 
	 ~~r   )__name__
__module____qualname__r   r   propertyr   r   strtypingOptionalboolintr   r   r'   OMITDictAnyr   r
   r5   r   r;   r	   rB   rK    r   r   r   r      sY   L*; L  #4     37&*;?.. !//$/	.
 s#.  8. 
(.n NRKO?C;?FF 	F
 F F $__V[[fjj-IJF "??6;;sFJJ+GHF //";<F  8F 
(FR dh##(+#AGQ_A`#	#T &*-1EI;?:: :
 ooc": __T*: "??+AB:  8: 
:D 8<;?66 6
 6  &t46  86 
6r   r   c                      e Zd ZdefdZedefd       Zdddddede	j                  e   d	e	j                  e   d
e	j                  e   def
dZeeedddedededede	j                  e	j"                  ee	j$                  f      de	j                  e	j"                  ee	j$                  f      de	j                  e   d
e	j                  e   defdZdddeded
e	j                  e   defdZeeedddedede	j                  e   de	j                  e   de	j                  e   d
e	j                  e   defdZedddededede	j                  e   d
e	j                  e   de	j$                  fdZy) AsyncBranchesClientr   c                &    t        |      | _        y r   )r   r   r   s     r   r   zAsyncBranchesClient.__init__4  s    1Pr   r   c                     | j                   S )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        AsyncRawBranchesClient
        r   r   s    r   r   z%AsyncBranchesClient.with_raw_response7  r   r   Nr    r$   r!   r"   r#   c                t   K   | j                   j                  ||||       d{   }|j                  S 7 w)a  
        Returns a list of branches an agent has

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

        include_archived : typing.Optional[bool]
            Whether archived branches should be included

        limit : typing.Optional[int]
            How many results at most should be returned

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

        Returns
        -------
        ListResponseAgentBranchSummary
            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.branches.list(
                agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz",
                include_archived=True,
                limit=1,
            )


        asyncio.run(main())
        r    Nr&   r)   s         r   r'   zAsyncBranchesClient.listB  sE     f **//'7uVe 0 
 
	 ~~
s   #868r+   r/   r0   r1   r,   r-   r.   c          
      |   K   | j                   j                  ||||||||       d{   }	|	j                  S 7 w)a  
        Create a new branch from a given version of main branch

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

        parent_version_id : str
            ID of the version to branch from

        name : str
            Name of the branch. It is unique within the agent.

        description : str
            Description for the branch

        conversation_config : typing.Optional[typing.Dict[str, typing.Any]]
            Changes to apply to conversation config

        platform_settings : typing.Optional[typing.Dict[str, typing.Any]]
            Changes to apply to platform settings

        workflow : typing.Optional[AgentWorkflowRequestModel]
            Updated workflow definition

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

        Returns
        -------
        CreateAgentBranchResponseModel
            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.branches.create(
                agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz",
                parent_version_id="parent_version_id",
                name="name",
                description="description",
            )


        asyncio.run(main())
        r3   Nr4   r6   s
             r   r5   zAsyncBranchesClient.createz  sR     H **11/# 3/+ 2 	
 	
	 ~~	
s   '<:<r7   r8   c                r   K   | j                   j                  |||       d{   }|j                  S 7 w)a  
        Get information about a single agent branch

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

        branch_id : str
            Unique identifier for the branch.

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

        Returns
        -------
        AgentBranchResponse
            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.branches.get(
                agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz",
                branch_id="agtbranch_0901k4aafjxxfxt93gd841r7tv5t",
            )


        asyncio.run(main())
        r7   Nr:   r<   s        r   r;   zAsyncBranchesClient.get  s:     T **..xTc.dd	~~ es   "757r=   r>   r?   c                x   K   | j                   j                  ||||||       d{   }|j                  S 7 w)a  
        Update agent branch properties such as archiving status and protection level

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

        branch_id : str
            Unique identifier for the branch.

        name : typing.Optional[str]
            New name for the branch. Must be unique within the agent.

        is_archived : typing.Optional[bool]
            Whether the branch should be archived

        protection_status : typing.Optional[BranchProtectionStatus]
            The protection level for the branch

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

        Returns
        -------
        AgentBranchResponse
            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.branches.update(
                agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz",
                branch_id="agtbranch_0901k4aafjxxfxt93gd841r7tv5t",
            )


        asyncio.run(main())
        r=   NrA   rC   s           r   rB   zAsyncBranchesClient.update  sL     t **11#/+ 2 
 
	 ~~
s   %:8:rD   rF   rG   rE   c                v   K   | j                   j                  |||||       d{   }|j                  S 7 w)a  
        Merge a branch into a target branch

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

        source_branch_id : str
            Unique identifier for the source branch to merge from.

        target_branch_id : str
            The ID of the target branch to merge into (must be the main branch).

        archive_source_branch : typing.Optional[bool]
            Whether to archive the source branch after merging

        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.agents.branches.merge(
                agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz",
                source_branch_id="agtbrch_8901k4t9z5defmb8vh3e9361y7nj",
                target_branch_id="agtbrch_8901k4t9z5defmb8vh3e9361y7nj",
            )


        asyncio.run(main())
        rI   NrJ   rL   s          r   rK   zAsyncBranchesClient.merge;  sI     n **00-"7+ 1 
 
	 ~~
s   $979)rM   rN   rO   r   r   rP   r   r   rQ   rR   rS   rT   rU   r   r   r'   rV   rW   rX   r   r
   r5   r   r;   r	   rB   rK   rY   r   r   r[   r[   3  sa   Q*< Q  #9     37&*;?66 !//$/	6
 s#6  86 
(6~ NRKO?C;?NN 	N
 N N $__V[[fjj-IJN "??6;;sFJJ+GHN //";<N  8N 
(Nb dh++(++AGQ_A`+	+d &*-1EI;?BB B
 ooc"B __T*B "??+ABB  8B 
BT 8<;?>> >
 >  &t4>  8> 
>r   r[   )rR   core.client_wrapperr   r   core.request_optionsr   types.agent_branch_responser   "types.agent_workflow_request_modelr   types.branch_protection_statusr	   (types.create_agent_branch_response_modelr
   (types.list_response_agent_branch_summaryr   
raw_clientr   r   castrX   rV   r   r[   rY   r   r   <module>rl      sS     I 3 ? L E W W A v{{6::s#^ ^B	F Fr   