pub struct GeneratedSchema {
pub schema: Value,
pub name: String,
pub field_descriptions: HashMap<String, String>,
pub confidence: f64,
pub strict: bool,
pub examples_used: usize,
}Expand description
A generated JSON schema.
Fields§
§schema: ValueThe JSON Schema.
name: StringName for the schema.
field_descriptions: HashMap<String, String>Descriptions for each field (field_path -> description).
confidence: f64Confidence in the generated schema (0.0 to 1.0).
strict: boolWhether the schema was generated in strict mode.
examples_used: usizeNumber of examples used to generate.
Implementations§
Source§impl GeneratedSchema
impl GeneratedSchema
Sourcepub fn with_field_descriptions(
self,
descriptions: HashMap<String, String>,
) -> Self
pub fn with_field_descriptions( self, descriptions: HashMap<String, String>, ) -> Self
Set field descriptions.
Sourcepub fn with_confidence(self, confidence: f64) -> Self
pub fn with_confidence(self, confidence: f64) -> Self
Set confidence.
Sourcepub fn with_examples_used(self, count: usize) -> Self
pub fn with_examples_used(self, count: usize) -> Self
Set examples used.
Sourcepub fn to_extraction_schema(&self) -> ExtractionSchema
pub fn to_extraction_schema(&self) -> ExtractionSchema
Convert to ExtractionSchema for use in automation.
Sourcepub fn schema_string(&self) -> String
pub fn schema_string(&self) -> String
Get the schema as a pretty-printed string.
Trait Implementations§
Source§impl Clone for GeneratedSchema
impl Clone for GeneratedSchema
Source§fn clone(&self) -> GeneratedSchema
fn clone(&self) -> GeneratedSchema
Returns a duplicate of the value. Read more
1.0.0 · 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 GeneratedSchema
impl Debug for GeneratedSchema
Source§impl<'de> Deserialize<'de> for GeneratedSchema
impl<'de> Deserialize<'de> for GeneratedSchema
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
Auto Trait Implementations§
impl Freeze for GeneratedSchema
impl RefUnwindSafe for GeneratedSchema
impl Send for GeneratedSchema
impl Sync for GeneratedSchema
impl Unpin for GeneratedSchema
impl UnwindSafe for GeneratedSchema
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