§
    šŠtjq  ã                  ó–   — d dl mZ d dlZd dlmZmZmZmZmZ d dl	m
Z
 d dlmZ d dlmZ  G d„ ded	¬
¦  «        Z G d„ de¦  «        ZdS )é    )ÚannotationsN)ÚAnyÚDictÚListÚMappingÚOptional)ÚCallbackManagerForLLMRun)ÚLLM)Ú	BaseModelc                  óN   — e Zd ZU dZdZded<   dZded<   	 dZd	ed
<   dZded<   dS )ÚParamsz)Parameters for the MLflow AI Gateway LLM.g        ÚfloatÚtemperatureé   ÚintÚcandidate_countNúOptional[List[str]]ÚstopzOptional[int]Ú
max_tokens)	Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Ú__annotations__r   r   r   © ó    úh/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/langchain_community/llms/mlflow_ai_gateway.pyr   r      s_   € € € € € € Ø3Ð3à€KÐÐÐÑØ€OÐÐÐÑØ-Ø $€DÐ$Ð$Ð$Ñ$Ø $€JÐ$Ð$Ð$Ñ$Ð$Ð$r   r   Úallow)Úextrac                  ó¢   ‡ — e Zd ZU dZded<   dZded<   dZded<   dˆ fd„Zedd„¦   «         Z	edd„¦   «         Z
	 	 ddd„Zedd„¦   «         Zˆ xZS )ÚMlflowAIGatewaya7  MLflow AI Gateway LLMs.

    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.llms import MlflowAIGateway

            completions = MlflowAIGateway(
                gateway_uri="<your-mlflow-ai-gateway-uri>",
                route="<your-mlflow-ai-gateway-completions-route>",
                params={
                    "temperature": 0.1
                }
            )
    ÚstrÚrouteNzOptional[str]Úgateway_urizOptional[Params]ÚparamsÚkwargsr   c                ó  •— t          j        dt          ¦  «         	 dd l}n"# t          $ r}t	          d¦  «        |‚d }~ww xY w t          ¦   «         j        di |¤Ž | j        r!|j         	                    | j        ¦  «         d S d S )NzF`MlflowAIGateway` is deprecated. Use `Mlflow` or `Databricks` instead.r   ú_Could not import `mlflow.gateway` module. Please install it with `pip install mlflow[gateway]`.r   )
ÚwarningsÚwarnÚDeprecationWarningÚmlflow.gatewayÚImportErrorÚsuperÚ__init__r$   ÚgatewayÚset_gateway_uri)Úselfr&   ÚmlflowÚeÚ	__class__s       €r   r/   zMlflowAIGateway.__init__/   sÀ   ø€ ÝŒØTÝñ	
ô 	
ð 	
ð	Ø!Ð!Ð!Ð!Ð!øÝð 	ð 	ð 	ÝðHñô ð ðøøøøð	øøøð 	�‰ŒÔÐ"Ð"˜6Ð"Ð"Ð"ØÔð 	=ØŒN×*Ò*¨4Ô+;Ñ<Ô<Ð<Ð<Ð<ð	=ð 	=s   �" ¢
A¬<¼AÚreturnúDict[str, Any]c                óh   — | j         | j        dœ| j        r| j                             ¦   «         ni ¥}|S )N)r$   r#   )r$   r#   r%   Údict)r2   r%   s     r   Ú_default_paramszMlflowAIGateway._default_params@   sF   € ð  Ô+Ø”Zð"
ð "
ð &*¤[Ð8ˆtŒ{×ÒÑ!Ô!Ð!°bð"
ˆð
 ˆr   úMapping[str, Any]c                ó   — | j         S )N)r:   ©r2   s    r   Ú_identifying_paramsz#MlflowAIGateway._identifying_paramsI   s   € àÔ#Ð#r   Úpromptr   r   Úrun_managerú"Optional[CallbackManagerForLLMRun]c                óD  — 	 dd l }n"# t          $ r}t          d¦  «        |‚d }~ww xY wd|i| j        r| j                             ¦   «         ni ¥}|p| j        r| j        j        nd x}r||d<   |j                             | j        |¬¦  «        }	|	d         d         d         S )Nr   r(   r?   r   )ÚdataÚ
candidatesÚtext)r,   r-   r%   r9   r   r0   Úqueryr#   )
r2   r?   r   r@   r&   r3   r4   rC   ÚsÚresps
             r   Ú_callzMlflowAIGateway._callM   sá   € ð	Ø!Ð!Ð!Ð!Ð!øÝð 	ð 	ð 	ÝðHñô ð ðøøøøð	øøøð �fð 
à%)¤[Ð8ˆtŒ{×ÒÑ!Ô!Ð!°bð 
ˆð ÐD¨d¬kÐC˜$œ+Ô*Ð*¸tÐEˆ1ð 	ØˆD�‰LØŒ~×#Ò# D¤J°TÐ#Ñ:Ô:ˆØ�LÔ! !Ô$ VÔ,Ð,s   ‚ ‡
&‘!¡&c                ó   — dS )Nzmlflow-ai-gatewayr   r=   s    r   Ú	_llm_typezMlflowAIGateway._llm_typee   s   € à"Ð"r   )r&   r   )r6   r7   )r6   r;   )NN)
r?   r"   r   r   r@   rA   r&   r   r6   r"   )r6   r"   )r   r   r   r   r   r$   r%   r/   Úpropertyr:   r>   rI   rK   Ú__classcell__)r5   s   @r   r!   r!      s÷   ø€ € € € € € ðð ð& €J€J�JØ!%€KÐ%Ð%Ð%Ñ%Ø#€FÐ#Ð#Ð#Ñ#ð=ð =ð =ð =ð =ð =ð" ðð ð ñ „Xðð ð$ð $ð $ñ „Xð$ð %)Ø:>ð	-ð -ð -ð -ð -ð0 ð#ð #ð #ñ „Xð#ð #ð #ð #ð #r   r!   )Ú
__future__r   r)   Útypingr   r   r   r   r   Úlangchain_core.callbacksr	   Ú#langchain_core.language_models.llmsr
   Úpydanticr   r   r!   r   r   r   ú<module>rS      sï   ðØ "Ð "Ð "Ð "Ð "Ð "à €€€Ø 5Ð 5Ð 5Ð 5Ð 5Ð 5Ð 5Ð 5Ð 5Ð 5Ð 5Ð 5Ð 5Ð 5à =Ð =Ð =Ð =Ð =Ð =Ø 3Ð 3Ð 3Ð 3Ð 3Ð 3Ø Ð Ð Ð Ð Ð ð
%ð %ð %ð %ð %ˆY˜gð %ñ %ô %ð %ðP#ð P#ð P#ð P#ð P#�cñ P#ô P#ð P#ð P#ð P#r   