pub struct OpenAiResponseFormat {
pub format_type: String,
pub json_schema: Option<OpenAiJsonSchema>,
}Expand description
OpenAI-compatible response format specifier.
Mirrors OpenAI’s response_format field on /v1/chat/completions:
{"type": "text"}— default, no constraint{"type": "json_object"}— output must be valid JSON{"type": "json_schema", "json_schema": {"name":..., "strict":true, "schema": {...}}}— output must conform to the inline JSON Schema
Fields§
§format_type: String§json_schema: Option<OpenAiJsonSchema>Present only when format_type == "json_schema".
Trait Implementations§
Source§impl Clone for OpenAiResponseFormat
impl Clone for OpenAiResponseFormat
Source§fn clone(&self) -> OpenAiResponseFormat
fn clone(&self) -> OpenAiResponseFormat
Returns a duplicate 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 OpenAiResponseFormat
impl Debug for OpenAiResponseFormat
Source§impl<'de> Deserialize<'de> for OpenAiResponseFormat
impl<'de> Deserialize<'de> for OpenAiResponseFormat
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 OpenAiResponseFormat
impl RefUnwindSafe for OpenAiResponseFormat
impl Send for OpenAiResponseFormat
impl Sync for OpenAiResponseFormat
impl Unpin for OpenAiResponseFormat
impl UnsafeUnpin for OpenAiResponseFormat
impl UnwindSafe for OpenAiResponseFormat
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