Hierarchy

  • EngagementPowers

Index

Methods

Methods

Static sendEngagements

  • Sends a collection of different engagement types.

    throws

    {Error} When a particular engagement type is missing required fields

    throws

    {TypeError} When engagements is an invalid type.

    example

    This example returns a DialogueResponse to the Andi chat window and a FieldTag to the someField property

    import { EngagementPowers, DialogueResponse, FieldTag } from "@andi/powers";
    import { FieldTagTypes, ISkillContext, ISkillActivity } from "andiskills";
    
    export async function run(skillContext: ISkillContext): Promise<ISkillActivity> {
        const fieldTag: FieldTag = {
            text: "Example Field Tag",
            tagType: FieldTagTypes.Info,
            key: "uniqueTemplateKeyFieldTag",
            fields: ["someField"]
        };
    
        const dialogueResponse: DialogueResponse = {
            message: "Example Dialogue Response",
            tags: []
        }
    
        return EngagementPowers.sendEngagements([fieldTag, dialogueResponse]);
    }

    Parameters

    Returns Promise<ISkillActivity>

    Returns a skill activity with a dialogue response and field tag to the browser.

Generated using TypeDoc