A response describes how the assistant will respond to a user's request. It includes not just spoken responses but also displays, media, and system responses like account linking.
export interface SimpleResponse<T = string | ResponseOutput> extends Partial<Actionable> { /** * Name of the response. * * Used to help differentiate multiple responses. * * @type {string} * @memberof SimpleResponse */ name?: string; /** * Used for tracking the response in third party analytics. * * @type {string} * @memberof SimpleResponse */ tag?: string; /** * What the assistant will say first as part of the response. * * @type {(string | ResponseOutput)} * @memberof SimpleResponse */ outputSpeech?: T; /** * If provided, the output speech was most likely a question and requires a response from the user. * The reprompt is given if the user doesn't say anything or the assistant can't recognize the response. * * @type {(string | ResponseOutput)} * @memberof SimpleResponse */ reprompt?: T; /** * @deprecated This is not in use. * * @type {(string | ResponseOutput)} * @memberof SimpleResponse */ silencePrompt?: T; /** * Segments used for the outputSpeech and reprompt. * * @type {ResponseSegmentsMap} * @memberof SimpleResponse */ segments?: ResponseSegmentsMap; /** * Display elements for surfaces/devices with screens. * * @type {[]} * @memberof SimpleResponse */ displays?: Display[]; /** * Media for playback * * @type {Media[]} * @memberof SimpleResponse */ media?: Media[]; /** * System responses to perform account links, control media, surface changes, and permission requests. * * @type {string} * @memberof SimpleResponse */ system?: "ACCOUNT_LINK" | "MEDIA_ENQUEUE" | "MEDIA_STOP" | "SURFACE_CHANGE" | "PERMISSION_LIST" | "PERMISSION_EMAIL" | "PERMISSION_PHONE_NUMBER" | "PERMISSION_LOCATION_PRECISE" | "PERMISSION_LOCATION_COURSE"; /** * Supplemental data to augment the response. * * For some of the system responses, there are some predefined keys. * * context: string for SURFACE_CHANGE, ACCOUNT_LINK, * title: string for SURFACE_CHANGE * * @type {({ [key: string]: boolean | number | string })} * @memberof SimpleResponse */ data?: { context?: string; title?: string; [key: string]: boolean | number | string; };
}
Comments
0 comments
Article is closed for comments.