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

    Class OpenFloorAgentAbstract

    Base class for Open Floor Protocol agents Provides event handling infrastructure and basic agent behaviors

    class MyAgent extends OpenFloorAgent {
    constructor(manifest) {
    super(manifest);
    this.on('utterance', this.handleUtterance.bind(this));
    }

    async handleUtterance(event, envelope, outEnvelope) {
    // Handle utterance event
    }
    }

    Hierarchy (View Summary)

    Index

    Constructors

    Accessors

    • get serviceUrl(): string

      Get the agent's service URL from the manifest

      Returns string

    • get speakerUri(): string

      Get the agent's speaker URI from the manifest

      Returns string

    Methods

    • Remove an event handler

      Parameters

      • eventType: keyof AgentEventHandlers

        Type of event

      • handler: (...args: any[]) => Promise<void>

        Handler function to remove

      Returns void

    • Add an event handler for a specific event type

      Parameters

      • eventType: keyof AgentEventHandlers

        Type of event to handle

      • handler: (...args: any[]) => Promise<void>

        Handler function

      Returns void

    • Process an incoming envelope and generate a response This is the main entry point for agent message processing

      Parameters

      • inEnvelope: Envelope

        Incoming envelope to process

      Returns Promise<Envelope>

      Promise resolving to response envelope