Skip to content

Commit

Permalink
added trace view img.
Browse files Browse the repository at this point in the history
  • Loading branch information
djl11 committed Feb 22, 2025
1 parent 0dcaba3 commit a91d194
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 8 additions & 0 deletions demo_testing/logs_trace_view.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import unify
unify.activate("traced-view-demo")

@unify.traced
def my_function(a, b):
return a + b

my_function(1, 2)
8 changes: 4 additions & 4 deletions logging/traces.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ my_function(1, 2)

If you create a view tile and select the trace in the table, you'll then see the trace viewer.

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

Traces are made up of spans, each of which represent a unit of computation. Traces can have an arbitrary number of spans, and spans can have child spans up to an arbitrary depth.

Expand All @@ -38,7 +38,7 @@ def outer_fn(a, b):
outer_fn(3, 4)
```

IMG
GIF

## LLM Traces

Expand All @@ -49,7 +49,7 @@ client = unify.Unify("o3-mini@openai", traced=True)
client.generate("Hello, world!")
```

IMG
GIF


When these LLM calls are part of a broader trace, then the cost and tokens are accumulated in the trace, propogating the cost and tokens to the parent spans.
Expand All @@ -64,4 +64,4 @@ def llm_jury(question):
llm_jury("What is the capital of France?")
```

IMG
GIF

0 comments on commit a91d194

Please sign in to comment.