pub struct GenerationSchema {
pub name: GenerationSchemaName,
pub description: Option<SchemaDescription>,
pub properties: Vec<GenerationSchemaProperty>,
}Expand description
Describes the JSON object shape that the model must produce for structured generation.
Build one using the builder methods, then pass it to LanguageModelSession::generate_object.
use aimx::{GenerationSchema, GenerationSchemaProperty, GenerationSchemaPropertyType};
let schema = GenerationSchema::new("Point")
.property(GenerationSchemaProperty::new("x", GenerationSchemaPropertyType::Double))
.property(GenerationSchemaProperty::new("y", GenerationSchemaPropertyType::Double));Fields§
§name: GenerationSchemaNameInternal type name used by the model’s structured generation system.
description: Option<SchemaDescription>Optional description of what this type represents.
properties: Vec<GenerationSchemaProperty>The properties the model must populate.
Implementations§
Source§impl GenerationSchema
impl GenerationSchema
Sourcepub fn new(name: impl Into<GenerationSchemaName>) -> Self
pub fn new(name: impl Into<GenerationSchemaName>) -> Self
Creates a new empty schema with the given type name.
Sourcepub fn description(self, description: impl Into<SchemaDescription>) -> Self
pub fn description(self, description: impl Into<SchemaDescription>) -> Self
Attaches a description of this type.
Sourcepub fn property(self, property: GenerationSchemaProperty) -> Self
pub fn property(self, property: GenerationSchemaProperty) -> Self
Adds a property to this schema.
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 · 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
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