Skip to content
This repository was archived by the owner on Jan 15, 2025. It is now read-only.

Commit bf75952

Browse files
munozemiliofeich-msChris McConnell
authored
Cherry-pick LU and Dialog fixes (#1189)
* Replace node fetch to axios to enable proxy in luis and qnamaker build (#1182) * replace node fetch and luis client to axios to enable proxy in luis and qnamaker build * fix tests * Fixes #1184 (#1185) Treats files with identical content as not being duplicated. This is because nuget likes to copy the same files in multiple places. Co-authored-by: Chris McConnell <chrimc> * fix axios bug to support https proxy (#1186) Co-authored-by: Fei Chen <[email protected]> Co-authored-by: Chris McConnell <[email protected]>
1 parent b2b3db3 commit bf75952

File tree

14 files changed

+367
-187
lines changed

14 files changed

+367
-187
lines changed

common/config/rush/pnpm-lock.yaml

Lines changed: 16 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/dialog/src/library/schemaMerger.ts

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1424,25 +1424,32 @@ export class SchemaMerger {
14241424
for (const [ext, files] of this.files.entries()) {
14251425
for (const [file, records] of files.entries()) {
14261426
const winner = records[0]
1427+
let winnerSrc = ''
14271428
const same: PathComponent[] = []
14281429
const conflicts: PathComponent[] = []
14291430
for (const alt of records) {
14301431
if (alt.path.endsWith('.schema') || alt.path.endsWith('.uischema')) {
14311432
alt.node.metadata.includesSchema = true
14321433
}
14331434
if (alt !== winner) {
1434-
if (winner.node === alt.node) {
1435-
same.push(alt)
1436-
} else if (ext === '.schema') {
1437-
// Check for same content which can happen when project and nuget from project are
1438-
// both being used.
1439-
const winnerSrc = await fs.readFile(winner.path, 'utf8')
1440-
const altSrc = await fs.readFile(alt.path, 'utf8')
1441-
if (winnerSrc !== altSrc) {
1435+
if (!winnerSrc) {
1436+
winnerSrc = await fs.readFile(winner.path, 'utf8')
1437+
}
1438+
const altSrc = await fs.readFile(alt.path, 'utf8')
1439+
// If content is identical, then don't treat as a duplicate.
1440+
// This is mainly about nuget packages which like to have multiple copies of files.
1441+
if (winnerSrc !== altSrc) {
1442+
if (winner.node === alt.node) {
1443+
same.push(alt)
1444+
} else if (ext === '.schema') {
1445+
const winnerSrc = await fs.readFile(winner.path, 'utf8')
1446+
const altSrc = await fs.readFile(alt.path, 'utf8')
1447+
if (winnerSrc !== altSrc) {
1448+
conflicts.push(alt)
1449+
}
1450+
} else if (ext !== '.uischema') {
14421451
conflicts.push(alt)
14431452
}
1444-
} else if (ext !== '.uischema') {
1445-
conflicts.push(alt)
14461453
}
14471454
}
14481455
}
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
{
2+
"$schema": "https://schemas.botframework.com/schemas/component/v1.0/component.schema",
3+
"$role": "implements(Microsoft.IDialog)",
4+
"title": "Adaptive Dialog",
5+
"description": "Flexible, data driven dialog that can adapt to the conversation.",
6+
"type": "object",
7+
"properties": {
8+
"id": {
9+
"type": "string",
10+
"title": "Id",
11+
"description": "Optional dialog ID."
12+
},
13+
"autoEndDialog": {
14+
"$ref": "schema:#/definitions/booleanExpression",
15+
"title": "Auto end dialog",
16+
"description": "If set to true the dialog will automatically end when there are no further actions. If set to false, remember to manually end the dialog using EndDialog action.",
17+
"default": true
18+
},
19+
"defaultResultProperty": {
20+
"type": "string",
21+
"title": "Default result property",
22+
"description": "Value that will be passed back to the parent dialog.",
23+
"default": "dialog.result"
24+
},
25+
"recognizer": {
26+
"$kind": "Microsoft.IRecognizer",
27+
"title": "Recognizer",
28+
"description": "Input recognizer that interprets user input into intent and entities."
29+
},
30+
"generator": {
31+
"$kind": "Microsoft.ILanguageGenerator",
32+
"title": "Language Generator",
33+
"description": "Language generator that generates bot responses."
34+
},
35+
"selector": {
36+
"$kind": "Microsoft.ITriggerSelector",
37+
"title": "Selector",
38+
"description": "Policy to determine which trigger is executed. Defaults to a 'best match' selector (optional)."
39+
},
40+
"triggers": {
41+
"type": "array",
42+
"description": "List of triggers defined for this dialog.",
43+
"title": "Triggers",
44+
"items": {
45+
"$kind": "Microsoft.ITrigger",
46+
"title": "Event triggers",
47+
"description": "Event triggers for handling events."
48+
}
49+
},
50+
"schema": {
51+
"title": "Schema",
52+
"description": "Schema to fill in.",
53+
"anyOf": [
54+
{
55+
"$ref": "http://json-schema.org/draft-07/schema#"
56+
},
57+
{
58+
"type": "string",
59+
"title": "Reference to JSON schema",
60+
"description": "Reference to JSON schema .dialog file."
61+
}
62+
]
63+
}
64+
}
65+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"$schema": "https://schemas.botframework.com/schemas/ui/v1.0/ui.schema",
3+
"form": {
4+
"label": "Adaptive dialog",
5+
"description": "This configures a data driven dialog via a collection of events and actions.",
6+
"helpLink": "https://aka.ms/bf-composer-docs-dialog",
7+
"order": [
8+
"recognizer",
9+
"*"
10+
],
11+
"hidden": [
12+
"triggers",
13+
"generator",
14+
"selector",
15+
"schema"
16+
],
17+
"properties": {
18+
"recognizer": {
19+
"label": "Language Understanding",
20+
"description": "To understand what the user says, your dialog needs a \"Recognizer\"; that includes example words and sentences that users may use."
21+
}
22+
}
23+
}
24+
}
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# template
2+
- template
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# intent
2+
- intent
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

packages/lu/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@
3333
]
3434
},
3535
"dependencies": {
36-
"@azure/cognitiveservices-luis-authoring": "4.0.0-preview.1",
37-
"@azure/ms-rest-azure-js": "2.0.1",
3836
"@types/node-fetch": "~2.5.5",
3937
"antlr4": "~4.8.0",
38+
"axios": "~0.21.1",
39+
"axios-https-proxy": "^0.1.1",
4040
"chalk": "2.4.1",
4141
"console-stream": "^0.1.1",
4242
"deep-equal": "^1.0.1",

0 commit comments

Comments
 (0)