Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(docs): update langchain tutorial #5218

Merged
merged 1 commit into from
Oct 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading