
    icb                       d dl mZ d dlmZmZmZ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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& ddl'm(Z(m)Z) ddl*m+Z+m,Z, ddl-m.Z.m/Z/ ddl0m1Z1m2Z2 ddl3m4Z4m5Z5 ddl6m7Z7 ddl8m9Z9 ddl:m;Z; ddl<m=Z= ddl>m?Z? ddgZ@ G d de(          ZA G d de)          ZB G d d          ZC G d d          ZD G d d          ZE G d  d!          ZFdS )"    )annotations)ListMappingOptionalcast)chainN   )_legacy_response   )VersionsAsyncVersionsVersionsWithRawResponseAsyncVersionsWithRawResponseVersionsWithStreamingResponse"AsyncVersionsWithStreamingResponse)	BodyOmitQueryHeadersNotGiven	FileTypesSequenceNotStromit	not_given)is_givenextract_filespath_templatemaybe_transformstrip_not_givendeepcopy_minimalasync_maybe_transform)cached_property)SyncAPIResourceAsyncAPIResource)to_streamed_response_wrapper"async_to_streamed_response_wrapper)SyncPageCursorAsyncPageCursor)skill_list_paramsskill_create_params)AsyncPaginatormake_request_options)AnthropicBetaParam)SkillListResponse)SkillCreateResponse)SkillDeleteResponse)SkillRetrieveResponseSkillsAsyncSkillsc            	          e Zd Zed(d            Zed)d            Zed*d            Zeeeddded	d+dZ	edddedd,dZ
eeeedddedd-d%Zedddedd.d'ZdS )/r2   returnr   c                *    t          | j                  S N)r   _clientselfs    c/root/projects/qq-shell/venv/lib/python3.11/site-packages/anthropic/resources/beta/skills/skills.pyversionszSkills.versions7   s    %%%    SkillsWithRawResponsec                     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>   r9   s    r;   with_raw_responsezSkills.with_raw_response;   s     %T***r=   SkillsWithStreamingResponsec                     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
        )rB   r9   s    r;   with_streaming_responsezSkills.with_streaming_responseE   s     +4000r=   Ndisplay_titlefilesbetasextra_headersextra_query
extra_bodytimeoutrG   Optional[str] | OmitrH   *Optional[SequenceNotStr[FileTypes]] | OmitrI   List[AnthropicBetaParam] | OmitrJ   Headers | NonerK   Query | NonerL   Body | NonerM   'float | httpx.Timeout | None | NotGivenr/   c                  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          t          t          t          f         |          ddgg          }	d	|d
<   |                     dt          |t          j                  |	t          ||||          t                     S )  
        Create Skill

        Args:
          display_title: Display title for the skill.

              This is a human-readable label that is not included in the prompt sent to the
              model.

          files: Files to upload for the skill.

              All files must be in the same top-level directory and must include a SKILL.md
              file at the root of that directory.

          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 r7   str.0es     r;   	<genexpr>z Skills.create.<locals>.<genexpr>v   (      5L5Lc!ff5L5L5L5L5L5Lr=   skills-2025-10-02rG   rH   rH   <array>pathsmultipart/form-dataContent-Type/v1/skills?beta=truerJ   rK   rL   rM   bodyrH   optionscast_to)r   r   joinr   r   r    r   r   r   r[   object_postr   r*   SkillCreateParamsr,   r/   
r:   rG   rH   rI   rJ   rK   rL   rM   rk   extracted_filess
             r;   createzSkills.createN   s:   J	
$'#chhu5L5Le5L5L5LObNc/d/d&e&e&e" 	
 "	
 *+>X=CVTVX!. 
 
 (WS&[-A4(H(HRY[dQePfggg )>n%zz" ':'LMM!(+Q[el   (  
 
 	
r=   rI   rJ   rK   rL   rM   skill_idr[   r1   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 )
  
        Get Skill

        Args:
          skill_id: Unique identifier for the skill.

              The format and length of IDs may change over time.

          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 `skill_id` but received rW   rX   c              3  4   K   | ]}t          |          V  d S r7   rZ   r\   s     r;   r_   z"Skills.retrieve.<locals>.<genexpr>   r`   r=   ra   /v1/skills/{skill_id}?beta=truerv   ri   rl   rm   

ValueErrorr   r   rn   r   r   _getr   r,   r1   r:   rv   rI   rJ   rK   rL   rM   s          r;   retrievezSkills.retrieve   s    <  	ecW_ccddd	
$'#chhu5L5Le5L5L5LObNc/d/d&e&e&e" 	
 "	
 *+>X=CVTVXyy;hOOO(+Q[el   *  
 
 	
r=   limitpagesourcerI   rJ   rK   rL   rM   r   
int | Omitr   r   !SyncPageCursor[SkillListResponse]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 Skills

        Args:
          limit: Number of results to return per page.

              Maximum value is 100. Defaults to 20.

          page: Pagination token for fetching a specific page of results.

              Pass the value from a previous response's `next_page` field to get the next page
              of results.

          source: Filter skills by source.

              If provided, only skills from the specified source will be returned:

              - `"custom"`: only return user-created skills
              - `"anthropic"`: only return Anthropic-created skills

          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
        rW   rX   c              3  4   K   | ]}t          |          V  d S r7   rZ   r\   s     r;   r_   zSkills.list.<locals>.<genexpr>   r`   r=   ra   rh   r   r   r   rJ   rK   rL   rM   queryr   rl   model)r   r   rn   r   r   _get_api_listr'   r.   r,   r   r)   SkillListParams	r:   r   r   r   rI   rJ   rK   rL   rM   s	            r;   listzSkills.list   s    X	
$'#chhu5L5Le5L5L5LObNc/d/d&e&e&e" 	
 "	
 *+>X=CVTVX!!" 12(+'%%!& $"( 
 &5    $# " 
 
 	
r=   r0   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 )

  
        Delete Skill

        Args:
          skill_id: Unique identifier for the skill.

              The format and length of IDs may change over time.

          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
        ry   rW   rX   c              3  4   K   | ]}t          |          V  d S r7   rZ   r\   s     r;   r_   z Skills.delete.<locals>.<genexpr>4  r`   r=   ra   r{   r|   ri   r}   
r   r   r   rn   r   r   _deleter   r,   r0   r   s          r;   deletezSkills.delete  s    <  	ecW_ccddd	
$'#chhu5L5Le5L5L5LObNc/d/d&e&e&e" 	
 "	
 *+>X=CVTVX||;hOOO(+Q[el   (  
 
 	
r=   )r5   r   )r5   r>   )r5   rB   rG   rN   rH   rO   rI   rP   rJ   rQ   rK   rR   rL   rS   rM   rT   r5   r/   rv   r[   rI   rP   rJ   rQ   rK   rR   rL   rS   rM   rT   r5   r1   )r   r   r   rN   r   rN   rI   rP   rJ   rQ   rK   rR   rL   rS   rM   rT   r5   r   rv   r[   rI   rP   rJ   rQ   rK   rR   rL   rS   rM   rT   r5   r0   __name__
__module____qualname__r"   r<   rA   rE   r   r   rt   r   r   r    r=   r;   r2   r2   6   sT       & & & _& + + + _+ 1 1 1 _1 /3<@15 )-$("&;DC
 C
 C
 C
 C
 C
R 26 )-$("&;D1
 1
 1
 1
 1
 1
l !%)'+15 )-$("&;DI
 I
 I
 I
 I
 I
^ 26 )-$("&;D1
 1
 1
 1
 1
 1
 1
 1
r=   c            	          e Zd Zed(d            Zed)d            Zed*d            Zeeeddded	d+dZ	edddedd,dZ
eeeedddedd-d%Zedddedd.d'ZdS )/r3   r5   r   c                *    t          | j                  S r7   )r   r8   r9   s    r;   r<   zAsyncSkills.versionsF  s    T\***r=   AsyncSkillsWithRawResponsec                     t          |           S r@   )r   r9   s    r;   rA   zAsyncSkills.with_raw_responseJ  s     *$///r=    AsyncSkillsWithStreamingResponsec                     t          |           S rD   )r   r9   s    r;   rE   z#AsyncSkills.with_streaming_responseT  s     0555r=   NrF   rG   rN   rH   rO   rI   rP   rJ   rQ   rK   rR   rL   rS   rM   rT   r/   c                 K   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          t          t          t          f         |          ddgg          }	d	|d
<   |                     dt          |t          j                   d{V |	t          ||||          t                      d{V S )rV   rW   rX   c              3  4   K   | ]}t          |          V  d S r7   rZ   r\   s     r;   r_   z%AsyncSkills.create.<locals>.<genexpr>  r`   r=   ra   rb   rH   rc   rd   rf   rg   rh   Nri   rj   )r   r   rn   r   r   r    r   r   r   r[   ro   rp   r!   r*   rq   r,   r/   rr   s
             r;   rt   zAsyncSkills.create]  sn     J	
$'#chhu5L5Le5L5L5LObNc/d/d&e&e&e" 	
 "	
 *+>X=CVTVX!. 
 
 (WS&[-A4(H(HRY[dQePfggg )>n%ZZ",T3F3XYYYYYYYY!(+Q[el   (   
 
 
 
 
 
 
 
 	
r=   ru   rv   r[   r1   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 )rx   ry   rW   rX   c              3  4   K   | ]}t          |          V  d S r7   rZ   r\   s     r;   r_   z'AsyncSkills.retrieve.<locals>.<genexpr>  r`   r=   ra   r{   r|   ri   r}   Nr~   r   s          r;   r   zAsyncSkills.retrieve  s     <  	ecW_ccddd	
$'#chhu5L5Le5L5L5LObNc/d/d&e&e&e" 	
 "	
 *+>X=CVTVXYY;hOOO(+Q[el   *  
 
 
 
 
 
 
 
 	
r=   r   r   r   r   r   EAsyncPaginator[SkillListResponse, AsyncPageCursor[SkillListResponse]]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   rW   rX   c              3  4   K   | ]}t          |          V  d S r7   rZ   r\   s     r;   r_   z#AsyncSkills.list.<locals>.<genexpr>  r`   r=   ra   rh   r   r   r   )r   r   rn   r   r   r   r(   r.   r,   r   r)   r   r   s	            r;   r   zAsyncSkills.list  s    X	
$'#chhu5L5Le5L5L5LObNc/d/d&e&e&e" 	
 "	
 *+>X=CVTVX!!" !23(+'%%!& $"( 
 &5    $# " 
 
 	
r=   r0   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   ry   rW   rX   c              3  4   K   | ]}t          |          V  d S r7   rZ   r\   s     r;   r_   z%AsyncSkills.delete.<locals>.<genexpr>C  r`   r=   ra   r{   r|   ri   r}   Nr   r   s          r;   r   zAsyncSkills.delete   s     <  	ecW_ccddd	
$'#chhu5L5Le5L5L5LObNc/d/d&e&e&e" 	
 "	
 *+>X=CVTVX\\;hOOO(+Q[el   ( " 
 
 
 
 
 
 
 
 	
r=   )r5   r   )r5   r   )r5   r   r   r   )r   r   r   rN   r   rN   rI   rP   rJ   rQ   rK   rR   rL   rS   rM   rT   r5   r   r   r   r   r=   r;   r3   r3   E  sT       + + + _+ 0 0 0 _0 6 6 6 _6 /3<@15 )-$("&;DC
 C
 C
 C
 C
 C
R 26 )-$("&;D1
 1
 1
 1
 1
 1
l !%)'+15 )-$("&;DI
 I
 I
 I
 I
 I
^ 26 )-$("&;D1
 1
 1
 1
 1
 1
 1
 1
r=   c                  .    e Zd Zd	dZed
d            ZdS )r>   skillsr2   r5   Nonec                   || _         t          j        |j                  | _        t          j        |j                  | _        t          j        |j                  | _        t          j        |j                  | _        d S r7   )_skillsr
   to_raw_response_wrapperrt   r   r   r   r:   r   s     r;   __init__zSkillsWithRawResponse.__init__U  sw    &>M
 
 )@O
 
 %<K
 
	 '>M
 
r=   r   c                4    t          | j        j                  S r7   )r   r   r<   r9   s    r;   r<   zSkillsWithRawResponse.versionse  s    &t|'<===r=   Nr   r2   r5   r   )r5   r   r   r   r   r   r"   r<   r   r=   r;   r>   r>   T  sH        
 
 
 
  > > > _> > >r=   r>   c                  .    e Zd Zd	dZed
d            ZdS )r   r   r3   r5   r   c                   || _         t          j        |j                  | _        t          j        |j                  | _        t          j        |j                  | _        t          j        |j                  | _        d S r7   )r   r
   async_to_raw_response_wrapperrt   r   r   r   r   s     r;   r   z#AsyncSkillsWithRawResponse.__init__k  sw    &DM
 
 )FO
 
 %BK
 
	 'DM
 
r=   r   c                4    t          | j        j                  S r7   )r   r   r<   r9   s    r;   r<   z#AsyncSkillsWithRawResponse.versions{  s    +DL,ABBBr=   Nr   r3   r5   r   )r5   r   r   r   r=   r;   r   r   j  sN        
 
 
 
  C C C _C C Cr=   r   c                  .    e Zd Zd	dZed
d            ZdS )rB   r   r2   r5   r   c                    || _         t          |j                  | _        t          |j                  | _        t          |j                  | _        t          |j                  | _        d S r7   )r   r%   rt   r   r   r   r   s     r;   r   z$SkillsWithStreamingResponse.__init__  sk    2M
 
 5O
 
 1K
 
	 3M
 
r=   r   c                4    t          | j        j                  S r7   )r   r   r<   r9   s    r;   r<   z$SkillsWithStreamingResponse.versions  s    ,T\-BCCCr=   Nr   )r5   r   r   r   r=   r;   rB   rB     sN        
 
 
 
  D D D _D D Dr=   rB   c                  .    e Zd Zd	dZed
d            ZdS )r   r   r3   r5   r   c                    || _         t          |j                  | _        t          |j                  | _        t          |j                  | _        t          |j                  | _        d S r7   )r   r&   rt   r   r   r   r   s     r;   r   z)AsyncSkillsWithStreamingResponse.__init__  sk    8M
 
 ;O
 
 7K
 
	 9M
 
r=   r   c                4    t          | j        j                  S r7   )r   r   r<   r9   s    r;   r<   z)AsyncSkillsWithStreamingResponse.versions  s    1$,2GHHHr=   Nr   )r5   r   r   r   r=   r;   r   r     sN        
 
 
 
  I I I _I I Ir=   r   )G
__future__r   typingr   r   r   r   	itertoolsr   httpx r
   r<   r   r   r   r   r   r   _typesr   r   r   r   r   r   r   r   r   _utilsr   r   r   r   r   r    r!   _compatr"   	_resourcer#   r$   	_responser%   r&   
paginationr'   r(   
types.betar)   r*   _base_clientr+   r,   types.anthropic_beta_paramr-   types.beta.skill_list_responser.    types.beta.skill_create_responser/    types.beta.skill_delete_responser0   "types.beta.skill_retrieve_responser1   __all__r2   r3   r>   r   rB   r   r   r=   r;   <module>r      s   # " " " " " 0 0 0 0 0 0 0 0 0 0 0 0        ! ! ! ! ! !               
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
                  ( ' ' ' ' ' ; ; ; ; ; ; ; ; Z Z Z Z Z Z Z Z : : : : : : : : A A A A A A A A A A A A A A A A = = = = = = @ @ @ @ @ @ D D D D D D D D D D D D H H H H H H]
#L
 L
 L
 L
 L
_ L
 L
 L
^L
 L
 L
 L
 L
" L
 L
 L
^> > > > > > > >,C C C C C C C C,D D D D D D D D,I I I I I I I I I Ir=   