quotient_trace_openai_agents.py
from openinference.instrumentation.openai_agents import OpenAIAgentsInstrumentor
from quotientai import QuotientAI
quotient = QuotientAI()
quotient.tracer.init(
app_name="openai-agents-search-app",
environment="dev",
instruments=[OpenAIAgentsInstrumentor()],
)
import asyncio
from agents import Agent, Runner
@quotient.trace('haiku-agent')
async def main() -> None:
agent = Agent(
name="haiku-assistant",
instructions="You only respond in haikus.",
)
result = await Runner.run(agent, "Tell me about recursion in programming.")
print(result.final_output)
if __name__ == "__main__":
asyncio.run(main())