Ë
    Ýªg¼  ã                   ó@   — d Z ddlmZ ddlmZ ddlmZ  G d„ d«      Zy)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                   óh   — e Zd Zdd„Zdee   fd„Zdededefd„Zdede	fd	„Z
ded
ee   dedefd„Zy)ÚBedrockCohereEmbeddingConfigÚreturnNc                  ó   — y )N© ©Úselfs    úe/var/www/openai/venv/lib/python3.12/site-packages/litellm/llms/bedrock/embed/cohere_transformation.pyÚ__init__z%BedrockCohereEmbeddingConfig.__init__   s   € Øó    c                 ó   — dgS )NÚencoding_formatr
   r   s    r   Úget_supported_openai_paramsz8BedrockCohereEmbeddingConfig.get_supported_openai_params   s   € Ø!Ð"Ð"r   Únon_default_paramsÚoptional_paramsc                 óL   — |j                  «       D ]  \  }}|dk(  sŒ||d<   Œ |S )Nr   Úembedding_types)Úitems)r   r   r   ÚkÚvs        r   Úmap_openai_paramsz.BedrockCohereEmbeddingConfig.map_openai_params   s7   € ð '×,Ñ,Ö.‰DˆAˆqØÐ%Ó%Ø56Ð 1Ò2ð /ð Ðr   Úmodelc                 ó
   — d|v S )NÚ3r
   )r   r   s     r   Ú_is_v3_modelz)BedrockCohereEmbeddingConfig._is_v3_model   s   € Øeˆ|Ðr   ÚinputÚinference_paramsc                 óº   — t        «       j                  |||«      }t        |d   ¬«      }t        j                  j	                  «       D ]  }||v sŒ||   ||<   Œ |S )NÚ
input_type)r"   )r   Ú_transform_requestr   Ú__annotations__Úkeys)r   r   r   r    Útransformed_requestÚnew_transformed_requestr   s          r   r#   z/BedrockCohereEmbeddingConfig._transform_request   sq   € ô 4Ó5×HÑHØ5Ð*ó
Ðô #9Ø*¨<Ñ8ô#
Ðô (×7Ñ7×<Ñ<Ö>ˆAØÐ'Ò'Ø-@ÀÑ-CÐ'¨Ò*ð ?ð 'Ð&r   )r   N)Ú__name__Ú
__module__Ú__qualname__r   r   Ústrr   Údictr   Úboolr   r   r#   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>r2      s   ðñõ å JÝ =÷ 'ò  'r   