pub struct OutputSchema {
pub name: String,
pub description: Option<String>,
pub schema: Value,
pub strict: bool,
}Expand description
Structured output schema passed to the model and used for runtime parsing.
Fields§
§name: StringOutput schema name.
description: Option<String>Output schema description.
schema: ValueJSON schema for the final output value.
strict: boolWhether schema validation should be strict when provider support exists.
Implementations§
Source§impl OutputSchema
impl OutputSchema
Sourcepub fn typed<T>() -> Selfwhere
T: JsonSchema,
pub fn typed<T>() -> Selfwhere
T: JsonSchema,
Build an output schema from a Rust type.
The generated schema name is derived from the Rust type name and normalized for
provider request formats. Use Self::typed_named when the public schema name
needs to be stable across type renames.
Sourcepub fn typed_named<T>(name: impl Into<String>) -> Selfwhere
T: JsonSchema,
pub fn typed_named<T>(name: impl Into<String>) -> Selfwhere
T: JsonSchema,
Build a named output schema from a Rust type.
Sourcepub fn with_description(self, description: impl Into<String>) -> Self
pub fn with_description(self, description: impl Into<String>) -> Self
Add a description.
Sourcepub const fn with_strict(self, strict: bool) -> Self
pub const fn with_strict(self, strict: bool) -> Self
Set strict provider validation preference.
Sourcepub fn request_schema(&self) -> Value
pub fn request_schema(&self) -> Value
Return provider-neutral request schema metadata.
Trait Implementations§
Source§impl Clone for OutputSchema
impl Clone for OutputSchema
Source§fn clone(&self) -> OutputSchema
fn clone(&self) -> OutputSchema
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 OutputSchema
impl Debug for OutputSchema
Source§impl<'de> Deserialize<'de> for OutputSchema
impl<'de> Deserialize<'de> for OutputSchema
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
impl Eq for OutputSchema
Source§impl PartialEq for OutputSchema
impl PartialEq for OutputSchema
Source§fn eq(&self, other: &OutputSchema) -> bool
fn eq(&self, other: &OutputSchema) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for OutputSchema
impl Serialize for OutputSchema
impl StructuralPartialEq for OutputSchema
Auto Trait Implementations§
impl Freeze for OutputSchema
impl RefUnwindSafe for OutputSchema
impl Send for OutputSchema
impl Sync for OutputSchema
impl Unpin for OutputSchema
impl UnsafeUnpin for OutputSchema
impl UnwindSafe for OutputSchema
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