Struct async_openai::types::ChatCompletionResponseFormat
source · pub struct ChatCompletionResponseFormat {
pub type: ChatCompletionResponseFormatType,
}
Fields§
§type: ChatCompletionResponseFormatType
Setting to json_object
enables JSON mode. This guarantees that the message the model generates is valid JSON.
Note that your system prompt must still instruct the model to produce JSON, and to help ensure you don’t forget,
the API will throw an error if the string JSON
does not appear in your system message. Also note that the message
content may be partial (i.e. cut off) if finish_reason="length"
, which indicates the generation
exceeded max_tokens
or the conversation exceeded the max context length.
Must be one of text
or json_object
.
Trait Implementations§
source§impl Clone for ChatCompletionResponseFormat
impl Clone for ChatCompletionResponseFormat
source§fn clone(&self) -> ChatCompletionResponseFormat
fn clone(&self) -> ChatCompletionResponseFormat
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for ChatCompletionResponseFormat
impl Debug for ChatCompletionResponseFormat
source§impl<'de> Deserialize<'de> for ChatCompletionResponseFormat
impl<'de> Deserialize<'de> for ChatCompletionResponseFormat
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
source§impl PartialEq for ChatCompletionResponseFormat
impl PartialEq for ChatCompletionResponseFormat
source§fn eq(&self, other: &ChatCompletionResponseFormat) -> bool
fn eq(&self, other: &ChatCompletionResponseFormat) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for ChatCompletionResponseFormat
Auto Trait Implementations§
impl RefUnwindSafe for ChatCompletionResponseFormat
impl Send for ChatCompletionResponseFormat
impl Sync for ChatCompletionResponseFormat
impl Unpin for ChatCompletionResponseFormat
impl UnwindSafe for ChatCompletionResponseFormat
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