Skip to main content
View Notebook on Github

Microsoft Autogen Chat Example

AgentOps automatically configures itself when it’s initialized meaning your agent run data will be tracked and logged to your AgentOps dashboard right away. First let’s install the required packages

Installation

Then import them
Next, we’ll set our API keys. There are several ways to do this, the code below is just the most foolproof way for the purposes of this notebook. It accounts for both users who use environment variables and those who just want to set the API Key here in this notebook. Get an AgentOps API key
  1. Create an environment variable in a .env file or other method. By default, the AgentOps init() function will look for an environment variable named AGENTOPS_API_KEY. Or…
  2. Replace <your_agentops_key> below and pass in the optional api_key parameter to the AgentOps init(api_key=...) function. Remember not to commit your API key to a public repo!
AutoGen will now start automatically tracking
  • LLM prompts and completions
  • Token usage and costs
  • Agent names and actions
  • Correspondence between agents
  • Tool usage
  • Errors

Simple Chat Example

You can view data on this run at app.agentops.ai. The dashboard will display LLM events for each message sent by each agent, including those made by the human user.