o
    ØRWj]  ã                   @  s¬  d dl mZ d dl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 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& ddl'm(Z( ddl)m*Z*m+Z+ ddl,m-Z-m.Z. ddl/m0Z0m1Z1 ddl2m3Z3 ddl4m5Z5m6Z6 ddl7m8Z8m9Z9m:Z:m;Z;m<Z<m=Z= ddl>m?Z? ddgZ@G dd„ de*ƒZAG dd„ de+ƒZBG dd„ dƒZCG dd„ dƒZDG dd„ dƒZEG dd „ d ƒZFdS )!é    )Úannotations)ÚUnionÚMappingÚcast)ÚLiteralNé   )Ú_legacy_response)Úskill_list_paramsÚskill_create_paramsÚskill_update_paramsé   )ÚContentÚAsyncContentÚContentWithRawResponseÚAsyncContentWithRawResponseÚContentWithStreamingResponseÚ!AsyncContentWithStreamingResponse)Údeepcopy_with_paths)	ÚBodyÚOmitÚQueryÚHeadersÚNotGivenÚ	FileTypesÚSequenceNotStrÚomitÚ	not_given)Úextract_filesÚpath_templateÚmaybe_transformÚasync_maybe_transform)Úcached_property)ÚSyncAPIResourceÚAsyncAPIResource)Úto_streamed_response_wrapperÚ"async_to_streamed_response_wrapper)ÚSyncCursorPageÚAsyncCursorPage)ÚSkill)ÚAsyncPaginatorÚmake_request_options)ÚVersionsÚAsyncVersionsÚVersionsWithRawResponseÚAsyncVersionsWithRawResponseÚVersionsWithStreamingResponseÚ"AsyncVersionsWithStreamingResponse)ÚDeletedSkillÚSkillsÚAsyncSkillsc                   @  óº   e Zd Zed2dd„ƒZed3dd„ƒZed4d	d
„ƒZed5dd„ƒZeddde	dœd6dd„Z
ddde	dœd7d d!„Zddde	dœd8d#d$„Zeeeddde	d%œd9d-d.„Zddde	dœd:d0d1„ZdS );r2   Úreturnr   c                 C  ó
   t | jƒS ©N)r   Ú_client©Úself© r;   úm/home/esfera/Documents/content_generation/venv/lib/python3.10/site-packages/openai/resources/skills/skills.pyÚcontent5   ó   
zSkills.contentr+   c                 C  r6   r7   )r+   r8   r9   r;   r;   r<   Úversions9   r>   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/openai/openai-python#accessing-raw-response-data-eg-headers
        )r@   r9   r;   r;   r<   Úwith_raw_response=   ó   zSkills.with_raw_responseÚSkillsWithStreamingResponsec                 C  rA   ©zÌ
        An alternative to `.with_raw_response` that doesn't eagerly read the response body.

        For more information, see https://www.github.com/openai/openai-python#with_streaming_response
        )rE   r9   r;   r;   r<   Úwith_streaming_responseG   ó   zSkills.with_streaming_responseN©ÚfilesÚextra_headersÚextra_queryÚ
extra_bodyÚtimeoutrJ   ú2Union[SequenceNotStr[FileTypes], FileTypes] | OmitrK   úHeaders | NonerL   úQuery | NonerM   úBody | NonerN   ú'float | httpx.Timeout | None | NotGivenr(   c                C  s~   t d|iddgdggƒ}tttttf |ƒddgdggd�}|r(ddi|p&i ¥}| jdt|tj	ƒ|t
||||ddid	�td
�S )á˜  
        Create a new skill.

        Args:
          files: Skill files to upload (directory upload) or a single zip file.

          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
        rJ   ú<array>©ÚpathsúContent-Typeúmultipart/form-dataú/skillsÚbearer_authT©rK   rL   rM   rN   Úsecurity©ÚbodyrJ   ÚoptionsÚcast_to)r   r   r   r   ÚstrÚobjectÚ_postr   r
   ÚSkillCreateParamsr*   r(   ©r:   rJ   rK   rL   rM   rN   r_   Úextracted_filesr;   r;   r<   ÚcreateP   s"   $
ûõzSkills.create©rK   rL   rM   rN   Úskill_idrb   c             	   C  ó<   |s	t d|›�ƒ‚| jtd|d�t||||ddid�td�S )áJ  
        Get a skill by its ID.

        Args:
          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 ú/skills/{skill_id}©rj   r[   Tr\   ©r`   ra   ©Ú
ValueErrorÚ_getr   r*   r(   ©r:   rj   rK   rL   rM   rN   r;   r;   r<   Úretrieve~   ó   
û÷zSkills.retrieveÚdefault_versionc             
   C  sJ   |s	t d|›�ƒ‚| jtd|d�td|itjƒt||||ddid�td�S )	á«  
        Update the default version pointer for a skill.

        Args:
          default_version: The skill version number to set as default.

          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
        rm   rn   ro   rw   r[   Tr\   ©r_   r`   ra   )rr   rd   r   r   r   ÚSkillUpdateParamsr*   r(   ©r:   rj   rw   rK   rL   rM   rN   r;   r;   r<   Úupdate£   s   
ûözSkills.update©ÚafterÚlimitÚorderrK   rL   rM   rN   r~   ú
str | Omitr   ú
int | Omitr€   úLiteral['asc', 'desc'] | OmitúSyncCursorPage[Skill]c                C  ó:   | j dtt t||||t|||dœtjƒddid�td�S ©a`  
        List all skills for the current project.

        Args:
          after: Identifier for the last item from the previous pagination request

          limit: Number of items to retrieve

          order: Sort order of results by timestamp. Use `asc` for ascending order or `desc` for
              descending order.

          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
        rZ   )r~   r   r€   r[   T)rK   rL   rM   rN   Úqueryr]   )Úpager`   Úmodel)Ú_get_api_listr&   r(   r*   r   r	   ÚSkillListParams©r:   r~   r   r€   rK   rL   rM   rN   r;   r;   r<   ÚlistÌ   ó&    ýúóîzSkills.listr1   c             	   C  rk   )áM  
        Delete a skill by its ID.

        Args:
          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
        rm   rn   ro   r[   Tr\   rp   ©rr   Ú_deleter   r*   r1   rt   r;   r;   r<   Údelete  rv   zSkills.delete)r5   r   )r5   r+   )r5   r@   )r5   rE   ©rJ   rO   rK   rP   rL   rQ   rM   rR   rN   rS   r5   r(   ©rj   rb   rK   rP   rL   rQ   rM   rR   rN   rS   r5   r(   ©rj   rb   rw   rb   rK   rP   rL   rQ   rM   rR   rN   rS   r5   r(   )r~   r�   r   r‚   r€   rƒ   rK   rP   rL   rQ   rM   rR   rN   rS   r5   r„   ©rj   rb   rK   rP   rL   rQ   rM   rR   rN   rS   r5   r1   ©Ú__name__Ú
__module__Ú__qualname__r!   r=   r?   rC   rG   r   r   rh   ru   r|   r�   r’   r;   r;   r;   r<   r2   4   sL    	÷4÷,ö,õ;÷c                   @  r4   );r3   r5   r   c                 C  r6   r7   )r   r8   r9   r;   r;   r<   r=   (  r>   zAsyncSkills.contentr,   c                 C  r6   r7   )r,   r8   r9   r;   r;   r<   r?   ,  r>   zAsyncSkills.versionsÚAsyncSkillsWithRawResponsec                 C  rA   rB   )r›   r9   r;   r;   r<   rC   0  rD   zAsyncSkills.with_raw_responseÚ AsyncSkillsWithStreamingResponsec                 C  rA   rF   )rœ   r9   r;   r;   r<   rG   :  rH   z#AsyncSkills.with_streaming_responseNrI   rJ   rO   rK   rP   rL   rQ   rM   rR   rN   rS   r(   c                Ã  sŒ   �t d|iddgdggƒ}tttttf |ƒddgdggd�}|r)ddi|p'i ¥}| jdt|tj	ƒI dH |t
||||dd	id
�td�I dH S )rT   rJ   rU   rV   rX   rY   rZ   Nr[   Tr\   r^   )r   r   r   r   rb   rc   rd   r    r
   re   r*   r(   rf   r;   r;   r<   rh   C  s$   €$ûõzAsyncSkills.createri   rj   rb   c             	   Ã  óD   �|s
t d|›�ƒ‚| jtd|d�t||||ddid�td�I dH S )	rl   rm   rn   ro   r[   Tr\   rp   Nrq   rt   r;   r;   r<   ru   q  ó   €
û÷zAsyncSkills.retrieverw   c             
   Ã  sX   �|s
t d|›�ƒ‚| jtd|d�td|itjƒI dH t||||ddid�td	�I dH S )
rx   rm   rn   ro   rw   Nr[   Tr\   ry   )rr   rd   r   r    r   rz   r*   r(   r{   r;   r;   r<   r|   –  s"   €

ÿûôzAsyncSkills.updater}   r~   r�   r   r‚   r€   rƒ   ú-AsyncPaginator[Skill, AsyncCursorPage[Skill]]c                C  r…   r†   )rŠ   r'   r(   r*   r   r	   r‹   rŒ   r;   r;   r<   r�   Á  rŽ   zAsyncSkills.listr1   c             	   Ã  r�   )	r�   rm   rn   ro   r[   Tr\   rp   Nr�   rt   r;   r;   r<   r’   ö  rž   zAsyncSkills.delete)r5   r   )r5   r,   )r5   r›   )r5   rœ   r“   r”   r•   )r~   r�   r   r‚   r€   rƒ   rK   rP   rL   rQ   rM   rR   rN   rS   r5   rŸ   r–   r—   r;   r;   r;   r<   r3   '  sL    	÷4÷,ö.õ;÷c                   @  ó2   e Zd Zddd„Zeddd	„ƒZeddd„ƒZdS )r@   Úskillsr2   r5   ÚNonec                 C  óP   || _ t |j¡| _t |j¡| _t |j¡| _t |j¡| _t |j¡| _d S r7   )Ú_skillsr   Úto_raw_response_wrapperrh   ru   r|   r�   r’   ©r:   r¡   r;   r;   r<   Ú__init__  ó    ÿÿÿÿ
ÿzSkillsWithRawResponse.__init__r   c                 C  ó   t | jjƒS r7   )r   r¤   r=   r9   r;   r;   r<   r=   0  ó   zSkillsWithRawResponse.contentr-   c                 C  r©   r7   )r-   r¤   r?   r9   r;   r;   r<   r?   4  rª   zSkillsWithRawResponse.versionsN©r¡   r2   r5   r¢   )r5   r   )r5   r-   ©r˜   r™   rš   r§   r!   r=   r?   r;   r;   r;   r<   r@     ó    
r@   c                   @  r    )r›   r¡   r3   r5   r¢   c                 C  r£   r7   )r¤   r   Úasync_to_raw_response_wrapperrh   ru   r|   r�   r’   r¦   r;   r;   r<   r§   :  r¨   z#AsyncSkillsWithRawResponse.__init__r   c                 C  r©   r7   )r   r¤   r=   r9   r;   r;   r<   r=   M  rª   z"AsyncSkillsWithRawResponse.contentr.   c                 C  r©   r7   )r.   r¤   r?   r9   r;   r;   r<   r?   Q  rª   z#AsyncSkillsWithRawResponse.versionsN©r¡   r3   r5   r¢   )r5   r   )r5   r.   r¬   r;   r;   r;   r<   r›   9  r­   r›   c                   @  r    )rE   r¡   r2   r5   r¢   c                 C  óF   || _ t|jƒ| _t|jƒ| _t|jƒ| _t|jƒ| _t|jƒ| _d S r7   )r¤   r$   rh   ru   r|   r�   r’   r¦   r;   r;   r<   r§   W  ó    ÿÿÿÿ
ÿz$SkillsWithStreamingResponse.__init__r   c                 C  r©   r7   )r   r¤   r=   r9   r;   r;   r<   r=   j  rª   z#SkillsWithStreamingResponse.contentr/   c                 C  r©   r7   )r/   r¤   r?   r9   r;   r;   r<   r?   n  rª   z$SkillsWithStreamingResponse.versionsNr«   )r5   r   )r5   r/   r¬   r;   r;   r;   r<   rE   V  r­   rE   c                   @  r    )rœ   r¡   r3   r5   r¢   c                 C  r°   r7   )r¤   r%   rh   ru   r|   r�   r’   r¦   r;   r;   r<   r§   t  r±   z)AsyncSkillsWithStreamingResponse.__init__r   c                 C  r©   r7   )r   r¤   r=   r9   r;   r;   r<   r=   ‡  rª   z(AsyncSkillsWithStreamingResponse.contentr0   c                 C  r©   r7   )r0   r¤   r?   r9   r;   r;   r<   r?   ‹  rª   z)AsyncSkillsWithStreamingResponse.versionsNr¯   )r5   r   )r5   r0   r¬   r;   r;   r;   r<   rœ   s  r­   rœ   )GÚ
__future__r   Útypingr   r   r   Útyping_extensionsr   ÚhttpxÚ r   Útypesr	   r
   r   r=   r   r   r   r   r   r   Ú_filesr   Ú_typesr   r   r   r   r   r   r   r   r   Ú_utilsr   r   r   r    Ú_compatr!   Ú	_resourcer"   r#   Ú	_responser$   r%   Ú
paginationr&   r'   Útypes.skillr(   Ú_base_clientr)   r*   Úversions.versionsr+   r,   r-   r.   r/   r0   Útypes.deleted_skillr1   Ú__all__r2   r3   r@   r›   rE   rœ   r;   r;   r;   r<   Ú<module>   s6    ,  t v