microsoft / botframework-cli

CLI Tools for the Microsoft Bot Framework
Other
177 stars 128 forks source link

Implement tool to register skill in parent bot #505

Closed gabog closed 6 days ago

gabog commented 5 years ago

Automate the process of adding, removing, and updating skill configuration for a Bot Framework Bot.

Operation Description Parameters
Add Register a skill with a Bot Framework bot. Manifest file (local remote) Endpoint to use (manifest has multiple potentially) Programming Language (different languages have different config files - could be resolved through probing)  [Optional] Local folder to resolve required LU files
Remove Unregister a skill from a Bot Framework bot. SkillID Programming Language (different languages have different config files - could be resolved through probing)
Update Refresh a skill registration with any changes from a connected skill (only relevant for Orchestrator/Dispatch scenarios) Manifest file (local remote) Programming Language (different languages have different config files - could be resolved through probing)
List List all skill registrations Programming Language (different languages have different config files - could be resolved through probing)

Core Skill Registration Steps (Action and Utterance Invocation)

  1. Validate Skill Manifest. Specifically to ensure Id, AppId, SkillEndpoint, etc. is valid. Given the current SDK approach requires developers to create this manually it leads to many errors.

  2. Extract core manifest information and update Bot configuration. Id, AppId, Endpoint, Name and Description are required on the Bot side. AppId is used as part of the secure skill communication mechanism.

    "botFrameworkSkills": { "id": "", "appId": "", "skillEndpoint": "", "name": "", "description": "" }

  3. Populate skillHostEndpoint Uri. This setting is part of the Bots configuration file and provides the endpoint that a Skill calls back with response activities. Not setting this leads to obscure HTTP 500 errors and is highly confusing to developers. As developers move from dev envrionments through to production this needs to be set as part of CI/CD. Can also be looked up based on other information in configuration.

    "skillHostEndpoint": ""

Additional Skill Registration Steps required for Utterance Invocation scenarios

  1. Retrieve LU training data. Manifest will point to LU source(s), one per supported locale. These need to be resolved and contents downloaded. Local File, Remote File and also directly from the LUIS model for Microsoft-centric and enterprise scenarios whereby a separate static file is not required.

  2. Filter out unneeded intents. Manifest optionally enables certain intents to be "exposed" (made public) so LU data may be filtered down to just the intents the manifest specifies. May not be needed. No intents specified will default to all intents.

  3. Train Dispatcher. A new "label" is added to Dispatcher/Orchestrator and the training utterances from previous step are added. This label is mapped to the Skill Name enabling the Skill to be identified at runtime.

  4. Multi-Locale. Above steps are repeated for each and every locale. Each locale will have a different dispatch model.

  5. Strongly typed class. Generated an updated Dispatch "model" class ensuring the (now extended) Dispatch result can be deserialized by the assistant. This avoids any code changes when adding a Skill.

Additional Considerations for Utterance Invocation Scenarios

darrenj commented 5 years ago

https://github.com/microsoft/botframework-solutions/tree/master/tools/botskills

rvallireply commented 4 years ago

https://github.com/microsoft/botframework-solutions/issues/2909

gabog commented 4 years ago

Just for reference, we could approach this as writing an extension for BF CLI specific to VA based on: https://github.com/microsoft/botframework-cli/blob/master/CONTRIBUTING.md#steps-to-create-a-new-plugin

gabog commented 4 years ago

Hi @scheyal and @clearab, do we still need this feature in the CLI? PVA knows how to register skills and composer has a way too. The only think that doesn't is VA that would map to our "coded approach" for implementing consumers. Do we have customers asking for this or we can close it?

Thanks

scheyal commented 3 years ago

We need some of this functionality for Orchestrator. Need to discuss in detail.