
    dhS
                    j    S SK Jr  S SKrS SKJrJrJrJr  S SKJ	r	  S SK
Jr  S	S jr " S S\	\5      rg)
    )annotationsN)AnyIteratorListOptional)
Embeddings)	BaseModelc              #  V   #    [        S[        U 5      U5       H  nXX!-    v   M     g 7fNr   )rangelen)textssizeis      e/var/www/html/shao/venv/lib/python3.13/site-packages/langchain_community/embeddings/mlflow_gateway.py_chunkr   
   s)     1c%j$'!! (s   ')c                  l   ^  \ rS rSr% SrS\S'    SrS\S'    SU 4S jjrSS	 jrSS
 jr	SS jr
SrU =r$ )MlflowAIGatewayEmbeddings   a  MLflow AI Gateway embeddings.

To use, you should have the ``mlflow[gateway]`` python package installed.
For more information, see https://mlflow.org/docs/latest/gateway/index.html.

Example:
    .. code-block:: python

        from langchain_community.embeddings import MlflowAIGatewayEmbeddings

        embeddings = MlflowAIGatewayEmbeddings(
            gateway_uri="<your-mlflow-ai-gateway-uri>",
            route="<your-mlflow-ai-gateway-embeddings-route>"
        )
strrouteNzOptional[str]gateway_uric                  > [         R                  " S[        5         SS Kn[
        TU ]  " S0 UD6  U R                  (       a&  UR                  R                  U R                  5        g g ! [         a  n[	        S5      UeS nAff = f)Nzd`MlflowAIGatewayEmbeddings` is deprecated. Use `MlflowEmbeddings` or `DatabricksEmbeddings` instead.r   _Could not import `mlflow.gateway` module. Please install it with `pip install mlflow[gateway]`. )
warningswarnDeprecationWarningmlflow.gatewayImportErrorsuper__init__r   gatewayset_gateway_uri)selfkwargsmlflowe	__class__s       r   r"   "MlflowAIGatewayEmbeddings.__init__%   s    .	

	! 	"6"NN**4+;+;<   	H 	s   A* *
B4B  Bc                L    SS K n/ n[        US5       Hn  nUR                  R	                  U R
                  SU0S9n[        US   S   [        5      (       a  UR                  US   5        MZ  UR                  US   5        Mp     U$ ! [         a  n[        S5      UeS nAff = f)Nr   r      text)data
embeddings)
r   r    r   r#   queryr   
isinstancer   extendappend)r%   r   r'   r(   r/   txtresps          r   _query MlflowAIGatewayEmbeddings._query7   s    	! 
%$C>>''

&#'GD$|,Q/66!!$|"45 !!$|"45 %   	H 	s   B 
B#BB#c                $    U R                  U5      $ )Nr6   )r%   r   s     r   embed_documents)MlflowAIGatewayEmbeddings.embed_documentsK   s    {{5!!    c                ,    U R                  U/5      S   $ r   r9   )r%   r-   s     r   embed_query%MlflowAIGatewayEmbeddings.embed_queryN   s    {{D6"1%%r<   r   )r&   r   )r   	List[str]returnzList[List[float]])r-   r   rA   zList[float])__name__
__module____qualname____firstlineno____doc____annotations__r   r"   r6   r:   r>   __static_attributes____classcell__)r)   s   @r   r   r      s8      J9!%K%0=$("& &r<   r   )r   r@   r   intrA   zIterator[List[str]])
__future__r   r   typingr   r   r   r   langchain_core.embeddingsr   pydanticr	   r   r   r   r<   r   <module>rO      s,    "  0 0 0 "
@&
I @&r<   