o
    r)iP                     @  sx  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 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.m/Z/ ddl0m1Z1 ddl2m3Z3 ddgZ4G dd deZ5G dd deZ6G dd dZ7G dd dZ8G dd dZ9G 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)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 r0   j/var/www/html/voicebot/backend/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
        )r4   r.   r0   r0   r1   with_raw_response'      zContainers.with_raw_responseContainersWithStreamingResponsec                 C  r5   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
        )r9   r.   r0   r0   r1   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] | Omitr@   (Literal['1g', '4g', '16g', '64g'] | OmitrA   ,container_create_params.NetworkPolicy | OmitrB   .Iterable[container_create_params.Skill] | OmitrC   Headers | NonerD   Query | NonerE   Body | NonerF   '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rG   r>   r?   r@   rA   rB   rC   rD   rE   rF   bodyoptionscast_to)_postr   r   ContainerCreateParamsr#   r%   r/   rG   r>   r?   r@   rA   rB   rC   rD   rE   rF   r0   r0   r1   create:   s"   (zContainers.createrU   container_idr&   c                C  s4   |s	t d|| j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/rU   rX   rY   
ValueError_getr#   r&   r/   r^   rC   rD   rE   rF   r0   r0   r1   retrieveu   s   zContainers.retrieveafterlimitrG   orderrC   rD   rE   rF   ri   
str | Omitrj   
int | Omitrk   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
        rS   )ri   rj   rG   rk   )rC   rD   rE   rF   query)pagerX   model)_get_api_listr    r$   r#   r   r   ContainerListParams	r/   ri   rj   rG   rk   rC   rD   rE   rF   r0   r0   r1   list   &   (zContainers.listNonec                C  sD   |s	t d|ddi|pi }| j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
        r`   Accept*/*ra   rU   rb   rd   _deleter#   r   rf   r0   r0   r1   delete   s   zContainers.delete)r*   r   )r*   r4   )r*   r9   rG   rH   r>   rI   r?   rJ   r@   rK   rA   rL   rB   rM   rC   rN   rD   rO   rE   rP   rF   rQ   r*   r%   r^   rH   rC   rN   rD   rO   rE   rP   rF   rQ   r*   r&   )ri   rl   rj   rm   rG   rl   rk   rn   rC   rN   rD   rO   rE   rP   rF   rQ   r*   ro   r^   rH   rC   rN   rD   rO   rE   rP   rF   rQ   r*   rz   __name__
__module____qualname__r   r2   r7   r;   r   r   r]   rg   rx   r   r0   r0   r0   r1   r'   "   H    	A$Cc                
   @  r)   )=r(   r*   r   c                 C  r+   r,   )r   r-   r.   r0   r0   r1   r2      r3   zAsyncContainers.filesAsyncContainersWithRawResponsec                 C  r5   r6   )r   r.   r0   r0   r1   r7      r8   z!AsyncContainers.with_raw_response$AsyncContainersWithStreamingResponsec                 C  r5   r:   )r   r.   r0   r0   r1   r;     r<   z'AsyncContainers.with_streaming_responseNr=   rG   rH   r>   rI   r?   rJ   r@   rK   rA   rL   rB   rM   rC   rN   rD   rO   rE   rP   rF   rQ   r%   c       
      
     sB   | j dt||||||dtjI dH t|||	|
dtdI dH S )rR   rS   rT   NrU   rV   )rZ   r   r   r[   r#   r%   r\   r0   r0   r1   r]     s$   (zAsyncContainers.createrU   r^   r&   c                  s<   |s
t d|| jd| t||||dtdI dH S )r_   r`   ra   rU   rb   Nrc   rf   r0   r0   r1   rg   I  s   zAsyncContainers.retrieverh   ri   rl   rj   rm   rk   rn   MAsyncPaginator[ContainerListResponse, AsyncCursorPage[ContainerListResponse]]c          	      C  rp   rq   )ru   r!   r$   r#   r   r   rv   rw   r0   r0   r1   rx   j  ry   zAsyncContainers.listrz   c                  sL   |s
t d|ddi|pi }| jd| t||||dtdI dH S )r{   r`   r|   r}   ra   rU   rb   Nr~   rf   r0   r0   r1   r     s   zAsyncContainers.delete)r*   r   )r*   r   )r*   r   r   r   )ri   rl   rj   rm   rG   rl   rk   rn   rC   rN   rD   rO   rE   rP   rF   rQ   r*   r   r   r   r0   r0   r0   r1   r(      r   c                   @  $   e Zd ZdddZeddd	Zd
S )r4   
containersr'   r*   rz   c                 C  B   || _ t|j| _t|j| _t|j| _t|j| _d S r,   )_containersr   to_raw_response_wrapperr]   rg   rx   r   r/   r   r0   r0   r1   __init__     
z"ContainersWithRawResponse.__init__r   c                 C     t | jjS r,   )r   r   r2   r.   r0   r0   r1   r2        zContainersWithRawResponse.filesNr   r'   r*   rz   )r*   r   r   r   r   r   r   r2   r0   r0   r0   r1   r4         
r4   c                   @  r   )r   r   r(   r*   rz   c                 C  r   r,   )r   r   async_to_raw_response_wrapperr]   rg   rx   r   r   r0   r0   r1   r     r   z'AsyncContainersWithRawResponse.__init__r   c                 C  r   r,   )r   r   r2   r.   r0   r0   r1   r2     r   z$AsyncContainersWithRawResponse.filesNr   r(   r*   rz   )r*   r   r   r0   r0   r0   r1   r     r   r   c                   @  r   )r9   r   r'   r*   rz   c                 C  :   || _ t|j| _t|j| _t|j| _t|j| _d S r,   )r   r   r]   rg   rx   r   r   r0   r0   r1   r        
z(ContainersWithStreamingResponse.__init__r   c                 C  r   r,   )r   r   r2   r.   r0   r0   r1   r2     r   z%ContainersWithStreamingResponse.filesNr   )r*   r   r   r0   r0   r0   r1   r9     r   r9   c                   @  r   )r   r   r(   r*   rz   c                 C  r   r,   )r   r   r]   rg   rx   r   r   r0   r0   r1   r     r   z-AsyncContainersWithStreamingResponse.__init__r   c                 C  r   r,   )r   r   r2   r.   r0   r0   r1   r2     r   z*AsyncContainersWithStreamingResponse.filesNr   )r*   r   r   r0   r0   r0   r1   r     r   r   );
__future__r   typingr   typing_extensionsr   httpx r   typesr   r   _typesr	   r
   r   r   r   r   r   r   r   _utilsr   r   _compatr   	_resourcer   r   	_responser   r   files.filesr   r   r   r   r   r   
paginationr    r!   _base_clientr"   r#   types.container_list_responser$   types.container_create_responser%   !types.container_retrieve_responser&   __all__r'   r(   r4   r   r9   r   r0   r0   r0   r1   <module>   s4   ,  U U