diff --git a/demo_testing/logs_trace_view.py b/demo_testing/logs_trace_view.py index 73053c7a5..050fdcb41 100644 --- a/demo_testing/logs_trace_view.py +++ b/demo_testing/logs_trace_view.py @@ -1,8 +1,20 @@ import unify -unify.activate("traced-view-demo") +unify.activate("nested-traced-view-demo") @unify.traced -def my_function(a, b): +def inner_fn(a, b): return a + b -my_function(1, 2) +@unify.traced +def mid_fn(a, b): + c = inner_fn(a, b) + d = inner_fn(c, b) + return c * d + +@unify.traced +def outer_fn(a, b): + c = mid_fn(a, b) + d = mid_fn(c, a) + return d / c + +outer_fn(3, 4) diff --git a/logging/traces.mdx b/logging/traces.mdx index ae5a57c4f..d6348deb3 100644 --- a/logging/traces.mdx +++ b/logging/traces.mdx @@ -36,9 +36,11 @@ def outer_fn(a, b): return d / c outer_fn(3, 4) -``` +``` -GIF +In the trace view pane, this will look as follows: + + ## LLM Traces