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
Auto Trait Implementations§
impl Freeze for ChatCompletionsParams
impl RefUnwindSafe for ChatCompletionsParams
impl Send for ChatCompletionsParams
impl Sync for ChatCompletionsParams
impl Unpin for ChatCompletionsParams
impl UnwindSafe for ChatCompletionsParams
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more