@microsoft/agents-hosting-dialogs 1.7.2 → 1.8.0-beta.36.gb033f0abc1
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/dist/src/choices/index.d.ts +1 -0
- package/dist/src/choices/index.js.map +1 -1
- package/dist/src/choices/recognizeChoices.js +1 -2
- package/dist/src/choices/recognizeChoices.js.map +1 -1
- package/dist/src/prompts/confirmPrompt.d.ts +2 -2
- package/dist/src/prompts/confirmPrompt.js +1 -1
- package/package.json +5 -5
- package/src/choices/index.ts +1 -0
- package/src/choices/recognizeChoices.ts +1 -3
- package/src/prompts/confirmPrompt.ts +2 -2
|
@@ -7,5 +7,6 @@ export * from './choiceFactory';
|
|
|
7
7
|
export * from './findChoices';
|
|
8
8
|
export { FindValuesOptions } from './findValues';
|
|
9
9
|
export { FoundValue } from './findValues';
|
|
10
|
+
export { Token, TokenizerFunction } from './tokenizer';
|
|
10
11
|
export * from './modelResult';
|
|
11
12
|
export * from './recognizeChoices';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/choices/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;GAGG;AACH,2CAAwB;AACxB,kDAA+B;AAC/B,gDAA6B;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/choices/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;GAGG;AACH,2CAAwB;AACxB,kDAA+B;AAC/B,gDAA6B;AAI7B,gDAA6B;AAC7B,qDAAkC"}
|
|
@@ -91,8 +91,7 @@ function recognizeChoices(utterance, choices, options) {
|
|
|
91
91
|
// Normalize choices
|
|
92
92
|
const list = (choices || [])
|
|
93
93
|
.map((choice) => (typeof choice === 'string' ? { value: choice } : choice))
|
|
94
|
-
.filter((choice) => choice
|
|
95
|
-
);
|
|
94
|
+
.filter((choice) => choice !== undefined && choice !== null);
|
|
96
95
|
// Try finding choices by text search first
|
|
97
96
|
// - We only want to use a single strategy for returning results to avoid issues where utterances
|
|
98
97
|
// like the "the third one" or "the red one" or "the first division book" would miss-recognize as
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recognizeChoices.js","sourceRoot":"","sources":["../../../src/choices/recognizeChoices.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBA,
|
|
1
|
+
{"version":3,"file":"recognizeChoices.js","sourceRoot":"","sources":["../../../src/choices/recognizeChoices.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBA,4CAqFC;AAzGD;;;GAGG;AACH,+CAA4E;AAG5E,kEAAmD;AACnD,gFAAiE;AAEjE,MAAM,MAAM,GAAG,IAAA,wBAAK,EAAC,0BAA0B,CAAC,CAAA;AAEhD;;;;;;;GAOG;AACH,SAAgB,gBAAgB,CAC9B,SAAiB,EACjB,OAA4B,EAC5B,OAA4B;;IAE5B,SAAS,kBAAkB,CAAE,KAAuB;QAClD,IAAI,CAAC;YACH,IAAI,CAAC,KAAK,CAAC,UAAU,IAAI,KAAK,CAAC,UAAU,CAAC,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,UAAU,CAAC,KAAK,KAAK,IAAI,EAAE,CAAC;gBACjG,OAAM;YACR,CAAC;YACD,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,CAAA;YAC5C,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC;gBACxD,OAAM;YACR,CAAC;YACD,MAAM,KAAK,GAAW,KAAK,GAAG,CAAC,CAAA;YAC/B,IAAI,KAAK,IAAI,CAAC,IAAI,KAAK,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;gBACtC,MAAM,MAAM,GAAW,IAAI,CAAC,KAAK,CA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
67
67
|
*/
|
|
68
68
|
export declare class ConfirmPrompt extends Prompt<boolean> {
|
|
69
69
|
/**
|
|
70
|
-
* A dictionary of
|
|
70
|
+
* A dictionary of default choices based on the supported prompt cultures.
|
|
71
71
|
* Can be replaced by user using the constructor that contains choiceDefaults.
|
|
72
72
|
* This is initially set in the constructor.
|
|
73
73
|
*/
|
|
@@ -99,7 +99,7 @@ export declare class ConfirmPrompt extends Prompt<boolean> {
|
|
|
99
99
|
* @param dialogId Unique ID of the dialog within its parent {@link DialogSet} or {@link ComponentDialog}.
|
|
100
100
|
* @param validator (Optional) validator that will be called each time the user responds to the prompt.
|
|
101
101
|
* @param defaultLocale (Optional) locale to use if the `TurnContext.activity.locale` is not specified. Defaults to a value of `en-us`.
|
|
102
|
-
* @param choiceDefaults (Optional) Overrides the dictionary of
|
|
102
|
+
* @param choiceDefaults (Optional) Overrides the dictionary of default choices for supported prompt cultures.
|
|
103
103
|
*/
|
|
104
104
|
constructor(dialogId: string, validator?: PromptValidator<boolean>, defaultLocale?: string, choiceDefaults?: ChoiceDefaultsConfirmPrompt);
|
|
105
105
|
/**
|
|
@@ -57,7 +57,7 @@ class ConfirmPrompt extends prompt_1.Prompt {
|
|
|
57
57
|
* @param dialogId Unique ID of the dialog within its parent {@link DialogSet} or {@link ComponentDialog}.
|
|
58
58
|
* @param validator (Optional) validator that will be called each time the user responds to the prompt.
|
|
59
59
|
* @param defaultLocale (Optional) locale to use if the `TurnContext.activity.locale` is not specified. Defaults to a value of `en-us`.
|
|
60
|
-
* @param choiceDefaults (Optional) Overrides the dictionary of
|
|
60
|
+
* @param choiceDefaults (Optional) Overrides the dictionary of default choices for supported prompt cultures.
|
|
61
61
|
*/
|
|
62
62
|
constructor(dialogId, validator, defaultLocale, choiceDefaults) {
|
|
63
63
|
super(dialogId, validator);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@microsoft/agents-hosting-dialogs",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.8.0-beta.36.gb033f0abc1",
|
|
5
5
|
"homepage": "https://github.com/microsoft/Agents-for-js",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -13,12 +13,12 @@
|
|
|
13
13
|
"url": "https://aka.ms/Agents"
|
|
14
14
|
},
|
|
15
15
|
"description": "Microsoft 365 Agents SDK Dialogs support.",
|
|
16
|
-
"main": "dist/index.js",
|
|
16
|
+
"main": "./dist/src/index.js",
|
|
17
17
|
"types": "dist/src/index.d.ts",
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@microsoft/agents-activity": "1.
|
|
20
|
-
"@microsoft/agents-hosting": "1.
|
|
21
|
-
"@microsoft/agents-telemetry": "1.
|
|
19
|
+
"@microsoft/agents-activity": "1.8.0-beta.36.gb033f0abc1",
|
|
20
|
+
"@microsoft/agents-hosting": "1.8.0-beta.36.gb033f0abc1",
|
|
21
|
+
"@microsoft/agents-telemetry": "1.8.0-beta.36.gb033f0abc1",
|
|
22
22
|
"@microsoft/recognizers-text-choice": "1.3.1",
|
|
23
23
|
"@microsoft/recognizers-text-date-time": "1.3.2",
|
|
24
24
|
"@microsoft/recognizers-text-number": "1.3.1",
|
package/src/choices/index.ts
CHANGED
|
@@ -7,5 +7,6 @@ export * from './choiceFactory'
|
|
|
7
7
|
export * from './findChoices'
|
|
8
8
|
export { FindValuesOptions } from './findValues'
|
|
9
9
|
export { FoundValue } from './findValues'
|
|
10
|
+
export { Token, TokenizerFunction } from './tokenizer'
|
|
10
11
|
export * from './modelResult'
|
|
11
12
|
export * from './recognizeChoices'
|
|
@@ -66,9 +66,7 @@ export function recognizeChoices (
|
|
|
66
66
|
// Normalize choices
|
|
67
67
|
const list: Choice[] = (choices || [])
|
|
68
68
|
.map((choice) => (typeof choice === 'string' ? { value: choice } : choice))
|
|
69
|
-
.filter(
|
|
70
|
-
(choice: Choice) => choice // TODO: does this do anything?
|
|
71
|
-
)
|
|
69
|
+
.filter((choice): choice is Choice => choice !== undefined && choice !== null)
|
|
72
70
|
|
|
73
71
|
// Try finding choices by text search first
|
|
74
72
|
// - We only want to use a single strategy for returning results to avoid issues where utterances
|
|
@@ -76,7 +76,7 @@ export interface ChoiceDefaultsConfirmPrompt {
|
|
|
76
76
|
*/
|
|
77
77
|
export class ConfirmPrompt extends Prompt<boolean> {
|
|
78
78
|
/**
|
|
79
|
-
* A dictionary of
|
|
79
|
+
* A dictionary of default choices based on the supported prompt cultures.
|
|
80
80
|
* Can be replaced by user using the constructor that contains choiceDefaults.
|
|
81
81
|
* This is initially set in the constructor.
|
|
82
82
|
*/
|
|
@@ -112,7 +112,7 @@ export class ConfirmPrompt extends Prompt<boolean> {
|
|
|
112
112
|
* @param dialogId Unique ID of the dialog within its parent {@link DialogSet} or {@link ComponentDialog}.
|
|
113
113
|
* @param validator (Optional) validator that will be called each time the user responds to the prompt.
|
|
114
114
|
* @param defaultLocale (Optional) locale to use if the `TurnContext.activity.locale` is not specified. Defaults to a value of `en-us`.
|
|
115
|
-
* @param choiceDefaults (Optional) Overrides the dictionary of
|
|
115
|
+
* @param choiceDefaults (Optional) Overrides the dictionary of default choices for supported prompt cultures.
|
|
116
116
|
*/
|
|
117
117
|
constructor (
|
|
118
118
|
dialogId: string,
|