Simple Agent Example
Most basic usage with OpenAI API
View Notebook on Github
AgentOps Basic Monitoring
This is an example of how to use the AgentOps library for basic Agent monitoring with OpenAI’s GPT
Installation
Setup
Import the necessary libraries:
Set up your API keys:
Initialize AgentOps at the beginning of your application:
Single Completion Example
Now just use OpenAI as you would normally!
Sessions are automatically managed by AgentOps. When your program exits, the session will be properly closed.
Tracking Custom Events
You can track custom operations using decorators:
You can also create operations for more complex tracking:
Further Reading
Check out more advanced examples like Multi-Agent or OpenAI Assistants integration.