Portkey
Integrate Portkey gateway and observability with PraisonAI agents
Portkey Integration
Portkey provides an AI gateway with observability.
Setup
pip install portkey-ai
export PORTKEY_API_KEY=xxxUsage
Auto-Instrumentation (Recommended)
from praisonai_tools.observability import obs
from praisonaiagents import Agent
obs.init(provider="portkey")
# Everything is auto-traced!
agent = Agent(name="Assistant", instructions="You are helpful.", model="gpt-4o-mini")
response = agent.chat("Hello!")Explicit Tracing
from praisonai_tools.observability import obs
obs.init(provider="portkey", auto_instrument=False)
with obs.trace("workflow"):
# Your agent code
pass