External Entities & Dynamic lists (#3300)
* Updated schema. * Added DynamicList and External entity support to declarative LUIS Recognizer. Improved MockLuis to pay attention to parameters. * Update cache files. * Update LuisRecognizerOptionsV3 to include support for DialogContext. * ExternalEntity recognizer tests running. * Move LUIS loader and convert to LUIS library. * Update TestBot to better handle one dialog. * Fix TestBot to work more reliably. * Move expression properties to its own library in order to support using them in LUIS Recognizer without introducing cycles. * Fix bogus build warnings. * Connect expresssion to dynamic lists. * Add LuisAdaptiveRecognizer to wrap LUISRecognizer functionality including expressions. This is also a breaking change because appid, etc. now is expressions. Fixed bug in ArrayExpressionConverter where other convertes would not be used. * Add explicit adapter dynamic list to get around serialization/deserialization issues. Add test that uses expression. * Update generator unit tests. * Switch to $role filling in string type. Get rid of lg and memorypath roles. * Update tests to run without a secret when LUIS results are cached. * Add back in extension method. * Remove LuisRecognizer from Recognizer since LuisAdaptiveRecognizer handles the mismatch. * Remove unneeded dependency. * Address code review comments.
This commit is contained in:
Родитель
4f332c0c37
Коммит
a9ccf3877f
|
@ -172,6 +172,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Bot.Builder.TestB
|
|||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Bot.Builder.TestBot.NetCore21.Tests", "tests\Microsoft.Bot.Builder.TestBot.NetCore21.Tests\Microsoft.Bot.Builder.TestBot.NetCore21.Tests.csproj", "{2FBA2BB7-73C8-45CD-99B7-D65F817C9051}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Bot.Expressions.Properties", "libraries\Microsoft.Bot.Expressions.Properties\Microsoft.Bot.Expressions.Properties.csproj", "{4943C197-0742-480E-B1D3-6738D41582A3}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
|
@ -700,6 +702,14 @@ Global
|
|||
{2FBA2BB7-73C8-45CD-99B7-D65F817C9051}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{2FBA2BB7-73C8-45CD-99B7-D65F817C9051}.Release-Windows|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{2FBA2BB7-73C8-45CD-99B7-D65F817C9051}.Release-Windows|Any CPU.Build.0 = Release|Any CPU
|
||||
{4943C197-0742-480E-B1D3-6738D41582A3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{4943C197-0742-480E-B1D3-6738D41582A3}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{4943C197-0742-480E-B1D3-6738D41582A3}.Debug-Windows|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{4943C197-0742-480E-B1D3-6738D41582A3}.Debug-Windows|Any CPU.Build.0 = Debug|Any CPU
|
||||
{4943C197-0742-480E-B1D3-6738D41582A3}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{4943C197-0742-480E-B1D3-6738D41582A3}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{4943C197-0742-480E-B1D3-6738D41582A3}.Release-Windows|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{4943C197-0742-480E-B1D3-6738D41582A3}.Release-Windows|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
@ -776,6 +786,7 @@ Global
|
|||
{D9242899-AB3F-46BB-BAB4-386CB8EC535C} = {AD743B78-D61F-4FBF-B620-FA83CE599A50}
|
||||
{99C466C3-1931-4C0E-AA0A-A8D9D140F56E} = {AD743B78-D61F-4FBF-B620-FA83CE599A50}
|
||||
{2FBA2BB7-73C8-45CD-99B7-D65F817C9051} = {AD743B78-D61F-4FBF-B620-FA83CE599A50}
|
||||
{4943C197-0742-480E-B1D3-6738D41582A3} = {4269F3C3-6B42-419B-B64A-3E6DC0F1574A}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {7173C9F3-A7F9-496E-9078-9156E35D6E16}
|
||||
|
|
|
@ -54,9 +54,9 @@ namespace Microsoft.Bot.Builder.AI.Luis
|
|||
throw new ArgumentException($"\"{applicationId}\" is not a valid LUIS application id.");
|
||||
}
|
||||
|
||||
if (!Guid.TryParse(endpointKey, out var subscriptionGuid))
|
||||
if (!Guid.TryParse(endpointKey, out var _))
|
||||
{
|
||||
throw new ArgumentException($"\"{subscriptionGuid}\" is not a valid LUIS subscription key.");
|
||||
throw new ArgumentException($"\"{endpointKey}\" is not a valid LUIS subscription key.");
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(endpoint))
|
||||
|
|
|
@ -20,7 +20,7 @@ namespace Microsoft.Bot.Builder.AI.Luis
|
|||
/// <summary>
|
||||
/// A LUIS based implementation of <see cref="ITelemetryRecognizer"/>.
|
||||
/// </summary>
|
||||
public class LuisRecognizer : Recognizer, ITelemetryRecognizer
|
||||
public class LuisRecognizer : ITelemetryRecognizer
|
||||
{
|
||||
[JsonProperty("$kind")]
|
||||
public const string DeclarativeType = "Microsoft.LuisRecognizer";
|
||||
|
@ -198,11 +198,6 @@ namespace Microsoft.Bot.Builder.AI.Luis
|
|||
return result;
|
||||
}
|
||||
|
||||
public override Task<RecognizerResult> RecognizeAsync(DialogContext dialogContext, CancellationToken cancellationToken = default)
|
||||
{
|
||||
return this.RecognizeAsync(dialogContext.Context, cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Runs an utterance through a recognizer and returns a strongly-typed recognizer result.
|
||||
/// </summary>
|
||||
|
@ -352,18 +347,6 @@ namespace Microsoft.Bot.Builder.AI.Luis
|
|||
return result;
|
||||
}
|
||||
|
||||
public override async Task<RecognizerResult> RecognizeAsync(DialogContext dialogContext, string text, string locale, CancellationToken cancellationToken = default)
|
||||
{
|
||||
// TODO: Review how to better integrate this--it assumes the turn context contains the text/locale
|
||||
var context = dialogContext.Context;
|
||||
if (context.Activity == null || context.Activity.Type != ActivityTypes.Message || context.Activity.Text != text || context.Activity.Locale != locale)
|
||||
{
|
||||
throw new ArgumentException("TurnContext is different than text");
|
||||
}
|
||||
|
||||
return await RecognizeAsync(dialogContext.Context, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invoked prior to a LuisResult being logged.
|
||||
/// </summary>
|
||||
|
|
|
@ -5,6 +5,7 @@ using System;
|
|||
using System.Net.Http;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Bot.Builder.Dialogs;
|
||||
|
||||
namespace Microsoft.Bot.Builder.AI.Luis
|
||||
{
|
||||
|
@ -50,6 +51,10 @@ namespace Microsoft.Bot.Builder.AI.Luis
|
|||
|
||||
public bool IncludeAPIResults { get; set; } = false;
|
||||
|
||||
// Support original ITurnContext
|
||||
internal abstract Task<RecognizerResult> RecognizeInternalAsync(ITurnContext turnContext, HttpClient httpClient, CancellationToken cancellationToken);
|
||||
|
||||
// Support DialogContext
|
||||
internal abstract Task<RecognizerResult> RecognizeInternalAsync(DialogContext context, HttpClient httpClient, CancellationToken cancellationToken);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,9 +7,11 @@ using System.Threading;
|
|||
using System.Threading.Tasks;
|
||||
using Microsoft.Azure.CognitiveServices.Language.LUIS.Runtime;
|
||||
using Microsoft.Azure.CognitiveServices.Language.LUIS.Runtime.Models;
|
||||
using Microsoft.Bot.Builder.Dialogs;
|
||||
using Microsoft.Bot.Builder.TraceExtensions;
|
||||
using Microsoft.Bot.Schema;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Newtonsoft.Json.Serialization;
|
||||
|
||||
namespace Microsoft.Bot.Builder.AI.Luis
|
||||
{
|
||||
|
@ -40,6 +42,9 @@ namespace Microsoft.Bot.Builder.AI.Luis
|
|||
/// <value> This settings will be used to call Luis.</value>
|
||||
public LuisPredictionOptions PredictionOptions { get; set; } = new LuisPredictionOptions();
|
||||
|
||||
internal override async Task<RecognizerResult> RecognizeInternalAsync(DialogContext context, HttpClient httpClient, CancellationToken cancellationToken)
|
||||
=> await RecognizeInternalAsync(context.Context, httpClient, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
internal override async Task<RecognizerResult> RecognizeInternalAsync(ITurnContext turnContext, HttpClient httpClient, CancellationToken cancellationToken)
|
||||
{
|
||||
BotAssert.ContextNotNull(turnContext);
|
||||
|
|
|
@ -8,6 +8,7 @@ using System.Text;
|
|||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web;
|
||||
using Microsoft.Bot.Builder.Dialogs;
|
||||
using Microsoft.Bot.Builder.TraceExtensions;
|
||||
using Microsoft.Bot.Schema;
|
||||
using Newtonsoft.Json;
|
||||
|
@ -36,13 +37,72 @@ namespace Microsoft.Bot.Builder.AI.Luis
|
|||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets entity recognizer to recognize external entities to pass to LUIS.
|
||||
/// </summary>
|
||||
/// <value>External entity recognizer.</value>
|
||||
[JsonProperty("externalEntityRecognizer")]
|
||||
public Recognizer ExternalEntityRecognizer { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Luis Prediction Options for the V3 endpoint.
|
||||
/// </summary>
|
||||
/// <value> This settings will be used to call Luis.</value>
|
||||
public LuisV3.LuisPredictionOptions PredictionOptions { get; set; } = new LuisV3.LuisPredictionOptions();
|
||||
|
||||
internal override async Task<RecognizerResult> RecognizeInternalAsync(DialogContext context, HttpClient httpClient, CancellationToken cancellationToken)
|
||||
{
|
||||
var utterance = Utterance(context.Context);
|
||||
var options = PredictionOptions;
|
||||
if (ExternalEntityRecognizer != null)
|
||||
{
|
||||
var matches = await ExternalEntityRecognizer.RecognizeAsync(context, cancellationToken).ConfigureAwait(false);
|
||||
if (matches.Entities != null && matches.Entities.Count > 2)
|
||||
{
|
||||
options = new LuisV3.LuisPredictionOptions(options);
|
||||
options.ExternalEntities = new List<LuisV3.ExternalEntity>();
|
||||
var entities = matches.Entities;
|
||||
var instance = entities["$instance"].ToObject<JObject>();
|
||||
if (instance != null)
|
||||
{
|
||||
foreach (var child in entities)
|
||||
{
|
||||
// TODO: Checking for "text" because we get an extra non-real entity from the text recognizers
|
||||
if (child.Key != "text" && child.Key != "$instance")
|
||||
{
|
||||
var instances = instance[child.Key]?.ToObject<JArray>();
|
||||
var values = child.Value.ToObject<JArray>();
|
||||
if (instances != null && values != null
|
||||
&& instances.Count == values.Count)
|
||||
{
|
||||
for (var i = 0; i < values.Count; ++i)
|
||||
{
|
||||
var childInstance = instances[i].ToObject<JObject>();
|
||||
if (childInstance != null
|
||||
&& childInstance.ContainsKey("startIndex")
|
||||
&& childInstance.ContainsKey("endIndex"))
|
||||
{
|
||||
var start = childInstance["startIndex"].Value<int>();
|
||||
var end = childInstance["endIndex"].Value<int>();
|
||||
options.ExternalEntities.Add(new LuisV3.ExternalEntity(child.Key, start, end - start, child.Value));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return await RecognizeAsync(context.Context, utterance, options, httpClient, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
internal override async Task<RecognizerResult> RecognizeInternalAsync(ITurnContext turnContext, HttpClient httpClient, CancellationToken cancellationToken)
|
||||
{
|
||||
return await RecognizeAsync(turnContext, Utterance(turnContext), PredictionOptions, httpClient, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
private string Utterance(ITurnContext turnContext)
|
||||
{
|
||||
BotAssert.ContextNotNull(turnContext);
|
||||
if (turnContext.Activity == null || turnContext.Activity.Type != ActivityTypes.Message)
|
||||
|
@ -50,8 +110,11 @@ namespace Microsoft.Bot.Builder.AI.Luis
|
|||
return null;
|
||||
}
|
||||
|
||||
var options = PredictionOptions;
|
||||
var utterance = turnContext.Activity?.AsMessageActivity()?.Text;
|
||||
return turnContext.Activity?.AsMessageActivity()?.Text;
|
||||
}
|
||||
|
||||
private async Task<RecognizerResult> RecognizeAsync(ITurnContext turnContext, string utterance, LuisV3.LuisPredictionOptions options, HttpClient httpClient, CancellationToken cancellationToken)
|
||||
{
|
||||
RecognizerResult recognizerResult;
|
||||
JObject luisResponse = null;
|
||||
|
||||
|
@ -66,8 +129,8 @@ namespace Microsoft.Bot.Builder.AI.Luis
|
|||
}
|
||||
else
|
||||
{
|
||||
var uri = BuildUri();
|
||||
var content = BuildRequestBody(utterance);
|
||||
var uri = BuildUri(options);
|
||||
var content = BuildRequestBody(utterance, options);
|
||||
httpClient.DefaultRequestHeaders.Add("Ocp-Apim-Subscription-Key", Application.EndpointKey);
|
||||
var response = await httpClient.PostAsync(uri.Uri, new StringContent(content.ToString(), System.Text.Encoding.UTF8, "application/json")).ConfigureAwait(false);
|
||||
response.EnsureSuccessStatusCode();
|
||||
|
@ -80,7 +143,7 @@ namespace Microsoft.Bot.Builder.AI.Luis
|
|||
recognizerResult.AlteredText = prediction["alteredQuery"]?.Value<string>();
|
||||
recognizerResult.Intents = LuisV3.LuisUtil.GetIntents(prediction);
|
||||
recognizerResult.Entities = LuisV3.LuisUtil.ExtractEntitiesAndMetadata(prediction);
|
||||
|
||||
|
||||
LuisV3.LuisUtil.AddProperties(prediction, recognizerResult);
|
||||
if (IncludeAPIResults)
|
||||
{
|
||||
|
@ -113,9 +176,8 @@ namespace Microsoft.Bot.Builder.AI.Luis
|
|||
return recognizerResult;
|
||||
}
|
||||
|
||||
private UriBuilder BuildUri()
|
||||
private UriBuilder BuildUri(LuisV3.LuisPredictionOptions options)
|
||||
{
|
||||
var options = PredictionOptions;
|
||||
var path = new StringBuilder(Application.Endpoint);
|
||||
path.Append($"/luis/prediction/v3.0/apps/{Application.ApplicationId}");
|
||||
|
||||
|
@ -138,9 +200,8 @@ namespace Microsoft.Bot.Builder.AI.Luis
|
|||
return uri;
|
||||
}
|
||||
|
||||
private JObject BuildRequestBody(string utterance)
|
||||
private JObject BuildRequestBody(string utterance, LuisV3.LuisPredictionOptions options)
|
||||
{
|
||||
var options = PredictionOptions;
|
||||
var content = new JObject
|
||||
{
|
||||
{ "query", utterance },
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
<ItemGroup>
|
||||
<PackageReference Include="AsyncUsageAnalyzers" Version="1.0.0-alpha003" PrivateAssets="all" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
||||
<PackageReference Include="SourceLink.Create.CommandLine" Version="2.8.3" >
|
||||
<PackageReference Include="SourceLink.Create.CommandLine" Version="2.8.3">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.Azure.CognitiveServices.Language.LUIS.Runtime" Version="2.1.0" />
|
||||
|
|
|
@ -11,6 +11,30 @@ namespace Microsoft.Bot.Builder.AI.LuisV3
|
|||
/// </summary>
|
||||
public class LuisPredictionOptions
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="LuisPredictionOptions"/> class.
|
||||
/// </summary>
|
||||
public LuisPredictionOptions()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="LuisPredictionOptions"/> class from an existing instance.
|
||||
/// </summary>
|
||||
/// <param name="other">Source of values.</param>
|
||||
public LuisPredictionOptions(LuisPredictionOptions other)
|
||||
{
|
||||
IncludeAllIntents = other.IncludeAllIntents;
|
||||
IncludeAPIResults = other.IncludeAPIResults;
|
||||
IncludeInstanceData = other.IncludeInstanceData;
|
||||
Log = other.Log;
|
||||
DynamicLists = other.DynamicLists;
|
||||
ExternalEntities = other.ExternalEntities;
|
||||
PreferExternalEntities = other.PreferExternalEntities;
|
||||
Slot = other.Slot;
|
||||
Version = other.Version;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether all intents come back or only the top one.
|
||||
/// </summary>
|
||||
|
|
|
@ -4,8 +4,7 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using Microsoft.Bot.Builder.Dialogs.Declarative;
|
||||
using Microsoft.Bot.Expressions;
|
||||
using Microsoft.Bot.Expressions.Properties;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
|
|
|
@ -2,11 +2,10 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Bot.Expressions;
|
||||
using Microsoft.Bot.Expressions.Properties;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Microsoft.Bot.Builder.Dialogs.Adaptive.Actions
|
||||
|
|
|
@ -5,7 +5,7 @@ using System;
|
|||
using System.Runtime.CompilerServices;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Bot.Expressions;
|
||||
using Microsoft.Bot.Expressions.Properties;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Microsoft.Bot.Builder.Dialogs.Adaptive.Actions
|
||||
|
|
|
@ -5,7 +5,7 @@ using System;
|
|||
using System.Runtime.CompilerServices;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Bot.Expressions;
|
||||
using Microsoft.Bot.Expressions.Properties;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Microsoft.Bot.Builder.Dialogs.Adaptive.Actions
|
||||
|
|
|
@ -5,7 +5,7 @@ using System;
|
|||
using System.Runtime.CompilerServices;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Bot.Expressions;
|
||||
using Microsoft.Bot.Expressions.Properties;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Microsoft.Bot.Builder.Dialogs.Adaptive.Actions
|
||||
|
|
|
@ -5,7 +5,7 @@ using System;
|
|||
using System.Runtime.CompilerServices;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Bot.Expressions;
|
||||
using Microsoft.Bot.Expressions.Properties;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Microsoft.Bot.Builder.Dialogs.Adaptive.Actions
|
||||
|
|
|
@ -8,7 +8,7 @@ using System.Linq;
|
|||
using System.Runtime.CompilerServices;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Bot.Expressions;
|
||||
using Microsoft.Bot.Expressions.Properties;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Microsoft.Bot.Builder.Dialogs.Adaptive.Actions
|
||||
|
|
|
@ -5,9 +5,7 @@ using System;
|
|||
using System.Runtime.CompilerServices;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Bot.Builder.Dialogs.Adaptive.Templates;
|
||||
using Microsoft.Bot.Expressions;
|
||||
using Microsoft.Bot.Schema;
|
||||
using Microsoft.Bot.Expressions.Properties;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Microsoft.Bot.Builder.Dialogs.Adaptive.Actions
|
||||
|
|
|
@ -7,7 +7,7 @@ using System.Linq;
|
|||
using System.Runtime.CompilerServices;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Bot.Expressions;
|
||||
using Microsoft.Bot.Expressions.Properties;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Microsoft.Bot.Builder.Dialogs.Adaptive.Actions
|
||||
|
|
|
@ -5,7 +5,7 @@ using System;
|
|||
using System.Runtime.CompilerServices;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Bot.Expressions;
|
||||
using Microsoft.Bot.Expressions.Properties;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Microsoft.Bot.Builder.Dialogs.Adaptive.Actions
|
||||
|
|
|
@ -7,7 +7,7 @@ using System.Linq;
|
|||
using System.Runtime.CompilerServices;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Bot.Expressions;
|
||||
using Microsoft.Bot.Expressions.Properties;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Microsoft.Bot.Builder.Dialogs.Adaptive.Actions
|
||||
|
|
|
@ -6,7 +6,7 @@ using System.Linq;
|
|||
using System.Runtime.CompilerServices;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Bot.Expressions;
|
||||
using Microsoft.Bot.Expressions.Properties;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
|
|
@ -5,7 +5,7 @@ using System;
|
|||
using System.Runtime.CompilerServices;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Bot.Expressions;
|
||||
using Microsoft.Bot.Expressions.Properties;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Microsoft.Bot.Builder.Dialogs.Adaptive.Actions
|
||||
|
|
|
@ -5,7 +5,7 @@ using System;
|
|||
using System.Runtime.CompilerServices;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Bot.Expressions;
|
||||
using Microsoft.Bot.Expressions.Properties;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Microsoft.Bot.Builder.Dialogs.Adaptive.Actions
|
||||
|
|
|
@ -5,7 +5,7 @@ using System;
|
|||
using System.Runtime.CompilerServices;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Bot.Expressions;
|
||||
using Microsoft.Bot.Expressions.Properties;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Microsoft.Bot.Builder.Dialogs.Adaptive.Actions
|
||||
|
|
|
@ -2,11 +2,10 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Bot.Expressions;
|
||||
using Microsoft.Bot.Expressions.Properties;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
|
|
|
@ -5,10 +5,9 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Bot.Expressions;
|
||||
using Microsoft.Bot.Expressions.Properties;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ using System;
|
|||
using System.Runtime.CompilerServices;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Bot.Expressions;
|
||||
using Microsoft.Bot.Expressions.Properties;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Microsoft.Bot.Builder.Dialogs.Adaptive.Actions
|
||||
|
|
|
@ -5,7 +5,7 @@ using System;
|
|||
using System.Runtime.CompilerServices;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Bot.Expressions;
|
||||
using Microsoft.Bot.Expressions.Properties;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Microsoft.Bot.Builder.Dialogs.Adaptive.Actions
|
||||
|
|
|
@ -5,7 +5,7 @@ using System;
|
|||
using System.Runtime.CompilerServices;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Bot.Expressions;
|
||||
using Microsoft.Bot.Expressions.Properties;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Microsoft.Bot.Builder.Dialogs.Adaptive.Actions
|
||||
|
|
|
@ -11,6 +11,7 @@ using System.Text;
|
|||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Bot.Builder.TraceExtensions;
|
||||
using Microsoft.Bot.Expressions.Properties;
|
||||
using Microsoft.Bot.Schema;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
|
|
|
@ -7,7 +7,7 @@ using System.Linq;
|
|||
using System.Runtime.CompilerServices;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Bot.Expressions;
|
||||
using Microsoft.Bot.Expressions.Properties;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Microsoft.Bot.Builder.Dialogs.Adaptive.Actions
|
||||
|
|
|
@ -6,9 +6,8 @@ using System.Runtime.CompilerServices;
|
|||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Bot.Builder.Dialogs.Adaptive.Templates;
|
||||
using Microsoft.Bot.Expressions;
|
||||
using Microsoft.Bot.Expressions.Properties;
|
||||
using Microsoft.Bot.Schema;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Microsoft.Bot.Builder.Dialogs.Adaptive.Actions
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
// Licensed under the MIT License.
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
|
||||
using Microsoft.Bot.Expressions.Properties;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Microsoft.Bot.Builder.Dialogs.Adaptive.Actions
|
||||
|
|
|
@ -6,7 +6,7 @@ using System.Collections.Generic;
|
|||
using System.Runtime.CompilerServices;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Bot.Expressions;
|
||||
using Microsoft.Bot.Expressions.Properties;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Microsoft.Bot.Builder.Dialogs.Adaptive.Actions
|
||||
|
|
|
@ -2,11 +2,10 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Bot.Expressions;
|
||||
using Microsoft.Bot.Expressions.Properties;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Microsoft.Bot.Builder.Dialogs.Adaptive.Actions
|
||||
|
|
|
@ -7,7 +7,7 @@ using System.Runtime.CompilerServices;
|
|||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Bot.Builder.Dialogs.Adaptive.Templates;
|
||||
using Microsoft.Bot.Expressions;
|
||||
using Microsoft.Bot.Expressions.Properties;
|
||||
using Microsoft.Bot.Schema;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
|
|
@ -3,11 +3,10 @@
|
|||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Bot.Expressions;
|
||||
using Microsoft.Bot.Expressions.Properties;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Microsoft.Bot.Builder.Dialogs.Adaptive.Actions
|
||||
|
|
|
@ -5,8 +5,7 @@ using System;
|
|||
using System.Runtime.CompilerServices;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Bot.Builder.Dialogs.Declarative;
|
||||
using Microsoft.Bot.Expressions;
|
||||
using Microsoft.Bot.Expressions.Properties;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Microsoft.Bot.Builder.Dialogs.Adaptive.Actions
|
||||
|
|
|
@ -5,9 +5,7 @@ using System;
|
|||
using System.Runtime.CompilerServices;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Bot.Builder.Dialogs.Adaptive.Templates;
|
||||
using Microsoft.Bot.Expressions;
|
||||
using Microsoft.Bot.Schema;
|
||||
using Microsoft.Bot.Expressions.Properties;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Microsoft.Bot.Builder.Dialogs.Adaptive.Actions
|
||||
|
|
|
@ -3,11 +3,11 @@
|
|||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Bot.Expressions;
|
||||
using Microsoft.Bot.Expressions.Properties;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Microsoft.Bot.Builder.Dialogs.Adaptive.Actions
|
||||
|
|
|
@ -5,7 +5,7 @@ using System;
|
|||
using System.Runtime.CompilerServices;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Bot.Expressions;
|
||||
using Microsoft.Bot.Expressions.Properties;
|
||||
using Microsoft.Bot.Schema;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ using System.Runtime.CompilerServices;
|
|||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Bot.Builder.Dialogs.Adaptive.Templates;
|
||||
using Microsoft.Bot.Expressions;
|
||||
using Microsoft.Bot.Expressions.Properties;
|
||||
using Microsoft.Bot.Schema;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
using Microsoft.Bot.Builder.AI.Luis;
|
||||
using Microsoft.Bot.Builder.Dialogs.Declarative;
|
||||
|
||||
namespace Microsoft.Bot.Builder.Dialogs.Adaptive
|
||||
|
@ -15,6 +16,7 @@ namespace Microsoft.Bot.Builder.Dialogs.Adaptive
|
|||
public static BotAdapter UseAdaptiveDialogs(this BotAdapter botAdapter)
|
||||
{
|
||||
DeclarativeTypeLoader.AddComponent(new AdaptiveComponentRegistration());
|
||||
DeclarativeTypeLoader.AddComponent(new LuisComponentRegistration());
|
||||
return botAdapter;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,6 +22,7 @@ using Microsoft.Bot.Builder.Dialogs.Declarative.Converters;
|
|||
using Microsoft.Bot.Builder.Dialogs.Declarative.Loaders;
|
||||
using Microsoft.Bot.Builder.Dialogs.Declarative.Resolvers;
|
||||
using Microsoft.Bot.Builder.Dialogs.Declarative.Types;
|
||||
using Microsoft.Bot.Expressions.Properties.Converters;
|
||||
using Newtonsoft.Json;
|
||||
using static Microsoft.Bot.Builder.Dialogs.Adaptive.Actions.EditArray;
|
||||
|
||||
|
@ -107,7 +108,6 @@ namespace Microsoft.Bot.Builder.Dialogs.Adaptive
|
|||
yield return new TypeRegistration<Ask>(Ask.DeclarativeType);
|
||||
|
||||
// Recognizers
|
||||
yield return new TypeRegistration<LuisRecognizer>(LuisRecognizer.DeclarativeType) { CustomDeserializer = new LuisRecognizerLoader(TypeFactory.Configuration) };
|
||||
yield return new TypeRegistration<RegexRecognizer>(RegexRecognizer.DeclarativeType);
|
||||
yield return new TypeRegistration<MultiLanguageRecognizer>(MultiLanguageRecognizer.DeclarativeType);
|
||||
yield return new TypeRegistration<RecognizerSet>(RecognizerSet.DeclarativeType);
|
||||
|
|
|
@ -4,10 +4,10 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Bot.Builder.Dialogs.Declarative.Resources;
|
||||
using Microsoft.Bot.Builder.LanguageGeneration;
|
||||
using Microsoft.Bot.Expressions.Properties;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Microsoft.Bot.Builder.Dialogs.Adaptive.Generators
|
||||
|
|
|
@ -8,7 +8,7 @@ using System.Runtime.CompilerServices;
|
|||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Bot.Builder.Dialogs.Adaptive.Templates;
|
||||
using Microsoft.Bot.Builder.Dialogs.Declarative;
|
||||
using Microsoft.Bot.Expressions.Properties;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Microsoft.Bot.Builder.Dialogs.Adaptive.Actions
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Bot.Expressions.Properties;
|
||||
using Microsoft.Bot.Schema;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
|
|
|
@ -3,15 +3,13 @@
|
|||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Bot.Builder.Dialogs.Choices;
|
||||
using Microsoft.Bot.Builder.Dialogs.Declarative;
|
||||
using Microsoft.Bot.Expressions.Properties;
|
||||
using Microsoft.Bot.Schema;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using static Microsoft.Recognizers.Text.Culture;
|
||||
|
||||
namespace Microsoft.Bot.Builder.Dialogs.Adaptive.Input
|
||||
|
|
|
@ -6,8 +6,7 @@ using System.Collections.Generic;
|
|||
using System.Runtime.CompilerServices;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Bot.Builder.Dialogs.Choices;
|
||||
using Microsoft.Bot.Builder.Dialogs.Declarative;
|
||||
using Microsoft.Bot.Expressions;
|
||||
using Microsoft.Bot.Expressions.Properties;
|
||||
using Microsoft.Bot.Schema;
|
||||
using Microsoft.Recognizers.Text.Choice;
|
||||
using Newtonsoft.Json;
|
||||
|
|
|
@ -5,7 +5,7 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Bot.Expressions;
|
||||
using Microsoft.Bot.Expressions.Properties;
|
||||
using Microsoft.Recognizers.Text.DateTime;
|
||||
using Newtonsoft.Json;
|
||||
using static Microsoft.Recognizers.Text.Culture;
|
||||
|
|
|
@ -3,13 +3,12 @@
|
|||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Bot.Builder.Dialogs.Choices;
|
||||
using Microsoft.Bot.Builder.LanguageGeneration;
|
||||
using Microsoft.Bot.Expressions;
|
||||
using Microsoft.Bot.Expressions.Properties;
|
||||
using Microsoft.Bot.Schema;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
|
|
@ -4,10 +4,9 @@
|
|||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Bot.Expressions;
|
||||
using Microsoft.Bot.Expressions.Properties;
|
||||
using Microsoft.Recognizers.Text.Number;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using static Microsoft.Recognizers.Text.Culture;
|
||||
|
||||
namespace Microsoft.Bot.Builder.Dialogs.Adaptive.Input
|
||||
|
|
|
@ -7,9 +7,8 @@ using System.Linq;
|
|||
using System.Text.RegularExpressions;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Bot.Builder.Dialogs.Adaptive.Templates;
|
||||
using Microsoft.Bot.Connector;
|
||||
using Microsoft.Bot.Expressions;
|
||||
using Microsoft.Bot.Expressions.Properties;
|
||||
using Microsoft.Bot.Schema;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Bot.Expressions;
|
||||
using Microsoft.Bot.Expressions.Properties;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Microsoft.Bot.Builder.Dialogs.Adaptive.Input
|
||||
|
|
|
@ -0,0 +1,40 @@
|
|||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.Bot.Builder.AI.LuisV3;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Microsoft.Bot.Builder.Dialogs.Adaptive.Luis
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines an extension for a list entity.
|
||||
/// </summary>
|
||||
public class DynamicList
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="DynamicList"/> class.
|
||||
/// </summary>
|
||||
public DynamicList()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the name of the list entity to extend.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// The name of the list entity to extend.
|
||||
/// </value>
|
||||
[JsonProperty(PropertyName = "entity")]
|
||||
public string Entity { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the lists to append on the extended list entity.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// The lists to append on the extended list entity.
|
||||
/// </value>
|
||||
[JsonProperty(PropertyName = "list")]
|
||||
public IList<ListElement> List { get; set; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,131 @@
|
|||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net.Http;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Bot.Builder.AI.Luis;
|
||||
using Microsoft.Bot.Expressions.Properties;
|
||||
using Microsoft.Bot.Schema;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Microsoft.Bot.Builder.Dialogs.Adaptive.Recognizers
|
||||
{
|
||||
/// <summary>
|
||||
/// Class that represents an adaptive LUIS recognizer.
|
||||
/// </summary>
|
||||
public class LuisAdaptiveRecognizer : Recognizer
|
||||
{
|
||||
[JsonProperty("$kind")]
|
||||
public const string DeclarativeType = "Microsoft.LuisRecognizer";
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="LuisAdaptiveRecognizer"/> class.
|
||||
/// </summary>
|
||||
public LuisAdaptiveRecognizer()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets LUIS application ID.
|
||||
/// </summary>
|
||||
/// <value>Application ID.</value>
|
||||
[JsonProperty("applicationId")]
|
||||
public StringExpression ApplicationId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets LUIS endpoint like https://westus.api.cognitive.microsoft.com to query.
|
||||
/// </summary>
|
||||
/// <value>LUIS Endpoint.</value>
|
||||
[JsonProperty("endpoint")]
|
||||
public StringExpression Endpoint { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the key used to talk to a LUIS endpoint.
|
||||
/// </summary>
|
||||
/// <value>Endpoint key.</value>
|
||||
[JsonProperty("endpointKey")]
|
||||
public StringExpression EndpointKey { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets an external entity recognizer.
|
||||
/// </summary>
|
||||
/// <remarks>This recognizer is run before calling LUIS and the results are passed to LUIS.</remarks>
|
||||
/// <value>Recognizer.</value>
|
||||
[JsonProperty("externalEntityRecognizer")]
|
||||
public Recognizer ExternalEntityRecognizer { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets an expression or constant LUIS dynamic list.
|
||||
/// </summary>
|
||||
/// <value>Dynamic lists.</value>
|
||||
[JsonProperty("dynamicLists")]
|
||||
public ArrayExpression<Luis.DynamicList> DynamicLists { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets LUIS prediction options.
|
||||
/// </summary>
|
||||
/// <value>Prediction options.</value>
|
||||
[JsonProperty("predictionOptions")]
|
||||
public AI.LuisV3.LuisPredictionOptions PredictionOptions { get; set; } = new AI.LuisV3.LuisPredictionOptions();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets HTTP client handler.
|
||||
/// </summary>
|
||||
/// <value>HTTP client handler.</value>
|
||||
[JsonIgnore]
|
||||
public HttpClientHandler HttpClient { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets <see cref="IBotTelemetryClient"/>.
|
||||
/// </summary>
|
||||
/// <value>Telemetry client.</value>
|
||||
[JsonIgnore]
|
||||
public IBotTelemetryClient TelemetryClient { get; set; } = new NullBotTelemetryClient();
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override async Task<RecognizerResult> RecognizeAsync(DialogContext dialogContext, string text, string locale, CancellationToken cancellationToken = default)
|
||||
{
|
||||
var wrapper = new LuisRecognizer(RecognizerOptions(dialogContext), HttpClient);
|
||||
var context = dialogContext.Context;
|
||||
if (context.Activity == null || context.Activity.Type != ActivityTypes.Message || context.Activity.Text != text || context.Activity.Locale != locale)
|
||||
{
|
||||
throw new ArgumentException("TurnContext is different than text");
|
||||
}
|
||||
|
||||
return await wrapper.RecognizeAsync(dialogContext.Context, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Construct V3 recognizer options from the current dialog context.
|
||||
/// </summary>
|
||||
/// <param name="dialogContext">Context.</param>
|
||||
/// <returns>LUIS Recognizer options.</returns>
|
||||
public LuisRecognizerOptionsV3 RecognizerOptions(DialogContext dialogContext)
|
||||
{
|
||||
var options = PredictionOptions;
|
||||
var dcState = dialogContext.GetState();
|
||||
if (DynamicLists != null)
|
||||
{
|
||||
options = new AI.LuisV3.LuisPredictionOptions(options);
|
||||
var list = new List<AI.LuisV3.DynamicList>();
|
||||
foreach (var listEntity in DynamicLists.GetValue(dcState))
|
||||
{
|
||||
list.Add(new AI.LuisV3.DynamicList(listEntity.Entity, listEntity.List));
|
||||
}
|
||||
|
||||
options.DynamicLists = list;
|
||||
}
|
||||
|
||||
var application = new LuisApplication(ApplicationId.GetValue(dcState), EndpointKey.GetValue(dcState), Endpoint.GetValue(dcState));
|
||||
return new LuisRecognizerOptionsV3(application)
|
||||
{
|
||||
ExternalEntityRecognizer = ExternalEntityRecognizer,
|
||||
PredictionOptions = options,
|
||||
TelemetryClient = TelemetryClient
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.Bot.Builder.Dialogs.Adaptive.Luis;
|
||||
using Microsoft.Bot.Builder.Dialogs.Adaptive.Recognizers;
|
||||
using Microsoft.Bot.Builder.Dialogs.Debugging;
|
||||
using Microsoft.Bot.Builder.Dialogs.Declarative;
|
||||
using Microsoft.Bot.Builder.Dialogs.Declarative.Resolvers;
|
||||
using Microsoft.Bot.Expressions.Properties.Converters;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Microsoft.Bot.Builder.AI.Luis
|
||||
{
|
||||
public class LuisComponentRegistration : ComponentRegistration
|
||||
{
|
||||
public override IEnumerable<TypeRegistration> GetTypes()
|
||||
{
|
||||
yield return new TypeRegistration<LuisAdaptiveRecognizer>(LuisAdaptiveRecognizer.DeclarativeType);
|
||||
}
|
||||
|
||||
public override IEnumerable<JsonConverter> GetConverters(ISourceMap sourceMap, IRefResolver refResolver, Stack<string> paths)
|
||||
{
|
||||
yield return new ArrayExpressionConverter<DynamicList>();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,10 +1,7 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using Microsoft.Bot.Builder.AI.Luis;
|
||||
using Microsoft.Bot.Builder.Dialogs.Adaptive.Templates;
|
||||
using Microsoft.Bot.Builder.Dialogs.Debugging;
|
||||
using Microsoft.Bot.Builder.Dialogs.Declarative;
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
|
||||
using System;
|
||||
using Microsoft.Bot.Builder.Dialogs.Memory;
|
||||
using Microsoft.Recognizers.Text.DateTime.Chinese;
|
||||
|
||||
namespace Microsoft.Bot.Builder.Dialogs
|
||||
{
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
using Microsoft.Bot.Builder.Dialogs.Adaptive.Converters;
|
||||
using Newtonsoft.Json;
|
||||
using Microsoft.Bot.Expressions.Properties;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
namespace Microsoft.Bot.Builder.Dialogs.Adaptive
|
||||
|
|
|
@ -56,10 +56,12 @@
|
|||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Microsoft.Bot.Builder.AI.LUIS\Microsoft.Bot.Builder.AI.Luis.csproj" />
|
||||
<ProjectReference Include="..\Microsoft.Bot.Builder.AI.QnA\Microsoft.Bot.Builder.AI.QnA.csproj" />
|
||||
<ProjectReference Include="..\Microsoft.Bot.Builder.Dialogs\Microsoft.Bot.Builder.Dialogs.csproj" />
|
||||
<ProjectReference Include="..\Microsoft.Bot.Builder.Dialogs.Declarative\Microsoft.Bot.Builder.Dialogs.Declarative.csproj" />
|
||||
<ProjectReference Include="..\Microsoft.Bot.Builder.LanguageGeneration\Microsoft.Bot.Builder.LanguageGeneration.csproj" />
|
||||
<ProjectReference Include="..\Microsoft.Bot.Expressions.Properties\Microsoft.Bot.Expressions.Properties.csproj" />
|
||||
<ProjectReference Include="..\Microsoft.Bot.Expressions\Microsoft.Bot.Expressions.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
|
|
|
@ -2,13 +2,12 @@
|
|||
// Licensed under the MIT License.
|
||||
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.Bot.Builder.Dialogs.Adaptive;
|
||||
using Microsoft.Bot.Builder.Dialogs.Adaptive.Converters;
|
||||
using Microsoft.Bot.Builder.Dialogs.Adaptive.QnA;
|
||||
using Microsoft.Bot.Builder.Dialogs.Adaptive.QnA.Recognizers;
|
||||
using Microsoft.Bot.Builder.Dialogs.Debugging;
|
||||
using Microsoft.Bot.Builder.Dialogs.Declarative;
|
||||
using Microsoft.Bot.Builder.Dialogs.Declarative.Resolvers;
|
||||
using Microsoft.Bot.Expressions.Properties.Converters;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Microsoft.Bot.Builder.AI.QnA
|
||||
|
|
|
@ -3,7 +3,7 @@ using System.Runtime.CompilerServices;
|
|||
using System.Threading.Tasks;
|
||||
using Microsoft.Bot.Builder.AI.QnA;
|
||||
using Microsoft.Bot.Builder.AI.QnA.Dialogs;
|
||||
using Microsoft.Bot.Expressions;
|
||||
using Microsoft.Bot.Expressions.Properties;
|
||||
using Microsoft.Bot.Schema;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@ using System.Net.Http;
|
|||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Bot.Builder.AI.QnA;
|
||||
using Microsoft.Bot.Expressions.Properties;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
},
|
||||
"disabled": {
|
||||
"$role": "expression",
|
||||
"type": [ "boolean", "string"],
|
||||
"type": "boolean",
|
||||
"title": "Disabled",
|
||||
"description": "Optional condition which if true will disable this action.",
|
||||
"examples": [
|
||||
|
@ -22,7 +22,7 @@
|
|||
"dialog": {
|
||||
"$kind": "Microsoft.IDialog",
|
||||
"$role": "expression",
|
||||
"type": ["string", "object"],
|
||||
"type": "object",
|
||||
"title": "Dialog name",
|
||||
"description": "Name of the dialog to call.",
|
||||
"examples": [
|
||||
|
@ -31,7 +31,7 @@
|
|||
},
|
||||
"options": {
|
||||
"$role": "expression",
|
||||
"type": [ "string", "object" ],
|
||||
"type": "object",
|
||||
"title": "Options",
|
||||
"description": "One or more options that are passed to the dialog that is called.",
|
||||
"additionalProperties": {
|
||||
|
@ -41,7 +41,7 @@
|
|||
},
|
||||
"activityProcessed": {
|
||||
"$role": "expression",
|
||||
"type": [ "boolean", "string" ],
|
||||
"type": "boolean",
|
||||
"title": "Activity Processed",
|
||||
"description": "When set to false, the dialog that is called can process the current activity.",
|
||||
"default": true
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
},
|
||||
"disabled": {
|
||||
"$role": "expression",
|
||||
"type": [ "boolean", "string" ],
|
||||
"type": "boolean",
|
||||
"title": "Disabled",
|
||||
"description": "Optional condition which if true will disable this action.",
|
||||
"examples": [
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
},
|
||||
"disabled": {
|
||||
"$role": "expression",
|
||||
"type": [ "boolean", "string" ],
|
||||
"type": "boolean",
|
||||
"title": "Disabled",
|
||||
"description": "Optional condition which if true will disable this action.",
|
||||
"examples": [
|
||||
|
@ -27,7 +27,14 @@
|
|||
},
|
||||
"eventValue": {
|
||||
"$role": "expression",
|
||||
"type": [ "object", "array", "number", "integer", "boolean", "string" ],
|
||||
"type": [
|
||||
"object",
|
||||
"array",
|
||||
"number",
|
||||
"integer",
|
||||
"boolean",
|
||||
"string"
|
||||
],
|
||||
"title": "Event value",
|
||||
"description": "Value to emit with the event (optional).",
|
||||
"additionalProperties": true
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
},
|
||||
"disabled": {
|
||||
"$role": "expression",
|
||||
"type": [ "boolean", "string" ],
|
||||
"type": "boolean",
|
||||
"title": "Disabled",
|
||||
"description": "Optional condition which if true will disable this action.",
|
||||
"examples": [
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
},
|
||||
"disabled": {
|
||||
"$role": "expression",
|
||||
"type": [ "boolean", "string" ],
|
||||
"type": "boolean",
|
||||
"title": "Disabled",
|
||||
"description": "Optional condition which if true will disable this action.",
|
||||
"examples": [
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
},
|
||||
"disabled": {
|
||||
"$role": "expression",
|
||||
"type": [ "boolean", "string" ],
|
||||
"type": "boolean",
|
||||
"title": "Disabled",
|
||||
"description": "Optional condition which if true will disable this action.",
|
||||
"examples": [
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
},
|
||||
"disabled": {
|
||||
"$role": "expression",
|
||||
"type": [ "boolean", "string" ],
|
||||
"type": "boolean",
|
||||
"title": "Disabled",
|
||||
"description": "Optional condition which if true will disable this action.",
|
||||
"examples": [
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
},
|
||||
"disabled": {
|
||||
"$role": "expression",
|
||||
"type": [ "boolean", "string" ],
|
||||
"type": "boolean",
|
||||
"title": "Disabled",
|
||||
"description": "Optional condition which if true will disable this action.",
|
||||
"examples": [
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
},
|
||||
"disabled": {
|
||||
"$role": "expression",
|
||||
"type": [ "boolean", "string" ],
|
||||
"type": "boolean",
|
||||
"title": "Disabled",
|
||||
"description": "Optional condition which if true will disable this action.",
|
||||
"examples": [
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
},
|
||||
"disabled": {
|
||||
"$role": "expression",
|
||||
"type": [ "boolean", "string" ],
|
||||
"type": "boolean",
|
||||
"title": "Disabled",
|
||||
"description": "Optional condition which if true will disable this action.",
|
||||
"examples": [
|
||||
|
@ -50,7 +50,14 @@
|
|||
},
|
||||
"value": {
|
||||
"$role": "expression",
|
||||
"type": [ "object", "array", "number", "integer", "boolean", "string" ],
|
||||
"type": [
|
||||
"object",
|
||||
"array",
|
||||
"number",
|
||||
"integer",
|
||||
"boolean",
|
||||
"string"
|
||||
],
|
||||
"title": "Value",
|
||||
"description": "New value or expression.",
|
||||
"examples": [
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
},
|
||||
"disabled": {
|
||||
"$role": "expression",
|
||||
"type": [ "boolean", "string" ],
|
||||
"type": "boolean",
|
||||
"title": "Disabled",
|
||||
"description": "Optional condition which if true will disable this action.",
|
||||
"examples": [
|
||||
|
@ -44,13 +44,20 @@
|
|||
},
|
||||
"eventValue": {
|
||||
"$role": "expression",
|
||||
"type": [ "object", "array", "number", "integer", "boolean", "string" ],
|
||||
"type": [
|
||||
"object",
|
||||
"array",
|
||||
"number",
|
||||
"integer",
|
||||
"boolean",
|
||||
"string"
|
||||
],
|
||||
"title": "Event value",
|
||||
"description": "Value to emit with the event (optional)."
|
||||
},
|
||||
"bubbleEvent": {
|
||||
"$role": "expression",
|
||||
"type": [ "boolean", "string" ],
|
||||
"type": "boolean",
|
||||
"title": "Bubble event",
|
||||
"description": "If true this event is passed on to parent dialogs.",
|
||||
"default": false
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
},
|
||||
"disabled": {
|
||||
"$role": "expression",
|
||||
"type": [ "boolean", "string" ],
|
||||
"type": "boolean",
|
||||
"title": "Disabled",
|
||||
"description": "Optional condition which if true will disable this action.",
|
||||
"examples": [
|
||||
|
@ -21,7 +21,14 @@
|
|||
},
|
||||
"value": {
|
||||
"$role": "expression",
|
||||
"type": [ "object", "array", "number", "integer", "boolean", "string" ],
|
||||
"type": [
|
||||
"object",
|
||||
"array",
|
||||
"number",
|
||||
"integer",
|
||||
"boolean",
|
||||
"string"
|
||||
],
|
||||
"title": "Value",
|
||||
"description": "Result value returned to the parent dialog.",
|
||||
"examples": [
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
},
|
||||
"disabled": {
|
||||
"$role": "expression",
|
||||
"type": [ "boolean", "string" ],
|
||||
"type": "boolean",
|
||||
"title": "Disabled",
|
||||
"description": "Optional condition which if true will disable this action.",
|
||||
"examples": [
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
},
|
||||
"disabled": {
|
||||
"$role": "expression",
|
||||
"type": [ "boolean", "string" ],
|
||||
"type": "boolean",
|
||||
"title": "Disabled",
|
||||
"description": "Optional condition which if true will disable this action.",
|
||||
"examples": [
|
||||
|
@ -21,7 +21,7 @@
|
|||
},
|
||||
"itemsProperty": {
|
||||
"$role": "expression",
|
||||
"type": [ "string" ],
|
||||
"type": "string",
|
||||
"title": "Items property",
|
||||
"description": "Property that holds the array.",
|
||||
"examples": [
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
},
|
||||
"disabled": {
|
||||
"$role": "expression",
|
||||
"type": [ "boolean", "string" ],
|
||||
"type": "boolean",
|
||||
"title": "Disabled",
|
||||
"description": "Optional condition which if true will disable this action.",
|
||||
"examples": [
|
||||
|
@ -38,7 +38,7 @@
|
|||
},
|
||||
"pageSize": {
|
||||
"$role": "expression",
|
||||
"type": [ "integer", "string" ],
|
||||
"type": "integer",
|
||||
"title": "Page size",
|
||||
"description": "Number of items in each page.",
|
||||
"default": 10
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
},
|
||||
"disabled": {
|
||||
"$role": "expression",
|
||||
"type": [ "boolean", "string" ],
|
||||
"type": "boolean",
|
||||
"title": "Disabled",
|
||||
"description": "Optional condition which if true will disable this action.",
|
||||
"examples": [
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
},
|
||||
"disabled": {
|
||||
"$role": "expression",
|
||||
"type": [ "boolean", "string" ],
|
||||
"type": "boolean",
|
||||
"title": "Disabled",
|
||||
"description": "Optional condition which if true will disable this action.",
|
||||
"examples": [
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
},
|
||||
"disabled": {
|
||||
"$role": "expression",
|
||||
"type": [ "boolean", "string" ],
|
||||
"type": "boolean",
|
||||
"title": "Disabled",
|
||||
"description": "Optional condition which if true will disable this action.",
|
||||
"examples": [
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
},
|
||||
"disabled": {
|
||||
"$role": "expression",
|
||||
"type": [ "boolean", "string" ],
|
||||
"type": "boolean",
|
||||
"title": "Disabled",
|
||||
"description": "Optional condition which if true will disable this action.",
|
||||
"examples": [
|
||||
|
@ -50,7 +50,14 @@
|
|||
},
|
||||
"body": {
|
||||
"$role": "expression",
|
||||
"type": [ "object", "array", "number", "integer", "boolean", "string" ],
|
||||
"type": [
|
||||
"object",
|
||||
"array",
|
||||
"number",
|
||||
"integer",
|
||||
"boolean",
|
||||
"string"
|
||||
],
|
||||
"title": "Body",
|
||||
"description": "Body to include in the HTTP call (supports data binding).",
|
||||
"additionalProperties": true
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
},
|
||||
"condition": {
|
||||
"$role": "expression",
|
||||
"type": [ "boolean", "string" ],
|
||||
"type": "boolean",
|
||||
"title": "Condition",
|
||||
"description": "Expression to evaluate.",
|
||||
"examples": [
|
||||
|
@ -25,7 +25,7 @@
|
|||
},
|
||||
"disabled": {
|
||||
"$role": "expression",
|
||||
"type": [ "boolean", "string" ],
|
||||
"type": "boolean",
|
||||
"title": "Disabled",
|
||||
"description": "Optional condition which if true will disable this action.",
|
||||
"examples": [
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
},
|
||||
"disabled": {
|
||||
"$role": "expression",
|
||||
"type": [ "boolean", "string" ],
|
||||
"type": "boolean",
|
||||
"title": "Disabled",
|
||||
"description": "Optional condition which if true will disable this action.",
|
||||
"examples": [
|
||||
|
@ -36,7 +36,7 @@
|
|||
},
|
||||
"traceActivity": {
|
||||
"$role": "expression",
|
||||
"type": [ "boolean", "string" ],
|
||||
"type": "boolean",
|
||||
"title": "Send Trace Activity",
|
||||
"description": "If true, automatically sends a TraceActivity (view in Bot Framework Emulator).",
|
||||
"default": false
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
},
|
||||
"disabled": {
|
||||
"$role": "expression",
|
||||
"type": [ "boolean", "string" ],
|
||||
"type": "boolean",
|
||||
"title": "Disabled",
|
||||
"description": "Optional condition which if true will disable this action.",
|
||||
"examples": [
|
||||
|
@ -21,7 +21,7 @@
|
|||
},
|
||||
"options": {
|
||||
"$role": "expression",
|
||||
"type": [ "string", "object" ],
|
||||
"type": "object",
|
||||
"title": "Options",
|
||||
"description": "One or more options that are passed to the dialog that is called.",
|
||||
"additionalProperties": {
|
||||
|
@ -31,7 +31,7 @@
|
|||
},
|
||||
"activityProcessed": {
|
||||
"$role": "expression",
|
||||
"type": [ "boolean", "string" ],
|
||||
"type": "boolean",
|
||||
"title": "Activity Processed",
|
||||
"description": "When set to false, the dialog that is called can process the current activity.",
|
||||
"default": true
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
},
|
||||
"disabled": {
|
||||
"$role": "expression",
|
||||
"type": [ "boolean", "string" ],
|
||||
"type": "boolean",
|
||||
"title": "Disabled",
|
||||
"description": "Optional condition which if true will disable this action.",
|
||||
"examples": [
|
||||
|
@ -22,7 +22,7 @@
|
|||
"dialog": {
|
||||
"$kind": "Microsoft.IDialog",
|
||||
"$role": "expression",
|
||||
"type": ["string", "object"],
|
||||
"type": "string",
|
||||
"title": "Dialog name",
|
||||
"description": "Name of the dialog to call.",
|
||||
"examples": [
|
||||
|
@ -31,7 +31,7 @@
|
|||
},
|
||||
"options": {
|
||||
"$role": "expression",
|
||||
"type": [ "string", "object" ],
|
||||
"type": "object",
|
||||
"title": "Options",
|
||||
"description": "One or more options that are passed to the dialog that is called.",
|
||||
"additionalProperties": {
|
||||
|
@ -41,7 +41,7 @@
|
|||
},
|
||||
"activityProcessed": {
|
||||
"$role": "expression",
|
||||
"type": [ "boolean", "string" ],
|
||||
"type": "boolean",
|
||||
"title": "Activity Processed",
|
||||
"description": "When set to false, the dialog that is called can process the current activity.",
|
||||
"default": true
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
},
|
||||
"disabled": {
|
||||
"$role": "expression",
|
||||
"type": [ "boolean", "string" ],
|
||||
"type": "boolean",
|
||||
"title": "Disabled",
|
||||
"description": "Optional condition which if true will disable this action.",
|
||||
"examples": [
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
},
|
||||
"disabled": {
|
||||
"$role": "expression",
|
||||
"type": [ "boolean", "string" ],
|
||||
"type": "boolean",
|
||||
"title": "Disabled",
|
||||
"description": "Optional condition which if true will disable this action.",
|
||||
"examples": [
|
||||
|
@ -40,7 +40,14 @@
|
|||
},
|
||||
"value": {
|
||||
"$role": "expression",
|
||||
"type": [ "object", "array", "number", "integer", "boolean", "string" ],
|
||||
"type": [
|
||||
"object",
|
||||
"array",
|
||||
"number",
|
||||
"integer",
|
||||
"boolean",
|
||||
"string"
|
||||
],
|
||||
"title": "Value",
|
||||
"description": "New value or expression.",
|
||||
"examples": [
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
},
|
||||
"disabled": {
|
||||
"$role": "expression",
|
||||
"type": [ "boolean", "string" ],
|
||||
"type": "boolean",
|
||||
"title": "Disabled",
|
||||
"description": "Optional condition which if true will disable this action.",
|
||||
"examples": [
|
||||
|
@ -34,7 +34,14 @@
|
|||
},
|
||||
"value": {
|
||||
"$role": "expression",
|
||||
"type": [ "object", "array", "number", "integer", "boolean", "string" ],
|
||||
"type": [
|
||||
"object",
|
||||
"array",
|
||||
"number",
|
||||
"integer",
|
||||
"boolean",
|
||||
"string"
|
||||
],
|
||||
"title": "Value",
|
||||
"description": "New value or expression.",
|
||||
"examples": [
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
},
|
||||
"disabled": {
|
||||
"$role": "expression",
|
||||
"type": [ "boolean", "string" ],
|
||||
"type": "boolean",
|
||||
"title": "Disabled",
|
||||
"description": "Optional condition which if true will disable this action.",
|
||||
"examples": [
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
},
|
||||
"disabled": {
|
||||
"$role": "expression",
|
||||
"type": [ "boolean", "string" ],
|
||||
"type": "boolean",
|
||||
"title": "Disabled",
|
||||
"description": "Optional condition which if true will disable this action.",
|
||||
"examples": [
|
||||
|
@ -40,7 +40,12 @@
|
|||
"properties": {
|
||||
"value": {
|
||||
"$role": "expression",
|
||||
"type": [ "number", "integer", "boolean", "string" ],
|
||||
"type": [
|
||||
"number",
|
||||
"integer",
|
||||
"boolean",
|
||||
"string"
|
||||
],
|
||||
"title": "Value",
|
||||
"description": "Value.",
|
||||
"examples": [
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
},
|
||||
"disabled": {
|
||||
"$role": "expression",
|
||||
"type": [ "boolean", "string" ],
|
||||
"type": "boolean",
|
||||
"title": "Disabled",
|
||||
"description": "Optional condition which if true will disable this action.",
|
||||
"examples": [
|
||||
|
@ -39,7 +39,14 @@
|
|||
},
|
||||
"value": {
|
||||
"$role": "expression",
|
||||
"type": [ "object", "array", "number", "integer", "boolean", "string" ],
|
||||
"type": [
|
||||
"object",
|
||||
"array",
|
||||
"number",
|
||||
"integer",
|
||||
"boolean",
|
||||
"string"
|
||||
],
|
||||
"title": "Value",
|
||||
"description": "Property that holds the value to send as trace activity."
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
},
|
||||
"disabled": {
|
||||
"$role": "expression",
|
||||
"type": [ "boolean", "string" ],
|
||||
"type": "boolean",
|
||||
"title": "Disabled",
|
||||
"description": "Optional condition which if true will disable this action.",
|
||||
"examples": [
|
||||
|
|
|
@ -14,19 +14,12 @@
|
|||
"$role": "expression",
|
||||
"title": "Expected Properties",
|
||||
"description": "Properties expected to be filled by entities from the user",
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,10 +22,8 @@
|
|||
"default": "value"
|
||||
},
|
||||
"choices": {
|
||||
"anyOf": [
|
||||
{
|
||||
"$role": "expression"
|
||||
},
|
||||
"$role": "expression",
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "array",
|
||||
"items": [
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
},
|
||||
"disabled": {
|
||||
"$role": "expression",
|
||||
"type": [ "boolean", "string" ],
|
||||
"type": "boolean",
|
||||
"title": "Disabled",
|
||||
"description": "Optional condition which if true will disable this action.",
|
||||
"examples": [
|
||||
|
@ -43,7 +43,7 @@
|
|||
},
|
||||
"timeout": {
|
||||
"$role": "expression",
|
||||
"type": [ "integer", "string" ],
|
||||
"type": "integer",
|
||||
"title": "Timeout",
|
||||
"description": "Time out setting for the OAuth signin card.",
|
||||
"default": "900000"
|
||||
|
@ -75,7 +75,7 @@
|
|||
},
|
||||
"maxTurnCount": {
|
||||
"$role": "expression",
|
||||
"type": [ "integer", "string" ],
|
||||
"type": "integer",
|
||||
"title": "Max turn count",
|
||||
"description": "Maximum number of re-prompt attempts to collect information.",
|
||||
"default": 3,
|
||||
|
@ -85,7 +85,14 @@
|
|||
},
|
||||
"defaultValue": {
|
||||
"$role": "expression",
|
||||
"type": [ "object", "array", "number", "integer", "boolean", "string" ],
|
||||
"type": [
|
||||
"object",
|
||||
"array",
|
||||
"number",
|
||||
"integer",
|
||||
"boolean",
|
||||
"string"
|
||||
],
|
||||
"title": "Default value",
|
||||
"description": "Expression to examine on each turn of the conversation as possible value to the property.",
|
||||
"examples": [
|
||||
|
@ -94,7 +101,7 @@
|
|||
},
|
||||
"allowInterruptions": {
|
||||
"$role": "expression",
|
||||
"type": [ "boolean", "string" ],
|
||||
"type": "boolean",
|
||||
"title": "Allow Interruptions",
|
||||
"description": "A boolean expression that determines whether the parent should be allowed to interrupt the input.",
|
||||
"default": "true",
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
},
|
||||
"threshold": {
|
||||
"$role": "expression",
|
||||
"type": [ "number", "string" ],
|
||||
"type": "number",
|
||||
"title": "Threshold",
|
||||
"description": "Threshold score to filter results.",
|
||||
"default": 0.3
|
||||
|
@ -65,7 +65,7 @@
|
|||
},
|
||||
"strictFilters": {
|
||||
"$role": "expression",
|
||||
"type": [ "array", "string" ],
|
||||
"type": "array",
|
||||
"title": "Strict Filters",
|
||||
"description": "Metadata filters to use when calling the QnA Maker KB.",
|
||||
"items": {
|
||||
|
@ -86,7 +86,7 @@
|
|||
},
|
||||
"top": {
|
||||
"$role": "expression",
|
||||
"type": [ "number", "string" ],
|
||||
"type": "number",
|
||||
"title": "Top",
|
||||
"description": "The number of answers you want to retrieve.",
|
||||
"default": 3
|
||||
|
|
|
@ -29,6 +29,52 @@
|
|||
"description": "LUIS prediction key used to call endpoint.",
|
||||
"$role": "expression"
|
||||
},
|
||||
"externalEntityRecognizer": {
|
||||
"title": "External Entity Recognizer",
|
||||
"description": "Entities recognized by this recognizer will be passed to LUIS as external entities.",
|
||||
"$kind": "Microsoft.Recognizer"
|
||||
},
|
||||
"dynamicLists": {
|
||||
"$role": "expression",
|
||||
"title": "Dynamic lists",
|
||||
"description": "Runtime defined entity lists.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"title": "Entity list",
|
||||
"description": "Lists of canonical values and synonyms for an entity.",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"entity": {
|
||||
"title": "Entity",
|
||||
"description": "Entity to extend with a dynamic list.",
|
||||
"type": "string"
|
||||
},
|
||||
"list": {
|
||||
"title": "Dynamic list",
|
||||
"description": "List of canonical forms and synonyms.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"canonicalForm": {
|
||||
"title": "Canonical form",
|
||||
"description": "Resolution if any synonym matches.",
|
||||
"type": "string"
|
||||
},
|
||||
"synonyms": {
|
||||
"title": "Synonyms",
|
||||
"description": "List of synonyms for a canonical form.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"predictionOptions": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
|
|
@ -12,18 +12,21 @@
|
|||
},
|
||||
"knowledgeBaseId": {
|
||||
"$role": "expression",
|
||||
"type": "string",
|
||||
"title": "KnowledgeBase Id",
|
||||
"description": "KnowledgeBase Id of your QnA Maker KnowledgeBase.",
|
||||
"default": "settings.qna.knowledgebaseid"
|
||||
},
|
||||
"endpointKey": {
|
||||
"$role": "expression",
|
||||
"type": "string",
|
||||
"title": "Endpoint Key",
|
||||
"description": "Endpoint key for the QnA Maker KB.",
|
||||
"default": "settings.qna.endpointkey"
|
||||
},
|
||||
"hostname": {
|
||||
"$role": "expression",
|
||||
"type": "string",
|
||||
"title": "Hostname",
|
||||
"description": "Hostname for your QnA Maker service.",
|
||||
"default": "settings.qna.hostname",
|
||||
|
|
|
@ -6,7 +6,8 @@
|
|||
"type": "object",
|
||||
"properties": {
|
||||
"condition": {
|
||||
"$role": "expression"
|
||||
"$role": "expression",
|
||||
"type": "boolean"
|
||||
},
|
||||
"ifTrue": {
|
||||
"$kind": "Microsoft.ITriggerSelector"
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче