Skip to content

Commit

Permalink
docs: update crewai tutorial for 0.63.0+ (#5026)
Browse files Browse the repository at this point in the history
* Update crewai tutorial for 0.63.0+

* Notebook clean
  • Loading branch information
Jgilhuly authored Oct 16, 2024
1 parent fd0c6ce commit c89ba9e
Showing 1 changed file with 57 additions and 1 deletion.
58 changes: 57 additions & 1 deletion tutorials/tracing/crewai_tracing_tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,62 @@
"CrewAIInstrumentor().instrument(skip_dep_check=True, tracer_provider=tracer_provider)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"CrewAI uses either Langchain or LiteLLM under the hood to call LLMs, depending on the package version. We recommend instrumenting the corresponding library to get visibility into the LLM calls."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"! pip show crewai | grep Version"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"If you're using CrewAI<0.63.0, instrument Langchain:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# ! pip install openinference-instrumentation-langchain\n",
"\n",
"# from openinference.instrumentation.langchain import LangChainInstrumentor\n",
"\n",
"# LangChainInstrumentor().instrument(tracer_provider=tracer_provider)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"If you're using CrewAI>=0.63.0, instrument LiteLLM:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"! pip install openinference-instrumentation-litellm\n",
"\n",
"from openinference.instrumentation.litellm import LiteLLMInstrumentor\n",
"\n",
"LiteLLMInstrumentor().instrument(tracer_provider=tracer_provider)"
]
},
{
"cell_type": "markdown",
"metadata": {
Expand Down Expand Up @@ -209,7 +265,7 @@
"metadata": {},
"outputs": [],
"source": [
"session.view()"
"print(f\"View traces at {session.url}\")"
]
},
{
Expand Down

0 comments on commit c89ba9e

Please sign in to comment.