use zenbase_llml::{llml, llml_with_options, LLMLOptions};
use serde_json::json;
fn main() {
println!("LLML Rust Examples\n");
let simple_data = json!({
"instructions": "Follow these steps",
"count": 42,
"enabled": true
});
println!("Simple data:");
println!("{}\n", llml(&simple_data));
let list_data = json!({
"rules": ["first", "second", "third"],
"numbers": [1, 2, 3]
});
println!("Lists:");
println!("{}\n", llml(&list_data));
let nested_data = json!({
"config": {
"debug": true,
"timeout": 30
},
"user_settings": {
"theme_mode": "dark",
"maxRetries": 5
}
});
println!("Nested objects:");
println!("{}\n", llml(&nested_data));
let mixed_data = json!({
"title": "My Document",
"sections": ["intro", "body", "conclusion"],
"metadata": {
"author": "Alice",
"version": "1.0"
}
});
println!("Mixed content:");
println!("{}\n", llml(&mixed_data));
println!("With indentation:");
let options = Some(LLMLOptions {
indent: " ".to_string(),
prefix: String::new(),
strict: false,
});
println!("{}\n", llml_with_options(&simple_data, options));
let empty_data = json!({
"empty_string": "",
"empty_array": [],
"zero": 0,
"false_value": false,
"null_value": null
});
println!("Empty/falsy values:");
println!("{}", llml(&empty_data));
}