Skip to content

Commit 5b2b4f2

Browse files
committed
updated docs
1 parent 3ca4302 commit 5b2b4f2

136 files changed

Lines changed: 732 additions & 707 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

api-reference/llm_queries/chat_completions.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,8 @@ curl --request POST \
194194
"response_format": "{ \"type\": \"json_mode\"}",
195195
"seed": 11,
196196
"stream_options": [
197-
"include_usage",
198-
true
197+
true,
198+
"include_usage"
199199
],
200200
"top_p": 0.5,
201201
"tool_choice": "{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}",
@@ -218,7 +218,7 @@ url = "https://api.unify.ai/v0/chat/completions"
218218

219219
headers = {"Authorization": "Bearer <token>"}
220220

221-
json_input = {"messages": [{"content": "Tell me a joke", "role": "user"}], "model": "gpt-4o-mini@openai", "max_tokens": 1024, "stop": ["The End.", " is the answer."], "stream": False, "temperature": 0.9, "frequency_penalty": 1.5, "logit_bias": {"0": 10, "1": -75, "2": 90}, "logprobs": False, "top_logprobs": 15, "n": 15, "presence_penalty": -1.1, "response_format": "{ "type": "json_mode"}", "seed": 11, "stream_options": ["include_usage", True], "top_p": 0.5, "tool_choice": "{"type": "function", "function": {"name": "my_function"}}", "parallel_tool_calls": True, "user": "some_user", "signature": "python", "use_custom_keys": True, "tags": ["user123", "CompanyABC"], "drop_params": True}
221+
json_input = {"messages": [{"content": "Tell me a joke", "role": "user"}], "model": "gpt-4o-mini@openai", "max_tokens": 1024, "stop": ["The End.", " is the answer."], "stream": False, "temperature": 0.9, "frequency_penalty": 1.5, "logit_bias": {"0": 10, "1": -75, "2": 90}, "logprobs": False, "top_logprobs": 15, "n": 15, "presence_penalty": -1.1, "response_format": "{ "type": "json_mode"}", "seed": 11, "stream_options": [True, "include_usage"], "top_p": 0.5, "tool_choice": "{"type": "function", "function": {"name": "my_function"}}", "parallel_tool_calls": True, "user": "some_user", "signature": "python", "use_custom_keys": True, "tags": ["user123", "CompanyABC"], "drop_params": True}
222222

223223
response = requests.request("POST", url, json=json_input, headers=headers)
224224

api-reference/logs/get_log_groups.mdx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ Name of the project to get entries from.
2323
Name of the log entry to get distinct values from.
2424
</ParamField>
2525

26+
<ParamField query="context" type="string | null" >
27+
Static context to filter logs by.
28+
</ParamField>
29+
2630
<ParamField query="filter_expr" type="string | null" >
2731
Boolean string to filter entries before grouping.
2832
</ParamField>
@@ -39,14 +43,14 @@ The log ids which cannot be returned from the search. None of the listed ids wil
3943

4044
```bash cURL
4145
curl --request GET \
42-
--url 'https://api.unify.ai/v0/logs/groups?project=eval-project&key=system_prompt&filter_expr=len(output)%20>%20200%20and%20temperature%20==%200.5&from_ids=0&1&2&exclude_ids=0&1&2' \
46+
--url 'https://api.unify.ai/v0/logs/groups?project=eval-project&key=system_prompt&context=training&filter_expr=len(output)%20>%20200%20and%20temperature%20==%200.5&from_ids=0&1&2&exclude_ids=0&1&2' \
4347
--header "Authorization: Bearer $UNIFY_KEY"
4448
```
4549

4650
```python Python
4751
import requests
4852

49-
url = "https://api.unify.ai/v0/logs/groups?project=eval-project&key=system_prompt&filter_expr=len(output)%20>%20200%20and%20temperature%20==%200.5&from_ids=0&1&2&exclude_ids=0&1&2"
53+
url = "https://api.unify.ai/v0/logs/groups?project=eval-project&key=system_prompt&context=training&filter_expr=len(output)%20>%20200%20and%20temperature%20==%200.5&from_ids=0&1&2&exclude_ids=0&1&2"
5054

5155
headers = {"Authorization": "Bearer <token>"}
5256

api-reference/openapi.json

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6145,6 +6145,25 @@
61456145
"description": "Name of the log entry to get distinct values from.",
61466146
"example": "system_prompt"
61476147
},
6148+
{
6149+
"name": "context",
6150+
"in": "query",
6151+
"required": false,
6152+
"schema": {
6153+
"anyOf": [
6154+
{
6155+
"type": "string"
6156+
},
6157+
{
6158+
"type": "null"
6159+
}
6160+
],
6161+
"description": "Static context to filter logs by.",
6162+
"title": "Context"
6163+
},
6164+
"description": "Static context to filter logs by.",
6165+
"example": "training"
6166+
},
61486167
{
61496168
"name": "filter_expr",
61506169
"in": "query",
@@ -12153,8 +12172,8 @@
1215312172
"title": "Stream Options",
1215412173
"description": "Options for streaming response. Only set this when you set `stream: true`.",
1215512174
"example": [
12156-
"include_usage",
12157-
true
12175+
true,
12176+
"include_usage"
1215812177
]
1215912178
},
1216012179
"top_p": {

python/classes/logging/dataset/Dataset.mdx

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ title: 'Dataset'
66
class Dataset
77
```
88

9-
<p align="right">[source code](https://github.com/unifyai/unify/tree/733a23e2b00bc3e5bc0b3d98f2e6f46ea7f7c17d/unify/logging/dataset.py#L20)</p>
9+
<p align="right">[source code](https://github.com/unifyai/unify/tree/d90d215edbd8b7afb5c43919bbf6f8e02fa231fb/unify/logging/dataset.py#L20)</p>
1010

1111

1212

1313
### \_\_init\_\_
1414

15-
<p align="right">[source code](https://github.com/unifyai/unify/tree/733a23e2b00bc3e5bc0b3d98f2e6f46ea7f7c17d/unify/logging/dataset.py#L21)</p>
15+
<p align="right">[source code](https://github.com/unifyai/unify/tree/d90d215edbd8b7afb5c43919bbf6f8e02fa231fb/unify/logging/dataset.py#L21)</p>
1616

1717
```python
1818
def __init__(
@@ -46,7 +46,7 @@ Initialize a local dataset.
4646

4747
### allow\_duplicates
4848

49-
<p align="right">[source code](https://github.com/unifyai/unify/tree/733a23e2b00bc3e5bc0b3d98f2e6f46ea7f7c17d/unify/logging/dataset.py#L74)</p>
49+
<p align="right">[source code](https://github.com/unifyai/unify/tree/d90d215edbd8b7afb5c43919bbf6f8e02fa231fb/unify/logging/dataset.py#L74)</p>
5050

5151
```python
5252
def allow_duplicates(self) -> bool:
@@ -58,7 +58,7 @@ Whether to allow duplicates in the dataset.
5858

5959
### data
6060

61-
<p align="right">[source code](https://github.com/unifyai/unify/tree/733a23e2b00bc3e5bc0b3d98f2e6f46ea7f7c17d/unify/logging/dataset.py#L81)</p>
61+
<p align="right">[source code](https://github.com/unifyai/unify/tree/d90d215edbd8b7afb5c43919bbf6f8e02fa231fb/unify/logging/dataset.py#L81)</p>
6262

6363
```python
6464
def data(self):
@@ -70,7 +70,7 @@ Dataset entries.
7070

7171
### name
7272

73-
<p align="right">[source code](https://github.com/unifyai/unify/tree/733a23e2b00bc3e5bc0b3d98f2e6f46ea7f7c17d/unify/logging/dataset.py#L67)</p>
73+
<p align="right">[source code](https://github.com/unifyai/unify/tree/d90d215edbd8b7afb5c43919bbf6f8e02fa231fb/unify/logging/dataset.py#L67)</p>
7474

7575
```python
7676
def name(self) -> str:
@@ -84,7 +84,7 @@ Name of the dataset.
8484

8585
### set\_allow\_duplicates
8686

87-
<p align="right">[source code](https://github.com/unifyai/unify/tree/733a23e2b00bc3e5bc0b3d98f2e6f46ea7f7c17d/unify/logging/dataset.py#L107)</p>
87+
<p align="right">[source code](https://github.com/unifyai/unify/tree/d90d215edbd8b7afb5c43919bbf6f8e02fa231fb/unify/logging/dataset.py#L107)</p>
8888

8989
```python
9090
def set_allow_duplicates(self, allow_duplicates: bool) -> Self:
@@ -106,7 +106,7 @@ This dataset, useful for chaining methods.
106106

107107
### set\_name
108108

109-
<p align="right">[source code](https://github.com/unifyai/unify/tree/733a23e2b00bc3e5bc0b3d98f2e6f46ea7f7c17d/unify/logging/dataset.py#L94)</p>
109+
<p align="right">[source code](https://github.com/unifyai/unify/tree/d90d215edbd8b7afb5c43919bbf6f8e02fa231fb/unify/logging/dataset.py#L94)</p>
110110

111111
```python
112112
def set_name(self, name: str) -> Self:
@@ -130,7 +130,7 @@ This dataset, useful for chaining methods.
130130

131131
### add
132132

133-
<p align="right">[source code](https://github.com/unifyai/unify/tree/733a23e2b00bc3e5bc0b3d98f2e6f46ea7f7c17d/unify/logging/dataset.py#L266)</p>
133+
<p align="right">[source code](https://github.com/unifyai/unify/tree/d90d215edbd8b7afb5c43919bbf6f8e02fa231fb/unify/logging/dataset.py#L266)</p>
134134

135135
```python
136136
def add(
@@ -163,7 +163,7 @@ The new dataset following the addition.
163163

164164
### download
165165

166-
<p align="right">[source code](https://github.com/unifyai/unify/tree/733a23e2b00bc3e5bc0b3d98f2e6f46ea7f7c17d/unify/logging/dataset.py#L181)</p>
166+
<p align="right">[source code](https://github.com/unifyai/unify/tree/d90d215edbd8b7afb5c43919bbf6f8e02fa231fb/unify/logging/dataset.py#L181)</p>
167167

168168
```python
169169
def download(self, overwrite: bool = False) -> Self:
@@ -188,7 +188,7 @@ This dataset after the in-place download, useful for chaining methods.
188188

189189
### from\_upstream
190190

191-
<p align="right">[source code](https://github.com/unifyai/unify/tree/733a23e2b00bc3e5bc0b3d98f2e6f46ea7f7c17d/unify/logging/dataset.py#L120)</p>
191+
<p align="right">[source code](https://github.com/unifyai/unify/tree/d90d215edbd8b7afb5c43919bbf6f8e02fa231fb/unify/logging/dataset.py#L120)</p>
192192

193193
```python
194194
def from_upstream(
@@ -220,7 +220,7 @@ The dataset, with contents downloaded from upstream.
220220

221221
### inplace\_add
222222

223-
<p align="right">[source code](https://github.com/unifyai/unify/tree/733a23e2b00bc3e5bc0b3d98f2e6f46ea7f7c17d/unify/logging/dataset.py#L315)</p>
223+
<p align="right">[source code](https://github.com/unifyai/unify/tree/d90d215edbd8b7afb5c43919bbf6f8e02fa231fb/unify/logging/dataset.py#L315)</p>
224224

225225
```python
226226
def inplace_add(
@@ -253,7 +253,7 @@ This dataset following the in-place addition.
253253

254254
### inplace\_sub
255255

256-
<p align="right">[source code](https://github.com/unifyai/unify/tree/733a23e2b00bc3e5bc0b3d98f2e6f46ea7f7c17d/unify/logging/dataset.py#L342)</p>
256+
<p align="right">[source code](https://github.com/unifyai/unify/tree/d90d215edbd8b7afb5c43919bbf6f8e02fa231fb/unify/logging/dataset.py#L342)</p>
257257

258258
```python
259259
def inplace_sub(
@@ -279,7 +279,7 @@ This dataset following the in-place subtraction.
279279

280280
### sub
281281

282-
<p align="right">[source code](https://github.com/unifyai/unify/tree/733a23e2b00bc3e5bc0b3d98f2e6f46ea7f7c17d/unify/logging/dataset.py#L293)</p>
282+
<p align="right">[source code](https://github.com/unifyai/unify/tree/d90d215edbd8b7afb5c43919bbf6f8e02fa231fb/unify/logging/dataset.py#L293)</p>
283283

284284
```python
285285
def sub(
@@ -305,7 +305,7 @@ The new dataset following the subtraction.
305305

306306
### sync
307307

308-
<p align="right">[source code](https://github.com/unifyai/unify/tree/733a23e2b00bc3e5bc0b3d98f2e6f46ea7f7c17d/unify/logging/dataset.py#L228)</p>
308+
<p align="right">[source code](https://github.com/unifyai/unify/tree/d90d215edbd8b7afb5c43919bbf6f8e02fa231fb/unify/logging/dataset.py#L228)</p>
309309

310310
```python
311311
def sync(self) -> Self:
@@ -322,7 +322,7 @@ This dataset after the in-place sync, useful for chaining methods.
322322

323323
### upload
324324

325-
<p align="right">[source code](https://github.com/unifyai/unify/tree/733a23e2b00bc3e5bc0b3d98f2e6f46ea7f7c17d/unify/logging/dataset.py#L156)</p>
325+
<p align="right">[source code](https://github.com/unifyai/unify/tree/d90d215edbd8b7afb5c43919bbf6f8e02fa231fb/unify/logging/dataset.py#L156)</p>
326326

327327
```python
328328
def upload(self, overwrite: bool = False) -> Self:
@@ -347,7 +347,7 @@ This dataset, useful for chaining methods.
347347

348348
### upstream\_diff
349349

350-
<p align="right">[source code](https://github.com/unifyai/unify/tree/733a23e2b00bc3e5bc0b3d98f2e6f46ea7f7c17d/unify/logging/dataset.py#L240)</p>
350+
<p align="right">[source code](https://github.com/unifyai/unify/tree/d90d215edbd8b7afb5c43919bbf6f8e02fa231fb/unify/logging/dataset.py#L240)</p>
351351

352352
```python
353353
def upstream_diff(self) -> Self:
@@ -365,7 +365,7 @@ This dataset after printing the diff, useful for chaining methods.
365365

366366
### \_\_add\_\_
367367

368-
<p align="right">[source code](https://github.com/unifyai/unify/tree/733a23e2b00bc3e5bc0b3d98f2e6f46ea7f7c17d/unify/logging/dataset.py#L364)</p>
368+
<p align="right">[source code](https://github.com/unifyai/unify/tree/d90d215edbd8b7afb5c43919bbf6f8e02fa231fb/unify/logging/dataset.py#L364)</p>
369369

370370
```python
371371
def __add__(
@@ -392,7 +392,7 @@ The new dataset following the addition.
392392

393393
### \_\_contains\_\_
394394

395-
<p align="right">[source code](https://github.com/unifyai/unify/tree/733a23e2b00bc3e5bc0b3d98f2e6f46ea7f7c17d/unify/logging/dataset.py#L485)</p>
395+
<p align="right">[source code](https://github.com/unifyai/unify/tree/d90d215edbd8b7afb5c43919bbf6f8e02fa231fb/unify/logging/dataset.py#L485)</p>
396396

397397
```python
398398
def __contains__(
@@ -419,7 +419,7 @@ Boolean, whether the passed Dataset is a subset of this one.
419419

420420
### \_\_getitem\_\_
421421

422-
<p align="right">[source code](https://github.com/unifyai/unify/tree/733a23e2b00bc3e5bc0b3d98f2e6f46ea7f7c17d/unify/logging/dataset.py#L535)</p>
422+
<p align="right">[source code](https://github.com/unifyai/unify/tree/d90d215edbd8b7afb5c43919bbf6f8e02fa231fb/unify/logging/dataset.py#L535)</p>
423423

424424
```python
425425
def __getitem__(self, item: Union[int, slice]) -> Union[Any, Dataset]:
@@ -443,7 +443,7 @@ An individual item or Dataset slice, for int and slice queries respectively.
443443

444444
### \_\_iadd\_\_
445445

446-
<p align="right">[source code](https://github.com/unifyai/unify/tree/733a23e2b00bc3e5bc0b3d98f2e6f46ea7f7c17d/unify/logging/dataset.py#L408)</p>
446+
<p align="right">[source code](https://github.com/unifyai/unify/tree/d90d215edbd8b7afb5c43919bbf6f8e02fa231fb/unify/logging/dataset.py#L408)</p>
447447

448448
```python
449449
def __iadd__(
@@ -469,7 +469,7 @@ This dataset following the in-place addition.
469469

470470
### \_\_isub\_\_
471471

472-
<p align="right">[source code](https://github.com/unifyai/unify/tree/733a23e2b00bc3e5bc0b3d98f2e6f46ea7f7c17d/unify/logging/dataset.py#L459)</p>
472+
<p align="right">[source code](https://github.com/unifyai/unify/tree/d90d215edbd8b7afb5c43919bbf6f8e02fa231fb/unify/logging/dataset.py#L459)</p>
473473

474474
```python
475475
def __isub__(
@@ -495,7 +495,7 @@ This dataset following the in-place subtraction.
495495

496496
### \_\_iter\_\_
497497

498-
<p align="right">[source code](https://github.com/unifyai/unify/tree/733a23e2b00bc3e5bc0b3d98f2e6f46ea7f7c17d/unify/logging/dataset.py#L475)</p>
498+
<p align="right">[source code](https://github.com/unifyai/unify/tree/d90d215edbd8b7afb5c43919bbf6f8e02fa231fb/unify/logging/dataset.py#L475)</p>
499499

500500
```python
501501
def __iter__(self) -> Any:
@@ -511,7 +511,7 @@ The next instance in the dataset.
511511

512512
### \_\_len\_\_
513513

514-
<p align="right">[source code](https://github.com/unifyai/unify/tree/733a23e2b00bc3e5bc0b3d98f2e6f46ea7f7c17d/unify/logging/dataset.py#L526)</p>
514+
<p align="right">[source code](https://github.com/unifyai/unify/tree/d90d215edbd8b7afb5c43919bbf6f8e02fa231fb/unify/logging/dataset.py#L526)</p>
515515

516516
```python
517517
def __len__(self) -> int:
@@ -527,7 +527,7 @@ The number of entries in the dataset.
527527

528528
### \_\_radd\_\_
529529

530-
<p align="right">[source code](https://github.com/unifyai/unify/tree/733a23e2b00bc3e5bc0b3d98f2e6f46ea7f7c17d/unify/logging/dataset.py#L381)</p>
530+
<p align="right">[source code](https://github.com/unifyai/unify/tree/d90d215edbd8b7afb5c43919bbf6f8e02fa231fb/unify/logging/dataset.py#L381)</p>
531531

532532
```python
533533
def __radd__(
@@ -562,7 +562,7 @@ The new dataset following the addition.
562562

563563
### \_\_repr\_\_
564564

565-
<p align="right">[source code](https://github.com/unifyai/unify/tree/733a23e2b00bc3e5bc0b3d98f2e6f46ea7f7c17d/unify/logging/dataset.py#L578)</p>
565+
<p align="right">[source code](https://github.com/unifyai/unify/tree/d90d215edbd8b7afb5c43919bbf6f8e02fa231fb/unify/logging/dataset.py#L578)</p>
566566

567567
```python
568568
def __repr__(self):
@@ -574,7 +574,7 @@ def __repr__(self):
574574

575575
### \_\_rsub\_\_
576576

577-
<p align="right">[source code](https://github.com/unifyai/unify/tree/733a23e2b00bc3e5bc0b3d98f2e6f46ea7f7c17d/unify/logging/dataset.py#L441)</p>
577+
<p align="right">[source code](https://github.com/unifyai/unify/tree/d90d215edbd8b7afb5c43919bbf6f8e02fa231fb/unify/logging/dataset.py#L441)</p>
578578

579579
```python
580580
def __rsub__(
@@ -602,7 +602,7 @@ The new dataset following the subtraction.
602602

603603
### \_\_setitem\_\_
604604

605-
<p align="right">[source code](https://github.com/unifyai/unify/tree/733a23e2b00bc3e5bc0b3d98f2e6f46ea7f7c17d/unify/logging/dataset.py#L556)</p>
605+
<p align="right">[source code](https://github.com/unifyai/unify/tree/d90d215edbd8b7afb5c43919bbf6f8e02fa231fb/unify/logging/dataset.py#L556)</p>
606606

607607
```python
608608
def __setitem__(self, item: Union[int, slice], value: Union[Any, Dataset]):
@@ -614,7 +614,7 @@ def __setitem__(self, item: Union[int, slice], value: Union[Any, Dataset]):
614614

615615
### \_\_sub\_\_
616616

617-
<p align="right">[source code](https://github.com/unifyai/unify/tree/733a23e2b00bc3e5bc0b3d98f2e6f46ea7f7c17d/unify/logging/dataset.py#L424)</p>
617+
<p align="right">[source code](https://github.com/unifyai/unify/tree/d90d215edbd8b7afb5c43919bbf6f8e02fa231fb/unify/logging/dataset.py#L424)</p>
618618

619619
```python
620620
def __sub__(

python/classes/logging/logs/ColumnContext.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ title: 'ColumnContext'
66
class ColumnContext
77
```
88

9-
<p align="right">[source code](https://github.com/unifyai/unify/tree/733a23e2b00bc3e5bc0b3d98f2e6f46ea7f7c17d/unify/logging/logs.py#L321)</p>
9+
<p align="right">[source code](https://github.com/unifyai/unify/tree/d90d215edbd8b7afb5c43919bbf6f8e02fa231fb/unify/logging/logs.py#L321)</p>
1010

1111

1212

1313
### \_\_init\_\_
1414

15-
<p align="right">[source code](https://github.com/unifyai/unify/tree/733a23e2b00bc3e5bc0b3d98f2e6f46ea7f7c17d/unify/logging/logs.py#L329)</p>
15+
<p align="right">[source code](https://github.com/unifyai/unify/tree/d90d215edbd8b7afb5c43919bbf6f8e02fa231fb/unify/logging/logs.py#L329)</p>
1616

1717
```python
1818
def __init__(self, context: str, mode: str = "both", overwrite: bool = False):
@@ -26,7 +26,7 @@ def __init__(self, context: str, mode: str = "both", overwrite: bool = False):
2626

2727
### \_\_enter\_\_
2828

29-
<p align="right">[source code](https://github.com/unifyai/unify/tree/733a23e2b00bc3e5bc0b3d98f2e6f46ea7f7c17d/unify/logging/logs.py#L335)</p>
29+
<p align="right">[source code](https://github.com/unifyai/unify/tree/d90d215edbd8b7afb5c43919bbf6f8e02fa231fb/unify/logging/logs.py#L335)</p>
3030

3131
```python
3232
def __enter__(self):
@@ -38,7 +38,7 @@ def __enter__(self):
3838

3939
### \_\_exit\_\_
4040

41-
<p align="right">[source code](https://github.com/unifyai/unify/tree/733a23e2b00bc3e5bc0b3d98f2e6f46ea7f7c17d/unify/logging/logs.py#L356)</p>
41+
<p align="right">[source code](https://github.com/unifyai/unify/tree/d90d215edbd8b7afb5c43919bbf6f8e02fa231fb/unify/logging/logs.py#L356)</p>
4242

4343
```python
4444
def __exit__(self, *args, **kwargs):

0 commit comments

Comments
 (0)