#[non_exhaustive]pub enum ResponseFormat {
Text,
Json,
Schema(Schema),
}Expand description
The shape of the answer’s text.
Each wire API maps it explicitly: Chat Completions sends response_format. Text is every
server’s default and is not sent. The answer is not checked against it when it arrives;
Completion::parse reads it into a type.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Text
Text of any shape. The default.
Json
A JSON object of any shape. Most APIs also want the prompt to ask for JSON.
Schema(Schema)
JSON that matches a schema.
Trait Implementations§
Source§impl Clone for ResponseFormat
impl Clone for ResponseFormat
Source§impl Debug for ResponseFormat
impl Debug for ResponseFormat
Source§impl Default for ResponseFormat
impl Default for ResponseFormat
Source§impl<'de> Deserialize<'de> for ResponseFormat
impl<'de> Deserialize<'de> for ResponseFormat
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 From<Schema> for ResponseFormat
impl From<Schema> for ResponseFormat
Source§impl PartialEq for ResponseFormat
impl PartialEq for ResponseFormat
Source§impl Serialize for ResponseFormat
impl Serialize for ResponseFormat
impl StructuralPartialEq for ResponseFormat
Auto Trait Implementations§
impl Freeze for ResponseFormat
impl RefUnwindSafe for ResponseFormat
impl Send for ResponseFormat
impl Sync for ResponseFormat
impl Unpin for ResponseFormat
impl UnsafeUnpin for ResponseFormat
impl UnwindSafe for ResponseFormat
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