Python SDK for AI agent monitoring, LLM cost tracking, benchmarking, and more. Integrates with most LLMs and agent frameworks including CrewAI, Agno, OpenAI Agents SDK, Langchain, Autogen, AG2, and CamelAI
Python agentagentopsagents-sdkaianthropicautogencost-estimationcrewaievalsevaluation-metricsgroqlangchainllmmistralollamaopenaiopenai-agents
Update AG2 Reference (#602)
Yiran Wucb785fed9110
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.mdindex 1db574e5..0b66b8d8 100644--- a/CONTRIBUTING.md+++ b/CONTRIBUTING.md@@ -2,7 +2,7 @@Thanks for checking out AgentOps. We're building tools to help developers like you make AI agents that actually work reliably. If you've ever tried to build an agent system, you know the pain - they're a nightmare to debug, impossible to monitor, and when something goes wrong... good luck figuring out why.-We created AgentOps to solve these headaches, and we'd love your help making it even better. Our SDK hooks into all the major Python frameworks (AutoGen, CrewAI, LangChain) and LLM providers (OpenAI, Anthropic, Cohere, etc.) to give you visibility into what your agents are actually doing.+We created AgentOps to solve these headaches, and we'd love your help making it even better. Our SDK hooks into all the major Python frameworks (AG2, CrewAI, LangChain) and LLM providers (OpenAI, Anthropic, Cohere, etc.) to give you visibility into what your agents are actually doing.## How You Can Helpdiff --git a/README.md b/README.mdindex 3d7dcdac..eb8fa402 100644--- a/README.md+++ b/README.md@@ -58,7 +58,7 @@ AgentOps helps developers build, evaluate, and monitor AI agents. From prototype| 💸 **LLM Cost Management** | Track spend with LLM foundation model providers || 🧪 **Agent Benchmarking** | Test your agents against 1,000+ evals || 🔐 **Compliance and Security** | Detect common prompt injection and data exfiltration exploits |-| 🤝 **Framework Integrations** | Native Integrations with CrewAI, AutoGen, Camel AI, & LangChain |+| 🤝 **Framework Integrations** | Native Integrations with CrewAI, AG2(AutoGen), Camel AI, & LangChain |## Quick Start ⌨️@@ -171,11 +171,11 @@ pip install 'crewai[agentops]'- [AgentOps integration example](https://docs.agentops.ai/v1/integrations/crewai)- [Official CrewAI documentation](https://docs.crewai.com/how-to/AgentOps-Observability)-### AutoGen 🤖-With only two lines of code, add full observability and monitoring to Autogen agents. Set an `AGENTOPS_API_KEY` in your environment and call `agentops.init()`+### AG2 🤖+With only two lines of code, add full observability and monitoring to AG2 (formerly AutoGen) agents. Set an `AGENTOPS_API_KEY` in your environment and call `agentops.init()`-- [Autogen Observability Example](https://microsoft.github.io/autogen/docs/notebooks/agentchat_agentops)-- [Autogen - AgentOps Documentation](https://microsoft.github.io/autogen/docs/ecosystem/agentops)+- [AG2 Observability Example](https://docs.ag2.ai/notebooks/agentchat_agentops)+- [AG2 - AgentOps Documentation](https://docs.ag2.ai/docs/ecosystem/agentops)### Camel AI 🐪diff --git a/docs/images/external/autogen/ag2_blue.svg b/docs/images/external/autogen/ag2_blue.svgnew file mode 100644index 00000000..28043ea4--- /dev/null+++ b/docs/images/external/autogen/ag2_blue.svg@@ -0,0 +1,35 @@+<svg version="1.0" xmlns="http://www.w3.org/2000/svg"+ width="18" height="18" viewBox="0 0 2000.000000 2000.000000">++<g transform="scale(2, -2) translate(-400, -1000)" fill="#A9BED4">+<path d="M420 965 c0 -32 2 -35 29 -35 25 0 30 -4 33 -27 2 -23 8 -29 36 -31+28 -3 32 -7 32 -33 0 -26 3 -29 30 -29 28 0 30 -3 30 -35 0 -32 -2 -35 -30+-35 -27 0 -30 -3 -30 -29 0 -26 -4 -30 -32 -33 -33 -3 -33 -3 -36 -65 l-3 -63+36 0 35 0 0 65 0 65 30 0 c27 0 30 3 30 30 l0 30 65 0 65 0 0 35 0 35 160 0+160 0 0 -35 0 -35 65 0 65 0 0 -30 c0 -28 3 -30 35 -30 l35 0 0 -65 0 -65 30+0 30 0 0 65 0 65 -30 0 c-27 0 -30 3 -30 30 0 28 -3 30 -35 30 -33 0 -35 2+-35 35 0 33 2 35 35 35 32 0 35 2 35 30 0 27 3 30 30 30 27 0 30 3 30 29 0 26+4 30 33 33 28 3 32 7 35 36 3 31 2 32 -32 32 -33 0 -36 -2 -36 -30 0 -27 -3+-30 -30 -30 -28 0 -30 -3 -30 -35 0 -33 -2 -35 -35 -35 -32 0 -35 -2 -35 -30+l0 -30 -65 0 -65 0 0 30 0 30 -160 0 -160 0 0 -30 0 -30 -65 0 -65 0 0 30 c0+27 -3 30 -29 30 -26 0 -30 4 -33 33 -2 27 -8 33 -30 35 -24 3 -28 8 -28 33 0+27 -3 29 -35 29 -33 0 -35 -2 -35 -35z"/>+<path d="M678 648 c-3 -29 -7 -33 -36 -36 l-33 -3 3 -62 3 -62 288 -3 287 -2+0 65 0 65 -30 0 c-28 0 -30 3 -30 35 l0 35 -224 0 -225 0 -3 -32z m132 -68 c0+-28 -3 -30 -35 -30 -32 0 -35 2 -35 30 0 28 3 30 35 30 32 0 35 -2 35 -30z+m250 0 c0 -27 -3 -30 -30 -30 -27 0 -30 3 -30 30 0 27 3 30 30 30 27 0 30 -3+30 -30z"/>+<path d="M490 345 c0 -33 -2 -35 -35 -35 l-35 0 0 -135 0 -135 35 0 35 0 0 70+0 70 65 0 65 0 0 -70 0 -70 35 0 35 0 0 135 0 135 -30 0 c-28 0 -30 3 -30 35+l0 35 -70 0 -70 0 0 -35z m130 -65 l0 -30 -65 0 -65 0 0 30 0 30 65 0 65 0 0+-30z"/>+<path d="M830 345 c0 -32 -2 -35 -30 -35 l-30 0 0 -100 0 -100 30 0 c28 0 30+-3 30 -35 l0 -35 70 0 70 0 0 35 c0 33 2 35 35 35 l35 0 0 70 0 71 -67 -3 -68+-3 -3 -32 c-3 -32 -2 -33 32 -33 34 0 36 -2 36 -35 l0 -35 -65 0 -65 0 0 100+0 100 100 0 100 0 0 35 0 35 -105 0 -105 0 0 -35z"/>+<path d="M1112 348 l3 -33 103 -3 102 -3 0 -29 c0 -29 0 -29 -67 -32 l-68 -3+-3 -32 c-3 -28 -7 -32 -35 -35 l-32 -3 -3 -67 -3 -68 141 0 140 0 0 35 0 35+-105 0 -105 0 0 35 0 35 70 0 70 0 0 29 c0 26 4 30 33 33 28 3 32 7 35 36 3+31 2 32 -32 32 -34 0 -36 2 -36 35 l0 35 -106 0 -105 0 3 -32z"/>+</g>+</svg>diff --git a/docs/v1/examples/examples.mdx b/docs/v1/examples/examples.mdxindex 05dfd962..6aa617b5 100644--- a/docs/v1/examples/examples.mdx+++ b/docs/v1/examples/examples.mdx@@ -37,8 +37,8 @@ mode: "wide"Track observations from Claude, Haiku and Sonnet series of models</Card>- <Card title="AutoGen" icon="microsoft" href="/v1/integrations/autogen">- AutoGen multi-agent conversible workflow with tool usage+ <Card title="AG2" icon={<img src="https://www.github.com/agentops-ai/agentops/blob/main/docs/images/external/autogen/ag2_blue.svg?raw=true" alt="AG2"/>} iconType="image" href="/v1/integrations/autogen">+ AG2 (Formerly AutoGen) multi-agent conversible workflow with tool usage</Card><Card title="CamelAI" icon={<img src="https://www.github.com/agentops-ai/agentops/blob/main/docs/images/external/camel/camel.png?raw=true" alt="CamelAI" />} iconType="image" href="/v1/examples/camel">diff --git a/docs/v1/integrations/autogen.mdx b/docs/v1/integrations/autogen.mdxindex a9cfc412..85cea76a 100644--- a/docs/v1/integrations/autogen.mdx+++ b/docs/v1/integrations/autogen.mdx@@ -1,14 +1,14 @@----title: Autogen-description: "Track your Autogen agents with AgentOps"+title: AG2+description: "Track your AG2 agents with AgentOps"---import CodeTooltip from '/snippets/add-code-tooltip.mdx'import EnvTooltip from '/snippets/add-env-tooltip.mdx'-AgentOps and Autogen teamed up to make monitoring Autogen agents dead simple. Autogen has comprehensive [documentation](https://microsoft.github.io/autogen/docs) available as well as a great [quickstart](https://microsoft.github.io/autogen/docs/Getting-Started).+AgentOps and AG2 (Formerly AutoGen) teamed up to make monitoring AG2 agents dead simple. AG2 has comprehensive [documentation](https://docs.ag2.ai/docs/Home) available as well as a great [quickstart](https://docs.ag2.ai/docs/Getting-Started).-## Adding AgentOps to Autogen agents+## Adding AgentOps to AG2 agents<Steps><Step title="Install the AgentOps SDK">@@ -21,7 +21,7 @@ AgentOps and Autogen teamed up to make monitoring Autogen agents dead simple. Au```</CodeGroup></Step>- <Step title="Install Autogen">+ <Step title="Install AG2"><CodeGroup>```bash pippip install pyautogendiff --git a/docs/v1/usage/sdk-reference.mdx b/docs/v1/usage/sdk-reference.mdxindex 62b11c9f..ae0690c3 100644--- a/docs/v1/usage/sdk-reference.mdx+++ b/docs/v1/usage/sdk-reference.mdx@@ -114,7 +114,7 @@ Set the parent API key which has visibility over projects it is a parent of.### `stop_instrumenting()`Stops instrumenting LLM calls. This is typically used by agent frameworks (i.e., [CrewAI](/v1/integrations/crewai) and-[autogen](/v1/integrations/autogen)) to stop using AgentOps' auto-instrumentation of LLM libraries such as OpenAI. This+[AG2](/v1/integrations/autogen)) to stop using AgentOps' auto-instrumentation of LLM libraries such as OpenAI. Thisallows these frameworks to use their own instrumenting or callback handler.diff --git a/examples/README.md b/examples/README.mdindex 03c7f452..6dca55bc 100644--- a/examples/README.md+++ b/examples/README.md@@ -23,7 +23,7 @@ At a high level, AgentOps gives you the ability to monitor LLM calls, costs, lat## Integrations- [AI21](./ai21_examples/ai21_examples.ipynb)- [Anthropic](./anthropic_examples/)--- [Autogen](./autogen_examples/)+- [AG2](./autogen_examples/)- [Cohere](./cohere_examples/cohere_example.ipynb)- [Crew.ai](./crew_examples/)- [Groq](./multi_agent_groq_example.ipynb)diff --git a/examples/autogen_examples/AgentChat.ipynb b/examples/autogen_examples/AgentChat.ipynbindex 85fd4991..7de27fac 100644--- a/examples/autogen_examples/AgentChat.ipynb+++ b/examples/autogen_examples/AgentChat.ipynb@@ -6,7 +6,7 @@"id": "bb6538d8-2a5d-4a99-b2c1-7130963e4f7b","metadata": {},"source": [- "# AutoGen Chat Example\n",+ "# AG2 Chat Example\n","<img src=\"https://raw.githubusercontent.com/AgentOps-AI/agentops/main/docs/images/external/autogen/autogen-integration.png?raw=true\" width=\"25%\"/>\n","\n","AgentOps automatically configures itself when it's initialized meaning your agent run data will be tracked and logged to your AgentOps dashboard right away."diff --git a/examples/autogen_examples/MathAgent.ipynb b/examples/autogen_examples/MathAgent.ipynbindex 1f1a44a6..124017bc 100644--- a/examples/autogen_examples/MathAgent.ipynb+++ b/examples/autogen_examples/MathAgent.ipynb@@ -6,7 +6,7 @@"id": "bb6538d8-2a5d-4a99-b2c1-7130963e4f7b","metadata": {},"source": [- "# AutoGen Tool Example\n",+ "# AG2 Tool Example\n","<img src=\"https://raw.githubusercontent.com/AgentOps-AI/agentops/main/docs/images/external/autogen/autogen-integration.png?raw=true\" width=\"25%\"/>\n","\n","To get started, you'll need to install the AgentOps package and [set an API key](app.agentops.ai).\n",@@ -103,7 +103,7 @@"id": "7858f0f6-9aca-4cdb-a514-9fbf7e353d50","metadata": {},"source": [- "AutoGen will now start automatically tracking\n",+ "AG2 will now start automatically tracking\n","\n","* LLM prompts and completions\n","* Token usage and costs\n",@@ -119,7 +119,7 @@"metadata": {},"source": ["# Tool Example\n",- "AgentOps tracks when Autogen agents use tools. You can find more information on this example in [tool-use.ipynb](https://github.com/microsoft/autogen/blob/main/website/docs/tutorial/tool-use.ipynb)"+ "AgentOps tracks when AG2 agents use tools. You can find more information on this example in [tool-use.ipynb](https://docs.ag2.ai/docs/tutorial/tool-use#tool-use)"]},{@@ -235,4 +235,3 @@"nbformat": 4,"nbformat_minor": 5}-\ No newline at end of filediff --git a/examples/demos/agentchat_agentops.ipynb b/examples/demos/agentchat_agentops.ipynbindex 2aa7a84e..4fb5dd69 100644--- a/examples/demos/agentchat_agentops.ipynb+++ b/examples/demos/agentchat_agentops.ipynb@@ -39,7 +39,7 @@"id": "38182a5296dceb34","metadata": {},"source": [- "## Adding AgentOps to an existing Autogen service.\n",+ "## Adding AgentOps to an existing AG2 service.\n","To get started, you'll need to install the AgentOps package and set an API key.\n","\n","AgentOps automatically configures itself when it's initialized meaning your agent run data will be tracked and logged to your AgentOps account right away."@@ -151,7 +151,7 @@"id": "4dd8f461ccd9cbef","metadata": {},"source": [- "Autogen will now start automatically tracking\n",+ "AG2 will now start automatically tracking\n","- LLM prompts and completions\n","- Token usage and costs\n","- Agent names and actions\n",@@ -218,7 +218,7 @@"metadata": {},"source": ["# Tool Example\n",- "AgentOps also tracks when Autogen agents use tools. You can find more information on this example in [tool-use.ipynb](https://github.com/microsoft/autogen/blob/main/website/docs/tutorial/tool-use.ipynb)"+ "AgentOps also tracks when AG2 agents use tools. You can find more information on this example in [tool-use.ipynb](https://docs.ag2.ai/docs/tutorial/tool-use#tool-use)"]},{