Skip to content

Commit

Permalink
updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
unify-dev-bot committed Feb 24, 2025
1 parent bf06818 commit 0f73f3b
Show file tree
Hide file tree
Showing 84 changed files with 1,110 additions and 682 deletions.
10 changes: 9 additions & 1 deletion api-reference/configs/create_interface.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,15 @@ api: 'POST /v0/interface'

</ParamField>

<ParamField body="new_name" type="string" >
<ParamField body="new_name" type="string | null" >

</ParamField>

<ParamField body="context" type="string | null" >

</ParamField>

<ParamField body="column_context" type="string | null" >

</ParamField>

Expand Down
10 changes: 9 additions & 1 deletion api-reference/configs/update_interface.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,15 @@ api: 'PUT /v0/interface'

</ParamField>

<ParamField body="new_name" type="string" >
<ParamField body="new_name" type="string | null" >

</ParamField>

<ParamField body="context" type="string | null" >

</ParamField>

<ParamField body="column_context" type="string | null" >

</ParamField>

Expand Down
6 changes: 3 additions & 3 deletions api-reference/llm_queries/chat_completions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,8 @@ curl --request POST \
"response_format": "{ \"type\": \"json_mode\"}",
"seed": 11,
"stream_options": [
true,
"include_usage"
"include_usage",
true
],
"top_p": 0.5,
"tool_choice": "{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}",
Expand All @@ -218,7 +218,7 @@ url = "https://api.unify.ai/v0/chat/completions"

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

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}
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}

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

Expand Down
7 changes: 6 additions & 1 deletion api-reference/logs/create_derived_entry.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ Eagerly computes each derived value and stores it in DerivedLog.value.
Name of the project the stored entries will be associated to.
</ParamField>

<ParamField body="context" type="any | null" >
Optional context path to update for the logs. Can use '/' for nested contexts (e.g. 'training/batch1').
</ParamField>

<ParamField body="key" type="string" required="true">
The name of the entry.
</ParamField>
Expand All @@ -38,6 +42,7 @@ curl --request POST \
--header 'Content-Type: application/json' \
--data '{
"project": "eval-project",
"context": "experiment1/trial1",
"key": "score_diff",
"equation": "{log0:score} - {log1:score}",
"referenced_logs": {
Expand All @@ -60,7 +65,7 @@ url = "https://api.unify.ai/v0/logs/derived"

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

json_input = {"project": "eval-project", "key": "score_diff", "equation": "{log0:score} - {log1:score}", "referenced_logs": {"log0": [0, 1, 2], "log1": {"filter_expr": "score > 0.5"}}}
json_input = {"project": "eval-project", "context": "experiment1/trial1", "key": "score_diff", "equation": "{log0:score} - {log1:score}", "referenced_logs": {"log0": [0, 1, 2], "log1": {"filter_expr": "score > 0.5"}}}

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

Expand Down
10 changes: 8 additions & 2 deletions api-reference/logs/get_fields.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: 'Get Fields'
api: 'GET /v0/logs/fields'
---
Returns a dictionary of field names and their types for the specified project.
If a context is provided, returns only fields associated with that context.

Each field entry contains:
- data_type: The data type of the field (int, str, etc)
- field_type: Whether it's an entry, param, or derived_entry
Expand All @@ -22,18 +24,22 @@ Each field entry contains:
Name of the project to get fields and their types for.
</ParamField>

<ParamField query="context" type="string | null" default={default}>
Optional context name to filter field types
</ParamField>

<RequestExample>

```bash cURL
curl --request GET \
--url 'https://api.unify.ai/v0/logs/fields?project=eval-project' \
--url 'https://api.unify.ai/v0/logs/fields?project=eval-project&context=training' \
--header "Authorization: Bearer $UNIFY_KEY"
```

```python Python
import requests

url = "https://api.unify.ai/v0/logs/fields?project=eval-project"
url = "https://api.unify.ai/v0/logs/fields?project=eval-project&context=training"

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

Expand Down
8 changes: 6 additions & 2 deletions api-reference/logs/get_logs_metric.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ The key you would like to extract the reduction metric for.
Name of the project to get entries from.
</ParamField>

<ParamField query="context" type="string | null" default={default}>
Static context to filter logs by.
</ParamField>

<ParamField query="filter_expr" type="string | null" >
Boolean string to filter entries. TODO: Detailed page.
</ParamField>
Expand All @@ -42,14 +46,14 @@ The log ids which cannot be returned from the search. None of the listed ids wil

```bash cURL
curl --request GET \
--url 'https://api.unify.ai/v0/logs/metric/mean?key=score&project=eval-project&filter_expr=len(output)%20>%20200%20and%20temperature%20==%200.5&from_ids=0&1&2&exclude_ids=0&1&2' \
--url 'https://api.unify.ai/v0/logs/metric/mean?key=score&project=eval-project&context=training&filter_expr=len(output)%20>%20200%20and%20temperature%20==%200.5&from_ids=0&1&2&exclude_ids=0&1&2' \
--header "Authorization: Bearer $UNIFY_KEY"
```

```python Python
import requests

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

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

Expand Down
84 changes: 0 additions & 84 deletions api-reference/logs/set_field_types.mdx

This file was deleted.

Loading

0 comments on commit 0f73f3b

Please sign in to comment.