#[non_exhaustive]pub enum SchemaTransform {
AdditionalPropertiesFalse,
RemovePropertyNames,
OpenAiStrict,
}Expand description
A rewrite applied to a JSON Schema before it is sent to a provider.
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.
AdditionalPropertiesFalse
Set additionalProperties: false on every object schema.
Applied by default to schemas derived from Rust types, so that models cannot invent properties the type does not declare.
RemovePropertyNames
Remove propertyNames keywords everywhere.
OpenAiStrict
OpenAI strict mode: additionalProperties: false, no propertyNames,
every property required, previously optional properties nullable.
Implementations§
Source§impl SchemaTransform
impl SchemaTransform
Sourcepub fn openai_strict() -> Self
pub fn openai_strict() -> Self
The OpenAI strict-mode transform.
Sourcepub fn additional_properties_false() -> Self
pub fn additional_properties_false() -> Self
The additionalProperties: false transform.
Trait Implementations§
Source§impl Clone for SchemaTransform
impl Clone for SchemaTransform
Source§fn clone(&self) -> SchemaTransform
fn clone(&self) -> SchemaTransform
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 moreimpl Copy for SchemaTransform
Source§impl Debug for SchemaTransform
impl Debug for SchemaTransform
impl Eq for SchemaTransform
Source§impl Hash for SchemaTransform
impl Hash for SchemaTransform
Source§impl PartialEq for SchemaTransform
impl PartialEq for SchemaTransform
impl StructuralPartialEq for SchemaTransform
Auto Trait Implementations§
impl Freeze for SchemaTransform
impl RefUnwindSafe for SchemaTransform
impl Send for SchemaTransform
impl Sync for SchemaTransform
impl Unpin for SchemaTransform
impl UnsafeUnpin for SchemaTransform
impl UnwindSafe for SchemaTransform
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.