Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
HowieG committed Sep 5, 2024
1 parent eb2f2ef commit dc29da3
Showing 1 changed file with 9 additions and 22 deletions.
31 changes: 9 additions & 22 deletions examples/autogen/agentchat_agentops.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"id": "a447802c88c8a240",
"metadata": {},
"source": [
"<img src=\"https://github.com/AgentOps-AI/agentops/blob/main/docs/images/external/logo/banner-badge.png?raw=true\"/>\n",
"<img src=\"https://github.com/AgentOps-AI/agentops/blob/main/docs/images/external/logo/banner-badge.png?raw=true\" width=\"25%\"/>\n",
"\n",
"[AgentOps](https://agentops.ai/?=autogen) provides session replays, metrics, and monitoring for AI agents.\n",
"\n",
Expand All @@ -28,10 +28,10 @@
"metadata": {},
"source": [
"### Overview Dashboard\n",
"<img src=\"https://raw.githubusercontent.com/AgentOps-AI/agentops/main/docs/images/external/app_screenshots/overview.gif\"/>\n",
"<img src=\"https://raw.githubusercontent.com/AgentOps-AI/agentops/main/docs/images/external/app_screenshots/overview.gif\" width=\"25%\"/>\n",
"\n",
"### Session Replays\n",
"<img src=\"https://raw.githubusercontent.com/AgentOps-AI/agentops/main/docs/images/external/app_screenshots/drilldown.gif\"/>"
"<img src=\"https://raw.githubusercontent.com/AgentOps-AI/agentops/main/docs/images/external/app_screenshots/drilldown.gif\" width=\"25%\"/>"
]
},
{
Expand Down Expand Up @@ -80,7 +80,9 @@
"metadata": {},
"outputs": [],
"source": [
"from autogen import ConversableAgent, UserProxyAgent, config_list_from_json\n",
"from autogen import ConversableAgent, UserProxyAgent\n",
"from typing import Annotated, Literal\n",
"from autogen import ConversableAgent, register_function\n",
"import agentops\n",
"import os\n",
"from os import environ\n",
Expand Down Expand Up @@ -193,16 +195,6 @@
"agentops.end_session(\"Success\")"
]
},
{
"cell_type": "markdown",
"id": "2217ed0f930cfcaa",
"metadata": {},
"source": [
"You can view data on this run at [app.agentops.ai](https://app.agentops.ai). \n",
"\n",
"The dashboard will display LLM events for each message sent by each agent, including those made by the human user."
]
},
{
"cell_type": "markdown",
"id": "cbd689b0f5617013",
Expand Down Expand Up @@ -234,15 +226,8 @@
},
"outputs": [],
"source": [
"from typing import Annotated, Literal\n",
"\n",
"from autogen import ConversableAgent, config_list_from_json, register_function\n",
"\n",
"agentops.start_session(tags=[\"autogen-tool-example\"])\n",
"\n",
"Operator = Literal[\"+\", \"-\", \"*\", \"/\"]\n",
"\n",
"\n",
"def calculator(a: int, b: int, operator: Annotated[Operator, \"operator\"]) -> int:\n",
" if operator == \"+\":\n",
" return a + b\n",
Expand All @@ -256,7 +241,9 @@
" raise ValueError(\"Invalid operator\")\n",
"\n",
"\n",
"config_list = config_list_from_json(env_or_file=\"OAI_CONFIG_LIST\")\n",
"config_list = [\n",
" {\"model\": \"gpt-4-turbo\", \"api_key\": OPENAI_API_KEY, \"tags\": [\"gpt-4\", \"tool\"]}\n",
"]\n",
"\n",
"# Create the agent that uses the LLM.\n",
"assistant = ConversableAgent(\n",
Expand Down

0 comments on commit dc29da3

Please sign in to comment.