Skip to content

Commit

Permalink
added param version image.
Browse files Browse the repository at this point in the history
  • Loading branch information
djl11 committed Feb 22, 2025
1 parent 0c587fb commit e8d2de1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 17 deletions.
4 changes: 4 additions & 0 deletions demo_testing/params_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@
answer="The capital of France is Paris.",
score=1.0
)

import json
log = unify.get_log_by_id(log.id)
print(json.dumps(log.params, indent=4))
22 changes: 5 additions & 17 deletions logging/parameters.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,26 +25,14 @@ They are always shown on the left hand side of the table.

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

When retrieving logs, parameters are returned as a `(version, value)` tuple.

```python
import json
log = unify.get_log_by_id(log.id)
print(json.dumps(log.params, indent=4))
```
```
{
"system_message": [
"0",
"You are a helpful assistant."
]
}
```

The version is a string, which is simply an incrementing integer.
Parameter versions are of type string, and the version is simply an incrementing integer.
In future, we plan to support custom version naming,
thus the choice of a *string* type rather than an *integer*.

You can see the version of a paramter in the view pane.

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

## Parameter Contexts

As with entries, parameters can be used as a context manager.
Expand Down

0 comments on commit e8d2de1

Please sign in to comment.