Module frame

Module frame 

Source
Expand description

Frames & slots — typed, first-class fields for conversation authoring.

Voice authors think in frames (a Booking, a PaymentFrame), not bare state keys. A slot carries a prompt, reprompt, confirmation policy, and PII/redaction policy alongside its State key. #[derive(Frame)] generates the Frame impl from a struct’s #[slot(..)] attributes; the conversation compiler consumes a frame’s slots for collect completion, and the metadata drives confirmations and repair.

use gemini_adk_rs::Frame; // the derive

#[derive(Frame)]
#[frame(name = "booking")]
struct Booking {
    #[slot(prompt = "For how many people?", confirm = "low_confidence")]
    party_size: u8,
    #[slot(prompt = "What day and time?")]
    slot: String,
    #[slot(prompt = "Name for the reservation?", pii)]
    name: String,
}

let spec = Booking::frame();
assert_eq!(spec.slot_keys(), vec!["party_size", "slot", "name"]);

Structs§

FrameSpec
The slot definition of a frame — the source of truth for what a stage that collects this frame must gather, plus the metadata that drives confirmation and repair.
SlotSpec
Metadata for a single slot within a FrameSpec.

Enums§

ConfirmPolicy
When a slot’s value should be confirmed back to the user before it is trusted.
SlotRecognizer
A serializable description of the deterministic recognizer that fills a slot.
SlotValidator
A serializable validator applied to a recognized slot value; a value failing it is rejected (the slot stays unfilled until a valid value is recognized).

Traits§

Frame
A typed conversation frame. Implement via #[derive(Frame)].