
    Cjo                        S SK r S SKrS SKrS SKJr  S SKJrJrJrJ	r	J
r
JrJrJr  S SKrS SKJr  S SKJrJr  S SKJr  S SKJr  S SKJr  S S	KJrJrJrJ r J!r!J"r"J#r#  S S
K$J%r%  S SK&J'r'  S SK(J)r)  S SK*J+r+J,r,  / SQr-\,       SFS\.S\\\.\4      S\\	\.      S\
S   S\\\.\4      S\\\.\4      S\\\.\4      S\"4S jj5       r/\       SGS\.S\\\.\4      S\\	\.      S\\.   S\\.   S\\.   S\
S   S\
S   S\\\\"4   4S jj5       r0\       SGSS .S\.S\\\.\4      S\\	\.      S\\.   S\\.   S\\.   S\
S   S\
S   S\"4S! jjj5       r0\,          SHS\.S\\\.\4      S\\	\.      S\\.   S\\.   S\\.   S\
S   S\\\.\4      S\\\.\4      S\\\.\4      S\\"\\\\"4   4   4S" jj5       r0\,        SIS#\\.   S$\\1   S%\\.   S\
S   S\\\.\4      S\\\.\4      S\\\.\4      S\!4S& jj5       r2\        SJS#\\.   S$\\1   S%\\.   S\\.   S\\.   S\\.   S\
S   S'\
S   S\\\\!4   4S( jj5       r3\        SJSS).S#\\.   S$\\1   S%\\.   S\\.   S\\.   S\\.   S\
S   S'\
S   S\!4S* jjj5       r3\,           SKS#\\.   S$\\1   S%\\.   S\\.   S\\.   S\\.   S\
S   S\\\.\4      S\\\.\4      S\\\.\4      S\\!\\\\!4   4   4S+ jj5       r3\,     SLS,\.S\
S   S\\\.\4      S\\\.\4      S\\\.\4      S\"4S- jj5       r4\     SMS,\.S\\.   S\\.   S\\.   S\
S   S.\
S   S\\\\"4   4S/ jj5       r5\     SMSS0.S,\.S\\.   S\\.   S\\.   S\
S   S.\
S   S\"4S1 jjj5       r5\,        SNS,\.S\\.   S\\.   S\\.   S\
S   S\\\.\4      S\\\.\4      S\\\.\4      S\\"\\\\"4   4   4S2 jj5       r5\,     SLS,\.S\
S   S\\\.\4      S\\\.\4      S\\\.\4      S\#4S3 jj5       r6\     SMS,\.S\\.   S\\.   S\\.   S\
S   S4\
S   S\\\\#4   4S5 jj5       r7\     SMSS6.S,\.S\\.   S\\.   S\\.   S\
S   S4\
S   S\#4S7 jjj5       r7\,        SNS,\.S\\.   S\\.   S\\.   S\
S   S\\\.\4      S\\\.\4      S\\\.\4      S\\#\\\\#4   4   4S8 jj5       r7\,        SIS,\.S#\\.   S$\\1   S%\\.   S\
S   S\\\.\4      S\\\.\4      S\\\.\4      S\4S9 jj5       r8\        SJS,\.S#\\.   S$\\1   S%\\.   S\\.   S\\.   S\\.   S\
S   S:\
S   S\\\\4   4S; jj5       r9\        SJSS<.S,\.S#\\.   S$\\1   S%\\.   S\\.   S\\.   S\\.   S\
S   S:\
S   S\4S= jjj5       r9\,           SKS,\.S#\\.   S$\\1   S%\\.   S\\.   S\\.   S\\.   S\
S   S\\\.\4      S\\\.\4      S\\\.\4      S\\\\\\4   4   4S> jj5       r9\,     SLS,\.S?\%S\
S   S\\\.\4      S\\\.\4      S\\\.\4      S\4S@ jj5       r:\     SMS,\.S?\%S\\.   S\\.   S\\.   S\
S   SA\
S   S\\\\4   4SB jj5       r;\     SMSSC.S,\.S?\%S\\.   S\\.   S\\.   S\
S   SA\
S   S\4SD jjj5       r;\,        SNS,\.S?\%S\\.   S\\.   S\\.   S\
S   S\\\.\4      S\\\.\4      S\\\.\4      S\\\\\\4   4   4SE jj5       r;g)O    N)partial)Any	CoroutineDictListLiteralOptionalUnionoverload)request_timeout)ContainerRequestUtils'decode_managed_container_id_for_request)Logging)BaseContainerConfig)base_llm_http_handler)$ContainerCreateOptionalRequestParamsContainerFileListResponseContainerFileObject"ContainerListOptionalRequestParamsContainerListResponseContainerObjectDeleteContainerResult)	FileTypes)GenericLiteLLMParams)	CallTypes)ProviderConfigManagerclient)acreate_containeradelete_containeralist_container_filesalist_containersaretrieve_containeraupload_container_filecreate_containerdelete_containerlist_container_fileslist_containersretrieve_containerupload_container_filenameexpires_afterfile_idscustom_llm_provider)openaiazure
azure_textextra_headersextra_query
extra_bodyreturnc                   #    [        5       n	 [        R                  " 5       n
SUS'   [        [        4U UUUUUUUS.UD6n[
        R                  " 5       n[        UR                  U5      nU
R                  SU5      I Sh  vN n[        R                  " U5      (       a  UI Sh  vN nU$ UnU$  N/ N! [         a  n[        R                  " SUUU	US9eSnAff = f7f)a   Asynchronously calls the `create_container` function with the given arguments and keyword arguments.

Parameters:
- `name` (str): Name of the container to create
- `expires_after` (Optional[Dict[str, Any]]): Container expiration time settings
- `file_ids` (Optional[List[str]]): IDs of files to copy to the container
- `timeout` (int): Request timeout in seconds
- `custom_llm_provider` (Optional[Literal["openai"]]): The LLM provider to use
- `extra_headers` (Optional[Dict[str, Any]]): Additional headers
- `extra_query` (Optional[Dict[str, Any]]): Additional query parameters
- `extra_body` (Optional[Dict[str, Any]]): Additional body parameters
- `kwargs` (dict): Additional keyword arguments

Returns:
- `response` (ContainerObject): The created container object
T
async_call)r*   r+   r,   timeoutr-   r1   r2   r3   N modelr-   original_exceptioncompletion_kwargsextra_kwargs)localsasyncioget_event_loopr   r$   contextvarscopy_contextrunrun_in_executoriscoroutine	Exceptionlitellmexception_type)r*   r+   r,   r7   r-   r1   r2   r3   kwargs
local_varsloopfuncctxfunc_with_contextinit_responseresponsees                    i/home/rurouni/.local/share/pipx/venvs/strix-agent/lib/python3.13/site-packages/litellm/containers/main.pyr   r   /   s     > J"
%%'#|
' 3'#!
 
 &&(#CGGT2"2249JKK}--**H  %H L +
  
$$ 3 (
 	

Y   CA3B5 B1$B5 &B3'B5 ,C-B5 0C1B5 3B5 5
C?CCCapi_keyapi_baseapi_versionr   Tc                    g N 
r*   r+   r,   r7   rT   rU   rV   r-   r   rI   s
             rR   r$   r$   w            F)r   c                    g rX   rY   rZ   s
             rR   r$   r$      r[   r\   c                    [        5       n UR                  S5      nUR                  S5      nUR                  SS5      SL nUR                  S5      nUb8  [        U[        5      (       a  [
        R                  " U5      n[        S0 UD6nU$ [        SUUUS.UD6n[        R                  " [        R                  " U5      S	9nUc  [        S
U 35      eUR                  U5        [        R                   " U5      n[        R"                  " UUS9nUR%                  US['        U5      SU0UEUS9  [(        R*                  R,                  Ul        [0        R2                  " U UUUUUU=(       d    [4        US9n[        U[        5      (       a&  [        R6                  " UUUR                  S5      U
S9nU$ ! [8         a  n[        R:                  " SUUUUS9eSnAff = f)zCreate a container using the OpenAI Container API.

Currently supports OpenAI

Example:
```python
import litellm

response = litellm.create_container(
    name="My Container",
    custom_llm_provider="openai",
)
print(response)
```
litellm_logging_objlitellm_call_idr6   FTmock_responseNrT   rU   rV   providerz+container operations are not supported for )container_provider_config container_create_optional_paramsr8   rI   r:   optional_paramslitellm_paramsr-   )r*   container_create_request_paramsre   ri   logging_objr1   r7   	_is_asynclitellm_metadataresponse_objr-   rm   r3   r9   rY   )r>   popget
isinstancestrjsonloadsr   r   r   get_provider_container_configrG   LlmProviders
ValueErrorupdater   -get_requested_container_create_optional_param$get_optional_params_container_createupdate_from_kwargsdictr   r$   value	call_typer   container_create_handlerDEFAULT_REQUEST_TIMEOUTencode_container_id_in_responserF   rH   )r*   r+   r,   r7   rT   rU   rV   r-   r1   r2   r3   rI   rJ   r_   r`   rl   ra   rP   ri   re   rf   rj   container_objrQ   s                           rR   r$   r$      s$   F J^
17<Q1R)/4E)FJJ|U3t;	 

?3$--- $

= 9&77HO . 
#
 	
 "?? --.AB 	" %,=>Q=RS  	&! "OO 	) "FF*C1Q 	( 	.. !@A!?1 !4 	/ 		
 )2(B(B(H(H%-FF,K&?)+'66	
 m_551QQ*$7!',>!?%	M  
$$ 3 (
 	

s   BF6 D'F6 6
G GGafterlimitorderc                   #    [        5       n	 [        R                  " 5       n
SUS'   [        [        4U UUUUUUUS.UD6n[
        R                  " 5       n[        UR                  U5      nU
R                  SU5      I Sh  vN n[        R                  " U5      (       a  UI Sh  vN nU$ UnU$  N/ N! [         a  n[        R                  " SUUU	US9eSnAff = f7f)a  Asynchronously list containers.

Parameters:
- `after` (Optional[str]): A cursor for pagination
- `limit` (Optional[int]): Number of items to return (1-100, default 20)
- `order` (Optional[str]): Sort order ('asc' or 'desc', default 'desc')
- `timeout` (int): Request timeout in seconds
- `custom_llm_provider` (Literal["openai"]): The LLM provider to use
- `extra_headers` (Optional[Dict[str, Any]]): Additional headers
- `extra_query` (Optional[Dict[str, Any]]): Additional query parameters
- `extra_body` (Optional[Dict[str, Any]]): Additional body parameters
- `kwargs` (dict): Additional keyword arguments

Returns:
- `response` (ContainerListResponse): The list of containers
Tr6   )r   r   r   r7   r-   r1   r2   r3   Nr8   r9   )r>   r?   r@   r   r'   rA   rB   rC   rD   rE   rF   rG   rH   )r   r   r   r7   r-   r1   r2   r3   rI   rJ   rK   rL   rM   rN   rO   rP   rQ   s                    rR   r!   r!   !  s     < J"
%%'#|
 3'#!
 
 &&(#CGGT2"2249JKK}--**H  %H L +
  
$$ 3 (
 	

rS   r!   c                    g rX   rY   
r   r   r   r7   rT   rU   rV   r-   r!   rI   s
             rR   r'   r'   g  r[   r\   )r!   c                    g rX   rY   r   s
             rR   r'   r'   x  r[   r\   c                    [        5       n UR                  S5      nUR                  S5      nUR                  SS5      SL nUR                  S5      nUb8  [        U[        5      (       a  [
        R                  " U5      n[        S0 UD6nU$ [        SUUUS.UD6n[        R                  " [        R                  " U5      S	9nUc  [        S
U 35      e[        R                  " U5      nUR!                  US[#        U5      SU0UEUS9  [$        R&                  R(                  Ul        [,        R.                  " UUUU UUUU	U=(       d    [0        US9
$ ! [2         a  n[        R4                  " SUUUUS9eSnAff = f)zKList containers using the OpenAI Container API.

Currently supports OpenAI
r_   r`   r6   FTra   Nrb   rc   2Container provider config not found for provider: r8   rg   )
re   ri   rk   r   r   r   r1   r2   r7   rl   r9   rY   )r>   rp   rq   rr   rs   rt   ru   r   r   r   rv   rG   rw   rx   r   +get_requested_container_list_optional_paramr|   r}   r   r'   r~   r   r   container_list_handlerr   rF   rH   )r   r   r   r7   rT   rU   rV   r-   r1   r2   r3   rI   rJ   r_   r`   rl   ra   rP   ri   re   container_list_optional_paramsrQ   s                         rR   r'   r'     s   0 JL
17<Q1R)/4E)FJJ|U3t;	 

?3$--- $

= 9,=}=HO . 
#
 	
 "?? --.AB 	" %,DEXDYZ  "MM 	' 	.. !?@!?0 !4 	/ 		
 )2(A(A(G(G%$;;&?)+'#66
 	
  
$$ 3 (
 	

s   BE CE 
E<E77E<container_idc           
        #    [        5       n [        R                  " 5       nSUS'   [        [        4U UUUUUS.UD6n	[
        R                  " 5       n
[        U
R                  U	5      nUR                  SU5      I Sh  vN n[        R                  " U5      (       a  UI Sh  vN nU$ UnU$  N/ N! [         a  n[        R                  " SUUUUS9eSnAff = f7f)a  Asynchronously retrieve a container.

Parameters:
- `container_id` (str): The ID of the container to retrieve
- `timeout` (int): Request timeout in seconds
- `custom_llm_provider` (Literal["openai"]): The LLM provider to use
- `extra_headers` (Optional[Dict[str, Any]]): Additional headers
- `extra_query` (Optional[Dict[str, Any]]): Additional query parameters
- `extra_body` (Optional[Dict[str, Any]]): Additional body parameters
- `kwargs` (dict): Additional keyword arguments

Returns:
- `response` (ContainerObject): The container object
Tr6   r   r7   r-   r1   r2   r3   Nr8   r9   )r>   r?   r@   r   r(   rA   rB   rC   rD   rE   rF   rG   rH   r   r7   r-   r1   r2   r3   rI   rJ   rK   rL   rM   rN   rO   rP   rQ   s                  rR   r"   r"     s     4 J 
%%'#|	
% 3'#!	
 	
 &&(#CGGT2"2249JKK}--**H  %H L +
  
$$ 3 (
 	

Y   CA1B3 ?B/ $B3 $B1%B3 *C+B3 .C/B3 1B3 3
C=CCCr"   c                    g rX   rY   r   r7   rT   rU   rV   r-   r"   rI   s           rR   r(   r(   4       r\   )r"   c                    g rX   rY   r   s           rR   r(   r(   C  r   r\   c	                    [        5       n
 UnU	R                  S5      nU	R                  S5      nU	R                  SS5      SL nU	R                  S5      nUb8  [        U[        5      (       a  [
        R                  " U5      n[        S0 UD6nU$ [        SUUUS.U	D6n[        U UUS	9u  nnnUU :g  n[        R                  " [        R                  " U5      S
9nUc  [        SU 35      eUR                  U	S0 SU0US9  [         R"                  R$                  Ul        [(        R*                  " UUUUUUU=(       d    [,        US9n[        U[        5      (       ae  U	R                  S0 5      nU(       a5  UR                  S5      (       a  U(       d  0 nSU;  a  0 US'   US   US   S'   [.        R0                  " UUUSS9nU$ ! [2         a  n[        R4                  " SWUU
U	S9eSnAff = f)zPRetrieve a container using the OpenAI Container API.

Currently supports OpenAI
r_   r`   r6   FTra   Nrb   r   r-   ri   rc   r   r8   rg   r   re   ri   rk   r1   r2   r7   rl   rm   model_id
model_infoidrn   r9   rY   )r>   rp   rq   rr   rs   rt   ru   r   r   r   r   rv   rG   rw   rx   r|   r   r(   r~   r   r   container_retrieve_handlerr   r   r   rF   rH   )r   r7   rT   rU   rV   r-   r1   r2   r3   rI   rJ   resolved_custom_llm_providerr_   r`   rl   ra   rP   ri   original_container_idwas_encodedre   r   rm   rQ   s                           rR   r(   r(   T  sR   , Je
,?$17<Q1R)/4E)FJJ|U3t;	 

?3$--- $

= 9&77HO . 
#
 	
 4)$7- 	L;^ ,|; "?? --.JK 	" %,DEaDbc 
 	..!? != 	/ 	
 )2(D(D(J(J%-HH.&?)+'#66	
 m_55%zz*<bA~11*=='')$'7757$\27Ej7Q .t41QQ*$@!1	M  
$$ < (
 	

   BG D3G 
G+G&&G+c           
        #    [        5       n [        R                  " 5       nSUS'   [        [        4U UUUUUS.UD6n	[
        R                  " 5       n
[        U
R                  U	5      nUR                  SU5      I Sh  vN n[        R                  " U5      (       a  UI Sh  vN nU$ UnU$  N/ N! [         a  n[        R                  " SUUUUS9eSnAff = f7f)a   Asynchronously delete a container.

Parameters:
- `container_id` (str): The ID of the container to delete
- `timeout` (int): Request timeout in seconds
- `custom_llm_provider` (Literal["openai"]): The LLM provider to use
- `extra_headers` (Optional[Dict[str, Any]]): Additional headers
- `extra_query` (Optional[Dict[str, Any]]): Additional query parameters
- `extra_body` (Optional[Dict[str, Any]]): Additional body parameters
- `kwargs` (dict): Additional keyword arguments

Returns:
- `response` (DeleteContainerResult): The deletion result
Tr6   r   Nr8   r9   )r>   r?   r@   r   r%   rA   rB   rC   rD   rE   rF   rG   rH   r   s                  rR   r   r     s     4 J 
%%'#|	
% 3'#!	
 	
 &&(#CGGT2"2249JKK}--**H  %H L +
  
$$ 3 (
 	

r   r   c                    g rX   rY   r   r7   rT   rU   rV   r-   r   rI   s           rR   r%   r%     r   r\   )r   c                    g rX   rY   r   s           rR   r%   r%   #  r   r\   c	                    [        5       n
 UnU	R                  S5      nU	R                  S5      nU	R                  SS5      SL nU	R                  S5      nUb8  [        U[        5      (       a  [
        R                  " U5      n[        S0 UD6nU$ [        SUUUS.U	D6n[        U UUS	9u  nnnUU :g  n[        R                  " [        R                  " U5      S
9nUc  [        SU 35      eUR                  U	S0 SU0US9  [         R"                  R$                  Ul        [(        R*                  " UUUUUUU=(       d    [,        US9n[        U[        5      (       ae  U	R                  S0 5      nU(       a5  UR                  S5      (       a  U(       d  0 nSU;  a  0 US'   US   US   S'   [.        R0                  " UUUSS9nU$ ! [2         a  n[        R4                  " SWUU
U	S9eSnAff = f)zNDelete a container using the OpenAI Container API.

Currently supports OpenAI
r_   r`   r6   FTra   Nrb   r   rc   r   r8   rg   r   rm   r   r   r   rn   r9   rY   )r>   rp   rq   rr   rs   rt   ru   r   r   r   r   rv   rG   rw   rx   r|   r   r%   r~   r   r   container_delete_handlerr   r   r   rF   rH   )r   r7   rT   rU   rV   r-   r1   r2   r3   rI   rJ   r   r_   r`   rl   ra   rP   ri   r   r   re   delete_resultrm   rQ   s                           rR   r%   r%   4  sS   , Je
,?$17<Q1R)/4E)FJJ|U3t;	 

?3$--- $

= 9,=}=HO . 
#
 	
 4)$7- 	L;^ ,|; "?? --.JK 	" %,DEaDbc 
 	..!? != 	/ 	
 )2(B(B(H(H%-FF.&?)+'#66	
 m%:;;%zz*<bA~11*=='')$'7757$\27Ej7Q .t41QQ*$@!1	M  
$$ < (
 	

r   c	                   #    [        5       n
 [        R                  " 5       nSU	S'   [        [        4U UUUUUUUUS.	U	D6n[
        R                  " 5       n[        UR                  U5      nUR                  SU5      I Sh  vN n[        R                  " U5      (       a  UI Sh  vN nU$ UnU$  N/ N! [         a  n[        R                  " SUUU
U	S9eSnAff = f7f)a  Asynchronously list files in a container.

Parameters:
- `container_id` (str): The ID of the container
- `after` (Optional[str]): A cursor for pagination
- `limit` (Optional[int]): Number of items to return (1-100, default 20)
- `order` (Optional[str]): Sort order ('asc' or 'desc', default 'desc')
- `timeout` (int): Request timeout in seconds
- `custom_llm_provider` (Literal["openai"]): The LLM provider to use
- `extra_headers` (Optional[Dict[str, Any]]): Additional headers
- `extra_query` (Optional[Dict[str, Any]]): Additional query parameters
- `extra_body` (Optional[Dict[str, Any]]): Additional body parameters
- `kwargs` (dict): Additional keyword arguments

Returns:
- `response` (ContainerFileListResponse): The list of container files
Tr6   )	r   r   r   r   r7   r-   r1   r2   r3   Nr8   r9   )r>   r?   r@   r   r&   rA   rB   rC   rD   rE   rF   rG   rH   )r   r   r   r   r7   r-   r1   r2   r3   rI   rJ   rK   rL   rM   rN   rO   rP   rQ   s                     rR   r    r      s    < J#
%%'#| 
% 3'#!
 
 &&(#CGGT2"2249JKK}--**H  %H L +
  
$$ 3 (
 	

sY   C A4B6 B2$B6 'B4(B6 -C .B6 1C 2B6 4B6 6
C CCC r    c	                    g rX   rY   r   r   r   r   r7   rT   rU   rV   r-   r    rI   s              rR   r&   r&          r\   )r    c	                    g rX   rY   r   s              rR   r&   r&     r   r\   c                    [        5       n UnUR                  S5      nUR                  S5      nUR                  SS5      SL nUR                  S5      nUb8  [        U[        5      (       a  [
        R                  " U5      n[        S0 UD6nU$ [        SUUUS.UD6n[        U UUS	9u  nnn[        R                  " [        R                  " U5      S
9nUc  [        SU 35      eUR                  USU UUUS.SU0US9  [         R"                  R$                  Ul        [(        R*                  " UUUUUUUU	U
U=(       d    [,        US9$ ! [.         a  n[        R0                  " SWUUUS9eSnAff = f)zUList files in a container using the OpenAI Container API.

Currently supports OpenAI
r_   r`   r6   FTra   Nrb   r   rc   r   r8   )r   r   r   r   rg   )r   re   ri   rk   r   r   r   r1   r2   r7   rl   r9   rY   )r>   rp   rq   rr   rs   rt   ru   r   r   r   r   rv   rG   rw   rx   r|   r   r&   r~   r   r   container_file_list_handlerr   rF   rH   )r   r   r   r   r7   rT   rU   rV   r-   r1   r2   r3   rI   rJ   r   r_   r`   rl   ra   rP   ri   r   re   rQ   s                           rR   r&   r&   !  s   . JU
,?$17<Q1R)/4E)FJJ|U3t;	 

?3$--- $

= 90A=AHO . 
#
 	
 4)$7- 	L;^ "?? --.JK 	" %,DEaDbc 
 	.. ,	 "? != 	/ 	
  )2(F(F(L(L%$@@.&?)+'#66
 	
  
$$ < (
 	

s   BE B:E 
E2E--E2filec                   #    [        5       n [        R                  " 5       n	SUS'   [        [        4U UUUUUUS.UD6n
[
        R                  " 5       n[        UR                  U
5      nU	R                  SU5      I Sh  vN n[        R                  " U5      (       a  UI Sh  vN nU$ UnU$  N/ N! [         a  n[        R                  " SUUUUS9eSnAff = f7f)a  Asynchronously upload a file to a container.

This endpoint allows uploading files directly to a container session,
supporting various file types like CSV, Excel, Python scripts, etc.

Parameters:
- `container_id` (str): The ID of the container to upload the file to
- `file` (FileTypes): The file to upload. Can be:
    - A tuple of (filename, content, content_type)
    - A tuple of (filename, content)
    - A file-like object with read() method
    - Bytes
    - A string path to a file
- `timeout` (int): Request timeout in seconds
- `custom_llm_provider` (Literal["openai"]): The LLM provider to use
- `extra_headers` (Optional[Dict[str, Any]]): Additional headers
- `extra_query` (Optional[Dict[str, Any]]): Additional query parameters
- `extra_body` (Optional[Dict[str, Any]]): Additional body parameters
- `kwargs` (dict): Additional keyword arguments

Returns:
- `response` (ContainerFileObject): The uploaded file object

Example:
```python
import litellm

# Upload a CSV file
response = await litellm.aupload_container_file(
    container_id="container_abc123",
    file=("data.csv", open("data.csv", "rb").read(), "text/csv"),
    custom_llm_provider="openai",
)
print(response)
```
Tr6   )r   r   r7   r-   r1   r2   r3   Nr8   r9   )r>   r?   r@   r   r)   rA   rB   rC   rD   rE   rF   rG   rH   )r   r   r7   r-   r1   r2   r3   rI   rJ   rK   rL   rM   rN   rO   rP   rQ   s                   rR   r#   r#     s     ^ J!
%%'#|!

% 3'#!

 

 &&(#CGGT2"2249JKK}--**H  %H L +
  
$$ 3 (
 	

sY   CA2B4  B0$B4 %B2&B4 +C,B4 /C0B4 2B4 4
C>CCCr#   c                    g rX   rY   	r   r   r7   rT   rU   rV   r-   r#   rI   s	            rR   r)   r)          r\   )r#   c                    g rX   rY   r   s	            rR   r)   r)     r   r\   c
                    SSK Jn  [        5       n UnU
R                  S5      nU
R	                  S5      nU
R                  SS5      SL nU
R	                  S5      nUb8  [        U[        5      (       a  [        R                  " U5      n[        S0 UD6nU$ [        SUUUS
.U
D6n[        U UUS9u  nnn[        R                  " [        R                  " U5      S9nUc  [!        SU 35      eUR#                  U
SSU 0SU0US9  [$        R&                  R(                  Ul        UR-                  SUUUUUU=(       d    [.        UUUS9
$ ! [0         a  n[        R2                  " SWUUU
S9eS	nAff = f)ax  Upload a file to a container using the OpenAI Container API.

This endpoint allows uploading files directly to a container session,
supporting various file types like CSV, Excel, Python scripts, JSON, etc.
This is useful when /chat/completions or /responses sends files to the
container but the input file type is limited to PDF. This endpoint lets
you work with other file types.

Currently supports OpenAI

Example:
```python
import litellm

# Upload a CSV file
response = litellm.upload_container_file(
    container_id="container_abc123",
    file=("data.csv", open("data.csv", "rb").read(), "text/csv"),
    custom_llm_provider="openai",
)
print(response)

# Upload a Python script
response = litellm.upload_container_file(
    container_id="container_abc123",
    file=("script.py", b"print('hello world')", "text/x-python"),
    custom_llm_provider="openai",
)
print(response)
```
r   )generic_container_handlerr_   r`   r6   FTra   Nrb   r   rc   r   r8   r   rg   r)   )
endpoint_namere   ri   rk   r1   r2   r7   rl   r   r   r9   rY   )+litellm.llms.custom_httpx.container_handlerr   r>   rp   rq   rr   rs   rt   ru   r   r   r   r   rv   rG   rw   rx   r|   r   r)   r~   r   handler   rF   rH   )r   r   r7   rT   rU   rV   r-   r1   r2   r3   rI   r   rJ   r   r_   r`   rl   ra   rP   ri   r   re   rQ   s                          rR   r)   r)   
  s   ` VJO
,?$17<Q1R)/4E)FJJ|U3t;	 

?3$--- $

= 9*;];HO . 
#
 	
 4)$7- 	L;^ "?? --.JK 	" %,DEaDbc 
 	..+\:!? != 	/ 	
 )2(G(G(M(M%(//1&?)+'#66. 0 
 	
  
$$ < (
 	

s   BE B1E 
E/E**E/)NNX  r.   NNN)NNr   NNNr.   )
NNr   NNNr.   NNN)NNNr   r.   NNN)NNNr   NNNr.   )NNNr   NNNr.   NNN)r   r.   NNN)r   NNNr.   )r   NNNr.   NNN)<r?   rA   rt   	functoolsr   typingr   r   r   r   r   r	   r
   r   rG   litellm.constantsr   r   litellm.containers.utilsr   r   *litellm.litellm_core_utils.litellm_loggingr   LiteLLMLoggingObj/litellm.llms.base_llm.containers.transformationr   litellm.mainr   litellm.types.containers.mainr   r   r   r   r   r   r   litellm.types.llms.openair   litellm.types.routerr   litellm.types.utilsr   litellm.utilsr   r   __all__rs   r   r$   intr!   r'   r"   r(   r   r%   r    r&   r#   r)   rY   r\   rR   <module>r      s       Q Q Q  H T O .   0 5 ) 7"  /3$(DL /3,0+/A

A
DcN+A
 tCy!A
 !!@AA
 DcN+A
 $sCx.)A
 c3h(A
 A
 A
N 
 /3$(!"!%DL
DcN+ tCy!
 c] sm # !!@A t} sC() 
  
 /3$(!"!%DL ).
DcN+ tCy!
 c] sm # !!@A u~  
$  /3$(!"!%DL /3,0+/A

A
DcN+A
 tCy!A

 c]A
 smA
 #A
 !!@AA
 DcN+A
 $sCx.)A
 c3h(A
 c3'(*A
 A
J DL /3,0+/@
C=@
C=@
 C=@

 !!@A@
 DcN+@
 $sCx.)@
 c3h(@
 @
 @
J 
!"!%DLC=C= C=
 c] sm # !!@A dm sC../ 
  
!"!%DL (-C=C= C=
 c] sm # !!@A en  
$ !"!%DL /3,0+/d
C=d
C=d
 C=d

 c]d
 smd
 #d
 !!@Ad
 DcN+d
 $sCx.)d
 c3h(d
 c3--.0d
 d
P  DL /3,0+/:
:
 !!@A:
 DcN+:
 $sCx.):
 c3h(:
 :
 :
~ 
 !"!%DL c] sm	
 # !!@A ! sC() 
 
 !"!%DL +0 c] sm	
 # !!@A !  
   !"!%DL /3,0+/{
{
 c]{
 sm	{

 #{
 !!@A{
 DcN+{
 $sCx.){
 c3h({
 c3'(*{
 {
~  DL /3,0+/:
:
 !!@A:
 DcN+:
 $sCx.):
 c3h(:
 :
 :
~ 
 !"!%DL c] sm	
 # !!@A t} sC../ 
 
 !"!%DL ). c] sm	
 # !!@A u~  
   !"!%DL /3,0+/{
{
 c]{
 sm	{

 #{
 !!@A{
 DcN+{
 $sCx.){
 c3h({
 c3--.0{
 {
~   DL.2,0+/A
A
C=A
 C=A
 C=	A
 !!@AA
 DcN+A
 $sCx.)A
 c3h(A
 A
 A
L 
  !"!%DLC= C= C=	 c] sm # !!@A #4= sC223 
" 
  !"!%DL -2C= C= C=	 c] sm # !!@A #5>  
&   !"!%DL.2,0+/l
l
C=l
 C=l
 C=	l
 c]l
 sml
 #l
 !!@Al
 DcN+l
 $sCx.)l
 c3h(l
 c31124l
 l
`  DL.2,0+/P
P

P
 !!@A	P

 DcN+P
 $sCx.)P
 c3h(P
 P
 P
j 
 !"!%DL
 c]	
 sm # !!@A $DM sC,,- 
 
 !"!%DL .3
 c]	
 sm # !!@A $EN  
"  !"!%DL.2,0+/A
A

A
 c]	A

 smA
 #A
 !!@AA
 DcN+A
 $sCx.)A
 c3h(A
 c3++,.A
 A
r\   