pub struct ToJsonSchemaOptions {
pub fields_always_required: bool,
pub supports_format: bool,
pub extract_descriptions: bool,
pub top_level_must_be_object: bool,
pub supports_additional_properties: bool,
}Fields§
§fields_always_required: boolIf true, mark all fields as required.
Use union type (with null) for optional fields instead.
Models like OpenAI will reject the schema if a field is not required.
supports_format: boolIf true, the JSON schema supports the format keyword.
extract_descriptions: boolIf true, extract descriptions to a separate extra instruction.
top_level_must_be_object: boolIf true, the top level must be a JSON object.
supports_additional_properties: boolIf true, include additionalProperties: false in object schemas.
Some LLM APIs (e.g., Gemini) do not support this constraint and will error.
Auto Trait Implementations§
impl Freeze for ToJsonSchemaOptions
impl RefUnwindSafe for ToJsonSchemaOptions
impl Send for ToJsonSchemaOptions
impl Sync for ToJsonSchemaOptions
impl Unpin for ToJsonSchemaOptions
impl UnwindSafe for ToJsonSchemaOptions
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