Skip to main content

Crate zenbase_llml

Crate zenbase_llml 

Source
Expand description

§LLML - Lightweight Markup Language

Converts data structures to XML-like markup with specific formatting rules.

§Features

  • Converts key-value pairs to XML tags: {"key": "value"}<key>value</key>
  • Formats arrays as numbered lists with wrapper tags
  • Supports nested objects and kebab-case conversion
  • Handles indentation, prefixes, and multiline strings

§Usage

use zenbase_llml::{llml, llml_with_options, LLMLOptions};
use serde_json::json;

let data = json!({"instructions": "Follow these steps"});
let result = llml(&data);
// Output: "<instructions>Follow these steps</instructions>"

// For custom formatting:
let options = LLMLOptions { indent: "  ".to_string(), prefix: String::new(), strict: false };
let result = llml_with_options(&data, Some(options));

Structs§

LLMLOptions
Configuration LLMLOptions for LLML formatting

Functions§

llml
Main LLML function - converts data structures to XML-like markup
llml_with_options
LLML function with explicit LLMLOptions - use when you need custom formatting