pub enum DynamicGenerationSchema {
Object {
name: String,
description: Option<String>,
properties: BTreeMap<String, DynamicGenerationProperty>,
},
Array {
item: Box<DynamicGenerationSchema>,
minimum_elements: Option<usize>,
maximum_elements: Option<usize>,
guides: Vec<GenerationGuide>,
},
AnyOf {
name: String,
description: Option<String>,
choices: Vec<DynamicGenerationSchema>,
},
AnyOfStrings {
name: String,
description: Option<String>,
choices: Vec<String>,
},
String {
description: Option<String>,
guides: Vec<GenerationGuide>,
},
Integer {
description: Option<String>,
guides: Vec<GenerationGuide>,
},
Float {
description: Option<String>,
guides: Vec<GenerationGuide>,
},
Number {
description: Option<String>,
guides: Vec<GenerationGuide>,
},
Decimal {
description: Option<String>,
guides: Vec<GenerationGuide>,
},
Boolean {
description: Option<String>,
},
GeneratedContent {
description: Option<String>,
},
Reference {
name: String,
},
}Expand description
A dynamic FoundationModels schema description.
Variants§
Object
Fields
§
properties: BTreeMap<String, DynamicGenerationProperty>Array
AnyOf
AnyOfStrings
String
Integer
Float
Number
Decimal
Boolean
GeneratedContent
Reference
Implementations§
Source§impl DynamicGenerationSchema
impl DynamicGenerationSchema
Sourcepub fn generated_content() -> Self
pub fn generated_content() -> Self
Create an arbitrary-JSON schema.
Sourcepub fn any_of(name: impl Into<String>, choices: Vec<Self>) -> Self
pub fn any_of(name: impl Into<String>, choices: Vec<Self>) -> Self
Create a named union of schemas.
Sourcepub fn any_of_strings(
name: impl Into<String>,
choices: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn any_of_strings( name: impl Into<String>, choices: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Create a named union of constant string choices.
Sourcepub fn with_description(self, description: impl Into<String>) -> Self
pub fn with_description(self, description: impl Into<String>) -> Self
Attach a description.
Sourcepub fn with_property(
self,
name: impl Into<String>,
property: DynamicGenerationProperty,
) -> Self
pub fn with_property( self, name: impl Into<String>, property: DynamicGenerationProperty, ) -> Self
Add a property to an object schema.
Sourcepub fn with_element_bounds(
self,
minimum: Option<usize>,
maximum: Option<usize>,
) -> Self
pub fn with_element_bounds( self, minimum: Option<usize>, maximum: Option<usize>, ) -> Self
Set the array bounds.
Sourcepub fn with_guides(
self,
guides: impl IntoIterator<Item = GenerationGuide>,
) -> Self
pub fn with_guides( self, guides: impl IntoIterator<Item = GenerationGuide>, ) -> Self
Attach FoundationModels generation guides.
Trait Implementations§
Source§impl Clone for DynamicGenerationSchema
impl Clone for DynamicGenerationSchema
Source§fn clone(&self) -> DynamicGenerationSchema
fn clone(&self) -> DynamicGenerationSchema
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 DynamicGenerationSchema
impl Debug for DynamicGenerationSchema
Source§impl PartialEq for DynamicGenerationSchema
impl PartialEq for DynamicGenerationSchema
Source§fn eq(&self, other: &DynamicGenerationSchema) -> bool
fn eq(&self, other: &DynamicGenerationSchema) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for DynamicGenerationSchema
Auto Trait Implementations§
impl Freeze for DynamicGenerationSchema
impl RefUnwindSafe for DynamicGenerationSchema
impl Send for DynamicGenerationSchema
impl Sync for DynamicGenerationSchema
impl Unpin for DynamicGenerationSchema
impl UnsafeUnpin for DynamicGenerationSchema
impl UnwindSafe for DynamicGenerationSchema
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