Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /agno-agi_agno /cookbook /observability /traceloop_op.py
| """ | |
| Traceloop Integration | |
| ===================== | |
| Demonstrates wrapping Agno calls in Traceloop workflow spans. | |
| """ | |
| from agno.agent import Agent | |
| from agno.models.openai import OpenAIChat | |
| from traceloop.sdk import Traceloop | |
| from traceloop.sdk.decorators import workflow | |
| # --------------------------------------------------------------------------- | |
| # Setup | |
| # --------------------------------------------------------------------------- | |
| Traceloop.init(app_name="agno_workflows") | |
| # --------------------------------------------------------------------------- | |
| # Create Agent | |
| # --------------------------------------------------------------------------- | |
| agent = Agent( | |
| name="AnalysisAgent", | |
| model=OpenAIChat(id="gpt-5.2"), | |
| ) | |
| def analyze_data(query: str) -> str: | |
| """Custom workflow that wraps agent execution.""" | |
| response = agent.run(query) | |
| return response.content | |
| # --------------------------------------------------------------------------- | |
| # Run Example | |
| # --------------------------------------------------------------------------- | |
| if __name__ == "__main__": | |
| # The workflow decorator creates a parent span | |
| result = analyze_data("Analyze the benefits of observability in AI systems") | |
| print(result) | |
Xet Storage Details
- Size:
- 1.27 kB
- Xet hash:
- a93dafba32b61d0cce4b1556419106368df200ad2b70e6638f451ef16d20ec49
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.