o
    Zh                     @   sX   d dl Z d dlmZ d dlmZ d dlmZ e eZ	eddddG d	d
 d
eZ
dS )    N)urlparse)
deprecated)
ChatMlflowz0.3.3z1.0z#databricks_langchain.ChatDatabricks)ZsinceZremovalZalternative_importc                   @   sN   e Zd ZU dZdZeed< 	 edefddZedefddZ	dd
dZ
d	S )ChatDatabricksa  `Databricks` chat models API.

    To use, you should have the ``mlflow`` python package installed.
    For more information, see https://mlflow.org/docs/latest/llms/deployments.

    Example:
        .. code-block:: python

            from langchain_community.chat_models import ChatDatabricks

            chat_model = ChatDatabricks(
                target_uri="databricks",
                endpoint="databricks-llama-2-70b-chat",
                temperature=0.1,
            )

            # single input invocation
            print(chat_model.invoke("What is MLflow?").content)

            # single input invocation with streaming response
            for chunk in chat_model.stream("What is MLflow?"):
                print(chunk.content, end="|")
    
databricks
target_urireturnc                 C      dS )zReturn type of chat model.zdatabricks-chat selfr
   r
   a/var/www/html/lang_env/lib/python3.10/site-packages/langchain_community/chat_models/databricks.py	_llm_type,   s   zChatDatabricks._llm_typec                 C   r	   )N r
   r   r
   r
   r   _mlflow_extras1   s   zChatDatabricks._mlflow_extrasNc                 C   s*   | j dkrd S t| j jdkrtdd S )Nr   zBInvalid target URI. The target URI must be a valid databricks URI.)r   r   scheme
ValueErrorr   r
   r
   r   _validate_uri5   s   
zChatDatabricks._validate_uri)r   N)__name__
__module____qualname____doc__r   str__annotations__propertyr   r   r   r
   r
   r
   r   r      s   
 r   )loggingurllib.parser   Zlangchain_core._apir   Z&langchain_community.chat_models.mlflowr   	getLoggerr   loggerr   r
   r
   r
   r   <module>   s    
