
    dh                         S SK r S SKJr  S SKJr  S SKJr  \ R                  " \5      r	\" SSSS9 " S	 S
\5      5       r
g)    N)urlparse)
deprecated)
ChatMlflowz0.3.3z1.0z#databricks_langchain.ChatDatabricks)sinceremovalalternative_importc                   d    \ rS rSr% SrSr\\S'    \S\4S j5       r	\S\4S j5       r
SS	 jrS
rg)ChatDatabricks   a  `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                     g)zReturn type of chat model.zdatabricks-chat selfs    b/var/www/html/shao/venv/lib/python3.13/site-packages/langchain_community/chat_models/databricks.py	_llm_typeChatDatabricks._llm_type,   s     !    c                     g)N r   r   s    r   _mlflow_extrasChatDatabricks._mlflow_extras1   s    r   Nc                     U R                   S:X  a  g [        U R                   5      R                  S:w  a  [        S5      eg )Nr   zBInvalid target URI. The target URI must be a valid databricks URI.)r   r   scheme
ValueErrorr   s    r   _validate_uriChatDatabricks._validate_uri5   s=    ??l*DOO$++|;T  <r   r   )r   N)__name__
__module____qualname____firstlineno____doc__r   str__annotations__propertyr   r   r   __static_attributes__r   r   r   r
   r
      sO    0 #J"<!3 ! !   r   r
   )loggingurllib.parser   langchain_core._apir   &langchain_community.chat_models.mlflowr   	getLoggerr    loggerr
   r   r   r   <module>r/      sJ     ! * =			8	$ 
<
,Z ,
,r   