
    ^h                     @    S r SSKJr  SSKJr  SSKJr   " S S5      rg)z
Transformation logic from OpenAI /v1/embeddings format to Bedrock Cohere /invoke format. 

Why separate file? Make it easy to see how transformation works
    )List)CohereEmbeddingConfig)CohereEmbeddingRequestc                   z    \ rS rSrSS jrS\\   4S jrS\S\S\4S jr	S	\S\
4S
 jrS	\S\\   S\S\4S jrSrg)BedrockCohereEmbeddingConfig   returnNc                     g )N selfs    j/home/james-whalen/.local/lib/python3.13/site-packages/litellm/llms/bedrock/embed/cohere_transformation.py__init__%BedrockCohereEmbeddingConfig.__init__   s        c                     S/$ )Nencoding_formatr   r   s    r   get_supported_openai_params8BedrockCohereEmbeddingConfig.get_supported_openai_params   s    !""r   non_default_paramsoptional_paramsc                 P    UR                  5        H  u  p4US:X  d  M  XBS'   M     U$ )Nr   embedding_types)items)r   r   r   kvs        r   map_openai_params.BedrockCohereEmbeddingConfig.map_openai_params   s3     ',,.DA%%56 12 / r   modelc                     SU;   $ )N3r   )r   r   s     r   _is_v3_model)BedrockCohereEmbeddingConfig._is_v3_model   s    e|r   inputinference_paramsc                     [        5       R                  XU5      n[        US   S9n[        R                  R	                  5        H  nXd;   d  M
  XF   XV'   M     U$ )N
input_type)r'   )r   _transform_requestr   __annotations__keys)r   r   r$   r%   transformed_requestnew_transformed_requestr   s          r   r(   /BedrockCohereEmbeddingConfig._transform_request   sh     45HH*
 #9*<8#
 (77<<>A'-@-C'* ? '&r   r   )r	   N)__name__
__module____qualname____firstlineno__r   r   strr   dictr   boolr"   r   r(   __static_attributes__r   r   r   r   r      sp    #T#Y #"&9=	# $ ''!%c'>B'	'r   r   N)__doc__typingr   (litellm.llms.cohere.embed.transformationr   litellm.types.llms.bedrockr   r   r   r   r   <module>r:      s     J = '  'r   