diff --git a/tutorials/tracing/crewai_tracing_tutorial.ipynb b/tutorials/tracing/crewai_tracing_tutorial.ipynb index 65a79f9cc1..3315a7103c 100644 --- a/tutorials/tracing/crewai_tracing_tutorial.ipynb +++ b/tutorials/tracing/crewai_tracing_tutorial.ipynb @@ -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": { @@ -209,7 +265,7 @@ "metadata": {}, "outputs": [], "source": [ - "session.view()" + "print(f\"View traces at {session.url}\")" ] }, {