@nlxai/core 1.2.7-alpha.2 → 1.2.7-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -375,7 +375,7 @@ return (<div>
375
375
  function promisify<Params>(
376
376
  fn,
377
377
  convo,
378
- timeout,
378
+ timeout?,
379
379
  ): (payload) => Promise<Response | null>;
380
380
  ```
381
381
 
@@ -405,7 +405,7 @@ the function to wrap (e.g. `convo.sendText`, `convo.sendChoice`, etc.)
405
405
 
406
406
  the `ConversationHandler` (from [createConversation](#createconversation))
407
407
 
408
- ##### timeout
408
+ ##### timeout?
409
409
 
410
410
  `number` = `10000`
411
411
 
@@ -415,19 +415,7 @@ the timeout in milliseconds
415
415
 
416
416
  A promise-wrapped version of the function. The function, when called, returns a promise that resolves to the Conversation's next response.
417
417
 
418
- ```ts
419
- (payload): Promise<Response | null>;
420
- ```
421
-
422
- ##### Parameters
423
-
424
- ###### payload
425
-
426
- `Params`
427
-
428
- ##### Returns
429
-
430
- `Promise`\<[`Response`](#response) \| `null`\>
418
+ (`payload`) => `Promise`\<[`Response`](#response) \| `null`\>
431
419
 
432
420
  #### Example
433
421
 
@@ -559,7 +547,7 @@ The configuration necessary to create a conversation.
559
547
  ##### applicationUrl?
560
548
 
561
549
  ```ts
562
- optional applicationUrl: string;
550
+ optional applicationUrl?: string;
563
551
  ```
564
552
 
565
553
  The URL at which your conversational application is running. Fetch this from the application's API channel tab.
@@ -572,7 +560,7 @@ Currently, there are a few ways to specify the application URL:
572
560
  ##### protocol?
573
561
 
574
562
  ```ts
575
- optional protocol: Protocol;
563
+ optional protocol?: Protocol;
576
564
  ```
577
565
 
578
566
  Specify the protocol (http, websocket or httpWithStreaming)
@@ -580,7 +568,7 @@ Specify the protocol (http, websocket or httpWithStreaming)
580
568
  ##### host?
581
569
 
582
570
  ```ts
583
- optional host: string;
571
+ optional host?: string;
584
572
  ```
585
573
 
586
574
  Hostname of the application deployment, without a leading `https://`.
@@ -588,7 +576,7 @@ Hostname of the application deployment, without a leading `https://`.
588
576
  ##### deploymentKey?
589
577
 
590
578
  ```ts
591
- optional deploymentKey: string;
579
+ optional deploymentKey?: string;
592
580
  ```
593
581
 
594
582
  Deployment key.
@@ -596,7 +584,7 @@ Deployment key.
596
584
  ##### channelKey?
597
585
 
598
586
  ```ts
599
- optional channelKey: string;
587
+ optional channelKey?: string;
600
588
  ```
601
589
 
602
590
  Channel key.
@@ -604,7 +592,7 @@ Channel key.
604
592
  ##### apiKey?
605
593
 
606
594
  ```ts
607
- optional apiKey: string;
595
+ optional apiKey?: string;
608
596
  ```
609
597
 
610
598
  API key.
@@ -612,7 +600,7 @@ API key.
612
600
  ##### headers?
613
601
 
614
602
  ```ts
615
- optional headers: Record<string, string>;
603
+ optional headers?: Record<string, string>;
616
604
  ```
617
605
 
618
606
  Headers to forward to the NLX API.
@@ -620,7 +608,7 @@ Headers to forward to the NLX API.
620
608
  ##### conversationId?
621
609
 
622
610
  ```ts
623
- optional conversationId: string;
611
+ optional conversationId?: string;
624
612
  ```
625
613
 
626
614
  Set `conversationId` to continue an existing conversation. If not set, a new conversation will be started (and a new conversationId will be generated internally).
@@ -628,7 +616,7 @@ Set `conversationId` to continue an existing conversation. If not set, a new con
628
616
  ##### userId?
629
617
 
630
618
  ```ts
631
- optional userId: string;
619
+ optional userId?: string;
632
620
  ```
633
621
 
634
622
  Setting the `userID` allows it to be searchable in application history, as well as usable via `{System.userId}` in the flow.
@@ -636,7 +624,7 @@ Setting the `userID` allows it to be searchable in application history, as well
636
624
  ##### responses?
637
625
 
638
626
  ```ts
639
- optional responses: Response[];
627
+ optional responses?: Response[];
640
628
  ```
641
629
 
642
630
  When `responses` is set, initialize the chatHandler with historical messages. This is useful when restoring a previous conversation, that perhaps started on a different page.
@@ -644,7 +632,7 @@ When `responses` is set, initialize the chatHandler with historical messages. Th
644
632
  ##### failureMessage?
645
633
 
646
634
  ```ts
647
- optional failureMessage: string;
635
+ optional failureMessage?: string;
648
636
  ```
649
637
 
650
638
  When set, this overrides the default failure message ("We encountered an issue. Please try again soon.").
@@ -661,7 +649,7 @@ If you don't have translations, hard-code this to the language code you support.
661
649
  ##### bidirectional?
662
650
 
663
651
  ```ts
664
- optional bidirectional: boolean;
652
+ optional bidirectional?: boolean;
665
653
  ```
666
654
 
667
655
  Specifies whether the conversation is using bidirectional Voice+ (if so, an additional command socket will be opened).
@@ -674,7 +662,7 @@ A bundle of functions to interact with a conversation, created by [createConvers
674
662
 
675
663
  #### Properties
676
664
 
677
- ##### sendText()
665
+ ##### sendText
678
666
 
679
667
  ```ts
680
668
  sendText: (text, context?) => void;
@@ -700,7 +688,7 @@ the user's message
700
688
 
701
689
  `void`
702
690
 
703
- ##### sendSlots()
691
+ ##### sendSlots
704
692
 
705
693
  ```ts
706
694
  sendSlots: (slots, context?) => void;
@@ -726,7 +714,7 @@ The slots to populate
726
714
 
727
715
  `void`
728
716
 
729
- ##### sendChoice()
717
+ ##### sendChoice
730
718
 
731
719
  ```ts
732
720
  sendChoice: (choiceId, context?, metadata?) => void;
@@ -758,7 +746,7 @@ links the choice to the specific message and node in the conversation.
758
746
 
759
747
  `void`
760
748
 
761
- ##### sendWelcomeFlow()
749
+ ##### sendWelcomeFlow
762
750
 
763
751
  ```ts
764
752
  sendWelcomeFlow: (context?) => void;
@@ -778,7 +766,7 @@ Trigger the welcome flow. This should be done when the user starts interacting w
778
766
 
779
767
  `void`
780
768
 
781
- ##### sendFlow()
769
+ ##### sendFlow
782
770
 
783
771
  ```ts
784
772
  sendFlow: (flowId, context?) => void;
@@ -804,7 +792,7 @@ the flow to trigger. The id is the name under the application's _Flows_.
804
792
 
805
793
  `void`
806
794
 
807
- ##### sendContext()
795
+ ##### sendContext
808
796
 
809
797
  ```ts
810
798
  sendContext: (context) => Promise<void>;
@@ -824,7 +812,7 @@ Send context without sending a message
824
812
 
825
813
  `Promise`\<`void`\>
826
814
 
827
- ##### appendMessageToTranscript()
815
+ ##### appendMessageToTranscript
828
816
 
829
817
  ```ts
830
818
  appendMessageToTranscript: (response) => void;
@@ -837,15 +825,18 @@ sources.
837
825
 
838
826
  ###### response
839
827
 
840
- the response with optional timestamps.
828
+ \| `Omit`\<[`ApplicationResponse`](#applicationresponse), `"receivedAt"`\> & `object`
829
+ \| `Omit`\<[`UserResponse`](#userresponse), `"receivedAt"`\> & `object`
830
+ \| `Omit`\<[`FailureMessage`](#failuremessage-1), `"receivedAt"`\> & `object`
831
+ \| `Omit`\<[`NoticeResponse`](#noticeresponse), `"receivedAt"`\> & `object`
841
832
 
842
- `Omit`\<[`ApplicationResponse`](#applicationresponse), `"receivedAt"`\> & `object` | `Omit`\<[`UserResponse`](#userresponse), `"receivedAt"`\> & `object` | `Omit`\<[`FailureMessage`](#failuremessage-1), `"receivedAt"`\> & `object`
833
+ the response with optional timestamps.
843
834
 
844
835
  ###### Returns
845
836
 
846
837
  `void`
847
838
 
848
- ##### sendStructured()
839
+ ##### sendStructured
849
840
 
850
841
  ```ts
851
842
  sendStructured: (request, context?) => void;
@@ -869,7 +860,7 @@ Send a combination of choice, slots, and flow in one request.
869
860
 
870
861
  `void`
871
862
 
872
- ##### submitFeedback()
863
+ ##### submitFeedback
873
864
 
874
865
  ```ts
875
866
  submitFeedback: (url, feedback) => Promise<void>;
@@ -901,7 +892,7 @@ Either a numerical rating or a textual comment.
901
892
 
902
893
  `Promise`\<`void`\>
903
894
 
904
- ##### subscribe()
895
+ ##### subscribe
905
896
 
906
897
  ```ts
907
898
  subscribe: (subscriber) => () => void;
@@ -921,15 +912,9 @@ The callback to subscribe
921
912
 
922
913
  A function to unsubscribe the callback.
923
914
 
924
- ```ts
925
- (): void;
926
- ```
927
-
928
- ###### Returns
929
-
930
- `void`
915
+ () => `void`
931
916
 
932
- ##### unsubscribe()
917
+ ##### unsubscribe
933
918
 
934
919
  ```ts
935
920
  unsubscribe: (subscriber) => void;
@@ -949,7 +934,7 @@ The callback to unsubscribe
949
934
 
950
935
  `void`
951
936
 
952
- ##### unsubscribeAll()
937
+ ##### unsubscribeAll
953
938
 
954
939
  ```ts
955
940
  unsubscribeAll: () => void;
@@ -961,7 +946,7 @@ Unsubscribe all callback from the conversation.
961
946
 
962
947
  `void`
963
948
 
964
- ##### currentConversationId()
949
+ ##### currentConversationId
965
950
 
966
951
  ```ts
967
952
  currentConversationId: () => string | undefined;
@@ -973,7 +958,7 @@ Get the current conversation ID if it's set, or undefined if there is no convers
973
958
 
974
959
  `string` \| `undefined`
975
960
 
976
- ##### currentLanguageCode()
961
+ ##### currentLanguageCode
977
962
 
978
963
  ```ts
979
964
  currentLanguageCode: () => string;
@@ -985,7 +970,7 @@ Get the current language code
985
970
 
986
971
  `string`
987
972
 
988
- ##### setLanguageCode()
973
+ ##### setLanguageCode
989
974
 
990
975
  ```ts
991
976
  setLanguageCode: (languageCode) => void;
@@ -1003,7 +988,7 @@ Set the language code
1003
988
 
1004
989
  `void`
1005
990
 
1006
- ##### reset()
991
+ ##### reset
1007
992
 
1008
993
  ```ts
1009
994
  reset: (options?) => void;
@@ -1026,7 +1011,7 @@ If set to true, will clear historical responses passed to subscribers.
1026
1011
 
1027
1012
  `void`
1028
1013
 
1029
- ##### destroy()
1014
+ ##### destroy
1030
1015
 
1031
1016
  ```ts
1032
1017
  destroy: () => void;
@@ -1038,7 +1023,7 @@ Removes all subscribers and, if using websockets, closes the connection.
1038
1023
 
1039
1024
  `void`
1040
1025
 
1041
- ##### setRequestOverride()
1026
+ ##### setRequestOverride
1042
1027
 
1043
1028
  ```ts
1044
1029
  setRequestOverride: (override) => void;
@@ -1050,13 +1035,13 @@ Optional [RequestOverride](#requestoverride) function used to bypass the applica
1050
1035
 
1051
1036
  ###### override
1052
1037
 
1053
- [`RequestOverride`](#requestoverride) | `undefined`
1038
+ [`RequestOverride`](#requestoverride) \| `undefined`
1054
1039
 
1055
1040
  ###### Returns
1056
1041
 
1057
1042
  `void`
1058
1043
 
1059
- ##### addEventListener()
1044
+ ##### addEventListener
1060
1045
 
1061
1046
  ```ts
1062
1047
  addEventListener: (event, handler) => void;
@@ -1072,13 +1057,14 @@ Add a listener to one of the handler's custom events
1072
1057
 
1073
1058
  ###### handler
1074
1059
 
1075
- [`VoicePlusCommandListener`](#voicepluscommandlistener) | [`InterimMessageListener`](#interimmessagelistener)
1060
+ \| [`VoicePlusCommandListener`](#voicepluscommandlistener)
1061
+ \| [`InterimMessageListener`](#interimmessagelistener)
1076
1062
 
1077
1063
  ###### Returns
1078
1064
 
1079
1065
  `void`
1080
1066
 
1081
- ##### removeEventListener()
1067
+ ##### removeEventListener
1082
1068
 
1083
1069
  ```ts
1084
1070
  removeEventListener: (event, handler) => void;
@@ -1094,7 +1080,28 @@ Remove a listener to one of the handler's custom events
1094
1080
 
1095
1081
  ###### handler
1096
1082
 
1097
- [`VoicePlusCommandListener`](#voicepluscommandlistener) | [`InterimMessageListener`](#interimmessagelistener)
1083
+ \| [`VoicePlusCommandListener`](#voicepluscommandlistener)
1084
+ \| [`InterimMessageListener`](#interimmessagelistener)
1085
+
1086
+ ###### Returns
1087
+
1088
+ `void`
1089
+
1090
+ ##### setInterimMessage
1091
+
1092
+ ```ts
1093
+ setInterimMessage: (message?) => void;
1094
+ ```
1095
+
1096
+ Set interim message. Setting `undefined` clears the current interim message.
1097
+
1098
+ ###### Parameters
1099
+
1100
+ ###### message?
1101
+
1102
+ `string`
1103
+
1104
+ interim message.
1098
1105
 
1099
1106
  ###### Returns
1100
1107
 
@@ -1137,6 +1144,7 @@ See also:
1137
1144
 
1138
1145
  - [UserResponse](#userresponse)
1139
1146
  - [FailureMessage](#failuremessage-1)
1147
+ - [FailureMessage](#failuremessage-1)
1140
1148
  - [Response](#response)
1141
1149
 
1142
1150
  #### Properties
@@ -1176,7 +1184,7 @@ The payload of the application response
1176
1184
  ##### expirationTimestamp?
1177
1185
 
1178
1186
  ```ts
1179
- optional expirationTimestamp: number;
1187
+ optional expirationTimestamp?: number;
1180
1188
  ```
1181
1189
 
1182
1190
  If there isn't some interaction by this time, the conversation will expire.
@@ -1184,7 +1192,7 @@ If there isn't some interaction by this time, the conversation will expire.
1184
1192
  ##### conversationId?
1185
1193
 
1186
1194
  ```ts
1187
- optional conversationId: string;
1195
+ optional conversationId?: string;
1188
1196
  ```
1189
1197
 
1190
1198
  The active conversation ID. If not set, a new conversation will be started.
@@ -1200,7 +1208,7 @@ Any messages from the application.
1200
1208
  ##### metadata?
1201
1209
 
1202
1210
  ```ts
1203
- optional metadata: ApplicationResponseMetadata;
1211
+ optional metadata?: ApplicationResponseMetadata;
1204
1212
  ```
1205
1213
 
1206
1214
  Global state about the current conversation
@@ -1209,7 +1217,7 @@ as well as whether the client should poll for more application responses.
1209
1217
  ##### payload?
1210
1218
 
1211
1219
  ```ts
1212
- optional payload: string;
1220
+ optional payload?: string;
1213
1221
  ```
1214
1222
 
1215
1223
  If configured, the [node's payload](https://docs.nlx.ai/platform/nlx-platform-guide/flows-and-building-blocks/overview/nodes#node-payload).
@@ -1217,7 +1225,7 @@ If configured, the [node's payload](https://docs.nlx.ai/platform/nlx-platform-gu
1217
1225
  ##### modalities?
1218
1226
 
1219
1227
  ```ts
1220
- optional modalities: ModalityPayloads;
1228
+ optional modalities?: ModalityPayloads;
1221
1229
  ```
1222
1230
 
1223
1231
  If configured, the node's modalities and their payloads.
@@ -1225,7 +1233,7 @@ If configured, the node's modalities and their payloads.
1225
1233
  ##### context?
1226
1234
 
1227
1235
  ```ts
1228
- optional context: Context;
1236
+ optional context?: Context;
1229
1237
  ```
1230
1238
 
1231
1239
  If the node is set to send context, the whole context associated with the conversation.
@@ -1242,7 +1250,7 @@ as well as whether the client should poll for more application responses.
1242
1250
  ##### intentId?
1243
1251
 
1244
1252
  ```ts
1245
- optional intentId: string;
1253
+ optional intentId?: string;
1246
1254
  ```
1247
1255
 
1248
1256
  The conversation's flow ID (called `intentId` here for legacy reasons).
@@ -1250,7 +1258,7 @@ The conversation's flow ID (called `intentId` here for legacy reasons).
1250
1258
  ##### escalation?
1251
1259
 
1252
1260
  ```ts
1253
- optional escalation: boolean;
1261
+ optional escalation?: boolean;
1254
1262
  ```
1255
1263
 
1256
1264
  Whether the current conversation has been marked as incomprehension.
@@ -1258,7 +1266,7 @@ Whether the current conversation has been marked as incomprehension.
1258
1266
  ##### frustration?
1259
1267
 
1260
1268
  ```ts
1261
- optional frustration: boolean;
1269
+ optional frustration?: boolean;
1262
1270
  ```
1263
1271
 
1264
1272
  Whether the current conversation has been marked frustrated
@@ -1266,7 +1274,7 @@ Whether the current conversation has been marked frustrated
1266
1274
  ##### incomprehension?
1267
1275
 
1268
1276
  ```ts
1269
- optional incomprehension: boolean;
1277
+ optional incomprehension?: boolean;
1270
1278
  ```
1271
1279
 
1272
1280
  Whether the current conversation has been marked as incomprehension.
@@ -1282,7 +1290,7 @@ Upload URL's
1282
1290
  ##### hasPendingDataRequest?
1283
1291
 
1284
1292
  ```ts
1285
- optional hasPendingDataRequest: boolean;
1293
+ optional hasPendingDataRequest?: boolean;
1286
1294
  ```
1287
1295
 
1288
1296
  Whether the client should poll for more application responses.
@@ -1290,7 +1298,7 @@ Whether the client should poll for more application responses.
1290
1298
  ##### sources?
1291
1299
 
1292
1300
  ```ts
1293
- optional sources: KnowledgeBaseResponseSource[];
1301
+ optional sources?: KnowledgeBaseResponseSource[];
1294
1302
  ```
1295
1303
 
1296
1304
  Knowledge base sources
@@ -1298,7 +1306,7 @@ Knowledge base sources
1298
1306
  ##### feedbackUrl?
1299
1307
 
1300
1308
  ```ts
1301
- optional feedbackUrl: string;
1309
+ optional feedbackUrl?: string;
1302
1310
  ```
1303
1311
 
1304
1312
  URL to use for submitting feedback about this response. See `feedbackConfig` for what the expected feedback type is.
@@ -1308,7 +1316,7 @@ You can pass this as the first argument to `submitFeedback`.
1308
1316
  ##### feedbackConfig?
1309
1317
 
1310
1318
  ```ts
1311
- optional feedbackConfig: FeedbackConfiguration;
1319
+ optional feedbackConfig?: FeedbackConfiguration;
1312
1320
  ```
1313
1321
 
1314
1322
  If present, the application would like to collect feedback from the user.
@@ -1324,7 +1332,7 @@ Response for knowlege base sources
1324
1332
  ##### fileName?
1325
1333
 
1326
1334
  ```ts
1327
- optional fileName: string;
1335
+ optional fileName?: string;
1328
1336
  ```
1329
1337
 
1330
1338
  File name
@@ -1332,7 +1340,7 @@ File name
1332
1340
  ##### pageNumber?
1333
1341
 
1334
1342
  ```ts
1335
- optional pageNumber: number;
1343
+ optional pageNumber?: number;
1336
1344
  ```
1337
1345
 
1338
1346
  Page number
@@ -1340,7 +1348,7 @@ Page number
1340
1348
  ##### content?
1341
1349
 
1342
1350
  ```ts
1343
- optional content: string;
1351
+ optional content?: string;
1344
1352
  ```
1345
1353
 
1346
1354
  Content
@@ -1348,7 +1356,7 @@ Content
1348
1356
  ##### metadata?
1349
1357
 
1350
1358
  ```ts
1351
- optional metadata: Record<string, unknown>;
1359
+ optional metadata?: Record<string, unknown>;
1352
1360
  ```
1353
1361
 
1354
1362
  Metadata
@@ -1356,7 +1364,7 @@ Metadata
1356
1364
  ##### presignedUrl?
1357
1365
 
1358
1366
  ```ts
1359
- optional presignedUrl: string;
1367
+ optional presignedUrl?: string;
1360
1368
  ```
1361
1369
 
1362
1370
  Presigned URL for direct retrieval
@@ -1373,7 +1381,7 @@ as well as whether the client should poll for more application responses.
1373
1381
  ##### intentId?
1374
1382
 
1375
1383
  ```ts
1376
- optional intentId: string;
1384
+ optional intentId?: string;
1377
1385
  ```
1378
1386
 
1379
1387
  The message node's flow ID (called `intentId` here for legacy reasons).
@@ -1389,7 +1397,7 @@ A message from the application, as well as any choices the user can make.
1389
1397
  ##### messageId?
1390
1398
 
1391
1399
  ```ts
1392
- optional messageId: string;
1400
+ optional messageId?: string;
1393
1401
  ```
1394
1402
 
1395
1403
  A unique identifier for the message.
@@ -1397,7 +1405,7 @@ A unique identifier for the message.
1397
1405
  ##### nodeId?
1398
1406
 
1399
1407
  ```ts
1400
- optional nodeId: string;
1408
+ optional nodeId?: string;
1401
1409
  ```
1402
1410
 
1403
1411
  The node id that this message is associated with.
@@ -1422,7 +1430,7 @@ A selection of choices to show to the user. They may choose one of them.
1422
1430
  ##### metadata?
1423
1431
 
1424
1432
  ```ts
1425
- optional metadata: ApplicationMessageMetadata;
1433
+ optional metadata?: ApplicationMessageMetadata;
1426
1434
  ```
1427
1435
 
1428
1436
  Metadata
@@ -1430,7 +1438,7 @@ Metadata
1430
1438
  ##### selectedChoiceId?
1431
1439
 
1432
1440
  ```ts
1433
- optional selectedChoiceId: string;
1441
+ optional selectedChoiceId?: string;
1434
1442
  ```
1435
1443
 
1436
1444
  After a choice has been made by the user, this will be updated locally to the selected choice id.
@@ -1487,7 +1495,7 @@ The text of the choice
1487
1495
  ##### choicePayload?
1488
1496
 
1489
1497
  ```ts
1490
- optional choicePayload: any;
1498
+ optional choicePayload?: any;
1491
1499
  ```
1492
1500
 
1493
1501
  An optional, schemaless payload for the choice.
@@ -1501,6 +1509,7 @@ A message from the user
1501
1509
  See also:
1502
1510
 
1503
1511
  - [ApplicationResponse](#applicationresponse)
1512
+ - [NoticeResponse](#noticeresponse)
1504
1513
  - [FailureMessage](#failuremessage-1)
1505
1514
  - [Response](#response)
1506
1515
 
@@ -1536,6 +1545,13 @@ The payload of the response
1536
1545
 
1537
1546
  A failure message is received when the NLX api is unreachable, or sends an unparsable response.
1538
1547
 
1548
+ See also:
1549
+
1550
+ - [ApplicationResponse](#applicationresponse)
1551
+ - [NoticeResponse](#noticeresponse)
1552
+ - [UserResponse](#userresponse)
1553
+ - [Response](#response)
1554
+
1539
1555
  #### Properties
1540
1556
 
1541
1557
  ##### type
@@ -1572,6 +1588,52 @@ When the failure occurred.
1572
1588
 
1573
1589
  ---
1574
1590
 
1591
+ ### NoticeResponse
1592
+
1593
+ A message from the user
1594
+
1595
+ See also:
1596
+
1597
+ - [ApplicationResponse](#applicationresponse)
1598
+ - [FailureMessage](#failuremessage-1)
1599
+ - [Response](#response)
1600
+
1601
+ #### Properties
1602
+
1603
+ ##### type
1604
+
1605
+ ```ts
1606
+ type: Notice;
1607
+ ```
1608
+
1609
+ The notice response type
1610
+
1611
+ ##### receivedAt
1612
+
1613
+ ```ts
1614
+ receivedAt: number;
1615
+ ```
1616
+
1617
+ When the response was received
1618
+
1619
+ ##### payload
1620
+
1621
+ ```ts
1622
+ payload: object;
1623
+ ```
1624
+
1625
+ The payload of the response
1626
+
1627
+ ###### text
1628
+
1629
+ ```ts
1630
+ text: string;
1631
+ ```
1632
+
1633
+ The error message is either the default, or the `failureMessage` set in the [Config](#config).
1634
+
1635
+ ---
1636
+
1575
1637
  ### FeedbackConfiguration
1576
1638
 
1577
1639
  Configuration for feedback collection. You can use this to render an appropriate feedback widget in your application.
@@ -1647,7 +1709,7 @@ Whether comments are enabled for this feedback collection.
1647
1709
  ##### question?
1648
1710
 
1649
1711
  ```ts
1650
- optional question: string;
1712
+ optional question?: string;
1651
1713
  ```
1652
1714
 
1653
1715
  Optional question to show to the user when collecting feedback.
@@ -1663,7 +1725,7 @@ Labels for individual feedback UI elements as customised by the builder.
1663
1725
  ###### positive?
1664
1726
 
1665
1727
  ```ts
1666
- optional positive: string;
1728
+ optional positive?: string;
1667
1729
  ```
1668
1730
 
1669
1731
  Label for positive feedback
@@ -1671,7 +1733,7 @@ Label for positive feedback
1671
1733
  ###### negative?
1672
1734
 
1673
1735
  ```ts
1674
- optional negative: string;
1736
+ optional negative?: string;
1675
1737
  ```
1676
1738
 
1677
1739
  Label for negative feedback
@@ -1679,7 +1741,7 @@ Label for negative feedback
1679
1741
  ###### comment?
1680
1742
 
1681
1743
  ```ts
1682
- optional comment: string;
1744
+ optional comment?: string;
1683
1745
  ```
1684
1746
 
1685
1747
  Label for comment
@@ -1696,7 +1758,7 @@ Includes a combination of choice, slots, and flow in one request.
1696
1758
  ##### choiceId?
1697
1759
 
1698
1760
  ```ts
1699
- optional choiceId: string;
1761
+ optional choiceId?: string;
1700
1762
  ```
1701
1763
 
1702
1764
  The `choiceId` is in the [ApplicationResponse](#applicationresponse)'s `.payload.messages[].choices[].choiceId` fields
@@ -1704,7 +1766,7 @@ The `choiceId` is in the [ApplicationResponse](#applicationresponse)'s `.payload
1704
1766
  ##### nodeId?
1705
1767
 
1706
1768
  ```ts
1707
- optional nodeId: string;
1769
+ optional nodeId?: string;
1708
1770
  ```
1709
1771
 
1710
1772
  Required if you want to change a choice that's already been sent.
@@ -1713,7 +1775,7 @@ The `nodeId` can be found in the corresponding [ApplicationMessage](#application
1713
1775
  ##### ~~intentId?~~
1714
1776
 
1715
1777
  ```ts
1716
- optional intentId: string;
1778
+ optional intentId?: string;
1717
1779
  ```
1718
1780
 
1719
1781
  The intent to trigger. The `intentId` is the name under the application's _Intents_.
@@ -1725,7 +1787,7 @@ use `flowId` instead.
1725
1787
  ##### flowId?
1726
1788
 
1727
1789
  ```ts
1728
- optional flowId: string;
1790
+ optional flowId?: string;
1729
1791
  ```
1730
1792
 
1731
1793
  The flow to trigger. The `flowId` is the name under the application's _Flows_.
@@ -1733,7 +1795,7 @@ The flow to trigger. The `flowId` is the name under the application's _Flows_.
1733
1795
  ##### slots?
1734
1796
 
1735
1797
  ```ts
1736
- optional slots: SlotsRecordOrArray;
1798
+ optional slots?: SlotsRecordOrArray;
1737
1799
  ```
1738
1800
 
1739
1801
  The slots to populate
@@ -1741,7 +1803,7 @@ The slots to populate
1741
1803
  ##### uploadIds?
1742
1804
 
1743
1805
  ```ts
1744
- optional uploadIds: string[];
1806
+ optional uploadIds?: string[];
1745
1807
  ```
1746
1808
 
1747
1809
  Upload ID
@@ -1749,7 +1811,7 @@ Upload ID
1749
1811
  ##### utterance?
1750
1812
 
1751
1813
  ```ts
1752
- optional utterance: string;
1814
+ optional utterance?: string;
1753
1815
  ```
1754
1816
 
1755
1817
  Upload utterance
@@ -1765,7 +1827,7 @@ The request data actually sent to the application, slightly different from [User
1765
1827
  ##### conversationId?
1766
1828
 
1767
1829
  ```ts
1768
- optional conversationId: string;
1830
+ optional conversationId?: string;
1769
1831
  ```
1770
1832
 
1771
1833
  The current conversation ID
@@ -1773,7 +1835,7 @@ The current conversation ID
1773
1835
  ##### userId?
1774
1836
 
1775
1837
  ```ts
1776
- optional userId: string;
1838
+ optional userId?: string;
1777
1839
  ```
1778
1840
 
1779
1841
  The current user ID
@@ -1781,7 +1843,7 @@ The current user ID
1781
1843
  ##### context?
1782
1844
 
1783
1845
  ```ts
1784
- optional context: Context;
1846
+ optional context?: Context;
1785
1847
  ```
1786
1848
 
1787
1849
  Request context, if applicable
@@ -1797,7 +1859,7 @@ Main request
1797
1859
  ###### unstructured?
1798
1860
 
1799
1861
  ```ts
1800
- optional unstructured: object;
1862
+ optional unstructured?: object;
1801
1863
  ```
1802
1864
 
1803
1865
  Unstructured request
@@ -1813,7 +1875,7 @@ Request body text
1813
1875
  ###### structured?
1814
1876
 
1815
1877
  ```ts
1816
- optional structured: StructuredRequest & object;
1878
+ optional structured?: StructuredRequest & object;
1817
1879
  ```
1818
1880
 
1819
1881
  Structured request
@@ -1823,7 +1885,7 @@ Structured request
1823
1885
  ###### slots?
1824
1886
 
1825
1887
  ```ts
1826
- optional slots: SlotValue[];
1888
+ optional slots?: SlotValue[];
1827
1889
  ```
1828
1890
 
1829
1891
  Only array-form slots are allowed for the purposes of sending to the backend
@@ -1879,7 +1941,7 @@ Helps link the choice to the specific message in the conversation.
1879
1941
  ##### responseIndex?
1880
1942
 
1881
1943
  ```ts
1882
- optional responseIndex: number;
1944
+ optional responseIndex?: number;
1883
1945
  ```
1884
1946
 
1885
1947
  The index of the [Response](#response) associated with this choice.
@@ -1889,7 +1951,7 @@ It is not sent to the application.
1889
1951
  ##### messageIndex?
1890
1952
 
1891
1953
  ```ts
1892
- optional messageIndex: number;
1954
+ optional messageIndex?: number;
1893
1955
  ```
1894
1956
 
1895
1957
  The index of the [ApplicationMessage](#applicationmessage) associated with this choice.
@@ -1899,7 +1961,7 @@ It is not sent to the application.
1899
1961
  ##### nodeId?
1900
1962
 
1901
1963
  ```ts
1902
- optional nodeId: string;
1964
+ optional nodeId?: string;
1903
1965
  ```
1904
1966
 
1905
1967
  Required if you want to change a choice that's already been sent.
@@ -1908,7 +1970,7 @@ The `nodeId` can be found in the corresponding [ApplicationMessage](#application
1908
1970
  ##### ~~intentId?~~
1909
1971
 
1910
1972
  ```ts
1911
- optional intentId: string;
1973
+ optional intentId?: string;
1912
1974
  ```
1913
1975
 
1914
1976
  Intent ID, used for sending to the NLU to allow it to double-check.
@@ -1920,7 +1982,7 @@ use `flowId` instead.
1920
1982
  ##### flowId?
1921
1983
 
1922
1984
  ```ts
1923
- optional flowId: string;
1985
+ optional flowId?: string;
1924
1986
  ```
1925
1987
 
1926
1988
  Flow ID, used for sending to the NLU to allow it to double-check.
@@ -1973,6 +2035,22 @@ The protocol used to communicate with the application
1973
2035
 
1974
2036
  #### Enumeration Members
1975
2037
 
2038
+ ##### Http
2039
+
2040
+ ```ts
2041
+ Http: "http";
2042
+ ```
2043
+
2044
+ Supported for development purposes only
2045
+
2046
+ ##### HttpWithStreaming
2047
+
2048
+ ```ts
2049
+ HttpWithStreaming: "httpWithStreaming";
2050
+ ```
2051
+
2052
+ Supported for development purposes only
2053
+
1976
2054
  ##### Https
1977
2055
 
1978
2056
  ```ts
@@ -2029,6 +2107,14 @@ Failure: "failure";
2029
2107
 
2030
2108
  Generic failure (cannot be attributed to the application)
2031
2109
 
2110
+ ##### Notice
2111
+
2112
+ ```ts
2113
+ Notice: "notice";
2114
+ ```
2115
+
2116
+ Notices for important conversation events like agent joined
2117
+
2032
2118
  ## Events
2033
2119
 
2034
2120
  ### ConversationHandlerEvent
@@ -2075,7 +2161,7 @@ A `SlotsRecord` is equivalent to an array of [SlotValue](#slotvalue) objects.
2075
2161
  type SlotsRecordOrArray = SlotsRecord | SlotValue[];
2076
2162
  ```
2077
2163
 
2078
- Values to fill an intent's [attached slots](https://docs.nlx.ai/platform/nlx-platform-guide/flows-and-building-blocks/overview/setup#attached-slots).
2164
+ Values to fill an flow's [attached slots](https://docs.nlx.ai/platform/nlx-platform-guide/flows-and-building-blocks/overview/setup#attached-slots).
2079
2165
 
2080
2166
  Supports either a [SlotsRecord](#slotsrecord) or an array of [SlotValue](#slotvalue) objects
2081
2167
 
@@ -2110,7 +2196,9 @@ type UserResponsePayload =
2110
2196
 
2111
2197
  The payload of the user response
2112
2198
 
2113
- #### Type Declaration
2199
+ #### Union Members
2200
+
2201
+ ##### Type Literal
2114
2202
 
2115
2203
  ```ts
2116
2204
  {
@@ -2120,7 +2208,7 @@ The payload of the user response
2120
2208
  }
2121
2209
  ```
2122
2210
 
2123
- ##### type
2211
+ ###### type
2124
2212
 
2125
2213
  ```ts
2126
2214
  type: "text";
@@ -2128,7 +2216,7 @@ type: "text";
2128
2216
 
2129
2217
  Set when `sendText` is called.
2130
2218
 
2131
- ##### text
2219
+ ###### text
2132
2220
 
2133
2221
  ```ts
2134
2222
  text: string;
@@ -2136,14 +2224,18 @@ text: string;
2136
2224
 
2137
2225
  The user's message
2138
2226
 
2139
- ##### context?
2227
+ ###### context?
2140
2228
 
2141
2229
  ```ts
2142
- optional context: Context;
2230
+ optional context?: Context;
2143
2231
  ```
2144
2232
 
2145
2233
  [Context](https://docs.nlx.ai/platform/nlx-platform-guide/flows-and-building-blocks/advanced/context-variables) for usage later in the flow.
2146
2234
 
2235
+ ---
2236
+
2237
+ ##### Type Literal
2238
+
2147
2239
  ```ts
2148
2240
  {
2149
2241
  type: "choice";
@@ -2152,7 +2244,7 @@ optional context: Context;
2152
2244
  }
2153
2245
  ```
2154
2246
 
2155
- ##### type
2247
+ ###### type
2156
2248
 
2157
2249
  ```ts
2158
2250
  type: "choice";
@@ -2160,7 +2252,7 @@ type: "choice";
2160
2252
 
2161
2253
  Set when `sendChoice` is called.
2162
2254
 
2163
- ##### choiceId
2255
+ ###### choiceId
2164
2256
 
2165
2257
  ```ts
2166
2258
  choiceId: string;
@@ -2169,14 +2261,16 @@ choiceId: string;
2169
2261
  The `choiceId` passed to `sendChoice`
2170
2262
  Correlates to a `choiceId` in the [ApplicationResponse](#applicationresponse)'s `.payload.messages[].choices[].choiceId` fields
2171
2263
 
2172
- ##### context?
2264
+ ###### context?
2173
2265
 
2174
2266
  ```ts
2175
- optional context: Context;
2267
+ optional context?: Context;
2176
2268
  ```
2177
2269
 
2178
2270
  [Context](https://docs.nlx.ai/platform/nlx-platform-guide/flows-and-building-blocks/advanced/context-variables) for usage later in the flow.
2179
2271
 
2272
+ ---
2273
+
2180
2274
  `object` & [`StructuredRequest`](#structuredrequest)
2181
2275
 
2182
2276
  ---
@@ -2184,7 +2278,11 @@ optional context: Context;
2184
2278
  ### Response
2185
2279
 
2186
2280
  ```ts
2187
- type Response = ApplicationResponse | UserResponse | FailureMessage;
2281
+ type Response =
2282
+ | ApplicationResponse
2283
+ | UserResponse
2284
+ | NoticeResponse
2285
+ | FailureMessage;
2188
2286
  ```
2189
2287
 
2190
2288
  A response from the application or the user.
@@ -2214,7 +2312,7 @@ Normalized structured request with a single way to represent slots
2214
2312
  ##### slots?
2215
2313
 
2216
2314
  ```ts
2217
- optional slots: SlotValue[];
2315
+ optional slots?: SlotValue[];
2218
2316
  ```
2219
2317
 
2220
2318
  Only array-form slots are allowed for the purposes of sending to the backend
@@ -2231,7 +2329,7 @@ Language code named for clarity, may restrict it to a finite list
2231
2329
 
2232
2330
  ---
2233
2331
 
2234
- ### RequestOverride()
2332
+ ### RequestOverride
2235
2333
 
2236
2334
  ```ts
2237
2335
  type RequestOverride = (applicationRequest, appendResponse) => void;
@@ -2269,7 +2367,7 @@ Voice+ context, type to be defined
2269
2367
 
2270
2368
  ---
2271
2369
 
2272
- ### VoicePlusCommandListener()
2370
+ ### VoicePlusCommandListener
2273
2371
 
2274
2372
  ```ts
2275
2373
  type VoicePlusCommandListener = (payload) => void;
@@ -2289,7 +2387,7 @@ Voice+ command listener
2289
2387
 
2290
2388
  ---
2291
2389
 
2292
- ### InterimMessageListener()
2390
+ ### InterimMessageListener
2293
2391
 
2294
2392
  ```ts
2295
2393
  type InterimMessageListener = (message?) => void;
@@ -2309,7 +2407,7 @@ Interim message listener
2309
2407
 
2310
2408
  ---
2311
2409
 
2312
- ### Subscriber()
2410
+ ### Subscriber
2313
2411
 
2314
2412
  ```ts
2315
2413
  type Subscriber = (response, newResponse?) => void;
@@ -2346,10 +2444,14 @@ type StepInfo =
2346
2444
 
2347
2445
  Step information, either a step ID as a single string or an object
2348
2446
 
2349
- #### Type Declaration
2447
+ #### Union Members
2350
2448
 
2351
2449
  `string`
2352
2450
 
2451
+ ---
2452
+
2453
+ ##### Type Literal
2454
+
2353
2455
  ```ts
2354
2456
  {
2355
2457
  stepId: string;
@@ -2357,7 +2459,7 @@ Step information, either a step ID as a single string or an object
2357
2459
  }
2358
2460
  ```
2359
2461
 
2360
- ##### stepId
2462
+ ###### stepId
2361
2463
 
2362
2464
  ```ts
2363
2465
  stepId: string;
@@ -2365,10 +2467,10 @@ stepId: string;
2365
2467
 
2366
2468
  Step ID
2367
2469
 
2368
- ##### stepTriggerDescription?
2470
+ ###### stepTriggerDescription?
2369
2471
 
2370
2472
  ```ts
2371
- optional stepTriggerDescription: string;
2473
+ optional stepTriggerDescription?: string;
2372
2474
  ```
2373
2475
 
2374
2476
  Step trigger description