-
Notifications
You must be signed in to change notification settings - Fork 281
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated Dialog Manager to work with skills (#2343)
* updated dialog manager to support skills * reordered properties of dialog manager * make dialog manager's dialogs property public * added tests for dialog manager * code style change * added test to get/set root dialog of dialog manager * move sendStateSnapshotTrace() to dialog manager * added test for state trace in dialog manager * added skill extensions to inject skill client and conversation id factory * updated test of beginSkill to use extensions * use static functions instead of extensions Co-authored-by: Steven Gum <[email protected]>
- Loading branch information
Showing
7 changed files
with
474 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
libraries/botbuilder-dialogs-adaptive/src/skillExtensions.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/** | ||
* @module botbuilder-dialogs-adaptive | ||
*/ | ||
/** | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. | ||
*/ | ||
|
||
import { DialogManager } from 'botbuilder-dialogs'; | ||
import { BotFrameworkClient, SkillConversationIdFactoryBase } from 'botbuilder-core'; | ||
|
||
export const skillClientKey = Symbol('SkillClient'); | ||
export const skillConversationIdFactoryKey = Symbol('SkillConversationIdFactory'); | ||
|
||
export class SkillExtensions { | ||
/** | ||
* Configures the skill client to use. | ||
*/ | ||
public static useSkillClient(dialogManager: DialogManager, skillClient: BotFrameworkClient): DialogManager { | ||
dialogManager.initialTurnState.set(skillClientKey, skillClient); | ||
return dialogManager; | ||
} | ||
|
||
/** | ||
* Configures the skill conversation id factory to use. | ||
*/ | ||
public static useSkillConverationIdFactory(dialogManager: DialogManager, skillConversationIdFactory: SkillConversationIdFactoryBase): DialogManager { | ||
dialogManager.initialTurnState.set(skillConversationIdFactoryKey, skillConversationIdFactory); | ||
return dialogManager; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.