with mlflow.start_run(run_name="databricks-docs-bot"):
logged_chain_info = mlflow.langchain.log_model(
lc_model=os.path.join(
os.getcwd(),
f"{QUICK_START_REPO_SAVE_FOLDER}/quick_start_demo/sample_rag_chain",
), # Chain code file from the quick start repo
model_config=chain_config, # Chain configuration set above
artifact_path="chain", # Required by MLflow
input_example=input_example, # Save the chain's input schema. MLflow will execute the chain before logging and capturing its output schema.
)
langchain 0.2.1 langchain-community 0.2.4 langchain-core 0.2.5 langchain-text-splitters 0.2.1 mlflow 2.15.1 mlflow-skinny 2.15.1
import mlflow import os
Log the model to MLflow
with mlflow.start_run(run_name="databricks-docs-bot"): logged_chain_info = mlflow.langchain.log_model( lc_model=os.path.join( os.getcwd(), f"{QUICK_START_REPO_SAVE_FOLDER}/quick_start_demo/sample_rag_chain", ), # Chain code file from the quick start repo model_config=chain_config, # Chain configuration set above artifact_path="chain", # Required by MLflow input_example=input_example, # Save the chain's input schema. MLflow will execute the chain before logging and capturing its output schema. )
Test the chain locally to see the MLflow Trace
chain = mlflow.langchain.load_model(logged_chain_info.model_uri) chain.invoke(input_example)
I assume this is a version issue but I can't find doc on the log_model parameters.