o
    iQ                     @  s|  d dl mZ d dlmZ d dlmZ d dlZddlmZ ddl	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 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$m%Z%m&Z&m'Z'm(Z( ddl)m*Z*m+Z+ ddl,m-Z-m.Z. ddl/m0Z0 ddl1m2Z2 ddl3m4Z4 ddgZ5G dd deZ6G dd deZ7G dd dZ8G dd dZ9G dd dZ:G dd dZ;dS )     )annotations)Iterable)LiteralN   )_legacy_response)container_list_paramscontainer_create_params)	BodyOmitQueryHeadersNoneTypeNotGivenSequenceNotStromit	not_given)path_templatemaybe_transformasync_maybe_transform)cached_property)SyncAPIResourceAsyncAPIResource)to_streamed_response_wrapper"async_to_streamed_response_wrapper   )Files
AsyncFilesFilesWithRawResponseAsyncFilesWithRawResponseFilesWithStreamingResponseAsyncFilesWithStreamingResponse)SyncCursorPageAsyncCursorPage)AsyncPaginatormake_request_options)ContainerListResponse)ContainerCreateResponse)ContainerRetrieveResponse
ContainersAsyncContainersc                
   @     e Zd Zed6ddZed7ddZed8d	d
Zeeeeeddded	d9d"d#Z	ddded$d:d'd(Z
eeeeddded)d;d1d2Zddded$d<d4d5ZdS )=r(   returnr   c                 C  
   t | jS N)r   _clientself r1   `/home/kim/smarthome/.venv/lib/python3.10/site-packages/openai/resources/containers/containers.pyfiles#      
zContainers.filesContainersWithRawResponsec                 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
        )r5   r/   r1   r1   r2   with_raw_response'      zContainers.with_raw_responseContainersWithStreamingResponsec                 C  r6   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:   r/   r1   r1   r2   with_streaming_response1      z"Containers.with_streaming_responseN	expires_afterfile_idsmemory_limitnetwork_policyskillsextra_headersextra_query
extra_bodytimeoutnamestrr?   +container_create_params.ExpiresAfter | Omitr@   SequenceNotStr[str] | OmitrA   (Literal['1g', '4g', '16g', '64g'] | OmitrB   ,container_create_params.NetworkPolicy | OmitrC   .Iterable[container_create_params.Skill] | OmitrD   Headers | NonerE   Query | NonerF   Body | NonerG   'float | httpx.Timeout | None | NotGivenr&   c       
      
   C  s4   | j dt||||||dtjt|||	|
dtdS )  
        Create Container

        Args:
          name: Name of the container to create.

          expires_after: Container expiration time in seconds relative to the 'anchor' time.

          file_ids: IDs of files to copy to the container.

          memory_limit: Optional memory limit for the container. Defaults to "1g".

          network_policy: Network access policy for the container.

          skills: An optional list of skills referenced by id or inline data.

          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
        /containersrH   r?   r@   rA   rB   rC   rD   rE   rF   rG   bodyoptionscast_to)_postr   r   ContainerCreateParamsr$   r&   r0   rH   r?   r@   rA   rB   rC   rD   rE   rF   rG   r1   r1   r2   create:   s"   (zContainers.createrV   container_idr'   c                C  s6   |s	t d|| jtd|dt||||dtdS )F  
        Retrieve Container

        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
        ;Expected a non-empty value for `container_id` but received /containers/{container_id}r_   rV   rY   rZ   
ValueError_getr   r$   r'   r0   r_   rD   rE   rF   rG   r1   r1   r2   retrieveu   s   
zContainers.retrieveafterlimitrH   orderrD   rE   rF   rG   rk   
str | Omitrl   
int | Omitrm   Literal['asc', 'desc'] | Omit%SyncCursorPage[ContainerListResponse]c          	      C  6   | j dtt t||||t||||dtjdtdS a  List Containers

        Args:
          after: A cursor for use in pagination.

        `after` is an object ID that defines your place
              in the list. For instance, if you make a list request and receive 100 objects,
              ending with obj_foo, your subsequent call can include after=obj_foo in order to
              fetch the next page of the list.

          limit: A limit on the number of objects to be returned. Limit can range between 1 and
              100, and the default is 20.

          name: Filter results by container name.

          order: Sort order by the `created_at` timestamp of the objects. `asc` for ascending
              order and `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
        rT   )rk   rl   rH   rm   )rD   rE   rF   rG   query)pagerY   model)_get_api_listr!   r%   r$   r   r   ContainerListParams	r0   rk   rl   rH   rm   rD   rE   rF   rG   r1   r1   r2   list   &   (zContainers.listNonec                C  sF   |s	t d|ddi|pi }| jtd|dt||||dtdS )D  
        Delete Container

        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
        ra   Accept*/*rb   rc   rV   rd   rf   _deleter   r$   r   rh   r1   r1   r2   delete   s   
zContainers.delete)r+   r   )r+   r5   )r+   r:   rH   rI   r?   rJ   r@   rK   rA   rL   rB   rM   rC   rN   rD   rO   rE   rP   rF   rQ   rG   rR   r+   r&   r_   rI   rD   rO   rE   rP   rF   rQ   rG   rR   r+   r'   )rk   rn   rl   ro   rH   rn   rm   rp   rD   rO   rE   rP   rF   rQ   rG   rR   r+   rq   r_   rI   rD   rO   rE   rP   rF   rQ   rG   rR   r+   r|   __name__
__module____qualname__r   r3   r8   r<   r   r   r^   ri   rz   r   r1   r1   r1   r2   r(   "   H    	A$Cc                
   @  r*   )=r)   r+   r   c                 C  r,   r-   )r   r.   r/   r1   r1   r2   r3      r4   zAsyncContainers.filesAsyncContainersWithRawResponsec                 C  r6   r7   )r   r/   r1   r1   r2   r8      r9   z!AsyncContainers.with_raw_response$AsyncContainersWithStreamingResponsec                 C  r6   r;   )r   r/   r1   r1   r2   r<     r=   z'AsyncContainers.with_streaming_responseNr>   rH   rI   r?   rJ   r@   rK   rA   rL   rB   rM   rC   rN   rD   rO   rE   rP   rF   rQ   rG   rR   r&   c       
      
     sB   | j dt||||||dtjI dH t|||	|
dtdI dH S )rS   rT   rU   NrV   rW   )r[   r   r   r\   r$   r&   r]   r1   r1   r2   r^     s$   (zAsyncContainers.createrV   r_   r'   c                  s>   |s
t d|| jtd|dt||||dtdI dH S )r`   ra   rb   rc   rV   rd   Nre   rh   r1   r1   r2   ri   I  s   
zAsyncContainers.retrieverj   rk   rn   rl   ro   rm   rp   MAsyncPaginator[ContainerListResponse, AsyncCursorPage[ContainerListResponse]]c          	      C  rr   rs   )rw   r"   r%   r$   r   r   rx   ry   r1   r1   r2   rz   j  r{   zAsyncContainers.listr|   c                  sN   |s
t d|ddi|pi }| jtd|dt||||dtdI dH S )	r}   ra   r~   r   rb   rc   rV   rd   Nr   rh   r1   r1   r2   r     s   
zAsyncContainers.delete)r+   r   )r+   r   )r+   r   r   r   )rk   rn   rl   ro   rH   rn   rm   rp   rD   rO   rE   rP   rF   rQ   rG   rR   r+   r   r   r   r1   r1   r1   r2   r)      r   c                   @  $   e Zd ZdddZeddd	Zd
S )r5   
containersr(   r+   r|   c                 C  B   || _ t|j| _t|j| _t|j| _t|j| _d S r-   )_containersr   Zto_raw_response_wrapperr^   ri   rz   r   r0   r   r1   r1   r2   __init__     
z"ContainersWithRawResponse.__init__r   c                 C     t | jjS r-   )r   r   r3   r/   r1   r1   r2   r3        zContainersWithRawResponse.filesNr   r(   r+   r|   )r+   r   r   r   r   r   r   r3   r1   r1   r1   r2   r5         
r5   c                   @  r   )r   r   r)   r+   r|   c                 C  r   r-   )r   r   Zasync_to_raw_response_wrapperr^   ri   rz   r   r   r1   r1   r2   r     r   z'AsyncContainersWithRawResponse.__init__r   c                 C  r   r-   )r   r   r3   r/   r1   r1   r2   r3     r   z$AsyncContainersWithRawResponse.filesNr   r)   r+   r|   )r+   r   r   r1   r1   r1   r2   r     r   r   c                   @  r   )r:   r   r(   r+   r|   c                 C  :   || _ t|j| _t|j| _t|j| _t|j| _d S r-   )r   r   r^   ri   rz   r   r   r1   r1   r2   r        
z(ContainersWithStreamingResponse.__init__r   c                 C  r   r-   )r   r   r3   r/   r1   r1   r2   r3     r   z%ContainersWithStreamingResponse.filesNr   )r+   r   r   r1   r1   r1   r2   r:     r   r:   c                   @  r   )r   r   r)   r+   r|   c                 C  r   r-   )r   r   r^   ri   rz   r   r   r1   r1   r2   r     r   z-AsyncContainersWithStreamingResponse.__init__r    c                 C  r   r-   )r    r   r3   r/   r1   r1   r2   r3     r   z*AsyncContainersWithStreamingResponse.filesNr   )r+   r    r   r1   r1   r1   r2   r     r   r   )<
__future__r   typingr   Ztyping_extensionsr   Zhttpx r   typesr   r   _typesr	   r
   r   r   r   r   r   r   r   Z_utilsr   r   r   Z_compatr   Z	_resourcer   r   	_responser   r   Zfiles.filesr   r   r   r   r   r    Z
paginationr!   r"   Z_base_clientr#   r$   Ztypes.container_list_responser%   Ztypes.container_create_responser&   Z!types.container_retrieve_responser'   __all__r(   r)   r5   r   r:   r   r1   r1   r1   r2   <module>   s4   ,  U U