Module flow_macros

Module flow_macros 

Source
Expand description

Typed graph macros — compile-time-checked names for flow authoring.

Flow/stage/tool/slot names are stringly by nature, which makes typos a runtime surprise. voice_flow! generates a module of &'static str name constants so the names are declared once and every reference is checked at compile time — a typo’d booking::collct is a build error, not a silent never-matching guard.

use gemini_adk_fluent_rs::voice_flow;

voice_flow! {
    mod booking {
        steps: [collect, confirm, done];
        tools: [book];
        slots: [party_size];
    }
}

assert_eq!(booking::collect, "collect");
assert_eq!(booking::book, "book");
assert_eq!(booking::party_size, "party_size");

Use the constants throughout the Conversation builder (.stage(booking::collect), .commit(booking::book, ..), Guard::captured([booking::party_size])) so renaming a name is one edit and mistyping it never compiles. (A full declarative voice_flow! body — stages, transitions, and guards in macro syntax — is a planned follow-up; this is the name-checking core.)