o
    ¨Ýj°S  ã                   @  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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+m,Z,m-Z- ddl.m/Z/m0Z0 ddl1m2Z2m3Z3 ddl4m5Z5 ddl6m7Z7 ddgZ8G dd„ de&ƒZ9G dd„ de'ƒZ:G dd„ dƒZ;G dd„ dƒZ<G dd„ dƒZ=G dd„ dƒZ>dS ) é    )Úannotations)ÚUnionÚMappingÚcast)ÚLiteralNé   )Ú_legacy_responseé   )Ú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)ÚAsyncPaginatorÚmake_request_options)Úversion_list_paramsÚversion_create_params)ÚSkillVersion)ÚDeletedSkillVersionÚVersionsÚAsyncVersionsc                   @  ó˜   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	dddedœd3d d!„Z
eeeddded"œd4d*d+„Zdddedœd5d-d.„ZdS )6r+   Úreturnr
   c                 C  ó
   t | jƒS ©N)r
   Ú_client©Úself© r4   úd/var/www/html/chatgpt/venv/lib/python3.10/site-packages/openai/resources/skills/versions/versions.pyÚcontent-   ó   
zVersions.contentÚVersionsWithRawResponsec                 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
        )r8   r2   r4   r4   r5   Úwith_raw_response1   ó   zVersions.with_raw_responseÚVersionsWithStreamingResponsec                 C  r9   ©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
        )r=   r2   r4   r4   r5   Úwith_streaming_response;   ó   z Versions.with_streaming_responseN©ÚdefaultÚfilesÚextra_headersÚextra_queryÚ
extra_bodyÚtimeoutÚskill_idÚstrrB   úbool | OmitrC   ú2Union[SequenceNotStr[FileTypes], FileTypes] | OmitrD   úHeaders | NonerE   úQuery | NonerF   úBody | NonerG   ú(float | httpx2.Timeout | None | NotGivenr)   c          
      C  sš   |s	t d|›�ƒ‚t||dœddgdggƒ}tttttf |ƒddgdggd�}	|	r2ddi|p0i ¥}| jtd|d	�t	|t
jƒ|	t||||d
did�td�S )áê  
        Create a new immutable skill version.

        Args:
          default: Whether to set this version as the default.

          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
        ú7Expected a non-empty value for `skill_id` but received ©rB   rC   rC   ú<array>©ÚpathsúContent-Typeúmultipart/form-dataú/skills/{skill_id}/versions©rH   Úbearer_authT©rD   rE   rF   rG   Úsecurity©ÚbodyrC   ÚoptionsÚcast_to)Ú
ValueErrorr   r   r   r   rI   ÚobjectÚ_postr   r   r(   ÚVersionCreateParamsr&   r)   ©
r3   rH   rB   rC   rD   rE   rF   rG   r^   Zextracted_filesr4   r4   r5   ÚcreateD   s0   þû$

ûõzVersions.create©rD   rE   rF   rG   Úversionc             	   C  óP   |s	t d|›�ƒ‚|st d|›�ƒ‚| jtd||d�t||||ddid�td�S )	á…  
        Get a specific skill version.

        Args:
          version: The version number to retrieve.

          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
        rQ   ú6Expected a non-empty value for `version` but received ú%/skills/{skill_id}/versions/{version}©rH   rh   rZ   Tr[   ©r_   r`   ©ra   Ú_getr   r&   r)   ©r3   rh   rH   rD   rE   rF   rG   r4   r4   r5   Úretrieve~   ó   û÷zVersions.retrieve©ÚafterÚlimitÚorderrD   rE   rF   rG   ru   ú
str | Omitrv   ú
int | Omitrw   úLiteral['asc', 'desc'] | OmitúSyncCursorPage[SkillVersion]c          	      C  óT   |s	t d|›�ƒ‚| jtd|d�tt t||||t|||dœtjƒddid�td�S ©	aø  
        List skill versions for a skill.

        Args:
          after: The skill version ID to start after.

          limit: Number of versions to retrieve.

          order: Sort order of results by version number.

          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
        rQ   rX   rY   )ru   rv   rw   rZ   T)rD   rE   rF   rG   Úqueryr\   )Úpager_   Úmodel)	ra   Ú_get_api_listr   r#   r)   r&   r   r'   ÚVersionListParams©	r3   rH   ru   rv   rw   rD   rE   rF   rG   r4   r4   r5   Úlist¨   ó*    
ýúóîzVersions.listr*   c             	   C  ri   )	áy  
        Delete a skill version.

        Args:
          version: The skill version number.

          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
        rQ   rk   rl   rm   rZ   Tr[   rn   ©ra   Ú_deleter   r&   r*   rq   r4   r4   r5   Údeleteß   rs   zVersions.delete)r.   r
   )r.   r8   )r.   r=   ©rH   rI   rB   rJ   rC   rK   rD   rL   rE   rM   rF   rN   rG   rO   r.   r)   ©rh   rI   rH   rI   rD   rL   rE   rM   rF   rN   rG   rO   r.   r)   )rH   rI   ru   rx   rv   ry   rw   rz   rD   rL   rE   rM   rF   rN   rG   rO   r.   r{   ©rh   rI   rH   rI   rD   rL   rE   rM   rF   rN   rG   rO   r.   r*   ©Ú__name__Ú
__module__Ú__qualname__r   r6   r;   r?   r   r   rf   rr   r„   r‰   r4   r4   r4   r5   r+   ,   ó@    	õAö.ô>öc                   @  r-   )6r,   r.   r   c                 C  r/   r0   )r   r1   r2   r4   r4   r5   r6     r7   zAsyncVersions.contentÚAsyncVersionsWithRawResponsec                 C  r9   r:   )r’   r2   r4   r4   r5   r;     r<   zAsyncVersions.with_raw_responseÚ"AsyncVersionsWithStreamingResponsec                 C  r9   r>   )r“   r2   r4   r4   r5   r?     r@   z%AsyncVersions.with_streaming_responseNrA   rH   rI   rB   rJ   rC   rK   rD   rL   rE   rM   rF   rN   rG   rO   r)   c          
      Ã  s¨   �|s
t d|›�ƒ‚t||dœddgdggƒ}tttttf |ƒddgdggd�}	|	r3ddi|p1i ¥}| jtd|d	�t	|t
jƒI d
H |	t||||ddid�td�I d
H S )rP   rQ   rR   rC   rS   rT   rV   rW   rX   rY   NrZ   Tr[   r]   )ra   r   r   r   r   rI   rb   rc   r   r   r(   rd   r&   r)   re   r4   r4   r5   rf   "  s2   €þû$
ûõzAsyncVersions.createrg   rh   c             	   Ã  óX   �|s
t d|›�ƒ‚|st d|›�ƒ‚| jtd||d�t||||ddid�td�I d	H S )
rj   rQ   rk   rl   rm   rZ   Tr[   rn   Nro   rq   r4   r4   r5   rr   \  ó    €û÷zAsyncVersions.retrievert   ru   rx   rv   ry   rw   rz   ú;AsyncPaginator[SkillVersion, AsyncCursorPage[SkillVersion]]c          	      C  r|   r}   )	ra   r�   r   r$   r)   r&   r   r'   r‚   rƒ   r4   r4   r5   r„   †  r…   zAsyncVersions.listr*   c             	   Ã  r”   )
r†   rQ   rk   rl   rm   rZ   Tr[   rn   Nr‡   rq   r4   r4   r5   r‰   ½  r•   zAsyncVersions.delete)r.   r   )r.   r’   )r.   r“   rŠ   r‹   )rH   rI   ru   rx   rv   ry   rw   rz   rD   rL   rE   rM   rF   rN   rG   rO   r.   r–   rŒ   r�   r4   r4   r4   r5   r,   
  r‘   c                   @  ó$   e Zd Zddd„Zeddd	„ƒZd
S )r8   Úversionsr+   r.   ÚNonec                 C  óB   || _ t |j¡| _t |j¡| _t |j¡| _t |j¡| _d S r0   )Ú	_versionsr   Zto_raw_response_wrapperrf   rr   r„   r‰   ©r3   r˜   r4   r4   r5   Ú__init__é  ó   ÿÿÿ
ÿz VersionsWithRawResponse.__init__r   c                 C  ó   t | jjƒS r0   )r   r›   r6   r2   r4   r4   r5   r6   ù  ó   zVersionsWithRawResponse.contentN©r˜   r+   r.   r™   )r.   r   ©rŽ   r�   r�   r�   r   r6   r4   r4   r4   r5   r8   è  ó    
r8   c                   @  r—   )r’   r˜   r,   r.   r™   c                 C  rš   r0   )r›   r   Zasync_to_raw_response_wrapperrf   rr   r„   r‰   rœ   r4   r4   r5   r�   ÿ  rž   z%AsyncVersionsWithRawResponse.__init__r   c                 C  rŸ   r0   )r   r›   r6   r2   r4   r4   r5   r6     r    z$AsyncVersionsWithRawResponse.contentN©r˜   r,   r.   r™   )r.   r   r¢   r4   r4   r4   r5   r’   þ  r£   r’   c                   @  r—   )r=   r˜   r+   r.   r™   c                 C  ó:   || _ t|jƒ| _t|jƒ| _t|jƒ| _t|jƒ| _d S r0   )r›   r!   rf   rr   r„   r‰   rœ   r4   r4   r5   r�     ó   ÿÿÿ
ÿz&VersionsWithStreamingResponse.__init__r   c                 C  rŸ   r0   )r   r›   r6   r2   r4   r4   r5   r6   %  r    z%VersionsWithStreamingResponse.contentNr¡   )r.   r   r¢   r4   r4   r4   r5   r=     r£   r=   c                   @  r—   )r“   r˜   r,   r.   r™   c                 C  r¥   r0   )r›   r"   rf   rr   r„   r‰   rœ   r4   r4   r5   r�   +  r¦   z+AsyncVersionsWithStreamingResponse.__init__r   c                 C  rŸ   r0   )r   r›   r6   r2   r4   r4   r5   r6   ;  r    z*AsyncVersionsWithStreamingResponse.contentNr¤   )r.   r   r¢   r4   r4   r4   r5   r“   *  r£   r“   )?Ú
__future__r   Útypingr   r   r   Ztyping_extensionsr   Zhttpx2Ú r   r6   r
   r   r   r   r   r   Ú_filesr   Ú_typesr   r   r   r   r   r   r   r   r   Z_utilsr   r   r   r   Z_compatr   Z	_resourcer   r    Ú	_responser!   r"   Z
paginationr#   r$   Z_base_clientr%   r&   Ztypes.skillsr'   r(   Ztypes.skills.skill_versionr)   Z"types.skills.deleted_skill_versionr*   Ú__all__r+   r,   r8   r’   r=   r“   r4   r4   r4   r5   Ú<module>   s4    , _ _