Crate product_farm_yaml_loader

Crate product_farm_yaml_loader 

Source
Expand description

Product-FARM YAML Loader

A flexible YAML-based product definition loader that intelligently parses user-defined schemas into Product-FARM core types.

§Features

  • Flexible Parsing: Detect YAML structure from file names and content tags
  • Intelligent Interpretation: Infer attribute types from naming conventions
  • Master Schema Derivation: Extract unified schema from multi-layer definitions
  • Inference Reports: Generate confidence-based reports of parsing decisions

§Quick Start

use product_farm_yaml_loader::{init, State};

// Initialize from a folder containing YAML files
let mut registry = init("./products/my-product")?;

// Create state with input values
let mut state = State::new();
state.set("scenario.difficulty", "expert");
state.set("scenario.max_score", 100.0);

// Evaluate a function
let result = registry.evaluate("my-product-v1", state, "calculate-score")?;

println!("Score: {:?}", result.outputs.get("scenario.score"));

Re-exports§

pub use evaluator::State;
pub use evaluator::EvalResult;
pub use report::InferenceReport;
pub use product_farm_farmscript as farmscript;
pub use error::*;
pub use schema::*;
pub use registry::*;

Modules§

discovery
File discovery for YAML product definitions.
error
Error types for the YAML loader.
evaluator
Evaluation functionality for product rules.
interpreter
Intelligent field interpretation.
llm_prompt
LLM Prompt Preprocessing
output
Structured YAML output generation.
parser
YAML parsing with tag detection.
registry
Product registry for loaded schemas.
report
Inference report generation.
schema
Flexible YAML schema types.
transformer
Schema transformation from YAML to core types.

Functions§

init
Initialize a ProductRegistry from a YAML folder.
init_with_report
Initialize and generate an inference report.
load
Load a single product definition without building a registry.