Skip to content

Commit

Permalink
updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
vedpatwardhan committed Sep 3, 2024
1 parent 5615a80 commit 06b726b
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions python/queries/clients.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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)
```

Expand All @@ -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.
Expand All @@ -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.
Expand All @@ -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
Expand Down

0 comments on commit 06b726b

Please sign in to comment.