From 50fe5080e6f10b8cdf56079ffe2c6542a4ce5779 Mon Sep 17 00:00:00 2001 From: Tony Kipkemboi Date: Wed, 26 Mar 2025 11:28:02 -0400 Subject: [PATCH] docs: update theme to mint and modify opik observability doc --- docs/docs.json | 2 +- docs/how-to/opik-observability.mdx | 87 ++++++++++++++++-------------- 2 files changed, 47 insertions(+), 42 deletions(-) diff --git a/docs/docs.json b/docs/docs.json index cced352cf..dc3acdaa6 100644 --- a/docs/docs.json +++ b/docs/docs.json @@ -1,6 +1,6 @@ { "$schema": "https://mintlify.com/docs.json", - "theme": "palm", + "theme": "mint", "name": "CrewAI", "colors": { "primary": "#EB6658", diff --git a/docs/how-to/opik-observability.mdx b/docs/how-to/opik-observability.mdx index a1d128b8f..b87c1513d 100644 --- a/docs/how-to/opik-observability.mdx +++ b/docs/how-to/opik-observability.mdx @@ -8,6 +8,10 @@ icon: meteor With [Comet Opik](https://www.comet.com/docs/opik/), debug, evaluate, and monitor your LLM applications, RAG systems, and agentic workflows with comprehensive tracing, automated evaluations, and production-ready dashboards. + + Opik agent monitoring example with CrewAI + + Opik provides comprehensive support for every stage of your CrewAI application development: - **Log Traces and Spans**: Automatically track LLM calls and application logic to debug and analyze development and production systems. Manually or programmatically annotate, view, and compare responses across projects. @@ -27,7 +31,7 @@ For this guide we will use CrewAI’s quickstart example. ```shell - %pip install crewai crewai-tools opik --upgrade + pip install crewai crewai-tools opik --upgrade ``` @@ -35,8 +39,10 @@ For this guide we will use CrewAI’s quickstart example. import opik opik.configure(use_local=False) ``` + First, we set up our API keys for our LLM-provider as environment variables: + ```python import os import getpass @@ -47,53 +53,56 @@ For this guide we will use CrewAI’s quickstart example. The first step is to create our project. We will use an example from CrewAI’s documentation: + ```python from crewai import Agent, Crew, Task, Process -class YourCrewName: - def agent_one(self) -> Agent: - return Agent( - role="Data Analyst", - goal="Analyze data trends in the market", - backstory="An experienced data analyst with a background in economics", - verbose=True, - ) + class YourCrewName: + def agent_one(self) -> Agent: + return Agent( + role="Data Analyst", + goal="Analyze data trends in the market", + backstory="An experienced data analyst with a background in economics", + verbose=True, + ) - def agent_two(self) -> Agent: - return Agent( - role="Market Researcher", - goal="Gather information on market dynamics", - backstory="A diligent researcher with a keen eye for detail", - verbose=True, - ) + def agent_two(self) -> Agent: + return Agent( + role="Market Researcher", + goal="Gather information on market dynamics", + backstory="A diligent researcher with a keen eye for detail", + verbose=True, + ) - def task_one(self) -> Task: - return Task( - name="Collect Data Task", - description="Collect recent market data and identify trends.", - expected_output="A report summarizing key trends in the market.", - agent=self.agent_one(), - ) + def task_one(self) -> Task: + return Task( + name="Collect Data Task", + description="Collect recent market data and identify trends.", + expected_output="A report summarizing key trends in the market.", + agent=self.agent_one(), + ) - def task_two(self) -> Task: - return Task( - name="Market Research Task", - description="Research factors affecting market dynamics.", - expected_output="An analysis of factors influencing the market.", - agent=self.agent_two(), - ) + def task_two(self) -> Task: + return Task( + name="Market Research Task", + description="Research factors affecting market dynamics.", + expected_output="An analysis of factors influencing the market.", + agent=self.agent_two(), + ) - def crew(self) -> Crew: - return Crew( - agents=[self.agent_one(), self.agent_two()], - tasks=[self.task_one(), self.task_two()], - process=Process.sequential, - verbose=True, - ) + def crew(self) -> Crew: + return Crew( + agents=[self.agent_one(), self.agent_two()], + tasks=[self.task_one(), self.task_two()], + process=Process.sequential, + verbose=True, + ) ``` + Now we can import Opik’s tracker and run our crew: + ```python from opik.integrations.crewai import track_crewai @@ -109,10 +118,6 @@ class YourCrewName: - Agent interactions and task execution flow - Performance metrics like latency and token usage - Evaluation metrics (built-in or custom) - - - Opik agent monitoring example with CrewAI -