diff --git a/tutorials/tracing/langchain_tracing_tutorial.ipynb b/tutorials/tracing/langchain_tracing_tutorial.ipynb index 9919e77af4..6b57ae8fda 100644 --- a/tutorials/tracing/langchain_tracing_tutorial.ipynb +++ b/tutorials/tracing/langchain_tracing_tutorial.ipynb @@ -43,7 +43,7 @@ "metadata": {}, "outputs": [], "source": [ - "!pip install \"langchain>=0.1.0\" langchain-community langchain-openai \"openai>=1\" \"arize-phoenix[evals]\" tiktoken nest-asyncio" + "!pip install \"langchain>=0.1.0\" langchain-community langchain-openai \"openai>=1\" \"arize-phoenix[evals]\" tiktoken nest-asyncio openinference-instrumentation-langchain" ] }, { @@ -70,6 +70,7 @@ "from langchain.chains import RetrievalQA\n", "from langchain.retrievers import KNNRetriever\n", "from langchain_openai import ChatOpenAI, OpenAIEmbeddings\n", + "from openinference.instrumentation.langchain import LangChainInstrumentor\n", "from tqdm import tqdm\n", "\n", "import phoenix as px\n", @@ -80,9 +81,9 @@ " RelevanceEvaluator,\n", " run_evals,\n", ")\n", + "from phoenix.otel import register\n", "from phoenix.session.evaluation import get_qa_with_reference, get_retrieved_documents\n", "from phoenix.trace import DocumentEvaluations, SpanEvaluations\n", - "from phoenix.trace.langchain import LangChainInstrumentor\n", "\n", "nest_asyncio.apply() # needed for concurrent evals in notebook environments" ] @@ -177,7 +178,8 @@ "metadata": {}, "outputs": [], "source": [ - "LangChainInstrumentor().instrument(skip_dep_check=True)" + "tracer_provider = register()\n", + "LangChainInstrumentor(tracer_provider=tracer_provider).instrument(skip_dep_check=True)" ] }, {