import { slotType, grain } from '../enums'; export declare type CustomSlotValue = { kind: T; value: string; }; export declare type NumberSlotValue = { kind: T; value: number; }; export declare type OrdinalSlotValue = { kind: T; value: number; }; export declare type InstantTimeSlotValue = { kind: T; value: string; grain: grain; precision: 'Exact' | 'Approximate'; }; export declare type TimeIntervalSlotValue = { kind: T; from: string; to: string; }; export declare type AmountOfMoneySlotValue = { kind: T; value: number; precision: 'Exact' | 'Approximate'; unit: string; }; export declare type TemperatureSlotValue = { kind: T; value: number; unit: 'celsius' | 'fahrenheit'; }; export declare type DurationSlotValue = { kind: T; years: number; quarters: number; months: number; weeks: number; days: number; hours: number; minutes: number; seconds: number; precision: 'Exact' | 'Approximate'; }; export declare type MusicAlbumSlotValue = { kind: T; value: string; }; export declare type MusicArtistSlotValue = { kind: T; value: string; }; export declare type MusicTrackSlotValue = { kind: T; value: string; }; export declare type CitySlotValue = { kind: T; value: string; }; export declare type CountrySlotValue = { kind: T; value: string; }; export declare type RegionSlotValue = { kind: T; value: string; }; export declare type PercentageSlotValue = { kind: T; value: number; }; export declare type InferedSlotType = T extends slotType.custom ? CustomSlotValue : T extends slotType.number ? NumberSlotValue : T extends slotType.ordinal ? OrdinalSlotValue : T extends slotType.instantTime ? InstantTimeSlotValue : T extends slotType.timeInterval ? TimeIntervalSlotValue : T extends slotType.amountOfMoney ? AmountOfMoneySlotValue : T extends slotType.temperature ? TemperatureSlotValue : T extends slotType.duration ? DurationSlotValue : T extends slotType.percentage ? PercentageSlotValue : T extends slotType.musicAlbum ? MusicAlbumSlotValue : T extends slotType.musicArtist ? MusicArtistSlotValue : T extends slotType.musicTrack ? MusicTrackSlotValue : T extends slotType.city ? CitySlotValue : T extends slotType.country ? CountrySlotValue : T extends slotType.region ? RegionSlotValue : never; export declare type NluSlot = { /** Confidence of the slot, between 0 and 1, 1 being confident. */ confidenceScore: number; /** The raw value of the slot, as is was in the input. */ rawValue: string; /** The range where the slot can be found in the input. */ range: { /** Beginning of the range (inclusive). */ start: number; /** End of the range (exclusive). */ end: number; }; /** The entity of the slot. */ entity: string; /** The name of the slot. */ slotName: string; /** The resolved value of the slot. */ value: InferedSlotType; /** Alternative values. */ alternatives?: InferedSlotType[]; }; export interface IntentMessage { /** The current session id. */ sessionId: string; /** The site where the user interaction took place. */ siteId: string; /** The user input that has generated this intent. */ input: string; /** Custom data provided in the StartSessionMessage or a ContinueSessionMessage. */ customData?: string; /** Structured description of the intent classification. */ intent: { /** The name of the detected intent. */ intentName: string; /** The probability of the detection, between 0 and 1, 1 being sure. */ confidenceScore: number; }; /** The level of confidence in the ASR prediction. */ asrConfidence: number; /** * Structured description of the tokens the ASR captured on for this intent. * The first level of arrays represents each invocation of the ASR, * the second one are the tokens captured. */ asrTokens: [{ /** The value of the token. */ value: string; /** Confidence of the token, between 0 and 1, 1 being confident. */ confidence: number; /** The start range in which the token is in the original input. */ rangeStart: number; /** The end range in which the token is in the original input. */ rangeEnd: number; /** Time when this token was detected. */ time: { /** Start time. */ start: number; /** End time. */ end: number; }; }[]?]; /** Structured description of the detected slots for this intent if any. */ slots: NluSlot[]; /** Array of alternative nlu slots that have lower probability. */ alternatives?: { /** * Nullable, name of the intent detected (null = no intent) */ intentName?: string; /** * Nullable */ slots?: NluSlot[]; /** * Between 0 and 1 */ confidenceScore: number; }[]; }