@openfloor/protocol - v0.0.4
    Preparing search index...

    Class Feature

    Represents a feature in a dialog event according to the Open Floor specification. Features contain tokens and metadata about different aspects of the dialog event.

    // Text feature with multiple tokens
    const feature = new Feature({
    mimeType: 'text/plain',
    tokens: [
    { value: 'Hello' },
    { value: 'world' }
    ]
    });

    // Feature with alternatives and language
    const feature2 = new Feature({
    mimeType: 'text/plain',
    lang: 'en-US',
    tokens: [{ value: 'Hello', confidence: 0.95 }],
    alternates: [[{ value: 'Hi', confidence: 0.85 }]]
    });

    Hierarchy (View Summary)

    Implements

    Index

    Constructors

    • Creates a new Feature instance

      Parameters

      • options: FeatureOptions

        Feature configuration options

      Returns Feature

      Error if invalid configuration is provided

    Properties

    alternates: readonly (readonly Token[])[]
    encoding?: string
    lang?: string
    mimeType: string
    tokens: readonly Token[]
    tokenSchema?: string

    Methods

    • Creates a Feature instance from a dictionary with nested object conversion

      Parameters

      • data: Record<string, unknown>

      Returns Feature