
    gg
                         d dl mZmZmZmZmZmZmZmZ eee	   e	e
f   Zeeeee
   ef   eee
   eee
   f   eee
   eee
   ee
e
f   f   f   Zdee
eeee   f   f   deee
ef      fdZdede
defdZy)	    )IODictListMappingOptionalTupleUnioncastdreturnc                     g }| j                         D ]C  \  }}t        |t              r|D ]  }|j                  ||f        1|j                  ||f       E |S )aE  
    The format we use is a list of tuples, where the first element is the
    name of the file and the second is the file object. Typically HTTPX wants
    a dict, but to be able to send lists of files, you have to use the list
    approach (which also works for non-lists)
    https://github.com/encode/httpx/pull/1032
    )items
isinstancelistappend)r   httpx_tupleskey	file_likefile_like_items        E/var/www/openai/venv/lib/python3.12/site-packages/cohere/core/file.py!convert_file_dict_to_httpx_tuplesr      sa     L'')Yi&"+##S.$9: #, i 01 $     filedefault_content_typec           	      *   t        | t              rt        |       dk(  r,t        t        t
        t           t        f   |       \  }}|||fS t        |       dk(  r?t        t        t
        t           t        t
        t           f   |       \  }}}|xs |}|||fS t        |       dk(  rSt        t        t
        t           t        t
        t           t        t        t        f   f   |       \  }}}}|xs |}||||fS t        dt        |              d| |fS )z
    This function resolves to the file's content type, if provided, and defaults
    to the default_content_type value if not.
             zUnexpected tuple length: N)
r   tuplelenr
   r   r   strFileContentr   
ValueError)r   r   filenamecontentfile_content_typeout_content_typeheaderss          r   with_content_typer)   .   s   
 $t9> $U8C=++E%F MHgg';<<Y!^37hsm[ZbcfZg>g8hjn3o0Hg00H4Hg'788Y!^<@hsm[(3-cARRSUY=9Hg0'  1H4Hg'7AA8TDEE$,--r   N)typingr   r   r   r   r   r   r	   r
   bytesr!   r"   Filer   r)    r   r   <module>r.      s    I H H BuIuc)*	(3-
$%	(3-hsm
34	S	"CtT$Z'(()	%T	
*.t .3 .4 .r   