Skip to main content

WIT_INTERFACE

Constant WIT_INTERFACE 

Source
pub const WIT_INTERFACE: &str = r#"
package intent:classifier@0.1.0;

interface classifier {
    /// Classification result for a single skill/intent.
    record intent-score {
        /// The skill ID or intent label
        label: string,
        /// Confidence score (0.0 to 1.0)
        score: float32,
    }

    /// Result of intent classification.
    record classification-result {
        /// Ranked list of intent scores (highest first)
        scores: list<intent-score>,
        /// Whether the query appears to be out-of-scope
        out-of-scope: bool,
    }

    /// Classifies the input query.
    ///
    /// Arguments:
    /// - input: The user's query text
    /// - context: Optional conversation context (JSON array of strings)
    ///
    /// Returns:
    /// - Classification result with ranked scores
    classify: func(input: string, context: string) -> result<classification-result, string>;
}

world intent-classifier {
    export classifier;
}
"#;
Expand description

Proposed WIT interface for intent classifiers.

This is the interface that WASM components should implement. Save this as intent-classifier.wit when building components.