MCPcopy Create free account
hub / github.com/AgentOps-AI/agentops / demonstrate_workflows

Function demonstrate_workflows

examples/agno/agno_workflow_setup.py:87–123  ·  view source on GitHub ↗

Demonstrate workflow capabilities with caching. This function shows: - How to create and use custom workflows - The performance benefits of caching - Session state persistence - Response streaming

()

Source from the content-addressed store, hash-verified

85
86
87def demonstrate_workflows():
88 """
89 Demonstrate workflow capabilities with caching.
90
91 This function shows:
92 - How to create and use custom workflows
93 - The performance benefits of caching
94 - Session state persistence
95 - Response streaming
96 """
97
98 tracer = agentops.start_trace(trace_name="Agno Workflow Setup Demonstration")
99 try:
100 workflow = CacheWorkflow()
101
102 response: Iterator[RunResponse] = workflow.run(message="Tell me a joke.")
103
104 pprint_run_response(response, markdown=True, show_time=True)
105
106 response: Iterator[RunResponse] = workflow.run(message="Tell me a joke.")
107
108 pprint_run_response(response, markdown=True, show_time=True)
109
110 agentops.end_trace(tracer, end_state="Success")
111
112 except Exception:
113 agentops.end_trace(tracer, end_state="Error")
114
115 # Let's check programmatically that spans were recorded in AgentOps
116 print("\n" + "=" * 50)
117 print("Now let's verify that our LLM calls were tracked properly...")
118 try:
119 agentops.validate_trace_spans(trace_context=tracer)
120 print("\n✅ Success! All LLM spans were properly recorded in AgentOps.")
121 except agentops.ValidationError as e:
122 print(f"\n❌ Error validating spans: {e}")
123 raise
124
125
126demonstrate_workflows()

Callers 1

Calls 4

runMethod · 0.95
CacheWorkflowClass · 0.85
start_traceMethod · 0.80
end_traceMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…