From 52346ba51dbc7f3c9fb4eb6c997f257fd2f1979b Mon Sep 17 00:00:00 2001 From: vedpatwardhan Date: Wed, 4 Sep 2024 09:36:43 +0000 Subject: [PATCH] updated docs --- api-reference/llm_queries/chat_completions.mdx | 6 +++--- api-reference/openapi.json | 4 ++-- python/dataset.mdx | 12 ++++++------ python/evaluation.mdx | 2 +- python/exceptions.mdx | 2 +- python/queries/chat.mdx | 1 - python/queries/clients.mdx | 2 +- python/queries/multi_llm.mdx | 1 + python/utils/credits.mdx | 2 +- python/utils/custom_api_keys.mdx | 2 +- python/utils/custom_endpoints.mdx | 2 +- python/utils/datasets.mdx | 2 +- python/utils/evaluations.mdx | 2 +- python/utils/evaluators.mdx | 2 +- python/utils/logging.mdx | 2 +- python/utils/supported_endpoints.mdx | 2 +- 16 files changed, 23 insertions(+), 23 deletions(-) diff --git a/api-reference/llm_queries/chat_completions.mdx b/api-reference/llm_queries/chat_completions.mdx index 8e105d9a7..b184499fc 100644 --- a/api-reference/llm_queries/chat_completions.mdx +++ b/api-reference/llm_queries/chat_completions.mdx @@ -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\"}}", @@ -203,7 +203,7 @@ url = "https://api.unify.ai/v0/chat/completions" headers = {"Authorization": "Bearer "} -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) diff --git a/api-reference/openapi.json b/api-reference/openapi.json index 253ada919..db836ec72 100644 --- a/api-reference/openapi.json +++ b/api-reference/openapi.json @@ -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": { diff --git a/python/dataset.mdx b/python/dataset.mdx index 2b5b7d025..31a42270b 100644 --- a/python/dataset.mdx +++ b/python/dataset.mdx @@ -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) ``` @@ -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 @@ -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. @@ -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 @@ -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 diff --git a/python/evaluation.mdx b/python/evaluation.mdx index 3ce27c5f7..d6ad52daf 100644 --- a/python/evaluation.mdx +++ b/python/evaluation.mdx @@ -265,4 +265,4 @@ from the other subtracted dataset. - `other` - The other dataset being added to this one. - + diff --git a/python/exceptions.mdx b/python/exceptions.mdx index 0848eee34..e66cd3c8b 100644 --- a/python/exceptions.mdx +++ b/python/exceptions.mdx @@ -92,4 +92,4 @@ class InternalServerError(UnifyError) Exception raised for HTTP 500 Internal Server Error errors. - + diff --git a/python/queries/chat.mdx b/python/queries/chat.mdx index 8249c3bc7..f3aa4c372 100644 --- a/python/queries/chat.mdx +++ b/python/queries/chat.mdx @@ -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. - diff --git a/python/queries/clients.mdx b/python/queries/clients.mdx index c22e639f3..ec937ac43 100644 --- a/python/queries/clients.mdx +++ b/python/queries/clients.mdx @@ -1250,4 +1250,4 @@ class AsyncUnify(Client) Class for interacting with the Unify chat completions endpoint in a synchronous manner. - + diff --git a/python/queries/multi_llm.mdx b/python/queries/multi_llm.mdx index 955f957fc..292fc1c2f 100644 --- a/python/queries/multi_llm.mdx +++ b/python/queries/multi_llm.mdx @@ -195,3 +195,4 @@ Generate content using the Unify API. - `UnifyError` - If an error occurs during content generation. + diff --git a/python/utils/credits.mdx b/python/utils/credits.mdx index 650d4c899..9cceab6a6 100644 --- a/python/utils/credits.mdx +++ b/python/utils/credits.mdx @@ -28,4 +28,4 @@ Returns the credits remaining in the user account, in USD. - `ValueError` - If there was an HTTP error. - + diff --git a/python/utils/custom_api_keys.mdx b/python/utils/custom_api_keys.mdx index daa9d10c8..3e268b5b8 100644 --- a/python/utils/custom_api_keys.mdx +++ b/python/utils/custom_api_keys.mdx @@ -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. - + diff --git a/python/utils/custom_endpoints.mdx b/python/utils/custom_endpoints.mdx index 58b89938a..06ddfd0ba 100644 --- a/python/utils/custom_endpoints.mdx +++ b/python/utils/custom_endpoints.mdx @@ -129,4 +129,4 @@ Get a list of custom endpoints for the authenticated user. - `requests.exceptions.RequestException` - If the API request fails. - + diff --git a/python/utils/datasets.mdx b/python/utils/datasets.mdx index b123f2bca..a783040cd 100644 --- a/python/utils/datasets.mdx +++ b/python/utils/datasets.mdx @@ -147,4 +147,4 @@ Fetches a list of all uploaded datasets. - `ValueError` - If there was an HTTP error. - + diff --git a/python/utils/evaluations.mdx b/python/utils/evaluations.mdx index 1ea658e15..6ff845661 100644 --- a/python/utils/evaluations.mdx +++ b/python/utils/evaluations.mdx @@ -161,4 +161,4 @@ Get the evaluation status for a specific dataset, endpoint, and evaluator. A dictionary containing the evaluation status information. - + diff --git a/python/utils/evaluators.mdx b/python/utils/evaluators.mdx index 590425ed9..d27989866 100644 --- a/python/utils/evaluators.mdx +++ b/python/utils/evaluators.mdx @@ -136,4 +136,4 @@ Get a list of available evaluators. A list of available evaluator names if successful, otherwise an empty list. - + diff --git a/python/utils/logging.mdx b/python/utils/logging.mdx index e29ecfa65..59fcc5627 100644 --- a/python/utils/logging.mdx +++ b/python/utils/logging.mdx @@ -86,4 +86,4 @@ Get query metrics for specified parameters. A dictionary containing the query metrics. - + diff --git a/python/utils/supported_endpoints.mdx b/python/utils/supported_endpoints.mdx index b66ea13a7..da435a8f0 100644 --- a/python/utils/supported_endpoints.mdx +++ b/python/utils/supported_endpoints.mdx @@ -94,4 +94,4 @@ provider. - `BadRequestError` - If there was an HTTP error. - `ValueError` - If there was an error parsing the JSON response. - +