o
    iP                     @  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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! 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.m/Z/ ddl0m1Z1m2Z2 ddl3m4Z4 ddl5m6Z6 ddgZ7G dd de%Z8G dd de&Z9G 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)	BodyOmitQueryHeadersNotGiven	FileTypesSequenceNotStromit	not_given)extract_filespath_templatemaybe_transformdeepcopy_minimal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   c/home/kim/smarthome/.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_response0      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}tttttf |ddgdggd}	|	r,ddi|p*i }| jtd|d	t	|t
j|	t||||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   rD   rE   rF   rG   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   createC   s&   $

zVersions.createrZ   versionc                C  J   |s	t d||st d|| jtd||dt||||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   re   rZ   r]   r^   r_   _getr   r&   r)   r3   re   rH   rD   rE   rF   rG   r4   r4   r5   retrievex      zVersions.retrieveafterlimitorderrD   rE   rF   rG   rr   
str | Omitrs   
int | Omitrt   Literal['asc', 'desc'] | OmitSyncCursorPage[SkillVersion]c          	      C  N   |s	t d|| jtd|dtt t||||t|||dtj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   )rr   rs   rt   )rD   rE   rF   rG   query)pager]   model)	r_   _get_api_listr   r#   r)   r&   r   r'   VersionListParams	r3   rH   rr   rs   rt   rD   rE   rF   rG   r4   r4   r5   list   (    
zVersions.listr*   c                C  rf   )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   rh   ri   rj   rZ   rk   r_   _deleter   r&   r*   rn   r4   r4   r5   delete   rp   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)   re   rI   rH   rI   rD   rL   rE   rM   rF   rN   rG   rO   r.   r)   )rH   rI   rr   ru   rs   rv   rt   rw   rD   rL   rE   rM   rF   rN   rG   rO   r.   rx   re   rI   rH   rI   rD   rL   rE   rM   rF   rN   rG   rO   r.   r*   __name__
__module____qualname__r   r6   r;   r?   r   r   rd   ro   r   r   r4   r4   r4   r5   r+   +   @    	<*=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}tttttf |ddgdggd}	|	r-ddi|p+i }| jtd|d	t	|t
jI d
H |	t||||dtdI d
H S )rP   rQ   rR   rC   rS   rT   rV   rW   rX   rY   NrZ   r[   )r_   r   r   r   r   rI   r`   ra   r   r   r(   rb   r&   r)   rc   r4   r4   r5   rd     s(   $
zAsyncVersions.createrZ   re   c                  R   |s
t d||st d|| jtd||dt||||dtdI dH S )rg   rQ   rh   ri   rj   rZ   rk   Nrl   rn   r4   r4   r5   ro   H     zAsyncVersions.retrieverq   rr   ru   rs   rv   rt   rw   ;AsyncPaginator[SkillVersion, AsyncCursorPage[SkillVersion]]c          	      C  ry   rz   )	r_   r~   r   r$   r)   r&   r   r'   r   r   r4   r4   r5   r   n  r   zAsyncVersions.listr*   c                  r   )r   rQ   rh   ri   rj   rZ   rk   Nr   rn   r4   r4   r5   r     r   zAsyncVersions.delete)r.   r   )r.   r   )r.   r   r   r   )rH   rI   rr   ru   rs   rv   rt   rw   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_wrapperrd   ro   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_wrapperrd   ro   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!   rd   ro   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"   rd   ro   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httpx r   r6   r
   r   r   r   r   r   _typesr   r   r   r   r   r   r   r   r   Z_utilsr   r   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>   s2    , Q Q