Skip to content

Commit

Permalink
updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
vedpatwardhan committed Sep 4, 2024
1 parent 451d2ea commit 52346ba
Show file tree
Hide file tree
Showing 16 changed files with 23 additions and 23 deletions.
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 @@ -182,8 +182,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 @@ -203,7 +203,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": True, "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": True, "drop_params": True}

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

Expand Down
4 changes: 2 additions & 2 deletions api-reference/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -3506,8 +3506,8 @@
"title": "Stream Options",
"description": "Options for streaming response. Only set this when you set `stream: true`.",
"example": [
true,
"include_usage"
"include_usage",
true
]
},
"top_p": {
Expand Down
12 changes: 6 additions & 6 deletions python/dataset.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ class Dataset()
### \_\_init\_\_

```python
def __init__(name: str = None,
queries: List[Union[str, ChatCompletion]] = None,
def __init__(queries: List[Union[str, ChatCompletion]] = None,
extra_fields: Dict[str, List[Any]] = None,
data: List[Dict[str, Union[ChatCompletion, Any]]] = None,
name: str = None,
auto_sync: bool = False,
api_key: Optional[str] = None)
```
Expand All @@ -29,8 +29,6 @@ Initialize a local dataset of LLM queries.

**Arguments**:

- `name` - The name of the dataset.

- `queries` - List of LLM queries to initialize the dataset with.

- `extra_fields` - Dictionary of lists for arbitrary extra fields contained
Expand All @@ -41,6 +39,8 @@ Initialize a local dataset of LLM queries.
"query" and all other keys otherwise coming from the `extra_fields`. This is
the internal representation used by the class.

- `name` - The name of the dataset.

- `auto_sync` - Whether to automatically keep this dataset fully synchronized
with the upstream variant at all times.

Expand Down Expand Up @@ -199,7 +199,7 @@ Saves to dataset to a local .jsonl filepath.
### add

```python
def add(other: __class__)
def add(other: Dataset)
```

Adds another dataset to this one, return a new Dataset instance, with this
Expand All @@ -216,7 +216,7 @@ new dataset receiving all unique queries from the other added dataset.
### sub

```python
def sub(other: __class__)
def sub(other: Dataset)
```

Subtracts another dataset from this one, return a new Dataset instance, with
Expand Down
2 changes: 1 addition & 1 deletion python/evaluation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -265,4 +265,4 @@ from the other subtracted dataset.

- `other` - The other dataset being added to this one.

<a id="evaluator"></a>
<a id="__init__"></a>
2 changes: 1 addition & 1 deletion python/exceptions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,4 @@ class InternalServerError(UnifyError)

Exception raised for HTTP 500 Internal Server Error errors.

<a id="_caching"></a>
<a id="evaluator"></a>
1 change: 0 additions & 1 deletion python/queries/chat.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -207,4 +207,3 @@ Starts the chat interaction loop.
- `show_credits` - Whether to show credit consumption. Defaults to False.
- `show_provider` - Whether to show the provider used. Defaults to False.

<a id="queries.multi_llm"></a>
2 changes: 1 addition & 1 deletion python/queries/clients.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1250,4 +1250,4 @@ class AsyncUnify(Client)
Class for interacting with the Unify chat completions endpoint in a synchronous
manner.

<a id="queries.chat"></a>
<a id="queries.multi_llm"></a>
1 change: 1 addition & 0 deletions python/queries/multi_llm.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -195,3 +195,4 @@ Generate content using the Unify API.

- `UnifyError` - If an error occurs during content generation.

<a id="queries.chat"></a>
2 changes: 1 addition & 1 deletion python/utils/credits.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ Returns the credits remaining in the user account, in USD.

- `ValueError` - If there was an HTTP error.

<a id="utils.router_training"></a>
<a id="utils.efficiency_benchmarks"></a>
2 changes: 1 addition & 1 deletion python/utils/custom_api_keys.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -143,4 +143,4 @@ Get a list of custom API keys associated with the user's account.
A list of dictionaries containing custom API key information.
Each dictionary has 'name' and 'value' keys.

<a id="utils.helpers"></a>
<a id="utils.evaluators"></a>
2 changes: 1 addition & 1 deletion python/utils/custom_endpoints.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,4 @@ Get a list of custom endpoints for the authenticated user.

- `requests.exceptions.RequestException` - If the API request fails.

<a id="utils.evaluators"></a>
<a id="utils.supported_endpoints"></a>
2 changes: 1 addition & 1 deletion python/utils/datasets.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -147,4 +147,4 @@ Fetches a list of all uploaded datasets.

- `ValueError` - If there was an HTTP error.

<a id="utils.supported_endpoints"></a>
<a id="utils.logging"></a>
2 changes: 1 addition & 1 deletion python/utils/evaluations.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -161,4 +161,4 @@ Get the evaluation status for a specific dataset, endpoint, and evaluator.

A dictionary containing the evaluation status information.

<a id="utils.custom_api_keys"></a>
<a id="utils.helpers"></a>
2 changes: 1 addition & 1 deletion python/utils/evaluators.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -136,4 +136,4 @@ Get a list of available evaluators.

A list of available evaluator names if successful, otherwise an empty list.

<a id="queries"></a>
<a id="utils.router_training"></a>
2 changes: 1 addition & 1 deletion python/utils/logging.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,4 @@ Get query metrics for specified parameters.

A dictionary containing the query metrics.

<a id="utils.router_deployment"></a>
<a id="utils.custom_api_keys"></a>
2 changes: 1 addition & 1 deletion python/utils/supported_endpoints.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,4 @@ provider.
- `BadRequestError` - If there was an HTTP error.
- `ValueError` - If there was an error parsing the JSON response.

<a id="utils.efficiency_benchmarks"></a>
<a id="utils.router_deployment"></a>

0 comments on commit 52346ba

Please sign in to comment.