rstructor_derive 0.6.0

Derive macros for rstructor: generate JSON Schema from Rust structs and enums to extract structured, validated outputs from LLMs (the Instructor pattern for Rust).
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use rstructor::Instructor;

#[derive(Instructor)]
#[llm(examples = "not an array")]
struct InvalidContainerExamples {
    value: String,
}

#[derive(Instructor)]
struct InvalidFieldExamples {
    #[llm(examples = 42)]
    value: String,
}

fn main() {}