
    2iP                       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Z4 G d de          Z5 G d de          Z6 G d d          Z7 G d d          Z8 G d d          Z9 G 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d/d            Zed0d            Zed1d            Zeeeeeddded		d2dZ	ddded d3d#Z
eeeeddded$d4d,Zddded d5d.ZdS )6r(   returnr   c                *    t          | j                  S N)r   _clientselfs    m/root/.openclaw/workspace/.venv-openai/lib/python3.11/site-packages/openai/resources/containers/containers.pyfileszContainers.files#   s    T\"""    ContainersWithRawResponsec                     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/   s    r1   with_raw_responsezContainers.with_raw_response'   s     )...r3   ContainersWithStreamingResponsec                     t          |           S 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
        )r8   r/   s    r1   with_streaming_responsez"Containers.with_streaming_response1   s     /t444r3   N	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'] | Omitr@   ,container_create_params.NetworkPolicy | OmitrA   .Iterable[container_create_params.Skill] | OmitrB   Headers | NonerC   Query | NonerD   Body | NonerE   'float | httpx.Timeout | None | NotGivenr&   c       
            |                      dt          ||||||dt          j                  t	          |||	|
          t
                    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rF   r=   r>   r?   r@   rA   rB   rC   rD   rE   bodyoptionscast_to)_postr   r	   ContainerCreateParamsr$   r&   r0   rF   r=   r>   r?   r@   rA   rB   rC   rD   rE   s              r1   createzContainers.create:   sx    P zz  %2 ($0&4$  (=
 
 )+Q[el   ,!  
 
 	
r3   rU   container_idr'   c          	         |st          d|          |                     d| t          ||||          t                    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'   r0   r^   rB   rC   rD   rE   s         r1   retrievezContainers.retrieveu   sm    .  	mk[gkklllyy)<))(+Q[el   .  
 
 	
r3   afterlimitrF   orderrB   rC   rD   rE   rj   
str | Omitrk   
int | Omitrl   Literal['asc', 'desc'] | Omit%SyncCursorPage[ContainerListResponse]c                   |                      dt          t                   t          ||||t	          ||||dt
          j                            t                    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   )rj   rk   rF   rl   )rB   rC   rD   rE   query)pagerX   model)_get_api_listr!   r%   r$   r   r   ContainerListParams	r0   rj   rk   rF   rl   rB   rC   rD   rE   s	            r1   listzContainers.list   s|    P !! 56(+'%%!&!& $!&	  *=    (% " 
 
 	
r3   Nonec          	         |st          d|          ddi|pi }|                     d| t          ||||          t                    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   rU   rc   re   _deleter$   r   rg   s         r1   deletezContainers.delete   s    .  	mk[gkklll!5B]-@bB||)<))(+Q[el     
 
 	
r3   )r+   r   )r+   r4   )r+   r8   rF   rG   r=   rH   r>   rI   r?   rJ   r@   rK   rA   rL   rB   rM   rC   rN   rD   rO   rE   rP   r+   r&   r^   rG   rB   rM   rC   rN   rD   rO   rE   rP   r+   r'   )rj   rm   rk   rn   rF   rm   rl   ro   rB   rM   rC   rN   rD   rO   rE   rP   r+   rp   r^   rG   rB   rM   rC   rN   rD   rO   rE   rP   r+   rz   __name__
__module____qualname__r   r2   r7   r;   r   r   r]   rh   ry   r    r3   r1   r(   r(   "   sF       # # # _# / / / _/ 5 5 5 _5 FJ/3AEGKAE )-$("&;D9
 9
 9
 9
 9
 9
B )-$("&;D
 
 
 
 
 
H ! /3 )-$("&;D;
 ;
 ;
 ;
 ;
 ;
F )-$("&;D 
  
  
  
  
  
  
  
r3   c            
          e Zd Zed/d            Zed0d            Zed1d            Zeeeeeddded		d2dZ	ddded d3d#Z
eeeeddded$d4d,Zddded d5d.ZdS )6r)   r+   r   c                *    t          | j                  S r-   )r   r.   r/   s    r1   r2   zAsyncContainers.files   s    $,'''r3   AsyncContainersWithRawResponsec                     t          |           S r6   )r   r/   s    r1   r7   z!AsyncContainers.with_raw_response   s     .d333r3   $AsyncContainersWithStreamingResponsec                     t          |           S r:   )r   r/   s    r1   r;   z'AsyncContainers.with_streaming_response  s     4D999r3   Nr<   rF   rG   r=   rH   r>   rI   r?   rJ   r@   rK   rA   rL   rB   rM   rC   rN   rD   rO   rE   rP   r&   c       
           K   |                      dt          ||||||dt          j                   d{V t	          |||	|
          t
                     d{V S )rR   rS   rT   NrU   rV   )rZ   r   r	   r[   r$   r&   r\   s              r1   r]   zAsyncContainers.create  s      P ZZ, %2 ($0&4$  (=
 
 
 
 
 
 
 
 )+Q[el   ,!   
 
 
 
 
 
 
 
 	
r3   rU   r^   r'   c          	        K   |st          d|          |                     d| t          ||||          t                     d{V S )r`   ra   rb   rU   rc   Nrd   rg   s         r1   rh   zAsyncContainers.retrieveI  s      .  	mk[gkklllYY)<))(+Q[el   .  
 
 
 
 
 
 
 
 	
r3   ri   rj   rm   rk   rn   rl   ro   MAsyncPaginator[ContainerListResponse, AsyncCursorPage[ContainerListResponse]]c                   |                      dt          t                   t          ||||t	          ||||dt
          j                            t                    S rr   )rv   r"   r%   r$   r   r   rw   rx   s	            r1   ry   zAsyncContainers.listj  s|    P !! !67(+'%%!&!& $!&	  *=    (% " 
 
 	
r3   rz   c          	        K   |st          d|          ddi|pi }|                     d| t          ||||          t                     d{V S )r|   ra   r}   r~   rb   rU   rc   Nr   rg   s         r1   r   zAsyncContainers.delete  s      .  	mk[gkklll!5B]-@bB\\)<))(+Q[el    " 
 
 
 
 
 
 
 
 	
r3   )r+   r   )r+   r   )r+   r   r   r   )rj   rm   rk   rn   rF   rm   rl   ro   rB   rM   rC   rN   rD   rO   rE   rP   r+   r   r   r   r   r3   r1   r)   r)      sF       ( ( ( _( 4 4 4 _4 : : : _: FJ/3AEGKAE )-$("&;D9
 9
 9
 9
 9
 9
B )-$("&;D
 
 
 
 
 
H ! /3 )-$("&;D;
 ;
 ;
 ;
 ;
 ;
F )-$("&;D 
  
  
  
  
  
  
  
r3   c                  .    e Zd Zd	dZed
d            ZdS )r4   
containersr(   r+   rz   c                   || _         t          j        |j                  | _        t          j        |j                  | _        t          j        |j                  | _        t          j        |j                  | _        d S r-   )_containersr   to_raw_response_wrapperr]   rh   ry   r   r0   r   s     r1   __init__z"ContainersWithRawResponse.__init__  s{    %&>
 
 )@
 
 %<O
 
	 '>
 
r3   r   c                4    t          | j        j                  S r-   )r   r   r2   r/   s    r1   r2   zContainersWithRawResponse.files  s    #D$4$:;;;r3   Nr   r(   r+   rz   )r+   r   r   r   r   r   r   r2   r   r3   r1   r4   r4     sH        
 
 
 
  < < < _< < <r3   r4   c                  .    e Zd Zd	dZed
d            ZdS )r   r   r)   r+   rz   c                   || _         t          j        |j                  | _        t          j        |j                  | _        t          j        |j                  | _        t          j        |j                  | _        d S r-   )r   r   async_to_raw_response_wrapperr]   rh   ry   r   r   s     r1   r   z'AsyncContainersWithRawResponse.__init__  s{    %&D
 
 )F
 
 %BO
 
	 'D
 
r3   r   c                4    t          | j        j                  S r-   )r   r   r2   r/   s    r1   r2   z$AsyncContainersWithRawResponse.files  s    ()9)?@@@r3   Nr   r)   r+   rz   )r+   r   r   r   r3   r1   r   r     sN        
 
 
 
  A A A _A A Ar3   r   c                  .    e Zd Zd	dZed
d            ZdS )r8   r   r(   r+   rz   c                    || _         t          |j                  | _        t          |j                  | _        t          |j                  | _        t          |j                  | _        d S r-   )r   r   r]   rh   ry   r   r   s     r1   r   z(ContainersWithStreamingResponse.__init__  so    %2
 
 5
 
 1O
 
	 3
 
r3   r   c                4    t          | j        j                  S r-   )r   r   r2   r/   s    r1   r2   z%ContainersWithStreamingResponse.files  s    )$*:*@AAAr3   Nr   )r+   r   r   r   r3   r1   r8   r8     sN        
 
 
 
  B B B _B B Br3   r8   c                  .    e Zd Zd	dZed
d            ZdS )r   r   r)   r+   rz   c                    || _         t          |j                  | _        t          |j                  | _        t          |j                  | _        t          |j                  | _        d S r-   )r   r   r]   rh   ry   r   r   s     r1   r   z-AsyncContainersWithStreamingResponse.__init__  so    %8
 
 ;
 
 7O
 
	 9
 
r3   r    c                4    t          | j        j                  S r-   )r    r   r2   r/   s    r1   r2   z*AsyncContainersWithStreamingResponse.files  s    .t/?/EFFFr3   Nr   )r+   r    r   r   r3   r1   r   r     sN        
 
 
 
  G G G _G G Gr3   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   r8   r   r   r3   r1   <module>r      s   # " " " " "       % % % % % %              C C C C C C C C e e e e e e e e e e e e e e e e e e e e e e < < < < < < < < & & & & & & : : : : : : : : Y Y Y Y Y Y Y Y                : 9 9 9 9 9 9 9 @ @ @ @ @ @ @ @ B B B B B B F F F F F F J J J J J J*
+Q
 Q
 Q
 Q
 Q
 Q
 Q
 Q
hQ
 Q
 Q
 Q
 Q
& Q
 Q
 Q
h< < < < < < < <,A A A A A A A A,B B B B B B B B,G G G G G G G G G Gr3   