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
Updated README with updated usage examples for new decorators and session management. Introduce `session`, `agent`, `operation`, `task`, and `workflow` decorators for improved observability. (#862)
Dwij8e832de8cecc
diff --git a/README.md b/README.mdindex 7cda3f30..af2832d3 100644--- a/README.md+++ b/README.md@@ -140,39 +140,75 @@ Add powerful observability to your agents, tools, and functions with as little cRefer to our [documentation](http://docs.agentops.ai)```python-# Automatically associate all Events with the agent that originated them-from agentops import track_agent+# Create a session span (root for all other spans)+from agentops.sdk.decorators import session-@track_agent(name='SomeCustomName')-class MyAgent:- ...+@session+def my_workflow():+ # Your session code here+ return result``````python-# Automatically create ToolEvents for tools that agents will use-from agentops import record_tool+# Create an agent span for tracking agent operations+from agentops.sdk.decorators import agent-@record_tool('SampleToolName')-def sample_tool(...):- ...+@agent+class MyAgent:+ def __init__(self, name):+ self.name = name++ # Agent methods here``````python-# Automatically create ActionEvents for other functions.-from agentops import record_action+# Create operation/task spans for tracking specific operations+from agentops.sdk.decorators import operation, task[email protected]_action('sample function being record')-def sample_function(...):- ...+@operation # or @task+def process_data(data):+ # Process the data+ return result``````python-# Manually record any other Events-from agentops import record, ActionEvent+# Create workflow spans for tracking multi-operation workflows+from agentops.sdk.decorators import workflow-record(ActionEvent("received_user_input"))+@workflow+def my_workflow(data):+ # Workflow implementation+ return result```+```python+# Nest decorators for proper span hierarchy+from agentops.sdk.decorators import session, agent, operation++@agent+class MyAgent:+ @operation+ def nested_operation(self, message):+ return f"Processed: {message}"++ @operation+ def main_operation(self):+ result = self.nested_operation("test message")+ return result++@session+def my_session():+ agent = MyAgent()+ return agent.main_operation()+```++All decorators support:+- Input/Output Recording+- Exception Handling+- Async/await functions+- Generator functions+- Custom attributes and names+## Integrations 🦾### OpenAI Agents SDK 🖇️