Skip to content

Commit

Permalink
fix(docs): update langchain tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
axiomofjoy committed Oct 29, 2024
1 parent 78942cd commit d0570cb
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tutorials/tracing/langchain_tracing_tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
},
{
Expand All @@ -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",
Expand All @@ -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"
]
Expand Down Expand Up @@ -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)"
]
},
{
Expand Down

0 comments on commit d0570cb

Please sign in to comment.