o
    ØRWj¨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   úx/home/esfera/Documents/content_generation/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 | httpx.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^   Ú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   ri   rZ   Tr[   ©r_   r`   ©ra   Ú_getr   r&   r)   ©r3   ri   rH   rD   rE   rF   rG   r4   r4   r5   Úretrieve~   ó   û÷zVersions.retrieve©ÚafterÚlimitÚorderrD   rE   rF   rG   rv   ú
str | Omitrw   ú
int | Omitrx   ú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   )rv   rw   rx   rZ   T)rD   rE   rF   rG   Úqueryr\   )Úpager_   Úmodel)	ra   Ú_get_api_listr   r#   r)   r&   r   r'   ÚVersionListParams©	r3   rH   rv   rw   rx   rD   rE   rF   rG   r4   r4   r5   Úlist¨   ó*    
ýúóîzVersions.listr*   c             	   C  rj   )	á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   rl   rm   rn   rZ   Tr[   ro   ©ra   Ú_deleter   r&   r*   rr   r4   r4   r5   Údeleteß   rt   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)   ©ri   rI   rH   rI   rD   rL   rE   rM   rF   rN   rG   rO   r.   r)   )rH   rI   rv   ry   rw   rz   rx   r{   rD   rL   rE   rM   rF   rN   rG   rO   r.   r|   ©ri   rI   rH   rI   rD   rL   rE   rM   rF   rN   rG   rO   r.   r*   ©Ú__name__Ú
__module__Ú__qualname__r   r6   r;   r?   r   r   rg   rs   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   rg   "  s2   €þû$
ûõzAsyncVersions.createrh   ri   c             	   Ã  óX   �|s
t d|›�ƒ‚|st d|›�ƒ‚| jtd||d�t||||ddid�td�I d	H S )
rk   rQ   rl   rm   rn   rZ   Tr[   ro   Nrp   rr   r4   r4   r5   rs   \  ó    €û÷zAsyncVersions.retrieveru   rv   ry   rw   rz   rx   r{   ú;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   rl   rm   rn   rZ   Tr[   ro   Nrˆ   rr   r4   r4   r5   rŠ   ½  r–   zAsyncVersions.delete)r.   r   )r.   r“   )r.   r”   r‹   rŒ   )rH   rI   rv   ry   rw   rz   rx   r{   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   Úto_raw_response_wrapperrg   rs   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   Úasync_to_raw_response_wrapperrg   rs   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!   rg   rs   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"   rg   rs   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   Útyping_extensionsr   ÚhttpxÚ r   r6   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$   Ú_base_clientr%   r&   Útypes.skillsr'   r(   Útypes.skills.skill_versionr)   Ú"types.skills.deleted_skill_versionr*   Ú__all__r+   r,   r8   r“   r=   r”   r4   r4   r4   r5   Ú<module>   s4    , _ _