Skip to content

Commit

Permalink
added trace view nested img.
Browse files Browse the repository at this point in the history
  • Loading branch information
djl11 committed Feb 22, 2025
1 parent a91d194 commit b93c87e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
18 changes: 15 additions & 3 deletions demo_testing/logs_trace_view.py
Original file line number Diff line number Diff line change
@@ -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)
6 changes: 4 additions & 2 deletions logging/traces.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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:

<img class="dark-light" width="100%" src="https://raw.githubusercontent.com/unifyai/unifyai.github.io/refs/heads/main/img/externally_linked/trace_view_nested_dark.gif"/>

## LLM Traces

Expand Down

0 comments on commit b93c87e

Please sign in to comment.