
    i                       d dl mZ d dlmZmZmZmZmZ d dlmZ d dl	m
Z
 d dlZddlmZ dd	lmZmZmZmZmZmZ dd
lmZmZmZmZmZmZmZ ddlmZmZm Z m!Z!m"Z" ddl#m$Z$ ddl%m&Z&m'Z' ddl(m)Z)m*Z* ddl+m,Z,m-Z- ddl.m/Z/m0Z0m1Z1m2Z2 ddl3m4Z4m5Z5 ddl6m7Z7 ddl8m9Z9 ddl:m;Z; ddl<m=Z= ddgZ> G d de&          Z? G d de'          Z@ G d d          ZA G d d          ZB G d d          ZC G d  d!          ZDdS )"    )annotations)DictListUnionIterableOptional)datetime)chainN   )_legacy_response   )VersionsAsyncVersionsVersionsWithRawResponseAsyncVersionsWithRawResponseVersionsWithStreamingResponse"AsyncVersionsWithStreamingResponse)BodyOmitQueryHeadersNotGivenomit	not_given)is_givenpath_templatemaybe_transformstrip_not_givenasync_maybe_transform)cached_property)SyncAPIResourceAsyncAPIResource)to_streamed_response_wrapper"async_to_streamed_response_wrapper)SyncPageCursorAsyncPageCursor)agent_list_paramsagent_create_paramsagent_update_paramsagent_retrieve_params)AsyncPaginatormake_request_options)AnthropicBetaParam)BetaManagedAgentsAgent)BetaManagedAgentsSkillParams)#BetaManagedAgentsURLMCPServerParamsAgentsAsyncAgentsc                      e Zd Zed?d            Zed@d            ZedAd            Zeeeeeeeddded	dBd$Z	eeddded%dCd)Z
eeeeeeeeeddded*dDd2Zeeeeeeddded3
dEd<Zeddded=dFd>ZdS )Gr1   returnr   c                *    t          | j                  S N)r   _clientselfs    p/home/agentuser/.hermes/hermes-agent/venv/lib/python3.11/site-packages/anthropic/resources/beta/agents/agents.pyversionszAgents.versions%   s    %%%    AgentsWithRawResponsec                     t          |           S a  
        This property can be used as a prefix for any HTTP method call to return
        the raw response object instead of the parsed content.

        For more information, see https://www.github.com/anthropics/anthropic-sdk-python#accessing-raw-response-data-eg-headers
        )r=   r8   s    r:   with_raw_responsezAgents.with_raw_response)   s     %T***r<   AgentsWithStreamingResponsec                     t          |           S z
        An alternative to `.with_raw_response` that doesn't eagerly read the response body.

        For more information, see https://www.github.com/anthropics/anthropic-sdk-python#with_streaming_response
        )rA   r8   s    r:   with_streaming_responsezAgents.with_streaming_response3   s     +4000r<   Ndescriptionmcp_serversmetadataskillssystemtoolsbetasextra_headersextra_query
extra_bodytimeoutmodelagent_create_params.ModelnamestrrF   Optional[str] | OmitrG   4Iterable[BetaManagedAgentsURLMCPServerParams] | OmitrH   Dict[str, str] | OmitrI   -Iterable[BetaManagedAgentsSkillParams] | OmitrJ   rK   )Iterable[agent_create_params.Tool] | OmitrL   List[AnthropicBetaParam] | OmitrM   Headers | NonerN   Query | NonerO   Body | NonerP   'float | httpx.Timeout | None | NotGivenr.   c               d   i t          dt          |	          r.d                    t          d |	D             dg                    nt          i          |
pi }
ddi|
pi }
|                     dt          ||||||||dt          j                  t          |
|||          t                    S )	K  Create Agent

        Args:
          model: Model identifier.

        Accepts the
              [model string](https://platform.claude.com/docs/en/about-claude/models/overview#latest-models-comparison),
              e.g. `claude-opus-4-6`, or a `model_config` object for additional configuration
              control

          name: Human-readable name for the agent. 1-256 characters.

          description: Description of what the agent does. Up to 2048 characters.

          mcp_servers: MCP servers this agent connects to. Maximum 20. Names must be unique within the
              array.

          metadata: Arbitrary key-value metadata. Maximum 16 pairs, keys up to 64 chars, values up
              to 512 chars.

          skills: Skills available to the agent. Maximum 20.

          system: System prompt for the agent. Up to 100,000 characters.

          tools: Tool configurations available to the agent. Maximum of 128 tools across all
              toolsets allowed.

          betas: Optional header to specify the beta version(s) you want to use.

          extra_headers: Send extra headers

          extra_query: Add additional query parameters to the request

          extra_body: Add additional JSON properties to the request

          timeout: Override the client-level default timeout for this request, in seconds
        anthropic-beta,c              3  4   K   | ]}t          |          V  d S r6   rT   .0es     r:   	<genexpr>z Agents.create.<locals>.<genexpr>w   (      5L5Lc!ff5L5L5L5L5L5Lr<   managed-agents-2026-04-01/v1/agents?beta=truerQ   rS   rF   rG   rH   rI   rJ   rK   rM   rN   rO   rP   bodyoptionscast_to)r   r   joinr
   r   _postr   r(   AgentCreateParamsr,   r.   r9   rQ   rS   rF   rG   rH   rI   rJ   rK   rL   rM   rN   rO   rP   s                 r:   createzAgents.create<   s   p	
$'#chhu5L5Le5L5L5LOjNk/l/l&m&m&m" 	
 "	
 *+F`=K^\^`zz" " #.#. ($$"	 	 $5  )+Q[el   +%  
 
 	
r<   versionrL   rM   rN   rO   rP   agent_idrx   
int | Omitc                  |st          d|          i t          dt          |          r.d                    t	          d |D             dg                    nt
          i          |pi }ddi|pi }|                     t          d|          t          ||||t          d|it          j                  	          t          
          S )  Get Agent

        Args:
          version: Agent version.

        Omit for the most recent version. Must be at least 1 if
              specified.

          betas: Optional header to specify the beta version(s) you want to use.

          extra_headers: Send extra headers

          extra_query: Add additional query parameters to the request

          extra_body: Add additional JSON properties to the request

          timeout: Override the client-level default timeout for this request, in seconds
        7Expected a non-empty value for `agent_id` but received ra   rb   c              3  4   K   | ]}t          |          V  d S r6   rd   re   s     r:   rh   z"Agents.retrieve.<locals>.<genexpr>   ri   r<   rj   /v1/agents/{agent_id}?beta=truery   rx   rM   rN   rO   rP   queryrp   rq   )
ValueErrorr   r   rr   r
   r   _getr   r,   r   r*   AgentRetrieveParamsr.   r9   ry   rx   rL   rM   rN   rO   rP   s           r:   retrievezAgents.retrieve   s   >  	ecW_ccddd	
$'#chhu5L5Le5L5L5LOjNk/l/l&m&m&m" 	
 "	
 *+F`=K^\^`yy;hOOO(+'%%y'&:<Q<eff   +  

 

 
	
r<   rF   rG   rH   rQ   rS   rI   rJ   rK   rL   rM   rN   rO   rP   int>Optional[Iterable[BetaManagedAgentsURLMCPServerParams]] | Omit)Optional[Dict[str, Optional[str]]] | Omit agent_update_params.Model | Omit
str | Omit7Optional[Iterable[BetaManagedAgentsSkillParams]] | Omit3Optional[Iterable[agent_update_params.Tool]] | Omitc                  |st          d|          i t          dt          |          r.d                    t	          d |D             dg                    nt
          i          |pi }ddi|pi }|                     t          d|          t          ||||||||	|
d	t          j
                  t          ||||	          t          
          S )   
        Update Agent

        Args:
          version: The agent's current version, used to prevent concurrent overwrites. Obtain this
              value from a create or retrieve response. The request fails if this does not
              match the server's current version.

          description: Description. Up to 2048 characters. Omit to preserve; send empty string or null
              to clear.

          mcp_servers: MCP servers. Full replacement. Omit to preserve; send empty array or null to
              clear. Names must be unique. Maximum 20.

          metadata: Metadata patch. Set a key to a string to upsert it, or to null to delete it.
              Omit the field to preserve. The stored bag is limited to 16 keys (up to 64 chars
              each) with values up to 512 chars.

          model: Model identifier. Accepts the
              [model string](https://platform.claude.com/docs/en/about-claude/models/overview#latest-models-comparison),
              e.g. `claude-opus-4-6`, or a `model_config` object for additional configuration
              control. Omit to preserve. Cannot be cleared.

          name: Human-readable name. 1-256 characters. Omit to preserve. Cannot be cleared.

          skills: Skills. Full replacement. Omit to preserve; send empty array or null to clear.
              Maximum 20.

          system: System prompt. Up to 100,000 characters. Omit to preserve; send empty string or
              null to clear.

          tools: Tool configurations available to the agent. Full replacement. Omit to preserve;
              send empty array or null to clear. Maximum of 128 tools across all toolsets
              allowed.

          betas: Optional header to specify the beta version(s) you want to use.

          extra_headers: Send extra headers

          extra_query: Add additional query parameters to the request

          extra_body: Add additional JSON properties to the request

          timeout: Override the client-level default timeout for this request, in seconds
        r}   ra   rb   c              3  4   K   | ]}t          |          V  d S r6   rd   re   s     r:   rh   z Agents.update.<locals>.<genexpr>  ri   r<   rj   r   r   	rx   rF   rG   rH   rQ   rS   rI   rJ   rK   rm   rn   )r   r   r   rr   r
   r   rs   r   r   r)   AgentUpdateParamsr,   r.   r9   ry   rx   rF   rG   rH   rQ   rS   rI   rJ   rK   rL   rM   rN   rO   rP   s                   r:   updatezAgents.update   s7   D  	ecW_ccddd	
$'#chhu5L5Le5L5L5LOjNk/l/l&m&m&m" 	
 "	
 *+F`=K^\^`zz;hOOO &#.#. (" $$"
 
 $5  )+Q[el   +'  
 
 	
r<   
created_at_gtecreated_at_lteinclude_archivedlimitpagerL   rM   rN   rO   rP   r   Union[str, datetime] | Omitr   r   bool | Omitr   r   &SyncPageCursor[BetaManagedAgentsAgent]c       
           i t          dt          |          r.d                    t          d |D             dg                    nt          i          |pi }ddi|pi }|                     dt          t                   t          |||	|
t          |||||dt          j                            t                    S )	  
        List Agents

        Args:
          created_at_gte: Return agents created at or after this time (inclusive).

          created_at_lte: Return agents created at or before this time (inclusive).

          include_archived: Include archived agents in results. Defaults to false.

          limit: Maximum results per page. Default 20, maximum 100.

          page: Opaque pagination cursor from a previous response.

          betas: Optional header to specify the beta version(s) you want to use.

          extra_headers: Send extra headers

          extra_query: Add additional query parameters to the request

          extra_body: Add additional JSON properties to the request

          timeout: Override the client-level default timeout for this request, in seconds
        ra   rb   c              3  4   K   | ]}t          |          V  d S r6   rd   re   s     r:   rh   zAgents.list.<locals>.<genexpr>\  ri   r<   rj   rk   r   r   r   r   r   r   r   rp   rQ   )r   r   rr   r
   r   _get_api_listr%   r.   r,   r   r'   AgentListParamsr9   r   r   r   r   r   rL   rM   rN   rO   rP   s              r:   listzAgents.list1  s   P	
$'#chhu5L5Le5L5L5LOjNk/l/l&m&m&m" 	
 "	
 *+F`=K^\^`!!" 67(+'%%*8*8,<!& $  &5	 	    )' " 
 
 	
r<   rL   rM   rN   rO   rP   c          
     f   |st          d|          i t          dt          |          r.d                    t	          d |D             dg                    nt
          i          |pi }ddi|pi }|                     t          d|          t          ||||          t          	          S )
  
        Archive Agent

        Args:
          betas: Optional header to specify the beta version(s) you want to use.

          extra_headers: Send extra headers

          extra_query: Add additional query parameters to the request

          extra_body: Add additional JSON properties to the request

          timeout: Override the client-level default timeout for this request, in seconds
        r}   ra   rb   c              3  4   K   | ]}t          |          V  d S r6   rd   re   s     r:   rh   z!Agents.archive.<locals>.<genexpr>  ri   r<   rj   '/v1/agents/{agent_id}/archive?beta=truer   rm   r   
r   r   r   rr   r
   r   rs   r   r,   r.   r9   ry   rL   rM   rN   rO   rP   s          r:   archivezAgents.archivez  s    4  	ecW_ccddd	
$'#chhu5L5Le5L5L5LOjNk/l/l&m&m&m" 	
 "	
 *+F`=K^\^`zzChWWW(+Q[el   +  
 
 	
r<   )r4   r   )r4   r=   )r4   rA   rQ   rR   rS   rT   rF   rU   rG   rV   rH   rW   rI   rX   rJ   rU   rK   rY   rL   rZ   rM   r[   rN   r\   rO   r]   rP   r^   r4   r.   ry   rT   rx   rz   rL   rZ   rM   r[   rN   r\   rO   r]   rP   r^   r4   r.    ry   rT   rx   r   rF   rU   rG   r   rH   r   rQ   r   rS   r   rI   r   rJ   rU   rK   r   rL   rZ   rM   r[   rN   r\   rO   r]   rP   r^   r4   r.   )r   r   r   r   r   r   r   rz   r   r   rL   rZ   rM   r[   rN   r\   rO   r]   rP   r^   r4   r   ry   rT   rL   rZ   rM   r[   rN   r\   rO   r]   rP   r^   r4   r.   __name__
__module____qualname__r    r;   r@   rD   r   r   rv   r   r   r   r    r<   r:   r1   r1   $   s       & & & _& + + + _+ 1 1 1 _1 -1LP*.@D'+;?15 )-$("&;D#V
 V
 V
 V
 V
 V
x #15 )-$("&;D6
 6
 6
 6
 6
 6
z -1VZ>B26JN'+EI15 )-$("&;D'c
 c
 c
 c
 c
 c
P 7;6:(, 15 )-$("&;DG
 G
 G
 G
 G
 G
Z 26 )-$("&;D-
 -
 -
 -
 -
 -
 -
 -
r<   c                      e Zd Zed?d            Zed@d            ZedAd            Zeeeeeeeddded	dBd$Z	eeddded%dCd)Z
eeeeeeeeeddded*dDd2Zeeeeeeddded3
dEd<Zeddded=dFd>ZdS )Gr2   r4   r   c                *    t          | j                  S r6   )r   r7   r8   s    r:   r;   zAsyncAgents.versions  s    T\***r<   AsyncAgentsWithRawResponsec                     t          |           S r?   )r   r8   s    r:   r@   zAsyncAgents.with_raw_response  s     *$///r<    AsyncAgentsWithStreamingResponsec                     t          |           S rC   )r   r8   s    r:   rD   z#AsyncAgents.with_streaming_response  s     0555r<   NrE   rQ   rR   rS   rT   rF   rU   rG   rV   rH   rW   rI   rX   rJ   rK   rY   rL   rZ   rM   r[   rN   r\   rO   r]   rP   r^   r.   c                 K   i t          dt          |	          r.d                    t          d |	D             dg                    nt          i          |
pi }
ddi|
pi }
|                     dt          ||||||||dt          j                   d{V t          |
|||          t          	           d{V S )
r`   ra   rb   c              3  4   K   | ]}t          |          V  d S r6   rd   re   s     r:   rh   z%AsyncAgents.create.<locals>.<genexpr>  ri   r<   rj   rk   rl   Nrm   rn   )r   r   rr   r
   r   rs   r   r(   rt   r,   r.   ru   s                 r:   rv   zAsyncAgents.create  sC     p	
$'#chhu5L5Le5L5L5LOjNk/l/l&m&m&m" 	
 "	
 *+F`=K^\^`ZZ"," #.#. ($$"	 	 $5        )+Q[el   +%   
 
 
 
 
 
 
 
 	
r<   rw   ry   rx   rz   c                 K   |st          d|          i t          dt          |          r.d                    t	          d |D             dg                    nt
          i          |pi }ddi|pi }|                     t          d|          t          ||||t          d|it          j                   d	{V 
          t                     d	{V S )r|   r}   ra   rb   c              3  4   K   | ]}t          |          V  d S r6   rd   re   s     r:   rh   z'AsyncAgents.retrieve.<locals>.<genexpr>>  ri   r<   rj   r   r   rx   Nr   r   )r   r   r   rr   r
   r   r   r   r,   r   r*   r   r.   r   s           r:   r   zAsyncAgents.retrieve  sE     >  	ecW_ccddd	
$'#chhu5L5Le5L5L5LOjNk/l/l&m&m&m" 	
 "	
 *+F`=K^\^`YY;hOOO(+'%19g2FH]Hqrrrrrrrr   +  

 

 

 

 

 

 

 

 
	
r<   r   r   r   r   r   r   r   r   c                 K   |st          d|          i t          dt          |          r.d                    t	          d |D             dg                    nt
          i          |pi }ddi|pi }|                     t          d|          t          ||||||||	|
d	t          j
                   d	{V t          ||||
          t                     d	{V S )r   r}   ra   rb   c              3  4   K   | ]}t          |          V  d S r6   rd   re   s     r:   rh   z%AsyncAgents.update.<locals>.<genexpr>  ri   r<   rj   r   r   r   Nrm   rn   )r   r   r   rr   r
   r   rs   r   r   r)   r   r,   r.   r   s                   r:   r   zAsyncAgents.updateR  sw     D  	ecW_ccddd	
$'#chhu5L5Le5L5L5LOjNk/l/l&m&m&m" 	
 "	
 *+F`=K^\^`ZZ;hOOO,&#.#. (" $$"
 
 $5        )+Q[el   +'   
 
 
 
 
 
 
 
 	
r<   r   r   r   r   r   r   r   r   OAsyncPaginator[BetaManagedAgentsAgent, AsyncPageCursor[BetaManagedAgentsAgent]]c       
           i t          dt          |          r.d                    t          d |D             dg                    nt          i          |pi }ddi|pi }|                     dt          t                   t          |||	|
t          |||||dt          j                            t                    S )	r   ra   rb   c              3  4   K   | ]}t          |          V  d S r6   rd   re   s     r:   rh   z#AsyncAgents.list.<locals>.<genexpr>  ri   r<   rj   rk   r   r   r   )r   r   rr   r
   r   r   r&   r.   r,   r   r'   r   r   s              r:   r   zAsyncAgents.list  s   P	
$'#chhu5L5Le5L5L5LOjNk/l/l&m&m&m" 	
 "	
 *+F`=K^\^`!!" !78(+'%%*8*8,<!& $  &5	 	    )' " 
 
 	
r<   r   c          
     v  K   |st          d|          i t          dt          |          r.d                    t	          d |D             dg                    nt
          i          |pi }ddi|pi }|                     t          d|          t          ||||          t          	           d
{V S )r   r}   ra   rb   c              3  4   K   | ]}t          |          V  d S r6   rd   re   s     r:   rh   z&AsyncAgents.archive.<locals>.<genexpr>  ri   r<   rj   r   r   rm   r   Nr   r   s          r:   r   zAsyncAgents.archive   s     4  	ecW_ccddd	
$'#chhu5L5Le5L5L5LOjNk/l/l&m&m&m" 	
 "	
 *+F`=K^\^`ZZChWWW(+Q[el   +   
 
 
 
 
 
 
 
 	
r<   )r4   r   )r4   r   )r4   r   r   r   r   )r   r   r   r   r   r   r   rz   r   r   rL   rZ   rM   r[   rN   r\   rO   r]   rP   r^   r4   r   r   r   r   r<   r:   r2   r2     s       + + + _+ 0 0 0 _0 6 6 6 _6 -1LP*.@D'+;?15 )-$("&;D#V
 V
 V
 V
 V
 V
x #15 )-$("&;D6
 6
 6
 6
 6
 6
z -1VZ>B26JN'+EI15 )-$("&;D'c
 c
 c
 c
 c
 c
P 7;6:(, 15 )-$("&;DG
 G
 G
 G
 G
 G
Z 26 )-$("&;D-
 -
 -
 -
 -
 -
 -
 -
r<   c                  .    e Zd Zd	dZed
d            ZdS )r=   agentsr1   r4   Nonec                @   || _         t          j        |j                  | _        t          j        |j                  | _        t          j        |j                  | _        t          j        |j                  | _        t          j        |j                  | _        d S r6   )_agentsr   to_raw_response_wrapperrv   r   r   r   r   r9   r   s     r:   __init__zAgentsWithRawResponse.__init__1  s    &>M
 
 )@O
 
 '>M
 
 %<K
 
	 (?N
 
r<   r   c                4    t          | j        j                  S r6   )r   r   r;   r8   s    r:   r;   zAgentsWithRawResponse.versionsD  s    &t|'<===r<   Nr   r1   r4   r   )r4   r   r   r   r   r   r    r;   r   r<   r:   r=   r=   0  sH        
 
 
 
& > > > _> > >r<   r=   c                  .    e Zd Zd	dZed
d            ZdS )r   r   r2   r4   r   c                @   || _         t          j        |j                  | _        t          j        |j                  | _        t          j        |j                  | _        t          j        |j                  | _        t          j        |j                  | _        d S r6   )r   r   async_to_raw_response_wrapperrv   r   r   r   r   r   s     r:   r   z#AsyncAgentsWithRawResponse.__init__J  s    &DM
 
 )FO
 
 'DM
 
 %BK
 
	 (EN
 
r<   r   c                4    t          | j        j                  S r6   )r   r   r;   r8   s    r:   r;   z#AsyncAgentsWithRawResponse.versions]  s    +DL,ABBBr<   Nr   r2   r4   r   )r4   r   r   r   r<   r:   r   r   I  sN        
 
 
 
& C C C _C C Cr<   r   c                  .    e Zd Zd	dZed
d            ZdS )rA   r   r1   r4   r   c                   || _         t          |j                  | _        t          |j                  | _        t          |j                  | _        t          |j                  | _        t          |j                  | _        d S r6   )r   r#   rv   r   r   r   r   r   s     r:   r   z$AgentsWithStreamingResponse.__init__c  s    2M
 
 5O
 
 3M
 
 1K
 
	 4N
 
r<   r   c                4    t          | j        j                  S r6   )r   r   r;   r8   s    r:   r;   z$AgentsWithStreamingResponse.versionsv  s    ,T\-BCCCr<   Nr   )r4   r   r   r   r<   r:   rA   rA   b  sN        
 
 
 
& D D D _D D Dr<   rA   c                  .    e Zd Zd	dZed
d            ZdS )r   r   r2   r4   r   c                   || _         t          |j                  | _        t          |j                  | _        t          |j                  | _        t          |j                  | _        t          |j                  | _        d S r6   )r   r$   rv   r   r   r   r   r   s     r:   r   z)AsyncAgentsWithStreamingResponse.__init__|  s    8M
 
 ;O
 
 9M
 
 7K
 
	 :N
 
r<   r   c                4    t          | j        j                  S r6   )r   r   r;   r8   s    r:   r;   z)AsyncAgentsWithStreamingResponse.versions  s    1$,2GHHHr<   Nr   )r4   r   r   r   r<   r:   r   r   {  sN        
 
 
 
& I I I _I I Ir<   r   )E
__future__r   typingr   r   r   r   r   r	   	itertoolsr
   httpx r   r;   r   r   r   r   r   r   _typesr   r   r   r   r   r   r   _utilsr   r   r   r   r   _compatr    	_resourcer!   r"   	_responser#   r$   
paginationr%   r&   
types.betar'   r(   r)   r*   _base_clientr+   r,   types.anthropic_beta_paramr-   $types.beta.beta_managed_agents_agentr.   +types.beta.beta_managed_agents_skill_paramsr/   4types.beta.beta_managed_agents_url_mcp_server_paramsr0   __all__r1   r2   r=   r   rA   r   r   r<   r:   <module>r      sH   # " " " " " 8 8 8 8 8 8 8 8 8 8 8 8 8 8              ! ! ! ! ! !                M L L L L L L L L L L L L L L L L L g g g g g g g g g g g g g g ' ' ' ' ' ' ; ; ; ; ; ; ; ; Z Z Z Z Z Z Z Z : : : : : : : : m m m m m m m m m m m m A A A A A A A A = = = = = = K K K K K K X X X X X X h h h h h h]
#C
 C
 C
 C
 C
_ C
 C
 C
LC
 C
 C
 C
 C
" C
 C
 C
L> > > > > > > >2C C C C C C C C2D D D D D D D D2I I I I I I I I I Ir<   