o
    î6Wj{b  ã                   @  s¸  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 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% ddl&m'Z' ddl(m)Z)m*Z* ddl+m,Z,m-Z- ddl.m/Z/m0Z0 ddl1m2Z2m3Z3 ddl4m5Z5m6Z6 ddl7m8Z8 ddl9m:Z: ddl;m<Z< ddl=m>Z> ddl?m@Z@ ddgZAG dd„ de)ƒZBG dd„ de*ƒZCG dd„ dƒZDG dd„ dƒZEG dd „ d ƒZFG d!d"„ d"ƒZGdS )#é    )Úannotations)ÚListÚMappingÚOptionalÚcast)ÚchainNé   )Ú_legacy_responseé   )ÚVersionsÚAsyncVersionsÚVersionsWithRawResponseÚAsyncVersionsWithRawResponseÚVersionsWithStreamingResponseÚ"AsyncVersionsWithStreamingResponse)Údeepcopy_with_paths)	ÚBodyÚOmitÚQueryÚHeadersÚNotGivenÚ	FileTypesÚSequenceNotStrÚomitÚ	not_given)Úis_givenÚextract_filesÚ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)Úskill_list_paramsÚskill_create_params)ÚAsyncPaginatorÚmake_request_options)ÚAnthropicBetaParam)ÚSkillListResponse)ÚSkillCreateResponse)ÚSkillDeleteResponse)ÚSkillRetrieveResponseÚSkillsÚAsyncSkillsc                	   @  óž   e Zd Zed/dd„ƒZed0dd„ƒZed1d	d
„ƒZeedddedœd2dd„Z	edddedœd3d"d#„Z
eeeeddded$œd4d*d+„Zedddedœd5d-d.„ZdS )6r1   Úreturnr   c                 C  ó
   t | jƒS ©N)r   Ú_client©Úself© r:   úu/home/esfera/Documents/content_generation/venv/lib/python3.10/site-packages/anthropic/resources/beta/skills/skills.pyÚversions0   ó   
zSkills.versionsÚSkillsWithRawResponsec                 C  ó   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   r:   r:   r;   Úwith_raw_response4   ó   zSkills.with_raw_responseÚSkillsWithStreamingResponsec                 C  r?   ©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
        )rC   r8   r:   r:   r;   Úwith_streaming_response>   ó   zSkills.with_streaming_responseN©Údisplay_titleÚbetasÚextra_headersÚextra_queryÚ
extra_bodyÚtimeoutÚfilesúSequenceNotStr[FileTypes]rH   úOptional[str] | OmitrI   úList[AnthropicBetaParam] | OmitrJ   úHeaders | NonerK   úQuery | NonerL   úBody | NonerM   ú'float | httpx.Timeout | None | NotGivenr.   c          
   
   C  s²   i t dt|ƒrd tdd„ |D ƒdgƒ¡ntiƒ¥|pi ¥}ddi|p$i ¥}t||dœddggƒ}tttt	t
f |ƒddggd	�}	d
|d< | jdt|tjƒ|	t||||d�td�S )áû  
        Create Skill

        Args:
          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.

          display_title: Display title for the skill.

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

          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                 s  ó   � | ]}t |ƒV  qd S r6   ©Ústr©Ú.0Úer:   r:   r;   Ú	<genexpr>o   ó   € z Skills.create.<locals>.<genexpr>úskills-2025-10-02©rN   rH   rN   ú<array>©Úpathsúmultipart/form-dataúContent-Typeú/v1/skills?beta=true©rJ   rK   rL   rM   ©ÚbodyrN   ÚoptionsÚcast_to)r   r   Újoinr   r   r   r   r   r   r[   ÚobjectÚ_postr   r)   ÚSkillCreateParamsr+   r.   ©
r9   rN   rH   rI   rJ   rK   rL   rM   rk   Úextracted_filesr:   r:   r;   ÚcreateG   s:   %ÿýÿÿø
þû 
ÿùzSkills.create©rI   rJ   rK   rL   rM   Úskill_idr[   r0   c                C  ó‚   |s	t d|›�ƒ‚i tdt|ƒrd tdd„ |D ƒdgƒ¡ntiƒ¥|p%i ¥}ddi|p-i ¥}| jtd|d�t||||d	�t	d
�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                 s  rY   r6   rZ   r\   r:   r:   r;   r_   °   r`   z"Skills.retrieve.<locals>.<genexpr>ra   ú/v1/skills/{skill_id}?beta=true©rv   ri   ©rl   rm   ©
Ú
ValueErrorr   r   rn   r   r   Ú_getr   r+   r0   ©r9   rv   rI   rJ   rK   rL   rM   r:   r:   r;   Úretrieve�   ó*   ÿýÿÿø

ÿûzSkills.retrieve©ÚlimitÚpageÚsourcerI   rJ   rK   rL   rM   r„   ú
int | Omitr…   r†   ú!SyncPageCursor[SkillListResponse]c          	      C  ó€   i t dt|ƒrd tdd„ |D ƒdgƒ¡ntiƒ¥|pi ¥}ddi|p$i ¥}| jdtt t||||t	|||dœt
jƒd�td	�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                 s  rY   r6   rZ   r\   r:   r:   r;   r_   ï   r`   zSkills.list.<locals>.<genexpr>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©	r9   r„   r…   r†   rI   rJ   rK   rL   rM   r:   r:   r;   ÚlistÀ   ó<   ,ÿýÿÿø
ýúûïzSkills.listr/   c                C  rw   )á
  
        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                 s  rY   r6   rZ   r\   r:   r:   r;   r_   .  r`   z Skills.delete.<locals>.<genexpr>ra   rz   r{   ri   r|   ©
r~   r   r   rn   r   r   Ú_deleter   r+   r/   r€   r:   r:   r;   Údelete  r‚   zSkills.delete)r4   r   )r4   r>   )r4   rC   ©rN   rO   rH   rP   rI   rQ   rJ   rR   rK   rS   rL   rT   rM   rU   r4   r.   ©rv   r[   rI   rQ   rJ   rR   rK   rS   rL   rT   rM   rU   r4   r0   )r„   r‡   r…   rP   r†   rP   rI   rQ   rJ   rR   rK   rS   rL   rT   rM   rU   r4   rˆ   ©rv   r[   rI   rQ   rJ   rR   rK   rS   rL   rT   rM   rU   r4   r/   ©Ú__name__Ú
__module__Ú__qualname__r!   r<   rA   rE   r   r   rt   r�   r“   r˜   r:   r:   r:   r;   r1   /   óF    	õJö6ôOöc                	   @  r3   )6r2   r4   r   c                 C  r5   r6   )r   r7   r8   r:   r:   r;   r<   @  r=   zAsyncSkills.versionsÚAsyncSkillsWithRawResponsec                 C  r?   r@   )r¡   r8   r:   r:   r;   rA   D  rB   zAsyncSkills.with_raw_responseÚ AsyncSkillsWithStreamingResponsec                 C  r?   rD   )r¢   r8   r:   r:   r;   rE   N  rF   z#AsyncSkills.with_streaming_responseNrG   rN   rO   rH   rP   rI   rQ   rJ   rR   rK   rS   rL   rT   rM   rU   r.   c          
   
   Ã  sÀ   �i t dt|ƒrd tdd„ |D ƒdgƒ¡ntiƒ¥|pi ¥}ddi|p%i ¥}t||dœddggƒ}tttt	t
f |ƒddggd	�}	d
|d< | jdt|tjƒI dH |	t||||d�td�I dH S )rV   rW   rX   c                 s  rY   r6   rZ   r\   r:   r:   r;   r_     r`   z%AsyncSkills.create.<locals>.<genexpr>ra   rb   rN   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   r:   r:   r;   rt   W  s<   €%ÿýÿÿø
þû ÿùzAsyncSkills.createru   rv   r[   r0   c                Ã  óŠ   �|s
t d|›�ƒ‚i tdt|ƒrd tdd„ |D ƒdgƒ¡ntiƒ¥|p&i ¥}ddi|p.i ¥}| jtd|d�t||||d	�t	d
�I dH S )rx   ry   rW   rX   c                 s  rY   r6   rZ   r\   r:   r:   r;   r_   À  r`   z'AsyncSkills.retrieve.<locals>.<genexpr>ra   rz   r{   ri   r|   Nr}   r€   r:   r:   r;   r�   �  ó,   €ÿýÿÿø

ÿûzAsyncSkills.retrieverƒ   r„   r‡   r…   r†   úEAsyncPaginator[SkillListResponse, AsyncPageCursor[SkillListResponse]]c          	      C  r‰   )
rŠ   rW   rX   c                 s  rY   r6   rZ   r\   r:   r:   r;   r_   ÿ  r`   z#AsyncSkills.list.<locals>.<genexpr>ra   rh   r‹   rŒ   rŽ   )r   r   rn   r   r   r�   r'   r-   r+   r   r(   r‘   r’   r:   r:   r;   r“   Ð  r”   zAsyncSkills.listr/   c                Ã  r£   )r•   ry   rW   rX   c                 s  rY   r6   rZ   r\   r:   r:   r;   r_   >  r`   z%AsyncSkills.delete.<locals>.<genexpr>ra   rz   r{   ri   r|   Nr–   r€   r:   r:   r;   r˜     r¤   zAsyncSkills.delete)r4   r   )r4   r¡   )r4   r¢   r™   rš   )r„   r‡   r…   rP   r†   rP   rI   rQ   rJ   rR   rK   rS   rL   rT   rM   rU   r4   r¥   r›   rœ   r:   r:   r:   r;   r2   ?  r    c                   @  ó$   e Zd Zddd„Zeddd	„ƒZd
S )r>   Úskillsr1   r4   ÚNonec                 C  óB   || _ t |j¡| _t |j¡| _t |j¡| _t |j¡| _d S r6   )Ú_skillsr	   Úto_raw_response_wrapperrt   r�   r“   r˜   ©r9   r§   r:   r:   r;   Ú__init__P  ó   ÿÿÿ
ÿzSkillsWithRawResponse.__init__r   c                 C  ó   t | jjƒS r6   )r   rª   r<   r8   r:   r:   r;   r<   `  ó   zSkillsWithRawResponse.versionsN©r§   r1   r4   r¨   )r4   r   ©r�   rž   rŸ   r­   r!   r<   r:   r:   r:   r;   r>   O  ó    
r>   c                   @  r¦   )r¡   r§   r2   r4   r¨   c                 C  r©   r6   )rª   r	   Úasync_to_raw_response_wrapperrt   r�   r“   r˜   r¬   r:   r:   r;   r­   f  r®   z#AsyncSkillsWithRawResponse.__init__r   c                 C  r¯   r6   )r   rª   r<   r8   r:   r:   r;   r<   v  r°   z#AsyncSkillsWithRawResponse.versionsN©r§   r2   r4   r¨   )r4   r   r²   r:   r:   r:   r;   r¡   e  r³   r¡   c                   @  r¦   )rC   r§   r1   r4   r¨   c                 C  ó:   || _ t|jƒ| _t|jƒ| _t|jƒ| _t|jƒ| _d S r6   )rª   r$   rt   r�   r“   r˜   r¬   r:   r:   r;   r­   |  ó   ÿÿÿ
ÿz$SkillsWithStreamingResponse.__init__r   c                 C  r¯   r6   )r   rª   r<   r8   r:   r:   r;   r<   Œ  r°   z$SkillsWithStreamingResponse.versionsNr±   )r4   r   r²   r:   r:   r:   r;   rC   {  r³   rC   c                   @  r¦   )r¢   r§   r2   r4   r¨   c                 C  r¶   r6   )rª   r%   rt   r�   r“   r˜   r¬   r:   r:   r;   r­   ’  r·   z)AsyncSkillsWithStreamingResponse.__init__r   c                 C  r¯   r6   )r   rª   r<   r8   r:   r:   r;   r<   ¢  r°   z)AsyncSkillsWithStreamingResponse.versionsNrµ   )r4   r   r²   r:   r:   r:   r;   r¢   ‘  r³   r¢   )HÚ
__future__r   Útypingr   r   r   r   Ú	itertoolsr   ÚhttpxÚ r	   r<   r   r   r   r   r   r   Ú_filesr   Ú_typesr   r   r   r   r   r   r   r   r   Ú_utilsr   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_responser/   Ú"types.beta.skill_retrieve_responser0   Ú__all__r1   r2   r>   r¡   rC   r¢   r:   r:   r:   r;   Ú<module>   s>    ,     