pub struct GenerationSchema { /* private fields */ }Expand description
A validated FoundationModels generation schema encoded as JSON Schema.
Implementations§
Source§impl GenerationSchema
impl GenerationSchema
Sourcepub fn from_dynamic(
root: DynamicGenerationSchema,
dependencies: impl IntoIterator<Item = DynamicGenerationSchema>,
) -> Result<Self, FMError>
pub fn from_dynamic( root: DynamicGenerationSchema, dependencies: impl IntoIterator<Item = DynamicGenerationSchema>, ) -> Result<Self, FMError>
Sourcepub fn new(
description: Option<String>,
properties: impl IntoIterator<Item = (impl Into<String>, DynamicGenerationProperty)>,
) -> Result<Self, FMError>
pub fn new( description: Option<String>, properties: impl IntoIterator<Item = (impl Into<String>, DynamicGenerationProperty)>, ) -> Result<Self, FMError>
Sourcepub fn new_with_nil_repr(
description: Option<String>,
represent_nil_explicitly_in_generated_content: bool,
properties: impl IntoIterator<Item = (impl Into<String>, DynamicGenerationProperty)>,
) -> Result<Self, FMError>
pub fn new_with_nil_repr( description: Option<String>, represent_nil_explicitly_in_generated_content: bool, properties: impl IntoIterator<Item = (impl Into<String>, DynamicGenerationProperty)>, ) -> Result<Self, FMError>
Sourcepub fn json_schema(&self) -> &str
pub fn json_schema(&self) -> &str
The JSON Schema payload accepted by Apple’s GenerationSchema.
Sourcepub fn generated_content() -> Self
pub fn generated_content() -> Self
A schema for arbitrary JSON (GeneratedContent).
Trait Implementations§
Source§impl Clone for GenerationSchema
impl Clone for GenerationSchema
Source§fn clone(&self) -> GenerationSchema
fn clone(&self) -> GenerationSchema
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 GenerationSchema
impl Debug for GenerationSchema
impl Eq for GenerationSchema
Source§impl PartialEq for GenerationSchema
impl PartialEq for GenerationSchema
Auto Trait Implementations§
impl Freeze for GenerationSchema
impl RefUnwindSafe for GenerationSchema
impl Send for GenerationSchema
impl Sync for GenerationSchema
impl Unpin for GenerationSchema
impl UnsafeUnpin for GenerationSchema
impl UnwindSafe for GenerationSchema
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