o
    +ia                     @  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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-m.Z. ddl/m0Z0m1Z1 ddl2m3Z3m4Z4 ddl5m6Z6 ddl7m8Z8 ddl9m:Z: ddl;m<Z< ddl=m>Z> ddgZ?G dd de'Z@G dd de(ZAG dd dZBG dd dZCG dd dZDG d d! d!ZEd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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dZed0ddZed1d	d
Ze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 )6r0   returnr   c                 C  
   t | jS N)r   _clientself r9   c/var/www/html/psymed-ai/venv/lib/python3.10/site-packages/anthropic/resources/beta/skills/skills.pyversions6      
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=   r7   r9   r9   r:   with_raw_response:      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
        )rB   r7   r9   r9   r:   with_streaming_responseD      zSkills.with_streaming_responseN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          
   
   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}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:
          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                 s      | ]}t |V  qd S r5   str.0er9   r9   r:   	<genexpr>u       z Skills.create.<locals>.<genexpr>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   rZ   object_postr   r(   SkillCreateParamsr*   r-   
r8   rG   rH   rI   rJ   rK   rL   rM   rj   extracted_filesr9   r9   r:   createM   s8   %
 
zSkills.createrI   rJ   rK   rL   rM   skill_idrZ   r/   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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 rV   rW   c                 s  rX   r5   rY   r[   r9   r9   r:   r^      r_   z"Skills.retrieve.<locals>.<genexpr>r`   /v1/skills/
?beta=truerh   rk   rl   	
ValueErrorr   r   rm   r   r   _getr*   r/   r8   ru   rI   rJ   rK   rL   rM   r9   r9   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
        rV   rW   c                 s  rX   r5   rY   r[   r9   r9   r:   r^      r_   zSkills.list.<locals>.<genexpr>r`   rg   r   r   r   rJ   rK   rL   rM   queryr   rk   model)r   r   rm   r   r   _get_api_listr%   r,   r*   r   r'   SkillListParams	r8   r   r   r   rI   rJ   rK   rL   rM   r9   r9   r:   list   <   ,
zSkills.listr.   c                C  rv   )
  
        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
        rx   rV   rW   c                 s  rX   r5   rY   r[   r9   r9   r:   r^   3  r_   z Skills.delete.<locals>.<genexpr>r`   ry   rz   rh   r{   	r}   r   r   rm   r   r   _deleter*   r.   r   r9   r9   r:   delete  r   zSkills.delete)r3   r   )r3   r=   )r3   rB   rG   rN   rH   rO   rI   rP   rJ   rQ   rK   rR   rL   rS   rM   rT   r3   r-   ru   rZ   rI   rP   rJ   rQ   rK   rR   rL   rS   rM   rT   r3   r/   )r   r   r   rN   r   rN   rI   rP   rJ   rQ   rK   rR   rL   rS   rM   rT   r3   r   ru   rZ   rI   rP   rJ   rQ   rK   rR   rL   rS   rM   rT   r3   r.   __name__
__module____qualname__r    r;   r@   rD   r   r   rs   r   r   r   r9   r9   r9   r:   r0   5   H    	I6Oc                	   @  r2   )6r1   r3   r   c                 C  r4   r5   )r   r6   r7   r9   r9   r:   r;   E  r<   zAsyncSkills.versionsAsyncSkillsWithRawResponsec                 C  r>   r?   )r   r7   r9   r9   r:   r@   I  rA   zAsyncSkills.with_raw_response AsyncSkillsWithStreamingResponsec                 C  r>   rC   )r   r7   r9   r9   r:   rD   S  rE   z#AsyncSkills.with_streaming_responseNrF   rG   rN   rH   rO   rI   rP   rJ   rQ   rK   rR   rL   rS   rM   rT   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}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 )rU   rV   rW   c                 s  rX   r5   rY   r[   r9   r9   r:   r^     r_   z%AsyncSkills.create.<locals>.<genexpr>r`   ra   rH   rb   rc   re   rf   rg   Nrh   ri   )r   r   rm   r   r   r   r   r   r   rZ   rn   ro   r   r(   rp   r*   r-   rq   r9   r9   r:   rs   \  s:   %
 zAsyncSkills.creatert   ru   rZ   r/   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d| dt||||d	td
I dH S )rw   rx   rV   rW   c                 s  rX   r5   rY   r[   r9   r9   r:   r^     r_   z'AsyncSkills.retrieve.<locals>.<genexpr>r`   ry   rz   rh   r{   Nr|   r   r9   r9   r:   r     ,   

zAsyncSkills.retriever   r   r   r   r   EAsyncPaginator[SkillListResponse, AsyncPageCursor[SkillListResponse]]c          	      C  r   )
r   rV   rW   c                 s  rX   r5   rY   r[   r9   r9   r:   r^     r_   z#AsyncSkills.list.<locals>.<genexpr>r`   rg   r   r   r   )r   r   rm   r   r   r   r&   r,   r*   r   r'   r   r   r9   r9   r:   r     r   zAsyncSkills.listr.   c                  r   )r   rx   rV   rW   c                 s  rX   r5   rY   r[   r9   r9   r:   r^   B  r_   z%AsyncSkills.delete.<locals>.<genexpr>r`   ry   rz   rh   r{   Nr   r   r9   r9   r:   r     r   zAsyncSkills.delete)r3   r   )r3   r   )r3   r   r   r   )r   r   r   rN   r   rN   rI   rP   rJ   rQ   rK   rR   rL   rS   rM   rT   r3   r   r   r   r9   r9   r9   r:   r1   D  r   c                   @  $   e Zd ZdddZeddd	Zd
S )r=   skillsr0   r3   Nonec                 C  B   || _ t|j| _t|j| _t|j| _t|j| _d S r5   )_skillsr	   to_raw_response_wrapperrs   r   r   r   r8   r   r9   r9   r:   __init__T     
zSkillsWithRawResponse.__init__r   c                 C     t | jjS r5   )r   r   r;   r7   r9   r9   r:   r;   d     zSkillsWithRawResponse.versionsNr   r0   r3   r   )r3   r   r   r   r   r   r    r;   r9   r9   r9   r:   r=   S      
r=   c                   @  r   )r   r   r1   r3   r   c                 C  r   r5   )r   r	   async_to_raw_response_wrapperrs   r   r   r   r   r9   r9   r:   r   j  r   z#AsyncSkillsWithRawResponse.__init__r   c                 C  r   r5   )r   r   r;   r7   r9   r9   r:   r;   z  r   z#AsyncSkillsWithRawResponse.versionsNr   r1   r3   r   )r3   r   r   r9   r9   r9   r:   r   i  r   r   c                   @  r   )rB   r   r0   r3   r   c                 C  :   || _ t|j| _t|j| _t|j| _t|j| _d S r5   )r   r#   rs   r   r   r   r   r9   r9   r:   r        
z$SkillsWithStreamingResponse.__init__r   c                 C  r   r5   )r   r   r;   r7   r9   r9   r:   r;     r   z$SkillsWithStreamingResponse.versionsNr   )r3   r   r   r9   r9   r9   r:   rB     r   rB   c                   @  r   )r   r   r1   r3   r   c                 C  r   r5   )r   r$   rs   r   r   r   r   r9   r9   r:   r     r   z)AsyncSkillsWithStreamingResponse.__init__r   c                 C  r   r5   )r   r   r;   r7   r9   r9   r:   r;     r   z)AsyncSkillsWithStreamingResponse.versionsNr   )r3   r   r   r9   r9   r9   r:   r     r   r   )F
__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   _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_responser/   __all__r0   r1   r=   r   rB   r   r9   r9   r9   r:   <module>   s<    ,     