This file contains hidden or 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
| { | |
| "iisSettings": { | |
| "windowsAuthentication": false, | |
| "anonymousAuthentication": true, | |
| "iisExpress": { | |
| "applicationUrl": "http://localhost:64645", | |
| "sslPort": 44366 | |
| } | |
| }, | |
| "profiles": { |
This file contains hidden or 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
| public class UnicornTest | |
| { | |
| private int topUnicorn=0; | |
| List <int> elements = new List<int>(); | |
| public int Size() | |
| { | |
| return topUnicorn; | |
| } | |
| public void Push(int element) |
This file contains hidden or 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
| BeFabulous(name, age) | |
| BeFabulous(name) |
This file contains hidden or 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
| //comprobar que es un unicornio con derecho a todos los accesos | |
| If((unircon.flags == true )&&(unicorn.age<100)) | |
| If(unicorn.IsElegibleForBenefits()) |
This file contains hidden or 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
| private async Task DispatchToTopIntentAsync(ITurnContext<IMessageActivity> turnContext, string intent, RecognizerResult recognizerResult, CancellationToken cancellationToken) | |
| { | |
| switch (intent) | |
| { | |
| case "l_HomeAutomation": | |
| await ProcessHomeAutomationAsync(turnContext, recognizerResult.Properties["luisResult"] as LuisResult, cancellationToken); | |
| break; | |
| case "l_Weather": | |
| await ProcessWeatherAsync(turnContext, recognizerResult.Properties["luisResult"] as LuisResult, cancellationToken); | |
| break; |
This file contains hidden or 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
| protected override async Task OnMessageActivityAsync(ITurnContext<IMessageActivity> turnContext, CancellationToken cancellationToken) | |
| { | |
| // First, we use the dispatch model to determine which cognitive service (LUIS or QnA) to use. | |
| var recognizerResult = await _botServices.Dispatch.RecognizeAsync(turnContext, cancellationToken); | |
| // Top intent tell us which cognitive service to use. | |
| var topIntent = recognizerResult.GetTopScoringIntent(); | |
| // Next, we call the dispatcher with the top intent. | |
| await DispatchToTopIntentAsync(turnContext, topIntent.intent, recognizerResult, cancellationToken); |
This file contains hidden or 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
| public BotServices(IConfiguration configuration) | |
| { | |
| // Read the setting for cognitive services (LUIS, QnA) from the appsettings.json | |
| Dispatch = new LuisRecognizer(new LuisApplication( | |
| configuration["LuisAppId"], | |
| configuration["LuisAPIKey"], | |
| $"https://{configuration["LuisAPIHostName"]}.api.cognitive.microsoft.com"), | |
| new LuisPredictionOptions { IncludeAllIntents = true, IncludeInstanceData = true }, | |
| true); |
This file contains hidden or 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
| "MicrosoftAppId": "", | |
| "MicrosoftAppPassword": "", | |
| "QnAKnowledgebaseId": "<knowledge-base-id>", | |
| "QnAEndpointKey": "<qna-maker-resource-key>", | |
| "QnAEndpointHostName": "<your-hostname>", | |
| "LuisAppId": "<app-id-for-dispatch-app>", | |
| "LuisAPIKey": "<your-luis-endpoint-key>", | |
| "LuisAPIHostName": "<your-dispatch-app-region>", |
This file contains hidden or 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
| #Abre la linea de comando en la carpeta destino | |
| npm i -g npm | |
| npm i -g botdispatch | |
| #usa dispatch init para inicializar, para crear usa el archivo (.dispact) para tu modelo dispatch. | |
| dispatch init -n <filename-to-create> --luisAuthoringKey "<your-luis-authoring-key>" --luisAuthoringRegion <your-region> | |
| #Usa *dispactch add* para agregar tus aplicaciones LUIS y QNA maker basado en el archivo .dispatch | |
| dispatch add -t luis -i "<app-id-for-weather-app>" -n "<name-of-weather-app>" -v <app-version-number> -k "<your-luis-authoring-key>" --intentName l_Weather | |
| dispatch add -t luis -i "<app-id-for-home-automation-app>" -n "<name-of-home-automation-app>" -v <app-version-number> -k "<your-luis-authoring-key>" --intentName l_HomeAutomation |
This file contains hidden or 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
| using System; | |
| using System.IO; | |
| class UnmanagedWrappper : IDisposable | |
| { | |
| public FileStream Stream {get; private set;} | |
| public UnmanagedWrappper() | |
| { | |
| this.Stream = File.Open("temp.dat", FileMode.Create); |
NewerOlder