1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
* OpenAI API
*
* APIs for sampling from and fine-tuning language models
*
* The version of the OpenAPI document: 1.2.0
*
* Generated by: https://openapi-generator.tech
*/
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct CreateEditRequest {
/// ID of the model to use. You can use the `text-davinci-edit-001` or `code-davinci-edit-001` model with this endpoint.
#[serde(rename = "model")]
pub model: String,
/// The input text to use as a starting point for the edit.
#[serde(rename = "input", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub input: Option<Option<String>>,
/// The instruction that tells the model how to edit the prompt.
#[serde(rename = "instruction")]
pub instruction: String,
/// How many edits to generate for the input and instruction.
#[serde(rename = "n", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub n: Option<Option<i32>>,
/// 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. We generally recommend altering this or `top_p` but not both.
#[serde(rename = "temperature", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub temperature: Option<Option<f32>>,
/// 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. We generally recommend altering this or `temperature` but not both.
#[serde(rename = "top_p", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub top_p: Option<Option<f32>>,
}
impl CreateEditRequest {
pub fn new(model: String, instruction: String) -> CreateEditRequest {
CreateEditRequest {
model,
input: None,
instruction,
n: None,
temperature: None,
top_p: None,
}
}
}