From 06b726b38614826e15920b2ba73270ca0ce218c3 Mon Sep 17 00:00:00 2001 From: vedpatwardhan Date: Tue, 3 Sep 2024 23:19:43 +0000 Subject: [PATCH] updated docs --- python/queries/clients.mdx | 44 +++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/python/queries/clients.mdx b/python/queries/clients.mdx index bdf3e00..d2537c1 100644 --- a/python/queries/clients.mdx +++ b/python/queries/clients.mdx @@ -24,19 +24,19 @@ def generate(user_prompt: Optional[str] = None, system_prompt: Optional[str] = None, messages: Optional[Iterable[ChatCompletionMessageParam]] = None, *, - max_tokens: Optional[int] = 1024, - stop: Union[Optional[str], List[str]] = None, - stream: Optional[bool] = False, - temperature: Optional[float] = 1.0, frequency_penalty: Optional[float] = None, logit_bias: Optional[Dict[str, int]] = None, logprobs: Optional[bool] = None, top_logprobs: Optional[int] = None, + max_tokens: Optional[int] = 1024, n: Optional[int] = None, presence_penalty: Optional[float] = None, response_format: Optional[ResponseFormat] = None, seed: Optional[int] = None, + stop: Union[Optional[str], List[str]] = None, + stream: Optional[bool] = False, stream_options: Optional[ChatCompletionStreamOptionsParam] = None, + temperature: Optional[float] = 1.0, top_p: Optional[float] = None, tools: Optional[Iterable[ChatCompletionToolParam]] = None, tool_choice: Optional[ChatCompletionToolChoiceOptionParam] = None, @@ -45,8 +45,8 @@ def generate(user_prompt: Optional[str] = None, tags: Optional[List[str]] = None, message_content_only: bool = True, cache: bool = False, - extra_headers: Optional[Headers] = None, - extra_query: Optional[Query] = None, + extra_headers: Optional[OpenAIHeaders] = None, + extra_query: Optional[OpenAIQuery] = None, **kwargs) ``` @@ -62,22 +62,6 @@ Generate content using the Unify API. - `messages` - A list of messages comprising the conversation so far. If provided, user_prompt must be None. -- `max_tokens` - The maximum number of tokens that can be generated in the chat - completion. The total length of input tokens and generated tokens is limited - by the model's context length. Defaults to the provider's default max_tokens - when the value is None. - -- `stop` - Up to 4 sequences where the API will stop generating further tokens. - -- `stream` - If True, generates content as a stream. If False, generates content - as a single response. Defaults to False. - -- `temperature` - What sampling temperature to use, between 0 and 2. - Higher values like 0.8 will make the output more random, - while lower values like 0.2 will make it more focused and deterministic. - It is generally recommended to alter this or top_p, but not both. - Defaults to the provider's default max_tokens when the value is None. - - `frequency_penalty` - Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim. @@ -98,6 +82,11 @@ Generate content using the Unify API. likely tokens to return at each token position, each with an associated log probability. logprobs must be set to true if this parameter is used. +- `max_tokens` - The maximum number of tokens that can be generated in the chat + completion. The total length of input tokens and generated tokens is limited + by the model's context length. Defaults to the provider's default max_tokens + when the value is None. + - `n` - How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep n as 1 to minimize costs. @@ -119,9 +108,20 @@ Generate content using the Unify API. you should refer to the system_fingerprint response parameter to monitor changes in the backend. +- `stop` - Up to 4 sequences where the API will stop generating further tokens. + +- `stream` - If True, generates content as a stream. If False, generates content + as a single response. Defaults to False. + - `stream_options` - Options for streaming response. Only set this when you set - `stream` - true. +- `temperature` - What sampling temperature to use, between 0 and 2. + Higher values like 0.8 will make the output more random, + while lower values like 0.2 will make it more focused and deterministic. + It is generally recommended to alter this or top_p, but not both. + Defaults to the provider's default max_tokens when the value is None. + - `top_p` - An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass