pub struct ChatCompletionsParams {
pub model: String,
pub messages: Vec<HashMap<String, String>>,
pub temperature: u32,
pub max_tokens: Option<u32>,
pub top_p: f32,
pub frequency_penalty: f32,
pub presence_penalty: f32,
pub stop: Option<Vec<String>>,
pub n: u32,
pub stream: bool,
pub logit_bias: Option<HashMap<String, i32>>,
pub user: Option<String>,
}
Fields§
§model: String
§messages: Vec<HashMap<String, String>>
[
{“role”: “system”, “content”: “You are a helpful assistant.”},
{"role": "user", "content": "Who won the world series in 2020?"},
{"role": "assistant", "content": "The Los Angeles Dodgers won the World Series in 2020."},
{“role”: “user”, “content”: “Where was it played?”}
]
or simply [ {“role”: “user”, “content”: “Who won the world series in 2020?”}, ]
temperature: u32
§max_tokens: Option<u32>
By default, the number of tokens the model can return will be (4096 - prompt tokens).
top_p: f32
§frequency_penalty: f32
§presence_penalty: f32
§stop: Option<Vec<String>>
§n: u32
§stream: bool
§logit_bias: Option<HashMap<String, i32>>
§user: Option<String>
Implementations§
Trait Implementations§
source§impl Default for ChatCompletionsParams
impl Default for ChatCompletionsParams
source§impl<'de> Deserialize<'de> for ChatCompletionsParams
impl<'de> Deserialize<'de> for ChatCompletionsParams
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more