You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: async-openai/README.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,7 +23,7 @@
23
23
24
24
- It's based on [OpenAI OpenAPI spec](https://github.com/openai/openai-openapi)
25
25
- Current features:
26
-
-[x] Completions (including SSE streaming)
26
+
-[x] Completions (including SSE streaming & Chat)
27
27
-[x] Edits
28
28
-[x] Embeddings
29
29
-[x] Files
@@ -35,7 +35,7 @@
35
35
- Non-streaming requests are retried with exponential backoff when [rate limited](https://platform.openai.com/docs/guides/rate-limits) by the API server.
36
36
- Ergonomic Rust library with builder pattern for all request objects.
37
37
38
-
*Being a young project there could be rough edges.*
38
+
_Being a young project there could be rough edges._
Copy file name to clipboardExpand all lines: async-openai/src/lib.rs
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -48,6 +48,7 @@
48
48
//! ## Examples
49
49
//! For full working examples for all supported features see [examples](https://github.com/64bit/async-openai/tree/main/examples) directory in the repository.
/// ID of the model to use. You can use the [List models](https://platform.openai.com/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](https://platform.openai.com/docs/models/overview) for descriptions of them.
170
+
pubmodel:String,
171
+
172
+
/// The message(s) to generate a response to, encoded as an array of the message type.
173
+
///
174
+
/// Note that <|endoftext|> is the document separator that the model sees during training, so if a prompt is not specified the model will generate as if from the beginning of a new document.
175
+
#[serde(skip_serializing_if = "Option::is_none")]
176
+
pubmessages:Option<Vec<Message>>,
177
+
178
+
/// What [sampling temperature](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277) to use. Higher values means the model will take more risks. Try 0.9 for more creative applications, and 0 (argmax sampling) for ones with a well-defined answer.
179
+
///
180
+
/// We generally recommend altering this or `top_p` but not both.
/// 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 are considered.
185
+
///
186
+
/// We generally recommend altering this or `temperature` but not both.
/// How many completions to generate for each prompt.
191
+
192
+
/// **Note:** Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings for `max_tokens` and `stop`.
193
+
///
194
+
#[serde(skip_serializing_if = "Option::is_none")]
195
+
pubn:Option<u8>,// min:1 max: 128, default: 1
196
+
197
+
/// Whether to stream back partial progress. If set, tokens will be sent as data-only [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format)
198
+
/// as they become available, with the stream terminated by a `data: [DONE]` message.
199
+
#[serde(skip_serializing_if = "Option::is_none")]
200
+
pubstream:Option<bool>,// nullable: true
201
+
202
+
/// Include the log probabilities on the `logprobs` most likely tokens, as well the chosen tokens. For example, if `logprobs` is 5, the API will return a list of the 5 most likely tokens. The API will always return the `logprob` of the sampled token, so there may be up to `logprobs+1` elements in the response.
203
+
204
+
/// The maximum value for `logprobs` is 5. If you need more than this, please contact us through our [Help center](https://help.openai.com) and describe your use case.
/// Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence.
209
+
#[serde(skip_serializing_if = "Option::is_none")]
210
+
pubstop:Option<Stop>,
211
+
212
+
/// Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.
213
+
///
214
+
/// [See more information about frequency and presence penalties.](https://platform.openai.com/docs/api-reference/parameter-details)
/// 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.
219
+
///
220
+
/// [See more information about frequency and presence penalties.](https://platform.openai.com/docs/api-reference/parameter-details)
/// Modify the likelihood of specified tokens appearing in the completion.
225
+
///
226
+
/// Accepts a json object that maps tokens (specified by their token ID in the GPT tokenizer) to an associated bias value from -100 to 100. You can use this [tokenizer tool](/tokenizer?view=bpe) (which works for both GPT-2 and GPT-3) to convert text to token IDs. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token.
227
+
///
228
+
/// As an example, you can pass `{"50256": -100}` to prevent the <|endoftext|> token from being generated.
/// A unique identifier representing your end-user, which will help OpenAI to monitor and detect abuse. [Learn more](https://platform.openai.com/docs/usage-policies/end-user-ids).
0 commit comments