Merge branch 'master' into fix/set-stylecop-warnings-as-error
This commit is contained in:
Коммит
7c341354c0
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -25,7 +25,7 @@ namespace Microsoft.Bot.Builder.FunctionalTests
|
|||
GetEnvironmentVars();
|
||||
|
||||
echoGuid = Guid.NewGuid().ToString();
|
||||
input = input + echoGuid;
|
||||
input += echoGuid;
|
||||
|
||||
var botAnswer = await StartBotConversationAsync();
|
||||
|
||||
|
@ -39,13 +39,13 @@ namespace Microsoft.Bot.Builder.FunctionalTests
|
|||
private static async Task<string> StartBotConversationAsync()
|
||||
{
|
||||
// Create a new Direct Line client.
|
||||
DirectLineClient client = new DirectLineClient(directLineSecret);
|
||||
var client = new DirectLineClient(directLineSecret);
|
||||
|
||||
// Start the conversation.
|
||||
var conversation = await client.Conversations.StartConversationAsync();
|
||||
|
||||
// Create a message activity with the input text.
|
||||
Activity userMessage = new Activity
|
||||
var userMessage = new Activity
|
||||
{
|
||||
From = new ChannelAccount(fromUser),
|
||||
Text = input,
|
||||
|
@ -70,7 +70,7 @@ namespace Microsoft.Bot.Builder.FunctionalTests
|
|||
private static async Task<string> ReadBotMessagesAsync(DirectLineClient client, string conversationId)
|
||||
{
|
||||
string watermark = null;
|
||||
string answer = string.Empty;
|
||||
var answer = string.Empty;
|
||||
|
||||
// Poll the bot for replies once per second.
|
||||
while (answer.Equals(string.Empty))
|
||||
|
@ -85,7 +85,7 @@ namespace Microsoft.Bot.Builder.FunctionalTests
|
|||
select x;
|
||||
|
||||
// Analyze each activity in the activity set.
|
||||
foreach (Activity activity in activities)
|
||||
foreach (var activity in activities)
|
||||
{
|
||||
if (activity.Type == ActivityTypes.Message && activity.Text != "Welcome to Echo Bot.")
|
||||
{
|
||||
|
|
|
@ -1,32 +0,0 @@
|
|||
@echo off
|
||||
rem Service tests run against recorded HTTP oracles.
|
||||
rem If you rerun against the service and generate <test>.json.new files, this batch file will allow you to review them and if they are OK
|
||||
rem replace <test>.json with <test>.json.new.
|
||||
setlocal EnableDelayedExpansion
|
||||
if "%DIFF%" == "" (
|
||||
where odd.exe /q
|
||||
if %errorlevel% equ 0 (
|
||||
set DIFF=odd.exe
|
||||
) else (
|
||||
set DIFF=windiff.exe
|
||||
)
|
||||
)
|
||||
for %%f in (*.new) do (
|
||||
echo.
|
||||
%DIFF% %%~nf %%f
|
||||
set correct=
|
||||
set /p correct=Is %%f correct [ynq]?
|
||||
echo !correct!
|
||||
if !correct! == y (
|
||||
echo Switching to new version
|
||||
move %%f %%~nf
|
||||
) else (
|
||||
if !correct! == n (
|
||||
echo Keeping old version
|
||||
) else (
|
||||
goto done
|
||||
)
|
||||
)
|
||||
)
|
||||
:done
|
||||
endlocal
|
|
@ -299,8 +299,6 @@ Global
|
|||
{76391566-9F22-4994-8B0F-02EFC0E9E228}.Debug - NuGet Packages|Any CPU.Build.0 = Debug|Any CPU
|
||||
{76391566-9F22-4994-8B0F-02EFC0E9E228}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{76391566-9F22-4994-8B0F-02EFC0E9E228}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{76391566-9F22-4994-8B0F-02EFC0E9E228}.Documentation|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{76391566-9F22-4994-8B0F-02EFC0E9E228}.Documentation|Any CPU.Build.0 = Debug|Any CPU
|
||||
{76391566-9F22-4994-8B0F-02EFC0E9E228}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{76391566-9F22-4994-8B0F-02EFC0E9E228}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Microsoft.Bot.Builder.AI.Luis
|
||||
{
|
||||
/// <summary>
|
||||
|
|
|
@ -0,0 +1,57 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Microsoft.Bot.Builder.AI.Luis
|
||||
{
|
||||
/// <summary>
|
||||
/// Strongly typed LUIS builtin GeographyV2.
|
||||
/// </summary>
|
||||
public class GeographyV2
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="GeographyV2"/> class.
|
||||
/// </summary>
|
||||
/// <param name="type">Type of geographic location from <see cref="Types"/>.</param>
|
||||
/// <param name="location">Geographic location.</param>
|
||||
public GeographyV2(string type, string location)
|
||||
{
|
||||
Type = type;
|
||||
Location = location;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets type of geographic location.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// Type of geographic location from <see cref="Types"/>.
|
||||
/// </value>
|
||||
[JsonProperty("type")]
|
||||
public string Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets geographic location.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// Geographic location.
|
||||
/// </value>
|
||||
[JsonProperty("location")]
|
||||
public string Location { get; set; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override string ToString() => $"GeographyV2({Type}, {Location})";
|
||||
|
||||
/// <summary>
|
||||
/// Different types of geographic locations.
|
||||
/// </summary>
|
||||
public static class Types
|
||||
{
|
||||
public const string POI = "poi";
|
||||
public const string City = "city";
|
||||
public const string CountryRegion = "countryRegion";
|
||||
public const string Continent = "continent";
|
||||
public const string State = "state";
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,55 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Microsoft.Bot.Builder.AI.Luis
|
||||
{
|
||||
/// <summary>
|
||||
/// Strongly typed LUIS builtin OrdinalV2.
|
||||
/// </summary>
|
||||
public class OrdinalV2
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="OrdinalV2"/> class.
|
||||
/// </summary>
|
||||
/// <param name="offset">Offset from <see cref="RelativeTo"/>.</param>
|
||||
/// <param name="relativeTo">Position that anchors offset.</param>
|
||||
public OrdinalV2(string relativeTo, long offset)
|
||||
{
|
||||
RelativeTo = relativeTo;
|
||||
Offset = offset;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the anchor for the offset.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// The base position in a sequence one of <see cref="Anchor"/>.
|
||||
/// </value>
|
||||
[JsonProperty("relativeTo")]
|
||||
public string RelativeTo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the offset in the sequence with respect to <see cref="RelativeTo"/>.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// Offset in sequence relative to <see cref="RelativeTo"/>.
|
||||
/// </value>
|
||||
[JsonProperty("offset")]
|
||||
public long Offset { get; set; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override string ToString() => $"OrdinalV2({RelativeTo}, {Offset})";
|
||||
|
||||
/// <summary>
|
||||
/// Possible anchors for offsets.
|
||||
/// </summary>
|
||||
public static class Anchor
|
||||
{
|
||||
public const string Current = "current";
|
||||
public const string End = "end";
|
||||
public const string Start = "start";
|
||||
}
|
||||
}
|
||||
}
|
|
@ -123,7 +123,7 @@ namespace Microsoft.Bot.Builder.AI.Luis
|
|||
}
|
||||
|
||||
string topIntent = null;
|
||||
double topScore = -1.0;
|
||||
var topScore = -1.0;
|
||||
if (results.Intents.Count > 0)
|
||||
{
|
||||
foreach (var intent in results.Intents)
|
||||
|
@ -189,10 +189,8 @@ namespace Microsoft.Bot.Builder.AI.Luis
|
|||
/// <param name="telemetryMetrics">Additional metrics to be logged to telemetry with the LuisResult event.</param>
|
||||
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
|
||||
/// <returns>The LUIS results of the analysis of the current message text in the current turn's context activity.</returns>
|
||||
public virtual async Task<RecognizerResult> RecognizeAsync(ITurnContext turnContext, Dictionary<string, string> telemetryProperties, Dictionary<string, double> telemetryMetrics = null, CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
return await RecognizeInternalAsync(turnContext, null, telemetryProperties, telemetryMetrics, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
public virtual async Task<RecognizerResult> RecognizeAsync(ITurnContext turnContext, Dictionary<string, string> telemetryProperties, Dictionary<string, double> telemetryMetrics = null, CancellationToken cancellationToken = default)
|
||||
=> await RecognizeInternalAsync(turnContext, null, telemetryProperties, telemetryMetrics, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
/// <summary>
|
||||
/// Return results of the analysis (Suggested actions and intents).
|
||||
|
@ -204,10 +202,8 @@ namespace Microsoft.Bot.Builder.AI.Luis
|
|||
/// <param name="telemetryMetrics">Additional metrics to be logged to telemetry with the LuisResult event.</param>
|
||||
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
|
||||
/// <returns>The LUIS results of the analysis of the current message text in the current turn's context activity.</returns>
|
||||
public virtual async Task<RecognizerResult> RecognizeAsync(ITurnContext turnContext, LuisPredictionOptions predictionOptions, Dictionary<string, string> telemetryProperties, Dictionary<string, double> telemetryMetrics = null, CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
return await RecognizeInternalAsync(turnContext, predictionOptions, telemetryProperties, telemetryMetrics, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
public virtual async Task<RecognizerResult> RecognizeAsync(ITurnContext turnContext, LuisPredictionOptions predictionOptions, Dictionary<string, string> telemetryProperties, Dictionary<string, double> telemetryMetrics = null, CancellationToken cancellationToken = default)
|
||||
=> await RecognizeInternalAsync(turnContext, predictionOptions, telemetryProperties, telemetryMetrics, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
/// <summary>
|
||||
/// Return results of the analysis (Suggested actions and intents).
|
||||
|
@ -218,7 +214,7 @@ namespace Microsoft.Bot.Builder.AI.Luis
|
|||
/// <param name="telemetryMetrics">Additional metrics to be logged to telemetry with the LuisResult event.</param>
|
||||
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
|
||||
/// <returns>The LUIS results of the analysis of the current message text in the current turn's context activity.</returns>
|
||||
public virtual async Task<T> RecognizeAsync<T>(ITurnContext turnContext, Dictionary<string, string> telemetryProperties, Dictionary<string, double> telemetryMetrics = null, CancellationToken cancellationToken = default(CancellationToken))
|
||||
public virtual async Task<T> RecognizeAsync<T>(ITurnContext turnContext, Dictionary<string, string> telemetryProperties, Dictionary<string, double> telemetryMetrics = null, CancellationToken cancellationToken = default)
|
||||
where T : IRecognizerConvert, new()
|
||||
{
|
||||
var result = new T();
|
||||
|
@ -237,7 +233,7 @@ namespace Microsoft.Bot.Builder.AI.Luis
|
|||
/// <param name="telemetryMetrics">Additional metrics to be logged to telemetry with the LuisResult event.</param>
|
||||
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
|
||||
/// <returns>The LUIS results of the analysis of the current message text in the current turn's context activity.</returns>
|
||||
public virtual async Task<T> RecognizeAsync<T>(ITurnContext turnContext, LuisPredictionOptions predictionOptions, Dictionary<string, string> telemetryProperties, Dictionary<string, double> telemetryMetrics = null, CancellationToken cancellationToken = default(CancellationToken))
|
||||
public virtual async Task<T> RecognizeAsync<T>(ITurnContext turnContext, LuisPredictionOptions predictionOptions, Dictionary<string, string> telemetryProperties, Dictionary<string, double> telemetryMetrics = null, CancellationToken cancellationToken = default)
|
||||
where T : IRecognizerConvert, new()
|
||||
{
|
||||
var result = new T();
|
||||
|
@ -254,7 +250,7 @@ namespace Microsoft.Bot.Builder.AI.Luis
|
|||
/// <param name="telemetryMetrics">Additional metrics to be logged to telemetry with the LuisResult event.</param>
|
||||
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
|
||||
/// <returns><see cref="Task"/>.</returns>
|
||||
protected virtual async Task OnRecognizerResultAsync(RecognizerResult recognizerResult, ITurnContext turnContext, Dictionary<string, string> telemetryProperties = null, Dictionary<string, double> telemetryMetrics = null, CancellationToken cancellationToken = default(CancellationToken))
|
||||
protected virtual async Task OnRecognizerResultAsync(RecognizerResult recognizerResult, ITurnContext turnContext, Dictionary<string, string> telemetryProperties = null, Dictionary<string, double> telemetryMetrics = null, CancellationToken cancellationToken = default)
|
||||
{
|
||||
var properties = await FillLuisEventPropertiesAsync(recognizerResult, turnContext, telemetryProperties, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
|
@ -272,7 +268,7 @@ namespace Microsoft.Bot.Builder.AI.Luis
|
|||
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
|
||||
/// additionalProperties
|
||||
/// <returns>A dictionary that is sent as "Properties" to IBotTelemetryClient.TrackEvent method for the BotMessageSend event.</returns>
|
||||
protected Task<Dictionary<string, string>> FillLuisEventPropertiesAsync(RecognizerResult recognizerResult, ITurnContext turnContext, Dictionary<string, string> telemetryProperties = null, CancellationToken cancellationToken = default(CancellationToken))
|
||||
protected Task<Dictionary<string, string>> FillLuisEventPropertiesAsync(RecognizerResult recognizerResult, ITurnContext turnContext, Dictionary<string, string> telemetryProperties = null, CancellationToken cancellationToken = default)
|
||||
{
|
||||
var topTwoIntents = (recognizerResult.Intents.Count > 0) ? recognizerResult.Intents.OrderByDescending(x => x.Value.Score).Take(2).ToArray() : null;
|
||||
|
||||
|
@ -391,8 +387,7 @@ namespace Microsoft.Bot.Builder.AI.Luis
|
|||
}
|
||||
|
||||
private LuisPredictionOptions MergeDefaultOptionsWithProvidedOptions(LuisPredictionOptions defaultOptions, LuisPredictionOptions overridenOptions)
|
||||
{
|
||||
return new LuisPredictionOptions()
|
||||
=> new LuisPredictionOptions()
|
||||
{
|
||||
BingSpellCheckSubscriptionKey = overridenOptions.BingSpellCheckSubscriptionKey ?? defaultOptions.BingSpellCheckSubscriptionKey,
|
||||
IncludeAllIntents = overridenOptions.IncludeAllIntents ?? defaultOptions.IncludeAllIntents,
|
||||
|
@ -402,7 +397,6 @@ namespace Microsoft.Bot.Builder.AI.Luis
|
|||
Staging = overridenOptions.Staging ?? defaultOptions.Staging,
|
||||
TimezoneOffset = overridenOptions.TimezoneOffset ?? defaultOptions.TimezoneOffset,
|
||||
};
|
||||
}
|
||||
|
||||
private DelegatingHandler CreateHttpHandlerPipeline(HttpClientHandler httpClientHandler, params DelegatingHandler[] handlers)
|
||||
{
|
||||
|
|
|
@ -85,14 +85,21 @@ namespace Microsoft.Bot.Builder.AI.Luis
|
|||
|
||||
internal static JToken ExtractEntityValue(EntityModel entity)
|
||||
{
|
||||
if (entity.Type.StartsWith("builtin.geographyV2."))
|
||||
{
|
||||
var subtype = entity.Type.Substring(20);
|
||||
return new JObject(
|
||||
new JProperty("type", subtype),
|
||||
new JProperty("location", entity.Entity));
|
||||
}
|
||||
|
||||
#pragma warning disable IDE0007 // Use implicit type
|
||||
if (entity.AdditionalProperties == null || !entity.AdditionalProperties.TryGetValue("resolution", out dynamic resolution))
|
||||
else if (entity.AdditionalProperties == null || !entity.AdditionalProperties.TryGetValue("resolution", out dynamic resolution))
|
||||
#pragma warning restore IDE0007 // Use implicit type
|
||||
{
|
||||
return entity.Entity;
|
||||
}
|
||||
|
||||
if (entity.Type.StartsWith("builtin.datetime."))
|
||||
else if (entity.Type.StartsWith("builtin.datetime."))
|
||||
{
|
||||
return JObject.FromObject(resolution);
|
||||
}
|
||||
|
@ -109,6 +116,12 @@ namespace Microsoft.Bot.Builder.AI.Luis
|
|||
var distinctTimexes = timexes.Distinct();
|
||||
return new JObject(new JProperty("type", type), new JProperty("timex", JArray.FromObject(distinctTimexes)));
|
||||
}
|
||||
else if (entity.Type.StartsWith("builtin.ordinalV2"))
|
||||
{
|
||||
return new JObject(
|
||||
new JProperty("relativeTo", resolution.relativeTo),
|
||||
new JProperty("offset", Number(resolution.offset)));
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (entity.Type)
|
||||
|
@ -184,13 +197,19 @@ namespace Microsoft.Bot.Builder.AI.Luis
|
|||
{
|
||||
type = "datetime";
|
||||
}
|
||||
|
||||
if (type.StartsWith("builtin.currency"))
|
||||
else if (type.StartsWith("builtin.currency"))
|
||||
{
|
||||
type = "money";
|
||||
}
|
||||
|
||||
if (type.StartsWith("builtin."))
|
||||
else if (type.StartsWith("builtin.geographyV2"))
|
||||
{
|
||||
type = "geographyV2";
|
||||
}
|
||||
else if (type.StartsWith("builtin.ordinalV2"))
|
||||
{
|
||||
type = "ordinalV2";
|
||||
}
|
||||
else if (type.StartsWith("builtin."))
|
||||
{
|
||||
type = type.Substring(8);
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@ namespace Microsoft.Bot.Builder.Dialogs
|
|||
/// <param name="dialogs">Parent dialog set.</param>
|
||||
/// <param name="turnContext">Context for the current turn of conversation with the user.</param>
|
||||
/// <param name="state">Current dialog state.</param>
|
||||
internal DialogContext(DialogSet dialogs, ITurnContext turnContext, DialogState state)
|
||||
public DialogContext(DialogSet dialogs, ITurnContext turnContext, DialogState state)
|
||||
{
|
||||
Dialogs = dialogs ?? throw new ArgumentNullException(nameof(dialogs));
|
||||
Context = turnContext ?? throw new ArgumentNullException(nameof(turnContext));
|
||||
|
|
|
@ -82,8 +82,8 @@ namespace Microsoft.Bot.Builder.Dialogs
|
|||
};
|
||||
|
||||
// Send initial prompt
|
||||
await OnPromptAsync(dc.Context, (IDictionary<string, object>)state[PersistedState], (PromptOptions)state[PersistedOptions], cancellationToken).ConfigureAwait(false);
|
||||
return Dialog.EndOfTurn;
|
||||
await OnPromptAsync(dc.Context, (IDictionary<string, object>)state[PersistedState], (PromptOptions)state[PersistedOptions], false, cancellationToken).ConfigureAwait(false);
|
||||
return EndOfTurn;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -133,8 +133,10 @@ namespace Microsoft.Bot.Builder.Dialogs
|
|||
}
|
||||
else
|
||||
{
|
||||
return Dialog.EndOfTurn;
|
||||
await OnPromptAsync(dc.Context, state, options, true, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
return EndOfTurn;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -158,7 +160,7 @@ namespace Microsoft.Bot.Builder.Dialogs
|
|||
// To avoid the prompt prematurely ending we need to implement this method and
|
||||
// simply re-prompt the user.
|
||||
await RepromptDialogAsync(dc.Context, dc.ActiveDialog, cancellationToken).ConfigureAwait(false);
|
||||
return Dialog.EndOfTurn;
|
||||
return EndOfTurn;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -173,7 +175,7 @@ namespace Microsoft.Bot.Builder.Dialogs
|
|||
{
|
||||
var state = (IDictionary<string, object>)instance.State[PersistedState];
|
||||
var options = (PromptOptions)instance.State[PersistedOptions];
|
||||
await OnPromptAsync(turnContext, state, options, cancellationToken).ConfigureAwait(false);
|
||||
await OnPromptAsync(turnContext, state, options, true, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -187,6 +189,14 @@ namespace Microsoft.Bot.Builder.Dialogs
|
|||
/// or threads to receive notice of cancellation.</param>
|
||||
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
|
||||
protected virtual async Task OnPromptAsync(ITurnContext turnContext, IDictionary<string, object> state, PromptOptions options, CancellationToken cancellationToken = default(CancellationToken))
|
||||
=> await OnPromptAsync(turnContext, state, options, false, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
protected virtual async Task OnPromptAsync(
|
||||
ITurnContext turnContext,
|
||||
IDictionary<string, object> state,
|
||||
PromptOptions options,
|
||||
bool isRetry,
|
||||
CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
if (turnContext == null)
|
||||
{
|
||||
|
@ -198,7 +208,11 @@ namespace Microsoft.Bot.Builder.Dialogs
|
|||
throw new ArgumentNullException(nameof(options));
|
||||
}
|
||||
|
||||
if (options.Prompt != null)
|
||||
if (isRetry && options.RetryPrompt != null)
|
||||
{
|
||||
await turnContext.SendActivityAsync(options.RetryPrompt, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
else if (options.Prompt != null)
|
||||
{
|
||||
await turnContext.SendActivityAsync(options.Prompt, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Bot.Schema;
|
||||
|
@ -207,65 +206,5 @@ namespace Microsoft.Bot.Builder
|
|||
{
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A TurnContext with a strongly typed Activity property that wraps an untyped inner TurnContext.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">An IActivity derived type, that is one of IMessageActivity, IConversationUpdateActivity etc.</typeparam>
|
||||
private class DelegatingTurnContext<T> : ITurnContext<T>
|
||||
where T : IActivity
|
||||
{
|
||||
private ITurnContext _innerTurnContext;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="DelegatingTurnContext{T}"/> class.
|
||||
/// </summary>
|
||||
/// <param name="innerTurnContext">The inner turn context.</param>
|
||||
public DelegatingTurnContext(ITurnContext innerTurnContext)
|
||||
{
|
||||
_innerTurnContext = innerTurnContext;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the inner context's activity, cast to the type parameter of this <see cref="DelegatingTurnContext{T}"/>.
|
||||
/// </summary>
|
||||
/// <value>The inner context's activity.</value>
|
||||
T ITurnContext<T>.Activity => (T)(IActivity)_innerTurnContext.Activity;
|
||||
|
||||
public BotAdapter Adapter => _innerTurnContext.Adapter;
|
||||
|
||||
public TurnContextStateCollection TurnState => _innerTurnContext.TurnState;
|
||||
|
||||
public Activity Activity => _innerTurnContext.Activity;
|
||||
|
||||
public bool Responded => _innerTurnContext.Responded;
|
||||
|
||||
public Task DeleteActivityAsync(string activityId, CancellationToken cancellationToken = default(CancellationToken))
|
||||
=> _innerTurnContext.DeleteActivityAsync(activityId, cancellationToken);
|
||||
|
||||
public Task DeleteActivityAsync(ConversationReference conversationReference, CancellationToken cancellationToken = default(CancellationToken))
|
||||
=> _innerTurnContext.DeleteActivityAsync(conversationReference, cancellationToken);
|
||||
|
||||
public ITurnContext OnDeleteActivity(DeleteActivityHandler handler)
|
||||
=> _innerTurnContext.OnDeleteActivity(handler);
|
||||
|
||||
public ITurnContext OnSendActivities(SendActivitiesHandler handler)
|
||||
=> _innerTurnContext.OnSendActivities(handler);
|
||||
|
||||
public ITurnContext OnUpdateActivity(UpdateActivityHandler handler)
|
||||
=> _innerTurnContext.OnUpdateActivity(handler);
|
||||
|
||||
public Task<ResourceResponse[]> SendActivitiesAsync(IActivity[] activities, CancellationToken cancellationToken = default(CancellationToken))
|
||||
=> _innerTurnContext.SendActivitiesAsync(activities, cancellationToken);
|
||||
|
||||
public Task<ResourceResponse> SendActivityAsync(string textReplyToSend, string speak = null, string inputHint = InputHints.AcceptingInput, CancellationToken cancellationToken = default(CancellationToken))
|
||||
=> _innerTurnContext.SendActivityAsync(textReplyToSend, speak, inputHint, cancellationToken);
|
||||
|
||||
public Task<ResourceResponse> SendActivityAsync(IActivity activity, CancellationToken cancellationToken = default(CancellationToken))
|
||||
=> _innerTurnContext.SendActivityAsync(activity, cancellationToken);
|
||||
|
||||
public Task<ResourceResponse> UpdateActivityAsync(IActivity activity, CancellationToken cancellationToken = default(CancellationToken))
|
||||
=> _innerTurnContext.UpdateActivityAsync(activity, cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,69 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Bot.Schema;
|
||||
|
||||
namespace Microsoft.Bot.Builder
|
||||
{
|
||||
/// <summary>
|
||||
/// A TurnContext with a strongly typed Activity property that wraps an untyped inner TurnContext.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">An IActivity derived type, that is one of IMessageActivity, IConversationUpdateActivity etc.</typeparam>
|
||||
public class DelegatingTurnContext<T> : ITurnContext<T>
|
||||
where T : IActivity
|
||||
{
|
||||
private ITurnContext _innerTurnContext;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="DelegatingTurnContext{T}"/> class.
|
||||
/// </summary>
|
||||
/// <param name="innerTurnContext">The inner turn context.</param>
|
||||
public DelegatingTurnContext(ITurnContext innerTurnContext)
|
||||
{
|
||||
_innerTurnContext = innerTurnContext;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the inner context's activity, cast to the type parameter of this <see cref="DelegatingTurnContext{T}"/>.
|
||||
/// </summary>
|
||||
/// <value>The inner context's activity.</value>
|
||||
T ITurnContext<T>.Activity => (T)(IActivity)_innerTurnContext.Activity;
|
||||
|
||||
public BotAdapter Adapter => _innerTurnContext.Adapter;
|
||||
|
||||
public TurnContextStateCollection TurnState => _innerTurnContext.TurnState;
|
||||
|
||||
public Activity Activity => _innerTurnContext.Activity;
|
||||
|
||||
public bool Responded => _innerTurnContext.Responded;
|
||||
|
||||
public Task DeleteActivityAsync(string activityId, CancellationToken cancellationToken = default(CancellationToken))
|
||||
=> _innerTurnContext.DeleteActivityAsync(activityId, cancellationToken);
|
||||
|
||||
public Task DeleteActivityAsync(ConversationReference conversationReference, CancellationToken cancellationToken = default(CancellationToken))
|
||||
=> _innerTurnContext.DeleteActivityAsync(conversationReference, cancellationToken);
|
||||
|
||||
public ITurnContext OnDeleteActivity(DeleteActivityHandler handler)
|
||||
=> _innerTurnContext.OnDeleteActivity(handler);
|
||||
|
||||
public ITurnContext OnSendActivities(SendActivitiesHandler handler)
|
||||
=> _innerTurnContext.OnSendActivities(handler);
|
||||
|
||||
public ITurnContext OnUpdateActivity(UpdateActivityHandler handler)
|
||||
=> _innerTurnContext.OnUpdateActivity(handler);
|
||||
|
||||
public Task<ResourceResponse[]> SendActivitiesAsync(IActivity[] activities, CancellationToken cancellationToken = default(CancellationToken))
|
||||
=> _innerTurnContext.SendActivitiesAsync(activities, cancellationToken);
|
||||
|
||||
public Task<ResourceResponse> SendActivityAsync(string textReplyToSend, string speak = null, string inputHint = InputHints.AcceptingInput, CancellationToken cancellationToken = default(CancellationToken))
|
||||
=> _innerTurnContext.SendActivityAsync(textReplyToSend, speak, inputHint, cancellationToken);
|
||||
|
||||
public Task<ResourceResponse> SendActivityAsync(IActivity activity, CancellationToken cancellationToken = default(CancellationToken))
|
||||
=> _innerTurnContext.SendActivityAsync(activity, cancellationToken);
|
||||
|
||||
public Task<ResourceResponse> UpdateActivityAsync(IActivity activity, CancellationToken cancellationToken = default(CancellationToken))
|
||||
=> _innerTurnContext.UpdateActivityAsync(activity, cancellationToken);
|
||||
}
|
||||
}
|
|
@ -126,6 +126,19 @@ namespace Microsoft.Bot.Builder.Integration.ApplicationInsights.Core
|
|||
return services;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds and configures services for Application Insights to the <see cref="IServiceCollection" />.
|
||||
/// </summary>
|
||||
/// <param name="services">The <see cref="IServiceCollection"/> which specifies the contract for a collection of service descriptors.</param>
|
||||
/// <returns>A reference to this instance after the operation has completed.</returns>
|
||||
public static IServiceCollection AddBotApplicationInsights(this IServiceCollection services)
|
||||
{
|
||||
services.AddApplicationInsightsTelemetry();
|
||||
services.AddSingleton<IBotTelemetryClient, BotTelemetryClient>();
|
||||
CreateBotTelemetry(services);
|
||||
return services;
|
||||
}
|
||||
|
||||
private static void CreateBotTelemetry(IServiceCollection services)
|
||||
{
|
||||
// Enables Bot Telemetry to save user/session id's as the bot user id and session
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// <auto-generated>
|
||||
// Code generated by LUISGen ..\..\..\..\tests\LUISGenTest\Contoso app.json -cs Microsoft.Bot.Builder.AI.Luis.Tests.Contoso_App -o ..\..\..\..\tests\LUISGenTest\
|
||||
// <auto-generated>
|
||||
// Code generated by LUISGen Contoso App.json -cs Microsoft.Bot.Builder.AI.Luis.Tests.Contoso_App -o
|
||||
// Tool github: https://github.com/microsoft/botbuilder-tools
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
|
@ -12,8 +12,12 @@ namespace Microsoft.Bot.Builder.AI.Luis.Tests
|
|||
{
|
||||
public partial class Contoso_App: IRecognizerConvert
|
||||
{
|
||||
[JsonProperty("text")]
|
||||
public string Text;
|
||||
|
||||
[JsonProperty("alteredText")]
|
||||
public string AlteredText;
|
||||
|
||||
public enum Intent {
|
||||
Cancel,
|
||||
Delivery,
|
||||
|
@ -27,50 +31,76 @@ namespace Microsoft.Bot.Builder.AI.Luis.Tests
|
|||
Travel,
|
||||
Weather_GetForecast
|
||||
};
|
||||
[JsonProperty("intents")]
|
||||
public Dictionary<Intent, IntentScore> Intents;
|
||||
|
||||
public class _Entities
|
||||
{
|
||||
// Simple entities
|
||||
public string[] Name;
|
||||
public string[] liker;
|
||||
public string[] likee;
|
||||
public string[] State;
|
||||
public string[] Weather_Location;
|
||||
public string[] source;
|
||||
public string[] destination;
|
||||
public string[] City;
|
||||
public string[] To;
|
||||
public string[] From;
|
||||
|
||||
public string[] Name;
|
||||
public string[] likee;
|
||||
public string[] liker;
|
||||
|
||||
public string[] State;
|
||||
|
||||
public string[] Weather_Location;
|
||||
public string[] destination;
|
||||
public string[] source;
|
||||
|
||||
// Built-in entities
|
||||
public Age[] age;
|
||||
public Age[] end;
|
||||
public Age[] begin;
|
||||
public Age[] end;
|
||||
|
||||
public DateTimeSpec[] datetime;
|
||||
public DateTimeSpec[] leave;
|
||||
public DateTimeSpec[] arrive;
|
||||
public DateTimeSpec[] leave;
|
||||
|
||||
public Dimension[] dimension;
|
||||
public Dimension[] length;
|
||||
public Dimension[] width;
|
||||
|
||||
public string[] email;
|
||||
public string[] sender;
|
||||
public string[] receiver;
|
||||
public string[] sender;
|
||||
|
||||
public GeographyV2[] geographyV2;
|
||||
public GeographyV2[] endloc;
|
||||
public GeographyV2[] startloc;
|
||||
|
||||
public Money[] money;
|
||||
public Money[] max;
|
||||
public Money[] min;
|
||||
|
||||
public double[] number;
|
||||
|
||||
public double[] ordinal;
|
||||
public double[] start;
|
||||
|
||||
public OrdinalV2[] ordinalV2;
|
||||
public OrdinalV2[] endpos;
|
||||
public OrdinalV2[] startpos;
|
||||
|
||||
public double[] percentage;
|
||||
public double[] minimum;
|
||||
public double[] maximum;
|
||||
public double[] minimum;
|
||||
|
||||
public string[] personName;
|
||||
public string[] child;
|
||||
public string[] parent;
|
||||
|
||||
public string[] phonenumber;
|
||||
public string[] newPhone;
|
||||
public string[] old;
|
||||
|
||||
public Temperature[] temperature;
|
||||
public Temperature[] b;
|
||||
public Temperature[] a;
|
||||
public Temperature[] b;
|
||||
|
||||
public string[] url;
|
||||
public string[] oldURL;
|
||||
|
||||
|
@ -86,8 +116,9 @@ namespace Microsoft.Bot.Builder.AI.Luis.Tests
|
|||
|
||||
// Pattern.any
|
||||
public string[] person;
|
||||
public string[] to;
|
||||
public string[] from;
|
||||
public string[] to;
|
||||
|
||||
public string[] subject;
|
||||
public string[] extra;
|
||||
|
||||
|
@ -161,65 +192,73 @@ namespace Microsoft.Bot.Builder.AI.Luis.Tests
|
|||
// Instance
|
||||
public class _Instance
|
||||
{
|
||||
public InstanceData[] Address;
|
||||
public InstanceData[] Destination;
|
||||
public InstanceData[] Source;
|
||||
public InstanceData[] Airline;
|
||||
public InstanceData[] Buyer;
|
||||
public InstanceData[] Seller;
|
||||
public InstanceData[] City;
|
||||
public InstanceData[] Composite1;
|
||||
public InstanceData[] Composite2;
|
||||
public InstanceData[] Name;
|
||||
public InstanceData[] liker;
|
||||
public InstanceData[] likee;
|
||||
public InstanceData[] liker;
|
||||
public InstanceData[] Part;
|
||||
public InstanceData[] buy;
|
||||
public InstanceData[] sell;
|
||||
public InstanceData[] State;
|
||||
public InstanceData[] Weather_Location;
|
||||
public InstanceData[] source;
|
||||
public InstanceData[] destination;
|
||||
public InstanceData[] City;
|
||||
public InstanceData[] To;
|
||||
public InstanceData[] From;
|
||||
public InstanceData[] source;
|
||||
public InstanceData[] age;
|
||||
public InstanceData[] end;
|
||||
public InstanceData[] begin;
|
||||
public InstanceData[] end;
|
||||
public InstanceData[] datetime;
|
||||
public InstanceData[] leave;
|
||||
public InstanceData[] arrive;
|
||||
public InstanceData[] leave;
|
||||
public InstanceData[] dimension;
|
||||
public InstanceData[] length;
|
||||
public InstanceData[] width;
|
||||
public InstanceData[] email;
|
||||
public InstanceData[] sender;
|
||||
public InstanceData[] receiver;
|
||||
public InstanceData[] sender;
|
||||
public InstanceData[] geographyV2;
|
||||
public InstanceData[] endloc;
|
||||
public InstanceData[] startloc;
|
||||
public InstanceData[] money;
|
||||
public InstanceData[] max;
|
||||
public InstanceData[] min;
|
||||
public InstanceData[] number;
|
||||
public InstanceData[] ordinal;
|
||||
public InstanceData[] start;
|
||||
public InstanceData[] ordinalV2;
|
||||
public InstanceData[] endpos;
|
||||
public InstanceData[] startpos;
|
||||
public InstanceData[] percentage;
|
||||
public InstanceData[] minimum;
|
||||
public InstanceData[] maximum;
|
||||
public InstanceData[] minimum;
|
||||
public InstanceData[] person;
|
||||
public InstanceData[] from;
|
||||
public InstanceData[] to;
|
||||
public InstanceData[] personName;
|
||||
public InstanceData[] child;
|
||||
public InstanceData[] parent;
|
||||
public InstanceData[] phonenumber;
|
||||
public InstanceData[] newPhone;
|
||||
public InstanceData[] old;
|
||||
public InstanceData[] temperature;
|
||||
public InstanceData[] b;
|
||||
public InstanceData[] a;
|
||||
public InstanceData[] url;
|
||||
public InstanceData[] oldURL;
|
||||
public InstanceData[] Airline;
|
||||
public InstanceData[] Buyer;
|
||||
public InstanceData[] Seller;
|
||||
public InstanceData[] Part;
|
||||
public InstanceData[] buy;
|
||||
public InstanceData[] sell;
|
||||
public InstanceData[] person;
|
||||
public InstanceData[] to;
|
||||
public InstanceData[] from;
|
||||
public InstanceData[] subject;
|
||||
public InstanceData[] extra;
|
||||
public InstanceData[] Address;
|
||||
public InstanceData[] Destination;
|
||||
public InstanceData[] Source;
|
||||
public InstanceData[] Composite1;
|
||||
public InstanceData[] Composite2;
|
||||
public InstanceData[] temperature;
|
||||
public InstanceData[] a;
|
||||
public InstanceData[] b;
|
||||
public InstanceData[] url;
|
||||
public InstanceData[] oldURL;
|
||||
}
|
||||
[JsonProperty("$instance")]
|
||||
public _Instance _instance;
|
||||
}
|
||||
[JsonProperty("entities")]
|
||||
public _Entities Entities;
|
||||
|
||||
[JsonExtensionData(ReadData = true, WriteData = true)]
|
||||
|
|
|
@ -22,15 +22,12 @@ using Newtonsoft.Json;
|
|||
using Newtonsoft.Json.Linq;
|
||||
using RichardSzalay.MockHttp;
|
||||
|
||||
namespace Microsoft.Bot.Builder.FunctionalTests
|
||||
namespace Microsoft.Bot.Builder.AI.Luis.Tests
|
||||
{
|
||||
[TestClass]
|
||||
#if !FUNCTIONALTESTS
|
||||
[Ignore("These integration tests run only when FUNCTIONALTESTS is defined")]
|
||||
#endif
|
||||
|
||||
// The LUIS application used in these unit tests is in TestData/TestLuistApp.json
|
||||
public class LuisRecognizerTests
|
||||
// The LUIS application used in these unit tests is in TestData/Contoso App.json
|
||||
public class LuisOracleTests
|
||||
{
|
||||
// Access the checked-in oracles so that if they are changed you can compare the changes and easily modify them.
|
||||
private const string _testData = @"../../../TestData/";
|
||||
|
@ -62,7 +59,7 @@ namespace Microsoft.Bot.Builder.FunctionalTests
|
|||
// 5) Run the review.cmd file to review each file if approved the new oracle file will replace the old one.
|
||||
// Changing this to false will cause running against the actual LUIS service.
|
||||
// This is useful in order to see if the oracles for mocking or testing have changed.
|
||||
private readonly bool _mock = true;
|
||||
private bool _mock = true;
|
||||
|
||||
[TestMethod]
|
||||
public void LuisRecognizerConstruction()
|
||||
|
@ -88,7 +85,6 @@ namespace Microsoft.Bot.Builder.FunctionalTests
|
|||
public void LuisRecognizer_Timeout()
|
||||
{
|
||||
var endpoint = "https://westus.api.cognitive.microsoft.com/luis/v2.0/apps/b31aeaf3-3511-495b-a07f-571fc873214b?verbose=true&timezoneOffset=-360&subscription-key=048ec46dc58e495482b0c447cfdbd291&q=";
|
||||
var fieldInfo = typeof(LuisRecognizer).GetField("_application", BindingFlags.NonPublic | BindingFlags.Instance);
|
||||
var optionsWithTimeout = new LuisPredictionOptions()
|
||||
{
|
||||
Timeout = 300,
|
||||
|
@ -132,7 +128,7 @@ namespace Microsoft.Bot.Builder.FunctionalTests
|
|||
Assert.AreEqual("https://westus.api.cognitive.microsoft.com", app.Endpoint);
|
||||
}
|
||||
|
||||
// [TestMethod] Commented out due to test failing.
|
||||
[TestMethod]
|
||||
public async Task LuisRecognizer_Configuration()
|
||||
{
|
||||
GetEnvironmentVarsLuis();
|
||||
|
@ -437,6 +433,39 @@ namespace Microsoft.Bot.Builder.FunctionalTests
|
|||
Assert.AreEqual(1, result.Entities["$instance"]["datetime_time"].Count());
|
||||
}
|
||||
|
||||
public async Task TestEndpoint<T>(string expectedPath, JToken oracle, string version)
|
||||
where T : IRecognizerConvert, new()
|
||||
{
|
||||
var newPath = expectedPath + ".new";
|
||||
using (var mockResponse = new MemoryStream(Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(oracle[version]))))
|
||||
{
|
||||
var text = oracle["text"] ?? oracle["Text"];
|
||||
var query = text.ToString();
|
||||
var context = GetContext(query);
|
||||
|
||||
var mockHttp = GetMockHttpClientHandlerObject(query, mockResponse);
|
||||
var luisRecognizer = GetLuisRecognizer(mockHttp, true, new LuisPredictionOptions { IncludeAllIntents = true });
|
||||
var typedResult = await luisRecognizer.RecognizeAsync<T>(context, CancellationToken.None);
|
||||
var typedJson = Json(typedResult);
|
||||
typedJson[version] = typedJson["luisResult"];
|
||||
typedJson.Remove("luisResult");
|
||||
|
||||
if (!WithinDelta(oracle, typedJson, 0.1))
|
||||
{
|
||||
using (var writer = new StreamWriter(newPath))
|
||||
{
|
||||
writer.Write(typedJson);
|
||||
}
|
||||
|
||||
Assert.Fail($"Returned JSON in {newPath} != expected JSON in {expectedPath}");
|
||||
}
|
||||
else
|
||||
{
|
||||
File.Delete(expectedPath + ".new");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// To create a file to test:
|
||||
// 1) Create a <name>.json file with an object { Text:<query> } in it.
|
||||
// 2) Run this test which will fail and generate a <name>.json.new file.
|
||||
|
@ -445,38 +474,13 @@ namespace Microsoft.Bot.Builder.FunctionalTests
|
|||
where T : IRecognizerConvert, new()
|
||||
{
|
||||
var expectedPath = GetFilePath(file);
|
||||
var newPath = expectedPath + ".new";
|
||||
|
||||
GetEnvironmentVarsLuis();
|
||||
|
||||
using (var expectedJsonReader = new JsonTextReader(new StreamReader(expectedPath)))
|
||||
{
|
||||
var expectedJson = await JToken.ReadFromAsync(expectedJsonReader);
|
||||
using (var mockResponse = new MemoryStream(Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(expectedJson["luisResult"]))))
|
||||
{
|
||||
var text = expectedJson["text"] ?? expectedJson["Text"];
|
||||
var query = text.ToString();
|
||||
var context = GetContext(query);
|
||||
|
||||
var mockHttp = GetMockHttpClientHandlerObject(query, mockResponse);
|
||||
var luisRecognizer = GetLuisRecognizer(mockHttp, true, new LuisPredictionOptions { IncludeAllIntents = true });
|
||||
var typedResult = await luisRecognizer.RecognizeAsync<T>(context, CancellationToken.None);
|
||||
var typedJson = Json(typedResult);
|
||||
|
||||
if (!WithinDelta(expectedJson, typedJson, 0.1))
|
||||
{
|
||||
using (var writer = new StreamWriter(newPath))
|
||||
{
|
||||
writer.Write(typedJson);
|
||||
}
|
||||
|
||||
Assert.Fail($"Returned JSON in {newPath} != expected JSON in {expectedPath}");
|
||||
}
|
||||
else
|
||||
{
|
||||
File.Delete(expectedPath + ".new");
|
||||
}
|
||||
}
|
||||
await TestEndpoint<T>(expectedPath, expectedJson, "v2");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -537,6 +541,9 @@ namespace Microsoft.Bot.Builder.FunctionalTests
|
|||
[TestMethod]
|
||||
public async Task Composite3() => await TestJson<RecognizerResult>("Composite3.json");
|
||||
|
||||
[TestMethod]
|
||||
public async Task GeoPeopleOrdinal() => await TestJson<RecognizerResult>("GeoPeopleOrdinal.json");
|
||||
|
||||
[TestMethod]
|
||||
public async Task PrebuiltDomains() => await TestJson<RecognizerResult>("Prebuilt.json");
|
||||
|
||||
|
@ -683,6 +690,7 @@ namespace Microsoft.Bot.Builder.FunctionalTests
|
|||
var result = await recognizer.RecognizeAsync(turnContext, additionalProperties).ConfigureAwait(false);
|
||||
|
||||
// Assert
|
||||
Assert.IsNotNull(result);
|
||||
Assert.AreEqual(telemetryClient.Invocations.Count, 1);
|
||||
Assert.AreEqual(telemetryClient.Invocations[0].Arguments[0].ToString(), "LuisResult");
|
||||
Assert.IsTrue(((Dictionary<string, string>)telemetryClient.Invocations[0].Arguments[1]).ContainsKey("test"));
|
||||
|
@ -729,6 +737,7 @@ namespace Microsoft.Bot.Builder.FunctionalTests
|
|||
var result = await recognizer.RecognizeAsync(turnContext, null).ConfigureAwait(false);
|
||||
|
||||
// Assert
|
||||
Assert.IsNotNull(result);
|
||||
Assert.AreEqual(telemetryClient.Invocations.Count, 1);
|
||||
Assert.AreEqual(telemetryClient.Invocations[0].Arguments[0].ToString(), "LuisResult");
|
||||
Assert.IsTrue(((Dictionary<string, string>)telemetryClient.Invocations[0].Arguments[1]).Count == 8);
|
||||
|
@ -775,6 +784,7 @@ namespace Microsoft.Bot.Builder.FunctionalTests
|
|||
var result = await recognizer.RecognizeAsync(turnContext, null).ConfigureAwait(false);
|
||||
|
||||
// Assert
|
||||
Assert.IsNotNull(result);
|
||||
Assert.AreEqual(telemetryClient.Invocations.Count, 1);
|
||||
Assert.AreEqual(telemetryClient.Invocations[0].Arguments[0].ToString(), "LuisResult");
|
||||
Assert.IsTrue(((Dictionary<string, string>)telemetryClient.Invocations[0].Arguments[1]).Count == 7);
|
||||
|
@ -826,6 +836,7 @@ namespace Microsoft.Bot.Builder.FunctionalTests
|
|||
var result = await recognizer.RecognizeAsync(turnContext, additionalProperties).ConfigureAwait(false);
|
||||
|
||||
// Assert
|
||||
Assert.IsNotNull(result);
|
||||
Assert.AreEqual(telemetryClient.Invocations.Count, 2);
|
||||
Assert.AreEqual(telemetryClient.Invocations[0].Arguments[0].ToString(), "LuisResult");
|
||||
Assert.IsTrue(((Dictionary<string, string>)telemetryClient.Invocations[0].Arguments[1]).ContainsKey("MyImportantProperty"));
|
||||
|
@ -883,6 +894,7 @@ namespace Microsoft.Bot.Builder.FunctionalTests
|
|||
var result = await recognizer.RecognizeAsync(turnContext, additionalProperties, additionalMetrics).ConfigureAwait(false);
|
||||
|
||||
// Assert
|
||||
Assert.IsNotNull(result);
|
||||
Assert.AreEqual(telemetryClient.Invocations.Count, 2);
|
||||
Assert.AreEqual(telemetryClient.Invocations[0].Arguments[0].ToString(), "LuisResult");
|
||||
Assert.IsTrue(((Dictionary<string, string>)telemetryClient.Invocations[0].Arguments[1]).ContainsKey("MyImportantProperty"));
|
||||
|
@ -935,6 +947,7 @@ namespace Microsoft.Bot.Builder.FunctionalTests
|
|||
var result = await recognizer.RecognizeAsync(turnContext, CancellationToken.None).ConfigureAwait(false);
|
||||
|
||||
// Assert
|
||||
Assert.IsNotNull(result);
|
||||
Assert.AreEqual(telemetryClient.Invocations.Count, 1);
|
||||
Assert.AreEqual(telemetryClient.Invocations[0].Arguments[0].ToString(), "LuisResult");
|
||||
Assert.IsTrue(((Dictionary<string, string>)telemetryClient.Invocations[0].Arguments[1]).ContainsKey("applicationId"));
|
||||
|
@ -978,6 +991,7 @@ namespace Microsoft.Bot.Builder.FunctionalTests
|
|||
var result = await recognizer.RecognizeAsync<TelemetryConvertResult>(turnContext, CancellationToken.None).ConfigureAwait(false);
|
||||
|
||||
// Assert
|
||||
Assert.IsNotNull(result);
|
||||
Assert.AreEqual(telemetryClient.Invocations.Count, 1);
|
||||
Assert.AreEqual(telemetryClient.Invocations[0].Arguments[0].ToString(), "LuisResult");
|
||||
Assert.IsTrue(((Dictionary<string, string>)telemetryClient.Invocations[0].Arguments[1]).ContainsKey("applicationId"));
|
||||
|
@ -1032,6 +1046,7 @@ namespace Microsoft.Bot.Builder.FunctionalTests
|
|||
var result = await recognizer.RecognizeAsync<TelemetryConvertResult>(turnContext, additionalProperties, additionalMetrics, CancellationToken.None).ConfigureAwait(false);
|
||||
|
||||
// Assert
|
||||
Assert.IsNotNull(result);
|
||||
Assert.AreEqual(telemetryClient.Invocations.Count, 1);
|
||||
Assert.AreEqual(telemetryClient.Invocations[0].Arguments[0].ToString(), "LuisResult");
|
||||
Assert.IsTrue(((Dictionary<string, string>)telemetryClient.Invocations[0].Arguments[1]).ContainsKey("test"));
|
||||
|
@ -1168,9 +1183,7 @@ namespace Microsoft.Bot.Builder.FunctionalTests
|
|||
}
|
||||
|
||||
private MockedHttpClientHandler GetMockHttpClientHandler(string example, string responsePath)
|
||||
{
|
||||
return GetMockHttpClientHandler(example, GetResponse(responsePath));
|
||||
}
|
||||
=> GetMockHttpClientHandler(example, GetResponse(responsePath));
|
||||
|
||||
private MockedHttpClientHandler GetMockHttpClientHandler(string example, Stream response)
|
||||
{
|
||||
|
@ -1207,6 +1220,7 @@ namespace Microsoft.Bot.Builder.FunctionalTests
|
|||
throw new Exception("Environment variable 'LuisAppId' not found.");
|
||||
}
|
||||
|
||||
// NOTE: This is required only if not mocking
|
||||
if (string.IsNullOrWhiteSpace(_subscriptionKey))
|
||||
{
|
||||
_subscriptionKey = Environment.GetEnvironmentVariable("LUISSUBSCRIPTIONKEY");
|
||||
|
@ -1214,7 +1228,7 @@ namespace Microsoft.Bot.Builder.FunctionalTests
|
|||
|
||||
if (string.IsNullOrWhiteSpace(_subscriptionKey))
|
||||
{
|
||||
throw new Exception("Environment variable 'LuisSubscriptionKey' not found.");
|
||||
_subscriptionKey = Guid.Empty.ToString();
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(_endpoint))
|
||||
|
@ -1226,6 +1240,12 @@ namespace Microsoft.Bot.Builder.FunctionalTests
|
|||
{
|
||||
throw new Exception("Environment variable 'LuisEndPoint' not found.");
|
||||
}
|
||||
|
||||
var mock = Environment.GetEnvironmentVariable("LUISMOCK");
|
||||
if (mock != null)
|
||||
{
|
||||
_mock = bool.Parse(mock);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -2,37 +2,37 @@
|
|||
"text": "12 years old and 3 days old and monday july 3rd and every monday and between 3am and 5:30am and 4 acres and 4 pico meters and chrimc@hotmail.com and $4 and $4.25 and also 32 and 210.4 and first and 10% and 10.5% and 425-555-1234 and 3 degrees and -27.5 degrees c and the next one and the previous one",
|
||||
"intents": {
|
||||
"EntityTests": {
|
||||
"score": 0.986663
|
||||
"score": 0.96595037
|
||||
},
|
||||
"Roles": {
|
||||
"score": 0.1664963
|
||||
"score": 0.184567839
|
||||
},
|
||||
"search": {
|
||||
"score": 0.12151327
|
||||
"score": 0.149123311
|
||||
},
|
||||
"Weather_GetForecast": {
|
||||
"score": 0.013088448
|
||||
},
|
||||
"None": {
|
||||
"score": 0.009308712
|
||||
"score": 0.0122321565
|
||||
},
|
||||
"Travel": {
|
||||
"score": 0.004110674
|
||||
"score": 0.0114093516
|
||||
},
|
||||
"None": {
|
||||
"score": 0.009063047
|
||||
},
|
||||
"Delivery": {
|
||||
"score": 0.0002886336
|
||||
"score": 0.000278715248
|
||||
},
|
||||
"SpecifyName": {
|
||||
"score": 0.000134838832
|
||||
"score": 6.590373E-05
|
||||
},
|
||||
"Help": {
|
||||
"score": 4.59630246E-06
|
||||
"score": 4.902734E-06
|
||||
},
|
||||
"Cancel": {
|
||||
"score": 1.5275E-06
|
||||
"score": 1.602786E-06
|
||||
},
|
||||
"Greeting": {
|
||||
"score": 8.0267E-07
|
||||
"score": 8.547132E-07
|
||||
}
|
||||
},
|
||||
"entities": {
|
||||
|
@ -43,7 +43,33 @@
|
|||
"endIndex": 300,
|
||||
"text": "12 years old and 3 days old and monday july 3rd and every monday and between 3am and 5 : 30am and 4 acres and 4 pico meters and chrimc @ hotmail . com and $ 4 and $ 4 . 25 and also 32 and 210 . 4 and first and 10 % and 10 . 5 % and 425 - 555 - 1234 and 3 degrees and - 27 . 5 degrees c and the next one and the previous one",
|
||||
"type": "Composite1",
|
||||
"score": 0.884687662
|
||||
"score": 0.877445638
|
||||
}
|
||||
],
|
||||
"ordinalV2": [
|
||||
{
|
||||
"startIndex": 44,
|
||||
"endIndex": 47,
|
||||
"text": "3rd",
|
||||
"type": "builtin.ordinalV2"
|
||||
},
|
||||
{
|
||||
"startIndex": 188,
|
||||
"endIndex": 193,
|
||||
"text": "first",
|
||||
"type": "builtin.ordinalV2"
|
||||
},
|
||||
{
|
||||
"startIndex": 271,
|
||||
"endIndex": 279,
|
||||
"text": "next one",
|
||||
"type": "builtin.ordinalV2.relative"
|
||||
},
|
||||
{
|
||||
"startIndex": 288,
|
||||
"endIndex": 300,
|
||||
"text": "previous one",
|
||||
"type": "builtin.ordinalV2.relative"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -418,62 +444,80 @@
|
|||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"ordinalV2": [
|
||||
{
|
||||
"relativeTo": "start",
|
||||
"offset": 3
|
||||
},
|
||||
{
|
||||
"relativeTo": "start",
|
||||
"offset": 1
|
||||
},
|
||||
{
|
||||
"relativeTo": "current",
|
||||
"offset": 1
|
||||
},
|
||||
{
|
||||
"relativeTo": "current",
|
||||
"offset": -1
|
||||
}
|
||||
]
|
||||
},
|
||||
"sentiment": {
|
||||
"label": "neutral",
|
||||
"score": 0.5
|
||||
},
|
||||
"luisResult": {
|
||||
"v2": {
|
||||
"query": "12 years old and 3 days old and monday july 3rd and every monday and between 3am and 5:30am and 4 acres and 4 pico meters and chrimc@hotmail.com and $4 and $4.25 and also 32 and 210.4 and first and 10% and 10.5% and 425-555-1234 and 3 degrees and -27.5 degrees c and the next one and the previous one",
|
||||
"topScoringIntent": {
|
||||
"intent": "EntityTests",
|
||||
"score": 0.986663
|
||||
"score": 0.96595037
|
||||
},
|
||||
"intents": [
|
||||
{
|
||||
"intent": "EntityTests",
|
||||
"score": 0.986663
|
||||
"score": 0.96595037
|
||||
},
|
||||
{
|
||||
"intent": "Roles",
|
||||
"score": 0.1664963
|
||||
"score": 0.184567839
|
||||
},
|
||||
{
|
||||
"intent": "search",
|
||||
"score": 0.12151327
|
||||
"score": 0.149123311
|
||||
},
|
||||
{
|
||||
"intent": "Weather.GetForecast",
|
||||
"score": 0.013088448
|
||||
},
|
||||
{
|
||||
"intent": "None",
|
||||
"score": 0.009308712
|
||||
"score": 0.0122321565
|
||||
},
|
||||
{
|
||||
"intent": "Travel",
|
||||
"score": 0.004110674
|
||||
"score": 0.0114093516
|
||||
},
|
||||
{
|
||||
"intent": "None",
|
||||
"score": 0.009063047
|
||||
},
|
||||
{
|
||||
"intent": "Delivery",
|
||||
"score": 0.0002886336
|
||||
"score": 0.000278715248
|
||||
},
|
||||
{
|
||||
"intent": "SpecifyName",
|
||||
"score": 0.000134838832
|
||||
"score": 6.590373E-05
|
||||
},
|
||||
{
|
||||
"intent": "Help",
|
||||
"score": 4.59630246E-06
|
||||
"score": 4.902734E-06
|
||||
},
|
||||
{
|
||||
"intent": "Cancel",
|
||||
"score": 1.5275E-06
|
||||
"score": 1.602786E-06
|
||||
},
|
||||
{
|
||||
"intent": "Greeting",
|
||||
"score": 8.0267E-07
|
||||
"score": 8.547132E-07
|
||||
}
|
||||
],
|
||||
"entities": [
|
||||
|
@ -482,7 +526,7 @@
|
|||
"type": "Composite1",
|
||||
"startIndex": 0,
|
||||
"endIndex": 299,
|
||||
"score": 0.884687662
|
||||
"score": 0.877445638
|
||||
},
|
||||
{
|
||||
"entity": "12",
|
||||
|
@ -832,6 +876,46 @@
|
|||
"value": "1"
|
||||
}
|
||||
},
|
||||
{
|
||||
"entity": "3rd",
|
||||
"type": "builtin.ordinalV2",
|
||||
"startIndex": 44,
|
||||
"endIndex": 46,
|
||||
"resolution": {
|
||||
"offset": "3",
|
||||
"relativeTo": "start"
|
||||
}
|
||||
},
|
||||
{
|
||||
"entity": "first",
|
||||
"type": "builtin.ordinalV2",
|
||||
"startIndex": 188,
|
||||
"endIndex": 192,
|
||||
"resolution": {
|
||||
"offset": "1",
|
||||
"relativeTo": "start"
|
||||
}
|
||||
},
|
||||
{
|
||||
"entity": "next one",
|
||||
"type": "builtin.ordinalV2.relative",
|
||||
"startIndex": 271,
|
||||
"endIndex": 278,
|
||||
"resolution": {
|
||||
"offset": "1",
|
||||
"relativeTo": "current"
|
||||
}
|
||||
},
|
||||
{
|
||||
"entity": "previous one",
|
||||
"type": "builtin.ordinalV2.relative",
|
||||
"startIndex": 288,
|
||||
"endIndex": 299,
|
||||
"resolution": {
|
||||
"offset": "-1",
|
||||
"relativeTo": "current"
|
||||
}
|
||||
},
|
||||
{
|
||||
"entity": "10%",
|
||||
"type": "builtin.percentage",
|
|
@ -2,37 +2,37 @@
|
|||
"text": "http://foo.com is where you can fly from seattle to dallas via denver",
|
||||
"intents": {
|
||||
"EntityTests": {
|
||||
"score": 0.9513557
|
||||
},
|
||||
"Roles": {
|
||||
"score": 0.05937675
|
||||
},
|
||||
"Weather_GetForecast": {
|
||||
"score": 0.0246020257
|
||||
"score": 0.944987357
|
||||
},
|
||||
"Travel": {
|
||||
"score": 0.0182663873
|
||||
"score": 0.0452092439
|
||||
},
|
||||
"Roles": {
|
||||
"score": 0.0297764745
|
||||
},
|
||||
"Weather_GetForecast": {
|
||||
"score": 0.0231683664
|
||||
},
|
||||
"search": {
|
||||
"score": 0.0149017535
|
||||
"score": 0.008871362
|
||||
},
|
||||
"None": {
|
||||
"score": 0.004570498
|
||||
"score": 0.004223796
|
||||
},
|
||||
"SpecifyName": {
|
||||
"score": 0.00189947966
|
||||
"score": 0.00236839615
|
||||
},
|
||||
"Delivery": {
|
||||
"score": 0.00140795356
|
||||
"score": 0.0013232599
|
||||
},
|
||||
"Help": {
|
||||
"score": 0.0005772592
|
||||
"score": 0.0005449379
|
||||
},
|
||||
"Cancel": {
|
||||
"score": 0.00024834834
|
||||
"score": 0.000226470322
|
||||
},
|
||||
"Greeting": {
|
||||
"score": 0.000163752949
|
||||
"score": 0.000151786517
|
||||
}
|
||||
},
|
||||
"entities": {
|
||||
|
@ -43,7 +43,15 @@
|
|||
"endIndex": 69,
|
||||
"text": "http : / / foo . com is where you can fly from seattle to dallas via denver",
|
||||
"type": "Composite2",
|
||||
"score": 0.950585246
|
||||
"score": 0.962469339
|
||||
}
|
||||
],
|
||||
"geographyV2": [
|
||||
{
|
||||
"startIndex": 41,
|
||||
"endIndex": 48,
|
||||
"text": "seattle",
|
||||
"type": "builtin.geographyV2.city"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -56,7 +64,7 @@
|
|||
"endIndex": 69,
|
||||
"text": "denver",
|
||||
"type": "City",
|
||||
"score": 0.983408
|
||||
"score": 0.984729
|
||||
}
|
||||
],
|
||||
"url": [
|
||||
|
@ -73,7 +81,7 @@
|
|||
"endIndex": 48,
|
||||
"text": "seattle",
|
||||
"type": "City::From",
|
||||
"score": 0.9981071
|
||||
"score": 0.9992566
|
||||
}
|
||||
],
|
||||
"To": [
|
||||
|
@ -82,7 +90,7 @@
|
|||
"endIndex": 58,
|
||||
"text": "dallas",
|
||||
"type": "City::To",
|
||||
"score": 0.996769965
|
||||
"score": 0.998420954
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -99,62 +107,68 @@
|
|||
"dallas"
|
||||
]
|
||||
}
|
||||
],
|
||||
"geographyV2": [
|
||||
{
|
||||
"type": "city",
|
||||
"location": "seattle"
|
||||
}
|
||||
]
|
||||
},
|
||||
"sentiment": {
|
||||
"label": "neutral",
|
||||
"score": 0.5
|
||||
},
|
||||
"luisResult": {
|
||||
"v2": {
|
||||
"query": "http://foo.com is where you can fly from seattle to dallas via denver",
|
||||
"topScoringIntent": {
|
||||
"intent": "EntityTests",
|
||||
"score": 0.9513557
|
||||
"score": 0.944987357
|
||||
},
|
||||
"intents": [
|
||||
{
|
||||
"intent": "EntityTests",
|
||||
"score": 0.9513557
|
||||
},
|
||||
{
|
||||
"intent": "Roles",
|
||||
"score": 0.05937675
|
||||
},
|
||||
{
|
||||
"intent": "Weather.GetForecast",
|
||||
"score": 0.0246020257
|
||||
"score": 0.944987357
|
||||
},
|
||||
{
|
||||
"intent": "Travel",
|
||||
"score": 0.0182663873
|
||||
"score": 0.0452092439
|
||||
},
|
||||
{
|
||||
"intent": "Roles",
|
||||
"score": 0.0297764745
|
||||
},
|
||||
{
|
||||
"intent": "Weather.GetForecast",
|
||||
"score": 0.0231683664
|
||||
},
|
||||
{
|
||||
"intent": "search",
|
||||
"score": 0.0149017535
|
||||
"score": 0.008871362
|
||||
},
|
||||
{
|
||||
"intent": "None",
|
||||
"score": 0.004570498
|
||||
"score": 0.004223796
|
||||
},
|
||||
{
|
||||
"intent": "SpecifyName",
|
||||
"score": 0.00189947966
|
||||
"score": 0.00236839615
|
||||
},
|
||||
{
|
||||
"intent": "Delivery",
|
||||
"score": 0.00140795356
|
||||
"score": 0.0013232599
|
||||
},
|
||||
{
|
||||
"intent": "Help",
|
||||
"score": 0.0005772592
|
||||
"score": 0.0005449379
|
||||
},
|
||||
{
|
||||
"intent": "Cancel",
|
||||
"score": 0.00024834834
|
||||
"score": 0.000226470322
|
||||
},
|
||||
{
|
||||
"intent": "Greeting",
|
||||
"score": 0.000163752949
|
||||
"score": 0.000151786517
|
||||
}
|
||||
],
|
||||
"entities": [
|
||||
|
@ -163,28 +177,34 @@
|
|||
"type": "City::To",
|
||||
"startIndex": 52,
|
||||
"endIndex": 57,
|
||||
"score": 0.996769965
|
||||
"score": 0.998420954
|
||||
},
|
||||
{
|
||||
"entity": "seattle",
|
||||
"type": "City::From",
|
||||
"startIndex": 41,
|
||||
"endIndex": 47,
|
||||
"score": 0.9981071
|
||||
"score": 0.9992566
|
||||
},
|
||||
{
|
||||
"entity": "denver",
|
||||
"type": "City",
|
||||
"startIndex": 63,
|
||||
"endIndex": 68,
|
||||
"score": 0.983408
|
||||
"score": 0.984729
|
||||
},
|
||||
{
|
||||
"entity": "http : / / foo . com is where you can fly from seattle to dallas via denver",
|
||||
"type": "Composite2",
|
||||
"startIndex": 0,
|
||||
"endIndex": 68,
|
||||
"score": 0.950585246
|
||||
"score": 0.962469339
|
||||
},
|
||||
{
|
||||
"entity": "seattle",
|
||||
"type": "builtin.geographyV2.city",
|
||||
"startIndex": 41,
|
||||
"endIndex": 47
|
||||
},
|
||||
{
|
||||
"entity": "http://foo.com",
|
|
@ -2,37 +2,37 @@
|
|||
"text": "Deliver from 12345 VA to 12346 WA",
|
||||
"intents": {
|
||||
"Roles": {
|
||||
"score": 0.9999103
|
||||
"score": 0.999888361
|
||||
},
|
||||
"Delivery": {
|
||||
"score": 0.002187348
|
||||
"score": 0.00234605442
|
||||
},
|
||||
"search": {
|
||||
"score": 8.737297E-06
|
||||
},
|
||||
"SpecifyName": {
|
||||
"score": 2.84510975E-06
|
||||
"score": 9.343347E-06
|
||||
},
|
||||
"Travel": {
|
||||
"score": 2.84510975E-06
|
||||
"score": 3.04712876E-06
|
||||
},
|
||||
"None": {
|
||||
"score": 1.07744E-06
|
||||
"score": 1.15824787E-06
|
||||
},
|
||||
"Weather_GetForecast": {
|
||||
"score": 9.387989E-07
|
||||
"score": 1.01009994E-06
|
||||
},
|
||||
"SpecifyName": {
|
||||
"score": 3.01666669E-09
|
||||
},
|
||||
"Greeting": {
|
||||
"score": 9.9375E-10
|
||||
"score": 1.06875E-09
|
||||
},
|
||||
"Cancel": {
|
||||
"score": 9.2941177E-10
|
||||
"score": 1E-09
|
||||
},
|
||||
"Help": {
|
||||
"score": 9.2941177E-10
|
||||
"score": 1E-09
|
||||
},
|
||||
"EntityTests": {
|
||||
"score": 4.6451612E-10
|
||||
"score": 4.6666665E-10
|
||||
}
|
||||
},
|
||||
"entities": {
|
||||
|
@ -43,7 +43,7 @@
|
|||
"endIndex": 21,
|
||||
"text": "12345 va",
|
||||
"type": "Address",
|
||||
"score": 0.934437752
|
||||
"score": 0.9377045
|
||||
}
|
||||
],
|
||||
"Destination": [
|
||||
|
@ -52,7 +52,7 @@
|
|||
"endIndex": 33,
|
||||
"text": "12346 wa",
|
||||
"type": "Address",
|
||||
"score": 0.9827704
|
||||
"score": 0.9818967
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -74,7 +74,7 @@
|
|||
"endIndex": 21,
|
||||
"text": "va",
|
||||
"type": "State",
|
||||
"score": 0.9457865
|
||||
"score": 0.9417667
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -104,7 +104,7 @@
|
|||
"endIndex": 33,
|
||||
"text": "wa",
|
||||
"type": "State",
|
||||
"score": 0.9903071
|
||||
"score": 0.9899993
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -121,56 +121,56 @@
|
|||
"label": "neutral",
|
||||
"score": 0.5
|
||||
},
|
||||
"luisResult": {
|
||||
"v2": {
|
||||
"query": "Deliver from 12345 VA to 12346 WA",
|
||||
"topScoringIntent": {
|
||||
"intent": "Roles",
|
||||
"score": 0.9999103
|
||||
"score": 0.999888361
|
||||
},
|
||||
"intents": [
|
||||
{
|
||||
"intent": "Roles",
|
||||
"score": 0.9999103
|
||||
"score": 0.999888361
|
||||
},
|
||||
{
|
||||
"intent": "Delivery",
|
||||
"score": 0.002187348
|
||||
"score": 0.00234605442
|
||||
},
|
||||
{
|
||||
"intent": "search",
|
||||
"score": 8.737297E-06
|
||||
},
|
||||
{
|
||||
"intent": "SpecifyName",
|
||||
"score": 2.84510975E-06
|
||||
"score": 9.343347E-06
|
||||
},
|
||||
{
|
||||
"intent": "Travel",
|
||||
"score": 2.84510975E-06
|
||||
"score": 3.04712876E-06
|
||||
},
|
||||
{
|
||||
"intent": "None",
|
||||
"score": 1.07744E-06
|
||||
"score": 1.15824787E-06
|
||||
},
|
||||
{
|
||||
"intent": "Weather.GetForecast",
|
||||
"score": 9.387989E-07
|
||||
"score": 1.01009994E-06
|
||||
},
|
||||
{
|
||||
"intent": "SpecifyName",
|
||||
"score": 3.01666669E-09
|
||||
},
|
||||
{
|
||||
"intent": "Greeting",
|
||||
"score": 9.9375E-10
|
||||
"score": 1.06875E-09
|
||||
},
|
||||
{
|
||||
"intent": "Cancel",
|
||||
"score": 9.2941177E-10
|
||||
"score": 1E-09
|
||||
},
|
||||
{
|
||||
"intent": "Help",
|
||||
"score": 9.2941177E-10
|
||||
"score": 1E-09
|
||||
},
|
||||
{
|
||||
"intent": "EntityTests",
|
||||
"score": 4.6451612E-10
|
||||
"score": 4.6666665E-10
|
||||
}
|
||||
],
|
||||
"entities": [
|
||||
|
@ -179,21 +179,21 @@
|
|||
"type": "State",
|
||||
"startIndex": 19,
|
||||
"endIndex": 20,
|
||||
"score": 0.9457865
|
||||
"score": 0.9417667
|
||||
},
|
||||
{
|
||||
"entity": "wa",
|
||||
"type": "State",
|
||||
"startIndex": 31,
|
||||
"endIndex": 32,
|
||||
"score": 0.9903071
|
||||
"score": 0.9899993
|
||||
},
|
||||
{
|
||||
"entity": "12345 va",
|
||||
"type": "Address",
|
||||
"startIndex": 13,
|
||||
"endIndex": 20,
|
||||
"score": 0.934437752,
|
||||
"score": 0.9377045,
|
||||
"role": "Source"
|
||||
},
|
||||
{
|
||||
|
@ -201,7 +201,7 @@
|
|||
"type": "Address",
|
||||
"startIndex": 25,
|
||||
"endIndex": 32,
|
||||
"score": 0.9827704,
|
||||
"score": 0.9818967,
|
||||
"role": "Destination"
|
||||
},
|
||||
{
|
|
@ -0,0 +1,233 @@
|
|||
{
|
||||
"text": "go from next to last to last move london to jakarta and homer simpson is the parent of lisa simpson",
|
||||
"intents": {
|
||||
"Roles": {
|
||||
"score": 0.999204934
|
||||
},
|
||||
"search": {
|
||||
"score": 0.0309635121
|
||||
},
|
||||
"None": {
|
||||
"score": 0.0109820236
|
||||
},
|
||||
"Travel": {
|
||||
"score": 0.01095186
|
||||
},
|
||||
"Weather_GetForecast": {
|
||||
"score": 0.0106523167
|
||||
},
|
||||
"Delivery": {
|
||||
"score": 0.00123035291
|
||||
},
|
||||
"EntityTests": {
|
||||
"score": 0.0009487789
|
||||
},
|
||||
"SpecifyName": {
|
||||
"score": 0.0009410849
|
||||
},
|
||||
"Help": {
|
||||
"score": 0.0001358991
|
||||
},
|
||||
"Cancel": {
|
||||
"score": 0.000107549029
|
||||
},
|
||||
"Greeting": {
|
||||
"score": 5.293933E-05
|
||||
}
|
||||
},
|
||||
"entities": {
|
||||
"$instance": {
|
||||
"startloc": [
|
||||
{
|
||||
"startIndex": 34,
|
||||
"endIndex": 40,
|
||||
"text": "london",
|
||||
"type": "builtin.geographyV2.city"
|
||||
}
|
||||
],
|
||||
"endloc": [
|
||||
{
|
||||
"startIndex": 44,
|
||||
"endIndex": 51,
|
||||
"text": "jakarta",
|
||||
"type": "builtin.geographyV2.city"
|
||||
}
|
||||
],
|
||||
"startpos": [
|
||||
{
|
||||
"startIndex": 8,
|
||||
"endIndex": 20,
|
||||
"text": "next to last",
|
||||
"type": "builtin.ordinalV2.relative"
|
||||
}
|
||||
],
|
||||
"endpos": [
|
||||
{
|
||||
"startIndex": 24,
|
||||
"endIndex": 28,
|
||||
"text": "last",
|
||||
"type": "builtin.ordinalV2.relative"
|
||||
}
|
||||
],
|
||||
"parent": [
|
||||
{
|
||||
"startIndex": 56,
|
||||
"endIndex": 69,
|
||||
"text": "homer simpson",
|
||||
"type": "builtin.personName"
|
||||
}
|
||||
],
|
||||
"child": [
|
||||
{
|
||||
"startIndex": 87,
|
||||
"endIndex": 99,
|
||||
"text": "lisa simpson",
|
||||
"type": "builtin.personName"
|
||||
}
|
||||
]
|
||||
},
|
||||
"startloc": [
|
||||
{
|
||||
"type": "city",
|
||||
"location": "london"
|
||||
}
|
||||
],
|
||||
"endloc": [
|
||||
{
|
||||
"type": "city",
|
||||
"location": "jakarta"
|
||||
}
|
||||
],
|
||||
"startpos": [
|
||||
{
|
||||
"relativeTo": "end",
|
||||
"offset": -1
|
||||
}
|
||||
],
|
||||
"endpos": [
|
||||
{
|
||||
"relativeTo": "end",
|
||||
"offset": 0
|
||||
}
|
||||
],
|
||||
"parent": [
|
||||
"homer simpson"
|
||||
],
|
||||
"child": [
|
||||
"lisa simpson"
|
||||
]
|
||||
},
|
||||
"sentiment": {
|
||||
"label": "neutral",
|
||||
"score": 0.5
|
||||
},
|
||||
"v2": {
|
||||
"query": "go from next to last to last move london to jakarta and homer simpson is the parent of lisa simpson",
|
||||
"topScoringIntent": {
|
||||
"intent": "Roles",
|
||||
"score": 0.999204934
|
||||
},
|
||||
"intents": [
|
||||
{
|
||||
"intent": "Roles",
|
||||
"score": 0.999204934
|
||||
},
|
||||
{
|
||||
"intent": "search",
|
||||
"score": 0.0309635121
|
||||
},
|
||||
{
|
||||
"intent": "None",
|
||||
"score": 0.0109820236
|
||||
},
|
||||
{
|
||||
"intent": "Travel",
|
||||
"score": 0.01095186
|
||||
},
|
||||
{
|
||||
"intent": "Weather.GetForecast",
|
||||
"score": 0.0106523167
|
||||
},
|
||||
{
|
||||
"intent": "Delivery",
|
||||
"score": 0.00123035291
|
||||
},
|
||||
{
|
||||
"intent": "EntityTests",
|
||||
"score": 0.0009487789
|
||||
},
|
||||
{
|
||||
"intent": "SpecifyName",
|
||||
"score": 0.0009410849
|
||||
},
|
||||
{
|
||||
"intent": "Help",
|
||||
"score": 0.0001358991
|
||||
},
|
||||
{
|
||||
"intent": "Cancel",
|
||||
"score": 0.000107549029
|
||||
},
|
||||
{
|
||||
"intent": "Greeting",
|
||||
"score": 5.293933E-05
|
||||
}
|
||||
],
|
||||
"entities": [
|
||||
{
|
||||
"entity": "london",
|
||||
"type": "builtin.geographyV2.city",
|
||||
"startIndex": 34,
|
||||
"endIndex": 39,
|
||||
"role": "startloc"
|
||||
},
|
||||
{
|
||||
"entity": "jakarta",
|
||||
"type": "builtin.geographyV2.city",
|
||||
"startIndex": 44,
|
||||
"endIndex": 50,
|
||||
"role": "endloc"
|
||||
},
|
||||
{
|
||||
"entity": "next to last",
|
||||
"type": "builtin.ordinalV2.relative",
|
||||
"startIndex": 8,
|
||||
"endIndex": 19,
|
||||
"resolution": {
|
||||
"offset": "-1",
|
||||
"relativeTo": "end"
|
||||
},
|
||||
"role": "startpos"
|
||||
},
|
||||
{
|
||||
"entity": "last",
|
||||
"type": "builtin.ordinalV2.relative",
|
||||
"startIndex": 24,
|
||||
"endIndex": 27,
|
||||
"resolution": {
|
||||
"offset": "0",
|
||||
"relativeTo": "end"
|
||||
},
|
||||
"role": "endpos"
|
||||
},
|
||||
{
|
||||
"entity": "homer simpson",
|
||||
"type": "builtin.personName",
|
||||
"startIndex": 56,
|
||||
"endIndex": 68,
|
||||
"role": "parent"
|
||||
},
|
||||
{
|
||||
"entity": "lisa simpson",
|
||||
"type": "builtin.personName",
|
||||
"startIndex": 87,
|
||||
"endIndex": 98,
|
||||
"role": "child"
|
||||
}
|
||||
],
|
||||
"sentimentAnalysis": {
|
||||
"label": "neutral",
|
||||
"score": 0.5
|
||||
}
|
||||
}
|
||||
}
|
|
@ -2,41 +2,49 @@
|
|||
"text": "email about something wicked this way comes from bart simpson and also kb435",
|
||||
"intents": {
|
||||
"search": {
|
||||
"score": 0.999999046
|
||||
},
|
||||
"None": {
|
||||
"score": 6.808464E-06
|
||||
},
|
||||
"Roles": {
|
||||
"score": 4.005832E-06
|
||||
},
|
||||
"Weather_GetForecast": {
|
||||
"score": 2.87446119E-06
|
||||
},
|
||||
"SpecifyName": {
|
||||
"score": 2.84510975E-06
|
||||
},
|
||||
"Travel": {
|
||||
"score": 2.84510975E-06
|
||||
},
|
||||
"Delivery": {
|
||||
"score": 1.66666393E-06
|
||||
"score": 0.9999993
|
||||
},
|
||||
"EntityTests": {
|
||||
"score": 1.43664579E-06
|
||||
"score": 1.044335E-05
|
||||
},
|
||||
"Roles": {
|
||||
"score": 5.98274755E-06
|
||||
},
|
||||
"Travel": {
|
||||
"score": 3.09763345E-06
|
||||
},
|
||||
"None": {
|
||||
"score": 2.38094663E-06
|
||||
},
|
||||
"Weather_GetForecast": {
|
||||
"score": 1.02792524E-06
|
||||
},
|
||||
"SpecifyName": {
|
||||
"score": 3.0666667E-09
|
||||
},
|
||||
"Delivery": {
|
||||
"score": 1.8E-09
|
||||
},
|
||||
"Greeting": {
|
||||
"score": 9.9375E-10
|
||||
"score": 1.0875E-09
|
||||
},
|
||||
"Cancel": {
|
||||
"score": 9.2941177E-10
|
||||
"score": 1.01764708E-09
|
||||
},
|
||||
"Help": {
|
||||
"score": 9.2941177E-10
|
||||
"score": 1.01764708E-09
|
||||
}
|
||||
},
|
||||
"entities": {
|
||||
"$instance": {
|
||||
"personName": [
|
||||
{
|
||||
"startIndex": 49,
|
||||
"endIndex": 61,
|
||||
"text": "bart simpson",
|
||||
"type": "builtin.personName"
|
||||
}
|
||||
],
|
||||
"Part": [
|
||||
{
|
||||
"startIndex": 71,
|
||||
|
@ -70,6 +78,9 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
"personName": [
|
||||
"bart simpson"
|
||||
],
|
||||
"Part": [
|
||||
"kb435"
|
||||
],
|
||||
|
@ -87,59 +98,65 @@
|
|||
"label": "negative",
|
||||
"score": 0.210341513
|
||||
},
|
||||
"luisResult": {
|
||||
"v2": {
|
||||
"query": "email about something wicked this way comes from bart simpson and also kb435",
|
||||
"topScoringIntent": {
|
||||
"intent": "search",
|
||||
"score": 0.999999046
|
||||
"score": 0.9999993
|
||||
},
|
||||
"intents": [
|
||||
{
|
||||
"intent": "search",
|
||||
"score": 0.999999046
|
||||
},
|
||||
{
|
||||
"intent": "None",
|
||||
"score": 6.808464E-06
|
||||
},
|
||||
{
|
||||
"intent": "Roles",
|
||||
"score": 4.005832E-06
|
||||
},
|
||||
{
|
||||
"intent": "Weather.GetForecast",
|
||||
"score": 2.87446119E-06
|
||||
},
|
||||
{
|
||||
"intent": "SpecifyName",
|
||||
"score": 2.84510975E-06
|
||||
},
|
||||
{
|
||||
"intent": "Travel",
|
||||
"score": 2.84510975E-06
|
||||
},
|
||||
{
|
||||
"intent": "Delivery",
|
||||
"score": 1.66666393E-06
|
||||
"score": 0.9999993
|
||||
},
|
||||
{
|
||||
"intent": "EntityTests",
|
||||
"score": 1.43664579E-06
|
||||
"score": 1.044335E-05
|
||||
},
|
||||
{
|
||||
"intent": "Roles",
|
||||
"score": 5.98274755E-06
|
||||
},
|
||||
{
|
||||
"intent": "Travel",
|
||||
"score": 3.09763345E-06
|
||||
},
|
||||
{
|
||||
"intent": "None",
|
||||
"score": 2.38094663E-06
|
||||
},
|
||||
{
|
||||
"intent": "Weather.GetForecast",
|
||||
"score": 1.02792524E-06
|
||||
},
|
||||
{
|
||||
"intent": "SpecifyName",
|
||||
"score": 3.0666667E-09
|
||||
},
|
||||
{
|
||||
"intent": "Delivery",
|
||||
"score": 1.8E-09
|
||||
},
|
||||
{
|
||||
"intent": "Greeting",
|
||||
"score": 9.9375E-10
|
||||
"score": 1.0875E-09
|
||||
},
|
||||
{
|
||||
"intent": "Cancel",
|
||||
"score": 9.2941177E-10
|
||||
"score": 1.01764708E-09
|
||||
},
|
||||
{
|
||||
"intent": "Help",
|
||||
"score": 9.2941177E-10
|
||||
"score": 1.01764708E-09
|
||||
}
|
||||
],
|
||||
"entities": [
|
||||
{
|
||||
"entity": "bart simpson",
|
||||
"type": "builtin.personName",
|
||||
"startIndex": 49,
|
||||
"endIndex": 60
|
||||
},
|
||||
{
|
||||
"entity": "kb435",
|
||||
"type": "Part",
|
|
@ -2,37 +2,37 @@
|
|||
"text": "http://foo.com is where you can get a weather forecast for seattle",
|
||||
"intents": {
|
||||
"Weather_GetForecast": {
|
||||
"score": 0.6606207
|
||||
"score": 0.669524968
|
||||
},
|
||||
"EntityTests": {
|
||||
"score": 0.415276438
|
||||
"score": 0.342939854
|
||||
},
|
||||
"Roles": {
|
||||
"score": 0.101625636
|
||||
"score": 0.0432791822
|
||||
},
|
||||
"None": {
|
||||
"score": 0.0172496215
|
||||
"score": 0.0175834317
|
||||
},
|
||||
"search": {
|
||||
"score": 0.0112974783
|
||||
"score": 0.014743383
|
||||
},
|
||||
"Travel": {
|
||||
"score": 0.004495183
|
||||
"score": 0.013458414
|
||||
},
|
||||
"SpecifyName": {
|
||||
"score": 0.00139474764
|
||||
"score": 0.00172697916
|
||||
},
|
||||
"Delivery": {
|
||||
"score": 0.00116541423
|
||||
"score": 0.0011408634
|
||||
},
|
||||
"Help": {
|
||||
"score": 0.0005478024
|
||||
"score": 0.0005502715
|
||||
},
|
||||
"Cancel": {
|
||||
"score": 0.000173182227
|
||||
"score": 0.000171828113
|
||||
},
|
||||
"Greeting": {
|
||||
"score": 0.000154677386
|
||||
"score": 0.0001518702
|
||||
}
|
||||
},
|
||||
"entities": {
|
||||
|
@ -43,7 +43,15 @@
|
|||
"endIndex": 66,
|
||||
"text": "http : / / foo . com is where you can get a weather forecast for seattle",
|
||||
"type": "Composite2",
|
||||
"score": 0.68477273
|
||||
"score": 0.456283748
|
||||
}
|
||||
],
|
||||
"geographyV2": [
|
||||
{
|
||||
"startIndex": 59,
|
||||
"endIndex": 66,
|
||||
"text": "seattle",
|
||||
"type": "builtin.geographyV2.city"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -64,7 +72,7 @@
|
|||
"endIndex": 66,
|
||||
"text": "seattle",
|
||||
"type": "Weather.Location",
|
||||
"score": 0.756665945
|
||||
"score": 0.76184386
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -75,62 +83,68 @@
|
|||
"seattle"
|
||||
]
|
||||
}
|
||||
],
|
||||
"geographyV2": [
|
||||
{
|
||||
"type": "city",
|
||||
"location": "seattle"
|
||||
}
|
||||
]
|
||||
},
|
||||
"sentiment": {
|
||||
"label": "neutral",
|
||||
"score": 0.5
|
||||
},
|
||||
"luisResult": {
|
||||
"v2": {
|
||||
"query": "http://foo.com is where you can get a weather forecast for seattle",
|
||||
"topScoringIntent": {
|
||||
"intent": "Weather.GetForecast",
|
||||
"score": 0.6606207
|
||||
"score": 0.669524968
|
||||
},
|
||||
"intents": [
|
||||
{
|
||||
"intent": "Weather.GetForecast",
|
||||
"score": 0.6606207
|
||||
"score": 0.669524968
|
||||
},
|
||||
{
|
||||
"intent": "EntityTests",
|
||||
"score": 0.415276438
|
||||
"score": 0.342939854
|
||||
},
|
||||
{
|
||||
"intent": "Roles",
|
||||
"score": 0.101625636
|
||||
"score": 0.0432791822
|
||||
},
|
||||
{
|
||||
"intent": "None",
|
||||
"score": 0.0172496215
|
||||
"score": 0.0175834317
|
||||
},
|
||||
{
|
||||
"intent": "search",
|
||||
"score": 0.0112974783
|
||||
"score": 0.014743383
|
||||
},
|
||||
{
|
||||
"intent": "Travel",
|
||||
"score": 0.004495183
|
||||
"score": 0.013458414
|
||||
},
|
||||
{
|
||||
"intent": "SpecifyName",
|
||||
"score": 0.00139474764
|
||||
"score": 0.00172697916
|
||||
},
|
||||
{
|
||||
"intent": "Delivery",
|
||||
"score": 0.00116541423
|
||||
"score": 0.0011408634
|
||||
},
|
||||
{
|
||||
"intent": "Help",
|
||||
"score": 0.0005478024
|
||||
"score": 0.0005502715
|
||||
},
|
||||
{
|
||||
"intent": "Cancel",
|
||||
"score": 0.000173182227
|
||||
"score": 0.000171828113
|
||||
},
|
||||
{
|
||||
"intent": "Greeting",
|
||||
"score": 0.000154677386
|
||||
"score": 0.0001518702
|
||||
}
|
||||
],
|
||||
"entities": [
|
||||
|
@ -139,14 +153,20 @@
|
|||
"type": "Weather.Location",
|
||||
"startIndex": 59,
|
||||
"endIndex": 65,
|
||||
"score": 0.756665945
|
||||
"score": 0.76184386
|
||||
},
|
||||
{
|
||||
"entity": "http : / / foo . com is where you can get a weather forecast for seattle",
|
||||
"type": "Composite2",
|
||||
"startIndex": 0,
|
||||
"endIndex": 65,
|
||||
"score": 0.68477273
|
||||
"score": 0.456283748
|
||||
},
|
||||
{
|
||||
"entity": "seattle",
|
||||
"type": "builtin.geographyV2.city",
|
||||
"startIndex": 59,
|
||||
"endIndex": 65
|
||||
},
|
||||
{
|
||||
"entity": "http://foo.com",
|
|
@ -1,41 +1,59 @@
|
|||
{
|
||||
"Text": "12 years old and 3 days old and monday july 3rd and every monday and between 3am and 5:30am and 4 acres and 4 pico meters and chrimc@hotmail.com and $4 and $4.25 and also 32 and 210.4 and first and 10% and 10.5% and 425-555-1234 and 3 degrees and -27.5 degrees c",
|
||||
"Intents": {
|
||||
"text": "12 years old and 3 days old and monday july 3rd and every monday and between 3am and 5:30am and 4 acres and 4 pico meters and chrimc@hotmail.com and $4 and $4.25 and also 32 and 210.4 and first and 10% and 10.5% and 425-555-1234 and 3 degrees and -27.5 degrees c and the next one and the previous one",
|
||||
"intents": {
|
||||
"EntityTests": {
|
||||
"score": 0.989627659
|
||||
"score": 0.96595037
|
||||
},
|
||||
"Roles": {
|
||||
"score": 0.180199549
|
||||
"score": 0.184567839
|
||||
},
|
||||
"search": {
|
||||
"score": 0.0275263824
|
||||
"score": 0.149123311
|
||||
},
|
||||
"Weather_GetForecast": {
|
||||
"score": 0.009608224
|
||||
},
|
||||
"None": {
|
||||
"score": 0.00783522
|
||||
"score": 0.0122321565
|
||||
},
|
||||
"Travel": {
|
||||
"score": 0.004344591
|
||||
"score": 0.0114093516
|
||||
},
|
||||
"None": {
|
||||
"score": 0.009063047
|
||||
},
|
||||
"Delivery": {
|
||||
"score": 0.000295953825
|
||||
"score": 0.000278715248
|
||||
},
|
||||
"SpecifyName": {
|
||||
"score": 0.000167466555
|
||||
"score": 6.590373E-05
|
||||
},
|
||||
"Help": {
|
||||
"score": 5.885256E-06
|
||||
"score": 4.902734E-06
|
||||
},
|
||||
"Cancel": {
|
||||
"score": 2.01380772E-06
|
||||
"score": 1.602786E-06
|
||||
},
|
||||
"Greeting": {
|
||||
"score": 1.080502E-06
|
||||
"score": 8.547132E-07
|
||||
}
|
||||
},
|
||||
"Entities": {
|
||||
"entities": {
|
||||
"ordinalV2": [
|
||||
{
|
||||
"relativeTo": "start",
|
||||
"offset": 3
|
||||
},
|
||||
{
|
||||
"relativeTo": "start",
|
||||
"offset": 1
|
||||
},
|
||||
{
|
||||
"relativeTo": "current",
|
||||
"offset": 1
|
||||
},
|
||||
{
|
||||
"relativeTo": "current",
|
||||
"offset": -1
|
||||
}
|
||||
],
|
||||
"Composite1": [
|
||||
{
|
||||
"age": [
|
||||
|
@ -119,7 +137,9 @@
|
|||
555.0,
|
||||
1234.0,
|
||||
3.0,
|
||||
-27.5
|
||||
-27.5,
|
||||
1.0,
|
||||
1.0
|
||||
],
|
||||
"ordinal": [
|
||||
3.0,
|
||||
|
@ -337,6 +357,20 @@
|
|||
"text": "-27.5",
|
||||
"type": "builtin.number",
|
||||
"subtype": "decimal"
|
||||
},
|
||||
{
|
||||
"startIndex": 276,
|
||||
"endIndex": 279,
|
||||
"text": "one",
|
||||
"type": "builtin.number",
|
||||
"subtype": "integer"
|
||||
},
|
||||
{
|
||||
"startIndex": 297,
|
||||
"endIndex": 300,
|
||||
"text": "one",
|
||||
"type": "builtin.number",
|
||||
"subtype": "integer"
|
||||
}
|
||||
],
|
||||
"ordinal": [
|
||||
|
@ -396,11 +430,37 @@
|
|||
"Composite1": [
|
||||
{
|
||||
"startIndex": 0,
|
||||
"endIndex": 262,
|
||||
"text": "12 years old and 3 days old and monday july 3rd and every monday and between 3am and 5 : 30am and 4 acres and 4 pico meters and chrimc @ hotmail . com and $ 4 and $ 4 . 25 and also 32 and 210 . 4 and first and 10 % and 10 . 5 % and 425 - 555 - 1234 and 3 degrees and - 27 . 5 degrees c",
|
||||
"score": 0.4619997,
|
||||
"endIndex": 300,
|
||||
"text": "12 years old and 3 days old and monday july 3rd and every monday and between 3am and 5 : 30am and 4 acres and 4 pico meters and chrimc @ hotmail . com and $ 4 and $ 4 . 25 and also 32 and 210 . 4 and first and 10 % and 10 . 5 % and 425 - 555 - 1234 and 3 degrees and - 27 . 5 degrees c and the next one and the previous one",
|
||||
"score": 0.877445638,
|
||||
"type": "Composite1"
|
||||
}
|
||||
],
|
||||
"ordinalV2": [
|
||||
{
|
||||
"startIndex": 44,
|
||||
"endIndex": 47,
|
||||
"text": "3rd",
|
||||
"type": "builtin.ordinalV2"
|
||||
},
|
||||
{
|
||||
"startIndex": 188,
|
||||
"endIndex": 193,
|
||||
"text": "first",
|
||||
"type": "builtin.ordinalV2"
|
||||
},
|
||||
{
|
||||
"startIndex": 271,
|
||||
"endIndex": 279,
|
||||
"text": "next one",
|
||||
"type": "builtin.ordinalV2.relative"
|
||||
},
|
||||
{
|
||||
"startIndex": 288,
|
||||
"endIndex": 300,
|
||||
"text": "previous one",
|
||||
"type": "builtin.ordinalV2.relative"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
|
@ -408,65 +468,65 @@
|
|||
"label": "neutral",
|
||||
"score": 0.5
|
||||
},
|
||||
"luisResult": {
|
||||
"query": "12 years old and 3 days old and monday july 3rd and every monday and between 3am and 5:30am and 4 acres and 4 pico meters and chrimc@hotmail.com and $4 and $4.25 and also 32 and 210.4 and first and 10% and 10.5% and 425-555-1234 and 3 degrees and -27.5 degrees c",
|
||||
"v2": {
|
||||
"query": "12 years old and 3 days old and monday july 3rd and every monday and between 3am and 5:30am and 4 acres and 4 pico meters and chrimc@hotmail.com and $4 and $4.25 and also 32 and 210.4 and first and 10% and 10.5% and 425-555-1234 and 3 degrees and -27.5 degrees c and the next one and the previous one",
|
||||
"topScoringIntent": {
|
||||
"intent": "EntityTests",
|
||||
"score": 0.989627659
|
||||
"score": 0.96595037
|
||||
},
|
||||
"intents": [
|
||||
{
|
||||
"intent": "EntityTests",
|
||||
"score": 0.989627659
|
||||
"score": 0.96595037
|
||||
},
|
||||
{
|
||||
"intent": "Roles",
|
||||
"score": 0.180199549
|
||||
"score": 0.184567839
|
||||
},
|
||||
{
|
||||
"intent": "search",
|
||||
"score": 0.0275263824
|
||||
"score": 0.149123311
|
||||
},
|
||||
{
|
||||
"intent": "Weather.GetForecast",
|
||||
"score": 0.009608224
|
||||
},
|
||||
{
|
||||
"intent": "None",
|
||||
"score": 0.00783522
|
||||
"score": 0.0122321565
|
||||
},
|
||||
{
|
||||
"intent": "Travel",
|
||||
"score": 0.004344591
|
||||
"score": 0.0114093516
|
||||
},
|
||||
{
|
||||
"intent": "None",
|
||||
"score": 0.009063047
|
||||
},
|
||||
{
|
||||
"intent": "Delivery",
|
||||
"score": 0.000295953825
|
||||
"score": 0.000278715248
|
||||
},
|
||||
{
|
||||
"intent": "SpecifyName",
|
||||
"score": 0.000167466555
|
||||
"score": 6.590373E-05
|
||||
},
|
||||
{
|
||||
"intent": "Help",
|
||||
"score": 5.885256E-06
|
||||
"score": 4.902734E-06
|
||||
},
|
||||
{
|
||||
"intent": "Cancel",
|
||||
"score": 2.01380772E-06
|
||||
"score": 1.602786E-06
|
||||
},
|
||||
{
|
||||
"intent": "Greeting",
|
||||
"score": 1.080502E-06
|
||||
"score": 8.547132E-07
|
||||
}
|
||||
],
|
||||
"entities": [
|
||||
{
|
||||
"entity": "12 years old and 3 days old and monday july 3rd and every monday and between 3am and 5 : 30am and 4 acres and 4 pico meters and chrimc @ hotmail . com and $ 4 and $ 4 . 25 and also 32 and 210 . 4 and first and 10 % and 10 . 5 % and 425 - 555 - 1234 and 3 degrees and - 27 . 5 degrees c",
|
||||
"entity": "12 years old and 3 days old and monday july 3rd and every monday and between 3am and 5 : 30am and 4 acres and 4 pico meters and chrimc @ hotmail . com and $ 4 and $ 4 . 25 and also 32 and 210 . 4 and first and 10 % and 10 . 5 % and 425 - 555 - 1234 and 3 degrees and - 27 . 5 degrees c and the next one and the previous one",
|
||||
"type": "Composite1",
|
||||
"startIndex": 0,
|
||||
"endIndex": 261,
|
||||
"score": 0.4619997
|
||||
"endIndex": 299,
|
||||
"score": 0.877445638
|
||||
},
|
||||
{
|
||||
"entity": "12",
|
||||
|
@ -628,6 +688,26 @@
|
|||
"value": "-27.5"
|
||||
}
|
||||
},
|
||||
{
|
||||
"entity": "one",
|
||||
"type": "builtin.number",
|
||||
"startIndex": 276,
|
||||
"endIndex": 278,
|
||||
"resolution": {
|
||||
"subtype": "integer",
|
||||
"value": "1"
|
||||
}
|
||||
},
|
||||
{
|
||||
"entity": "one",
|
||||
"type": "builtin.number",
|
||||
"startIndex": 297,
|
||||
"endIndex": 299,
|
||||
"resolution": {
|
||||
"subtype": "integer",
|
||||
"value": "1"
|
||||
}
|
||||
},
|
||||
{
|
||||
"entity": "12 years old",
|
||||
"type": "builtin.age",
|
||||
|
@ -796,6 +876,46 @@
|
|||
"value": "1"
|
||||
}
|
||||
},
|
||||
{
|
||||
"entity": "3rd",
|
||||
"type": "builtin.ordinalV2",
|
||||
"startIndex": 44,
|
||||
"endIndex": 46,
|
||||
"resolution": {
|
||||
"offset": "3",
|
||||
"relativeTo": "start"
|
||||
}
|
||||
},
|
||||
{
|
||||
"entity": "first",
|
||||
"type": "builtin.ordinalV2",
|
||||
"startIndex": 188,
|
||||
"endIndex": 192,
|
||||
"resolution": {
|
||||
"offset": "1",
|
||||
"relativeTo": "start"
|
||||
}
|
||||
},
|
||||
{
|
||||
"entity": "next one",
|
||||
"type": "builtin.ordinalV2.relative",
|
||||
"startIndex": 271,
|
||||
"endIndex": 278,
|
||||
"resolution": {
|
||||
"offset": "1",
|
||||
"relativeTo": "current"
|
||||
}
|
||||
},
|
||||
{
|
||||
"entity": "previous one",
|
||||
"type": "builtin.ordinalV2.relative",
|
||||
"startIndex": 288,
|
||||
"endIndex": 299,
|
||||
"resolution": {
|
||||
"offset": "-1",
|
||||
"relativeTo": "current"
|
||||
}
|
||||
},
|
||||
{
|
||||
"entity": "10%",
|
||||
"type": "builtin.percentage",
|
||||
|
@ -848,7 +968,7 @@
|
|||
"compositeEntities": [
|
||||
{
|
||||
"parentType": "Composite1",
|
||||
"value": "12 years old and 3 days old and monday july 3rd and every monday and between 3am and 5 : 30am and 4 acres and 4 pico meters and chrimc @ hotmail . com and $ 4 and $ 4 . 25 and also 32 and 210 . 4 and first and 10 % and 10 . 5 % and 425 - 555 - 1234 and 3 degrees and - 27 . 5 degrees c",
|
||||
"value": "12 years old and 3 days old and monday july 3rd and every monday and between 3am and 5 : 30am and 4 acres and 4 pico meters and chrimc @ hotmail . com and $ 4 and $ 4 . 25 and also 32 and 210 . 4 and first and 10 % and 10 . 5 % and 425 - 555 - 1234 and 3 degrees and - 27 . 5 degrees c and the next one and the previous one",
|
||||
"children": [
|
||||
{
|
||||
"type": "builtin.age",
|
||||
|
@ -962,6 +1082,14 @@
|
|||
"type": "builtin.number",
|
||||
"value": "-27.5"
|
||||
},
|
||||
{
|
||||
"type": "builtin.number",
|
||||
"value": "one"
|
||||
},
|
||||
{
|
||||
"type": "builtin.number",
|
||||
"value": "one"
|
||||
},
|
||||
{
|
||||
"type": "builtin.ordinal",
|
||||
"value": "3rd"
|
|
@ -1,41 +1,47 @@
|
|||
{
|
||||
"Text": "http://foo.com is where you can get a weather forecast for seattle",
|
||||
"Intents": {
|
||||
"text": "http://foo.com is where you can get a weather forecast for seattle",
|
||||
"intents": {
|
||||
"Weather_GetForecast": {
|
||||
"score": 0.6606207
|
||||
"score": 0.669524968
|
||||
},
|
||||
"EntityTests": {
|
||||
"score": 0.415276438
|
||||
"score": 0.342939854
|
||||
},
|
||||
"Roles": {
|
||||
"score": 0.07347516
|
||||
"score": 0.0432791822
|
||||
},
|
||||
"None": {
|
||||
"score": 0.0172496215
|
||||
"score": 0.0175834317
|
||||
},
|
||||
"search": {
|
||||
"score": 0.0105431341
|
||||
"score": 0.014743383
|
||||
},
|
||||
"Travel": {
|
||||
"score": 0.00389883434
|
||||
"score": 0.013458414
|
||||
},
|
||||
"SpecifyName": {
|
||||
"score": 0.001811265
|
||||
"score": 0.00172697916
|
||||
},
|
||||
"Delivery": {
|
||||
"score": 0.00116541423
|
||||
"score": 0.0011408634
|
||||
},
|
||||
"Help": {
|
||||
"score": 0.0005478024
|
||||
"score": 0.0005502715
|
||||
},
|
||||
"Cancel": {
|
||||
"score": 0.000173182227
|
||||
"score": 0.000171828113
|
||||
},
|
||||
"Greeting": {
|
||||
"score": 0.000154677386
|
||||
"score": 0.0001518702
|
||||
}
|
||||
},
|
||||
"Entities": {
|
||||
"entities": {
|
||||
"geographyV2": [
|
||||
{
|
||||
"type": "city",
|
||||
"location": "seattle"
|
||||
}
|
||||
],
|
||||
"Composite2": [
|
||||
{
|
||||
"url": [
|
||||
|
@ -58,7 +64,7 @@
|
|||
"startIndex": 59,
|
||||
"endIndex": 66,
|
||||
"text": "seattle",
|
||||
"score": 0.756665945,
|
||||
"score": 0.76184386,
|
||||
"type": "Weather.Location"
|
||||
}
|
||||
]
|
||||
|
@ -71,9 +77,17 @@
|
|||
"startIndex": 0,
|
||||
"endIndex": 66,
|
||||
"text": "http : / / foo . com is where you can get a weather forecast for seattle",
|
||||
"score": 0.617026448,
|
||||
"score": 0.456283748,
|
||||
"type": "Composite2"
|
||||
}
|
||||
],
|
||||
"geographyV2": [
|
||||
{
|
||||
"startIndex": 59,
|
||||
"endIndex": 66,
|
||||
"text": "seattle",
|
||||
"type": "builtin.geographyV2.city"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
|
@ -81,56 +95,56 @@
|
|||
"label": "neutral",
|
||||
"score": 0.5
|
||||
},
|
||||
"luisResult": {
|
||||
"v2": {
|
||||
"query": "http://foo.com is where you can get a weather forecast for seattle",
|
||||
"topScoringIntent": {
|
||||
"intent": "Weather.GetForecast",
|
||||
"score": 0.6606207
|
||||
"score": 0.669524968
|
||||
},
|
||||
"intents": [
|
||||
{
|
||||
"intent": "Weather.GetForecast",
|
||||
"score": 0.6606207
|
||||
"score": 0.669524968
|
||||
},
|
||||
{
|
||||
"intent": "EntityTests",
|
||||
"score": 0.415276438
|
||||
"score": 0.342939854
|
||||
},
|
||||
{
|
||||
"intent": "Roles",
|
||||
"score": 0.07347516
|
||||
"score": 0.0432791822
|
||||
},
|
||||
{
|
||||
"intent": "None",
|
||||
"score": 0.0172496215
|
||||
"score": 0.0175834317
|
||||
},
|
||||
{
|
||||
"intent": "search",
|
||||
"score": 0.0105431341
|
||||
"score": 0.014743383
|
||||
},
|
||||
{
|
||||
"intent": "Travel",
|
||||
"score": 0.00389883434
|
||||
"score": 0.013458414
|
||||
},
|
||||
{
|
||||
"intent": "SpecifyName",
|
||||
"score": 0.001811265
|
||||
"score": 0.00172697916
|
||||
},
|
||||
{
|
||||
"intent": "Delivery",
|
||||
"score": 0.00116541423
|
||||
"score": 0.0011408634
|
||||
},
|
||||
{
|
||||
"intent": "Help",
|
||||
"score": 0.0005478024
|
||||
"score": 0.0005502715
|
||||
},
|
||||
{
|
||||
"intent": "Cancel",
|
||||
"score": 0.000173182227
|
||||
"score": 0.000171828113
|
||||
},
|
||||
{
|
||||
"intent": "Greeting",
|
||||
"score": 0.000154677386
|
||||
"score": 0.0001518702
|
||||
}
|
||||
],
|
||||
"entities": [
|
||||
|
@ -139,14 +153,20 @@
|
|||
"type": "Weather.Location",
|
||||
"startIndex": 59,
|
||||
"endIndex": 65,
|
||||
"score": 0.756665945
|
||||
"score": 0.76184386
|
||||
},
|
||||
{
|
||||
"entity": "http : / / foo . com is where you can get a weather forecast for seattle",
|
||||
"type": "Composite2",
|
||||
"startIndex": 0,
|
||||
"endIndex": 65,
|
||||
"score": 0.617026448
|
||||
"score": 0.456283748
|
||||
},
|
||||
{
|
||||
"entity": "seattle",
|
||||
"type": "builtin.geographyV2.city",
|
||||
"startIndex": 59,
|
||||
"endIndex": 65
|
||||
},
|
||||
{
|
||||
"entity": "http://foo.com",
|
|
@ -4,53 +4,46 @@
|
|||
"Roles": {
|
||||
"score": 1.0
|
||||
},
|
||||
"EntityTests": {
|
||||
"score": 0.0115484772
|
||||
"search": {
|
||||
"score": 0.08896044
|
||||
},
|
||||
"Weather_GetForecast": {
|
||||
"score": 0.009885744
|
||||
},
|
||||
"search": {
|
||||
"score": 0.009508528
|
||||
"score": 0.0100867962
|
||||
},
|
||||
"Travel": {
|
||||
"score": 0.004027992
|
||||
"score": 0.009896766
|
||||
},
|
||||
"EntityTests": {
|
||||
"score": 0.0046325135
|
||||
},
|
||||
"None": {
|
||||
"score": 0.00087468233
|
||||
},
|
||||
"SpecifyName": {
|
||||
"score": 0.000113203794
|
||||
"score": 0.00093744183
|
||||
},
|
||||
"Delivery": {
|
||||
"score": 7.92103747E-05
|
||||
"score": 7.978094E-05
|
||||
},
|
||||
"SpecifyName": {
|
||||
"score": 5.360404E-05
|
||||
},
|
||||
"Help": {
|
||||
"score": 6.826453E-07
|
||||
"score": 7.622754E-07
|
||||
},
|
||||
"Greeting": {
|
||||
"score": 4.24091354E-07
|
||||
"score": 4.73494453E-07
|
||||
},
|
||||
"Cancel": {
|
||||
"score": 4.06555785E-07
|
||||
"score": 4.50860341E-07
|
||||
}
|
||||
},
|
||||
"entities": {
|
||||
"$instance": {
|
||||
"Composite1": [
|
||||
"likee": [
|
||||
{
|
||||
"startIndex": 0,
|
||||
"endIndex": 211,
|
||||
"text": "3 inches long by 2 inches wide and 5 % to 10 % and are you between 6 years old and 8 years old and can i trade kb457 for kb922 and change 425 - 777 - 1212 to 206 - 666 - 4123 and did delta buy virgin and did the rain from",
|
||||
"type": "Composite1",
|
||||
"score": 0.0632453859
|
||||
},
|
||||
{
|
||||
"startIndex": 299,
|
||||
"endIndex": 420,
|
||||
"text": "68 degrees and 72 degrees and john likes mary and leave 3pm and arrive 5pm and pay between $ 400 and $ 500 and send chrimc @",
|
||||
"type": "Composite1",
|
||||
"score": 0.0442264825
|
||||
"startIndex": 340,
|
||||
"endIndex": 344,
|
||||
"text": "mary",
|
||||
"type": "Name",
|
||||
"score": 0.9899757
|
||||
}
|
||||
],
|
||||
"liker": [
|
||||
|
@ -59,25 +52,7 @@
|
|||
"endIndex": 333,
|
||||
"text": "john",
|
||||
"type": "Name",
|
||||
"score": 0.9921442
|
||||
}
|
||||
],
|
||||
"likee": [
|
||||
{
|
||||
"startIndex": 340,
|
||||
"endIndex": 344,
|
||||
"text": "mary",
|
||||
"type": "Name",
|
||||
"score": 0.9902693
|
||||
}
|
||||
],
|
||||
"destination": [
|
||||
{
|
||||
"startIndex": 226,
|
||||
"endIndex": 233,
|
||||
"text": "redmond",
|
||||
"type": "Weather.Location",
|
||||
"score": 0.987181664
|
||||
"score": 0.9922591
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
|
@ -86,7 +61,130 @@
|
|||
"endIndex": 218,
|
||||
"text": "hawaii",
|
||||
"type": "Weather.Location",
|
||||
"score": 0.972107649
|
||||
"score": 0.9713092
|
||||
}
|
||||
],
|
||||
"destination": [
|
||||
{
|
||||
"startIndex": 226,
|
||||
"endIndex": 233,
|
||||
"text": "redmond",
|
||||
"type": "Weather.Location",
|
||||
"score": 0.985884964
|
||||
}
|
||||
],
|
||||
"number": [
|
||||
{
|
||||
"startIndex": 0,
|
||||
"endIndex": 1,
|
||||
"text": "3",
|
||||
"type": "builtin.number",
|
||||
"subtype": "integer"
|
||||
},
|
||||
{
|
||||
"startIndex": 17,
|
||||
"endIndex": 18,
|
||||
"text": "2",
|
||||
"type": "builtin.number",
|
||||
"subtype": "integer"
|
||||
},
|
||||
{
|
||||
"startIndex": 35,
|
||||
"endIndex": 36,
|
||||
"text": "5",
|
||||
"type": "builtin.number",
|
||||
"subtype": "integer"
|
||||
},
|
||||
{
|
||||
"startIndex": 41,
|
||||
"endIndex": 43,
|
||||
"text": "10",
|
||||
"type": "builtin.number",
|
||||
"subtype": "integer"
|
||||
},
|
||||
{
|
||||
"startIndex": 65,
|
||||
"endIndex": 66,
|
||||
"text": "6",
|
||||
"type": "builtin.number",
|
||||
"subtype": "integer"
|
||||
},
|
||||
{
|
||||
"startIndex": 81,
|
||||
"endIndex": 82,
|
||||
"text": "8",
|
||||
"type": "builtin.number",
|
||||
"subtype": "integer"
|
||||
},
|
||||
{
|
||||
"startIndex": 136,
|
||||
"endIndex": 139,
|
||||
"text": "425",
|
||||
"type": "builtin.number",
|
||||
"subtype": "integer"
|
||||
},
|
||||
{
|
||||
"startIndex": 140,
|
||||
"endIndex": 143,
|
||||
"text": "777",
|
||||
"type": "builtin.number",
|
||||
"subtype": "integer"
|
||||
},
|
||||
{
|
||||
"startIndex": 144,
|
||||
"endIndex": 148,
|
||||
"text": "1212",
|
||||
"type": "builtin.number",
|
||||
"subtype": "integer"
|
||||
},
|
||||
{
|
||||
"startIndex": 152,
|
||||
"endIndex": 155,
|
||||
"text": "206",
|
||||
"type": "builtin.number",
|
||||
"subtype": "integer"
|
||||
},
|
||||
{
|
||||
"startIndex": 156,
|
||||
"endIndex": 159,
|
||||
"text": "666",
|
||||
"type": "builtin.number",
|
||||
"subtype": "integer"
|
||||
},
|
||||
{
|
||||
"startIndex": 160,
|
||||
"endIndex": 164,
|
||||
"text": "4123",
|
||||
"type": "builtin.number",
|
||||
"subtype": "integer"
|
||||
},
|
||||
{
|
||||
"startIndex": 299,
|
||||
"endIndex": 301,
|
||||
"text": "68",
|
||||
"type": "builtin.number",
|
||||
"subtype": "integer"
|
||||
},
|
||||
{
|
||||
"startIndex": 314,
|
||||
"endIndex": 316,
|
||||
"text": "72",
|
||||
"type": "builtin.number",
|
||||
"subtype": "integer"
|
||||
},
|
||||
{
|
||||
"startIndex": 391,
|
||||
"endIndex": 394,
|
||||
"text": "400",
|
||||
"type": "builtin.number",
|
||||
"subtype": "integer"
|
||||
},
|
||||
{
|
||||
"startIndex": 400,
|
||||
"endIndex": 403,
|
||||
"text": "500",
|
||||
"type": "builtin.number",
|
||||
"subtype": "integer"
|
||||
}
|
||||
],
|
||||
"begin": [
|
||||
|
@ -105,6 +203,20 @@
|
|||
"type": "builtin.age"
|
||||
}
|
||||
],
|
||||
"datetime": [
|
||||
{
|
||||
"startIndex": 65,
|
||||
"endIndex": 72,
|
||||
"text": "6 years",
|
||||
"type": "builtin.datetimeV2.duration"
|
||||
},
|
||||
{
|
||||
"startIndex": 81,
|
||||
"endIndex": 88,
|
||||
"text": "8 years",
|
||||
"type": "builtin.datetimeV2.duration"
|
||||
}
|
||||
],
|
||||
"leave": [
|
||||
{
|
||||
"startIndex": 355,
|
||||
|
@ -137,6 +249,20 @@
|
|||
"type": "builtin.dimension"
|
||||
}
|
||||
],
|
||||
"dimension": [
|
||||
{
|
||||
"startIndex": 355,
|
||||
"endIndex": 358,
|
||||
"text": "3pm",
|
||||
"type": "builtin.dimension"
|
||||
},
|
||||
{
|
||||
"startIndex": 370,
|
||||
"endIndex": 373,
|
||||
"text": "5pm",
|
||||
"type": "builtin.dimension"
|
||||
}
|
||||
],
|
||||
"receiver": [
|
||||
{
|
||||
"startIndex": 413,
|
||||
|
@ -153,6 +279,20 @@
|
|||
"type": "builtin.email"
|
||||
}
|
||||
],
|
||||
"geographyV2": [
|
||||
{
|
||||
"startIndex": 212,
|
||||
"endIndex": 218,
|
||||
"text": "hawaii",
|
||||
"type": "builtin.geographyV2.state"
|
||||
},
|
||||
{
|
||||
"startIndex": 226,
|
||||
"endIndex": 233,
|
||||
"text": "redmond",
|
||||
"type": "builtin.geographyV2.city"
|
||||
}
|
||||
],
|
||||
"min": [
|
||||
{
|
||||
"startIndex": 390,
|
||||
|
@ -185,7 +325,37 @@
|
|||
"type": "builtin.percentage"
|
||||
}
|
||||
],
|
||||
"a": [
|
||||
"personName": [
|
||||
{
|
||||
"startIndex": 329,
|
||||
"endIndex": 333,
|
||||
"text": "john",
|
||||
"type": "builtin.personName"
|
||||
},
|
||||
{
|
||||
"startIndex": 340,
|
||||
"endIndex": 344,
|
||||
"text": "mary",
|
||||
"type": "builtin.personName"
|
||||
}
|
||||
],
|
||||
"old": [
|
||||
{
|
||||
"startIndex": 136,
|
||||
"endIndex": 148,
|
||||
"text": "425-777-1212",
|
||||
"type": "builtin.phonenumber"
|
||||
}
|
||||
],
|
||||
"newPhone": [
|
||||
{
|
||||
"startIndex": 152,
|
||||
"endIndex": 164,
|
||||
"text": "206-666-4123",
|
||||
"type": "builtin.phonenumber"
|
||||
}
|
||||
],
|
||||
"temperature": [
|
||||
{
|
||||
"startIndex": 299,
|
||||
"endIndex": 309,
|
||||
|
@ -250,233 +420,35 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
"Composite1": [
|
||||
{
|
||||
"$instance": {
|
||||
"datetime": [
|
||||
{
|
||||
"startIndex": 65,
|
||||
"endIndex": 72,
|
||||
"text": "6 years",
|
||||
"type": "builtin.datetimeV2.duration"
|
||||
},
|
||||
{
|
||||
"startIndex": 81,
|
||||
"endIndex": 88,
|
||||
"text": "8 years",
|
||||
"type": "builtin.datetimeV2.duration"
|
||||
}
|
||||
],
|
||||
"number": [
|
||||
{
|
||||
"startIndex": 0,
|
||||
"endIndex": 1,
|
||||
"text": "3",
|
||||
"type": "builtin.number",
|
||||
"subtype": "integer"
|
||||
},
|
||||
{
|
||||
"startIndex": 17,
|
||||
"endIndex": 18,
|
||||
"text": "2",
|
||||
"type": "builtin.number",
|
||||
"subtype": "integer"
|
||||
},
|
||||
{
|
||||
"startIndex": 35,
|
||||
"endIndex": 36,
|
||||
"text": "5",
|
||||
"type": "builtin.number",
|
||||
"subtype": "integer"
|
||||
},
|
||||
{
|
||||
"startIndex": 41,
|
||||
"endIndex": 43,
|
||||
"text": "10",
|
||||
"type": "builtin.number",
|
||||
"subtype": "integer"
|
||||
},
|
||||
{
|
||||
"startIndex": 65,
|
||||
"endIndex": 66,
|
||||
"text": "6",
|
||||
"type": "builtin.number",
|
||||
"subtype": "integer"
|
||||
},
|
||||
{
|
||||
"startIndex": 81,
|
||||
"endIndex": 82,
|
||||
"text": "8",
|
||||
"type": "builtin.number",
|
||||
"subtype": "integer"
|
||||
},
|
||||
{
|
||||
"startIndex": 136,
|
||||
"endIndex": 139,
|
||||
"text": "425",
|
||||
"type": "builtin.number",
|
||||
"subtype": "integer"
|
||||
},
|
||||
{
|
||||
"startIndex": 140,
|
||||
"endIndex": 143,
|
||||
"text": "777",
|
||||
"type": "builtin.number",
|
||||
"subtype": "integer"
|
||||
},
|
||||
{
|
||||
"startIndex": 144,
|
||||
"endIndex": 148,
|
||||
"text": "1212",
|
||||
"type": "builtin.number",
|
||||
"subtype": "integer"
|
||||
},
|
||||
{
|
||||
"startIndex": 152,
|
||||
"endIndex": 155,
|
||||
"text": "206",
|
||||
"type": "builtin.number",
|
||||
"subtype": "integer"
|
||||
},
|
||||
{
|
||||
"startIndex": 156,
|
||||
"endIndex": 159,
|
||||
"text": "666",
|
||||
"type": "builtin.number",
|
||||
"subtype": "integer"
|
||||
},
|
||||
{
|
||||
"startIndex": 160,
|
||||
"endIndex": 164,
|
||||
"text": "4123",
|
||||
"type": "builtin.number",
|
||||
"subtype": "integer"
|
||||
}
|
||||
],
|
||||
"phonenumber": [
|
||||
{
|
||||
"startIndex": 136,
|
||||
"endIndex": 148,
|
||||
"text": "425-777-1212",
|
||||
"type": "builtin.phonenumber"
|
||||
},
|
||||
{
|
||||
"startIndex": 152,
|
||||
"endIndex": 164,
|
||||
"text": "206-666-4123",
|
||||
"type": "builtin.phonenumber"
|
||||
}
|
||||
]
|
||||
},
|
||||
"datetime": [
|
||||
{
|
||||
"type": "duration",
|
||||
"timex": [
|
||||
"P6Y"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "duration",
|
||||
"timex": [
|
||||
"P8Y"
|
||||
]
|
||||
}
|
||||
],
|
||||
"number": [
|
||||
3,
|
||||
2,
|
||||
5,
|
||||
10,
|
||||
6,
|
||||
8,
|
||||
425,
|
||||
777,
|
||||
1212,
|
||||
206,
|
||||
666,
|
||||
4123
|
||||
],
|
||||
"phonenumber": [
|
||||
"425-777-1212",
|
||||
"206-666-4123"
|
||||
]
|
||||
},
|
||||
{
|
||||
"$instance": {
|
||||
"dimension": [
|
||||
{
|
||||
"startIndex": 355,
|
||||
"endIndex": 358,
|
||||
"text": "3pm",
|
||||
"type": "builtin.dimension"
|
||||
},
|
||||
{
|
||||
"startIndex": 370,
|
||||
"endIndex": 373,
|
||||
"text": "5pm",
|
||||
"type": "builtin.dimension"
|
||||
}
|
||||
],
|
||||
"number": [
|
||||
{
|
||||
"startIndex": 299,
|
||||
"endIndex": 301,
|
||||
"text": "68",
|
||||
"type": "builtin.number",
|
||||
"subtype": "integer"
|
||||
},
|
||||
{
|
||||
"startIndex": 314,
|
||||
"endIndex": 316,
|
||||
"text": "72",
|
||||
"type": "builtin.number",
|
||||
"subtype": "integer"
|
||||
},
|
||||
{
|
||||
"startIndex": 391,
|
||||
"endIndex": 394,
|
||||
"text": "400",
|
||||
"type": "builtin.number",
|
||||
"subtype": "integer"
|
||||
},
|
||||
{
|
||||
"startIndex": 400,
|
||||
"endIndex": 403,
|
||||
"text": "500",
|
||||
"type": "builtin.number",
|
||||
"subtype": "integer"
|
||||
}
|
||||
]
|
||||
},
|
||||
"dimension": [
|
||||
{
|
||||
"number": 3,
|
||||
"units": "Picometer"
|
||||
},
|
||||
{
|
||||
"number": 5,
|
||||
"units": "Picometer"
|
||||
}
|
||||
],
|
||||
"number": [
|
||||
68,
|
||||
72,
|
||||
400,
|
||||
500
|
||||
]
|
||||
}
|
||||
"likee": [
|
||||
"mary"
|
||||
],
|
||||
"liker": [
|
||||
"john"
|
||||
],
|
||||
"likee": [
|
||||
"mary"
|
||||
"source": [
|
||||
"hawaii"
|
||||
],
|
||||
"destination": [
|
||||
"redmond"
|
||||
],
|
||||
"source": [
|
||||
"hawaii"
|
||||
"number": [
|
||||
3,
|
||||
2,
|
||||
5,
|
||||
10,
|
||||
6,
|
||||
8,
|
||||
425,
|
||||
777,
|
||||
1212,
|
||||
206,
|
||||
666,
|
||||
4123,
|
||||
68,
|
||||
72,
|
||||
400,
|
||||
500
|
||||
],
|
||||
"begin": [
|
||||
{
|
||||
|
@ -490,6 +462,20 @@
|
|||
"units": "Year"
|
||||
}
|
||||
],
|
||||
"datetime": [
|
||||
{
|
||||
"type": "duration",
|
||||
"timex": [
|
||||
"P6Y"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "duration",
|
||||
"timex": [
|
||||
"P8Y"
|
||||
]
|
||||
}
|
||||
],
|
||||
"leave": [
|
||||
{
|
||||
"type": "time",
|
||||
|
@ -518,12 +504,32 @@
|
|||
"units": "Inch"
|
||||
}
|
||||
],
|
||||
"dimension": [
|
||||
{
|
||||
"number": 3,
|
||||
"units": "Picometer"
|
||||
},
|
||||
{
|
||||
"number": 5,
|
||||
"units": "Picometer"
|
||||
}
|
||||
],
|
||||
"receiver": [
|
||||
"chrimc@hotmail.com"
|
||||
],
|
||||
"sender": [
|
||||
"emad@gmail.com"
|
||||
],
|
||||
"geographyV2": [
|
||||
{
|
||||
"type": "state",
|
||||
"location": "hawaii"
|
||||
},
|
||||
{
|
||||
"type": "city",
|
||||
"location": "redmond"
|
||||
}
|
||||
],
|
||||
"min": [
|
||||
{
|
||||
"number": 400,
|
||||
|
@ -542,7 +548,17 @@
|
|||
"maximum": [
|
||||
10
|
||||
],
|
||||
"a": [
|
||||
"personName": [
|
||||
"john",
|
||||
"mary"
|
||||
],
|
||||
"old": [
|
||||
"425-777-1212"
|
||||
],
|
||||
"newPhone": [
|
||||
"206-666-4123"
|
||||
],
|
||||
"temperature": [
|
||||
{
|
||||
"number": 68,
|
||||
"units": "Degree"
|
||||
|
@ -581,7 +597,7 @@
|
|||
"label": "neutral",
|
||||
"score": 0.5
|
||||
},
|
||||
"luisResult": {
|
||||
"v2": {
|
||||
"query": "3 inches long by 2 inches wide and 5% to 10% and are you between 6 years old and 8 years old and can i trade kb457 for kb922 and change 425-777-1212 to 206-666-4123 and did delta buy virgin and did the rain from hawaii get to redmond and http://foo.com changed to http://blah.com and i like between 68 degrees and 72 degrees and john likes mary and leave 3pm and arrive 5pm and pay between $400 and $500 and send chrimc@hotmail.com from emad@gmail.com",
|
||||
"topScoringIntent": {
|
||||
"intent": "Roles",
|
||||
|
@ -593,92 +609,78 @@
|
|||
"score": 1.0
|
||||
},
|
||||
{
|
||||
"intent": "EntityTests",
|
||||
"score": 0.0115484772
|
||||
"intent": "search",
|
||||
"score": 0.08896044
|
||||
},
|
||||
{
|
||||
"intent": "Weather.GetForecast",
|
||||
"score": 0.009885744
|
||||
},
|
||||
{
|
||||
"intent": "search",
|
||||
"score": 0.009508528
|
||||
"score": 0.0100867962
|
||||
},
|
||||
{
|
||||
"intent": "Travel",
|
||||
"score": 0.004027992
|
||||
"score": 0.009896766
|
||||
},
|
||||
{
|
||||
"intent": "EntityTests",
|
||||
"score": 0.0046325135
|
||||
},
|
||||
{
|
||||
"intent": "None",
|
||||
"score": 0.00087468233
|
||||
},
|
||||
{
|
||||
"intent": "SpecifyName",
|
||||
"score": 0.000113203794
|
||||
"score": 0.00093744183
|
||||
},
|
||||
{
|
||||
"intent": "Delivery",
|
||||
"score": 7.92103747E-05
|
||||
"score": 7.978094E-05
|
||||
},
|
||||
{
|
||||
"intent": "SpecifyName",
|
||||
"score": 5.360404E-05
|
||||
},
|
||||
{
|
||||
"intent": "Help",
|
||||
"score": 6.826453E-07
|
||||
"score": 7.622754E-07
|
||||
},
|
||||
{
|
||||
"intent": "Greeting",
|
||||
"score": 4.24091354E-07
|
||||
"score": 4.73494453E-07
|
||||
},
|
||||
{
|
||||
"intent": "Cancel",
|
||||
"score": 4.06555785E-07
|
||||
"score": 4.50860341E-07
|
||||
}
|
||||
],
|
||||
"entities": [
|
||||
{
|
||||
"entity": "john",
|
||||
"type": "Name",
|
||||
"startIndex": 329,
|
||||
"endIndex": 332,
|
||||
"score": 0.9921442,
|
||||
"role": "liker"
|
||||
},
|
||||
{
|
||||
"entity": "mary",
|
||||
"type": "Name",
|
||||
"startIndex": 340,
|
||||
"endIndex": 343,
|
||||
"score": 0.9902693,
|
||||
"score": 0.9899757,
|
||||
"role": "likee"
|
||||
},
|
||||
{
|
||||
"entity": "redmond",
|
||||
"type": "Weather.Location",
|
||||
"startIndex": 226,
|
||||
"endIndex": 232,
|
||||
"score": 0.987181664,
|
||||
"role": "destination"
|
||||
"entity": "john",
|
||||
"type": "Name",
|
||||
"startIndex": 329,
|
||||
"endIndex": 332,
|
||||
"score": 0.9922591,
|
||||
"role": "liker"
|
||||
},
|
||||
{
|
||||
"entity": "hawaii",
|
||||
"type": "Weather.Location",
|
||||
"startIndex": 212,
|
||||
"endIndex": 217,
|
||||
"score": 0.972107649,
|
||||
"score": 0.9713092,
|
||||
"role": "source"
|
||||
},
|
||||
{
|
||||
"entity": "3 inches long by 2 inches wide and 5 % to 10 % and are you between 6 years old and 8 years old and can i trade kb457 for kb922 and change 425 - 777 - 1212 to 206 - 666 - 4123 and did delta buy virgin and did the rain from",
|
||||
"type": "Composite1",
|
||||
"startIndex": 0,
|
||||
"endIndex": 210,
|
||||
"score": 0.0632453859
|
||||
},
|
||||
{
|
||||
"entity": "68 degrees and 72 degrees and john likes mary and leave 3pm and arrive 5pm and pay between $ 400 and $ 500 and send chrimc @",
|
||||
"type": "Composite1",
|
||||
"startIndex": 299,
|
||||
"endIndex": 419,
|
||||
"score": 0.0442264825
|
||||
"entity": "redmond",
|
||||
"type": "Weather.Location",
|
||||
"startIndex": 226,
|
||||
"endIndex": 232,
|
||||
"score": 0.985884964,
|
||||
"role": "destination"
|
||||
},
|
||||
{
|
||||
"entity": "3",
|
||||
|
@ -986,6 +988,18 @@
|
|||
},
|
||||
"role": "sender"
|
||||
},
|
||||
{
|
||||
"entity": "hawaii",
|
||||
"type": "builtin.geographyV2.state",
|
||||
"startIndex": 212,
|
||||
"endIndex": 217
|
||||
},
|
||||
{
|
||||
"entity": "redmond",
|
||||
"type": "builtin.geographyV2.city",
|
||||
"startIndex": 226,
|
||||
"endIndex": 232
|
||||
},
|
||||
{
|
||||
"entity": "$400",
|
||||
"type": "builtin.currency",
|
||||
|
@ -1028,6 +1042,18 @@
|
|||
},
|
||||
"role": "maximum"
|
||||
},
|
||||
{
|
||||
"entity": "john",
|
||||
"type": "builtin.personName",
|
||||
"startIndex": 329,
|
||||
"endIndex": 332
|
||||
},
|
||||
{
|
||||
"entity": "mary",
|
||||
"type": "builtin.personName",
|
||||
"startIndex": 340,
|
||||
"endIndex": 343
|
||||
},
|
||||
{
|
||||
"entity": "425-777-1212",
|
||||
"type": "builtin.phonenumber",
|
||||
|
@ -1036,7 +1062,8 @@
|
|||
"resolution": {
|
||||
"score": "0.9",
|
||||
"value": "425-777-1212"
|
||||
}
|
||||
},
|
||||
"role": "old"
|
||||
},
|
||||
{
|
||||
"entity": "206-666-4123",
|
||||
|
@ -1046,7 +1073,8 @@
|
|||
"resolution": {
|
||||
"score": "0.9",
|
||||
"value": "206-666-4123"
|
||||
}
|
||||
},
|
||||
"role": "newPhone"
|
||||
},
|
||||
{
|
||||
"entity": "68 degrees",
|
||||
|
@ -1056,8 +1084,7 @@
|
|||
"resolution": {
|
||||
"unit": "Degree",
|
||||
"value": "68"
|
||||
},
|
||||
"role": "a"
|
||||
}
|
||||
},
|
||||
{
|
||||
"entity": "72 degrees",
|
||||
|
@ -1128,108 +1155,6 @@
|
|||
"role": "buy"
|
||||
}
|
||||
],
|
||||
"compositeEntities": [
|
||||
{
|
||||
"parentType": "Composite1",
|
||||
"value": "3 inches long by 2 inches wide and 5 % to 10 % and are you between 6 years old and 8 years old and can i trade kb457 for kb922 and change 425 - 777 - 1212 to 206 - 666 - 4123 and did delta buy virgin and did the rain from",
|
||||
"children": [
|
||||
{
|
||||
"type": "builtin.datetimeV2.duration",
|
||||
"value": "6 years"
|
||||
},
|
||||
{
|
||||
"type": "builtin.datetimeV2.duration",
|
||||
"value": "8 years"
|
||||
},
|
||||
{
|
||||
"type": "builtin.number",
|
||||
"value": "3"
|
||||
},
|
||||
{
|
||||
"type": "builtin.number",
|
||||
"value": "2"
|
||||
},
|
||||
{
|
||||
"type": "builtin.number",
|
||||
"value": "5"
|
||||
},
|
||||
{
|
||||
"type": "builtin.number",
|
||||
"value": "10"
|
||||
},
|
||||
{
|
||||
"type": "builtin.number",
|
||||
"value": "6"
|
||||
},
|
||||
{
|
||||
"type": "builtin.number",
|
||||
"value": "8"
|
||||
},
|
||||
{
|
||||
"type": "builtin.number",
|
||||
"value": "425"
|
||||
},
|
||||
{
|
||||
"type": "builtin.number",
|
||||
"value": "777"
|
||||
},
|
||||
{
|
||||
"type": "builtin.number",
|
||||
"value": "1212"
|
||||
},
|
||||
{
|
||||
"type": "builtin.number",
|
||||
"value": "206"
|
||||
},
|
||||
{
|
||||
"type": "builtin.number",
|
||||
"value": "666"
|
||||
},
|
||||
{
|
||||
"type": "builtin.number",
|
||||
"value": "4123"
|
||||
},
|
||||
{
|
||||
"type": "builtin.phonenumber",
|
||||
"value": "425-777-1212"
|
||||
},
|
||||
{
|
||||
"type": "builtin.phonenumber",
|
||||
"value": "206-666-4123"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"parentType": "Composite1",
|
||||
"value": "68 degrees and 72 degrees and john likes mary and leave 3pm and arrive 5pm and pay between $ 400 and $ 500 and send chrimc @",
|
||||
"children": [
|
||||
{
|
||||
"type": "builtin.dimension",
|
||||
"value": "3pm"
|
||||
},
|
||||
{
|
||||
"type": "builtin.dimension",
|
||||
"value": "5pm"
|
||||
},
|
||||
{
|
||||
"type": "builtin.number",
|
||||
"value": "68"
|
||||
},
|
||||
{
|
||||
"type": "builtin.number",
|
||||
"value": "72"
|
||||
},
|
||||
{
|
||||
"type": "builtin.number",
|
||||
"value": "400"
|
||||
},
|
||||
{
|
||||
"type": "builtin.number",
|
||||
"value": "500"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"sentimentAnalysis": {
|
||||
"label": "neutral",
|
||||
"score": 0.5
|
|
@ -0,0 +1,15 @@
|
|||
@echo off
|
||||
rem This runs LUIS tests against the LUIS service and will diff changes if any.
|
||||
rem Usage: test <optional true to mock and false to hit server>
|
||||
setlocal
|
||||
set LUISMOCK=false
|
||||
if "%1" == "" goto run
|
||||
set LUISMOCK=%1
|
||||
:run
|
||||
echo Running LUIS tests with LUISMOCK=%LUISMOCK%
|
||||
dotnet test
|
||||
if %errorlevel% == 0 goto done
|
||||
cd TestData
|
||||
echo Reviewing changes
|
||||
call review.cmd
|
||||
:done
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"luis_schema_version": "3.2.0",
|
||||
"versionId": "roles",
|
||||
"versionId": "GeoPeople",
|
||||
"name": "Contoso App",
|
||||
"desc": "Default Intents for Azure Bot Service V2",
|
||||
"culture": "en-us",
|
||||
|
@ -37,19 +37,15 @@
|
|||
"name": "Travel"
|
||||
},
|
||||
{
|
||||
"name": "Weather.GetForecast",
|
||||
"inherits": {
|
||||
"domain_name": "Weather",
|
||||
"model_name": "GetForecast"
|
||||
}
|
||||
"name": "Weather.GetForecast"
|
||||
}
|
||||
],
|
||||
"entities": [
|
||||
{
|
||||
"name": "Name",
|
||||
"roles": [
|
||||
"liker",
|
||||
"likee"
|
||||
"likee",
|
||||
"liker"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -58,10 +54,6 @@
|
|||
},
|
||||
{
|
||||
"name": "Weather.Location",
|
||||
"inherits": {
|
||||
"domain_name": "Weather",
|
||||
"model_name": "Location"
|
||||
},
|
||||
"roles": [
|
||||
"source",
|
||||
"destination"
|
||||
|
@ -84,8 +76,8 @@
|
|||
"State"
|
||||
],
|
||||
"roles": [
|
||||
"Destination",
|
||||
"Source"
|
||||
"Source",
|
||||
"Destination"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -152,8 +144,8 @@
|
|||
{
|
||||
"name": "person",
|
||||
"roles": [
|
||||
"to",
|
||||
"from"
|
||||
"from",
|
||||
"to"
|
||||
],
|
||||
"explicitList": []
|
||||
},
|
||||
|
@ -179,36 +171,43 @@
|
|||
{
|
||||
"name": "age",
|
||||
"roles": [
|
||||
"end",
|
||||
"begin"
|
||||
"begin",
|
||||
"end"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "datetimeV2",
|
||||
"roles": [
|
||||
"leave",
|
||||
"arrive"
|
||||
"arrive",
|
||||
"leave"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "dimension",
|
||||
"roles": [
|
||||
"length",
|
||||
"width"
|
||||
"width",
|
||||
"length"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "email",
|
||||
"roles": [
|
||||
"sender",
|
||||
"receiver"
|
||||
"receiver",
|
||||
"sender"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "geographyV2",
|
||||
"roles": [
|
||||
"startloc",
|
||||
"endloc"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "money",
|
||||
"roles": [
|
||||
"max",
|
||||
"min"
|
||||
"min",
|
||||
"max"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -221,6 +220,13 @@
|
|||
"start"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "ordinalV2",
|
||||
"roles": [
|
||||
"startpos",
|
||||
"endpos"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "percentage",
|
||||
"roles": [
|
||||
|
@ -228,10 +234,17 @@
|
|||
"maximum"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "personName",
|
||||
"roles": [
|
||||
"child",
|
||||
"parent"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "phonenumber",
|
||||
"roles": [
|
||||
"new",
|
||||
"newPhone",
|
||||
"old"
|
||||
]
|
||||
},
|
||||
|
@ -253,16 +266,16 @@
|
|||
"regex_features": [],
|
||||
"patterns": [
|
||||
{
|
||||
"pattern": "email about {subject} [from {person}] [and also {subject:extra}]",
|
||||
"intent": "search"
|
||||
"pattern": "deliver from {Address:Source} to {Address:Destination}",
|
||||
"intent": "Roles"
|
||||
},
|
||||
{
|
||||
"pattern": "email from {person:from} to {person:to}",
|
||||
"intent": "search"
|
||||
},
|
||||
{
|
||||
"pattern": "deliver from {Address:Source} to {Address:Destination}",
|
||||
"intent": "Roles"
|
||||
"pattern": "email about {subject} [from {person}] [and also {subject:extra}]",
|
||||
"intent": "search"
|
||||
}
|
||||
],
|
||||
"utterances": [
|
||||
|
@ -420,6 +433,18 @@
|
|||
"startPos": 119,
|
||||
"endPos": 123
|
||||
},
|
||||
{
|
||||
"entity": "Airline",
|
||||
"role": "Buyer",
|
||||
"startPos": 173,
|
||||
"endPos": 177
|
||||
},
|
||||
{
|
||||
"entity": "Airline",
|
||||
"role": "Seller",
|
||||
"startPos": 183,
|
||||
"endPos": 188
|
||||
},
|
||||
{
|
||||
"entity": "Weather.Location",
|
||||
"role": "source",
|
||||
|
@ -703,6 +728,64 @@
|
|||
"intent": "Help",
|
||||
"entities": []
|
||||
},
|
||||
{
|
||||
"text": "bart simpson",
|
||||
"intent": "EntityTests",
|
||||
"entities": []
|
||||
},
|
||||
{
|
||||
"text": "bart simpson helps homer simpson",
|
||||
"intent": "Roles",
|
||||
"entities": [
|
||||
{
|
||||
"entity": "personName",
|
||||
"role": "child",
|
||||
"startPos": 0,
|
||||
"endPos": 11
|
||||
},
|
||||
{
|
||||
"entity": "personName",
|
||||
"role": "parent",
|
||||
"startPos": 19,
|
||||
"endPos": 31
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"text": "bart simpson is parent of lisa simpson to move calcutta to london",
|
||||
"intent": "Roles",
|
||||
"entities": [
|
||||
{
|
||||
"entity": "personName",
|
||||
"role": "parent",
|
||||
"startPos": 0,
|
||||
"endPos": 11
|
||||
},
|
||||
{
|
||||
"entity": "personName",
|
||||
"role": "child",
|
||||
"startPos": 26,
|
||||
"endPos": 37
|
||||
},
|
||||
{
|
||||
"entity": "geographyV2",
|
||||
"role": "startloc",
|
||||
"startPos": 47,
|
||||
"endPos": 54
|
||||
},
|
||||
{
|
||||
"entity": "geographyV2",
|
||||
"role": "endloc",
|
||||
"startPos": 59,
|
||||
"endPos": 64
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"text": "calcutta",
|
||||
"intent": "EntityTests",
|
||||
"entities": []
|
||||
},
|
||||
{
|
||||
"text": "can i trade kb457 for kb922",
|
||||
"intent": "Roles",
|
||||
|
@ -756,7 +839,7 @@
|
|||
},
|
||||
{
|
||||
"entity": "phonenumber",
|
||||
"role": "new",
|
||||
"role": "newPhone",
|
||||
"startPos": 23,
|
||||
"endPos": 34
|
||||
}
|
||||
|
@ -774,7 +857,7 @@
|
|||
},
|
||||
{
|
||||
"entity": "phonenumber",
|
||||
"role": "new",
|
||||
"role": "newPhone",
|
||||
"startPos": 23,
|
||||
"endPos": 34
|
||||
}
|
||||
|
@ -822,6 +905,11 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"text": "did delta buy virgin",
|
||||
"intent": "Roles",
|
||||
"entities": []
|
||||
},
|
||||
{
|
||||
"text": "did delta buy virgin?",
|
||||
"intent": "Roles",
|
||||
|
@ -965,6 +1053,72 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"text": "go from 3rd to 5th",
|
||||
"intent": "Roles",
|
||||
"entities": [
|
||||
{
|
||||
"entity": "ordinalV2",
|
||||
"role": "startpos",
|
||||
"startPos": 8,
|
||||
"endPos": 10
|
||||
},
|
||||
{
|
||||
"entity": "ordinalV2",
|
||||
"role": "endpos",
|
||||
"startPos": 15,
|
||||
"endPos": 17
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"text": "go from first to last",
|
||||
"intent": "Roles",
|
||||
"entities": [
|
||||
{
|
||||
"entity": "ordinalV2",
|
||||
"role": "startpos",
|
||||
"startPos": 8,
|
||||
"endPos": 12
|
||||
},
|
||||
{
|
||||
"entity": "ordinalV2",
|
||||
"role": "endpos",
|
||||
"startPos": 17,
|
||||
"endPos": 20
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"text": "go from next to last to last move london to jakarta and homer simpson is the parent of lisa simpson",
|
||||
"intent": "Roles",
|
||||
"entities": [
|
||||
{
|
||||
"entity": "ordinalV2",
|
||||
"role": "startpos",
|
||||
"startPos": 8,
|
||||
"endPos": 19
|
||||
},
|
||||
{
|
||||
"entity": "ordinalV2",
|
||||
"role": "endpos",
|
||||
"startPos": 24,
|
||||
"endPos": 27
|
||||
},
|
||||
{
|
||||
"entity": "personName",
|
||||
"role": "parent",
|
||||
"startPos": 56,
|
||||
"endPos": 68
|
||||
},
|
||||
{
|
||||
"entity": "personName",
|
||||
"role": "child",
|
||||
"startPos": 87,
|
||||
"endPos": 98
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"text": "good afternoon",
|
||||
"intent": "Greeting",
|
||||
|
@ -1057,6 +1211,53 @@
|
|||
"intent": "Greeting",
|
||||
"entities": []
|
||||
},
|
||||
{
|
||||
"text": "homer simpson is parent of bart simpson",
|
||||
"intent": "Roles",
|
||||
"entities": []
|
||||
},
|
||||
{
|
||||
"text": "homer simpson is parent of bart simpson to move jakarta to calcutta",
|
||||
"intent": "Roles",
|
||||
"entities": [
|
||||
{
|
||||
"entity": "personName",
|
||||
"role": "child",
|
||||
"startPos": 27,
|
||||
"endPos": 38
|
||||
},
|
||||
{
|
||||
"entity": "geographyV2",
|
||||
"role": "startloc",
|
||||
"startPos": 48,
|
||||
"endPos": 54
|
||||
},
|
||||
{
|
||||
"entity": "geographyV2",
|
||||
"role": "endloc",
|
||||
"startPos": 59,
|
||||
"endPos": 66
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"text": "homer simpson is parent of lisa simpson",
|
||||
"intent": "Roles",
|
||||
"entities": [
|
||||
{
|
||||
"entity": "personName",
|
||||
"role": "parent",
|
||||
"startPos": 0,
|
||||
"endPos": 12
|
||||
},
|
||||
{
|
||||
"entity": "personName",
|
||||
"role": "child",
|
||||
"startPos": 27,
|
||||
"endPos": 38
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"text": "how are you",
|
||||
"intent": "Greeting",
|
||||
|
@ -1282,12 +1483,6 @@
|
|||
"role": "a",
|
||||
"startPos": 15,
|
||||
"endPos": 24
|
||||
},
|
||||
{
|
||||
"entity": "temperature",
|
||||
"role": "b",
|
||||
"startPos": 30,
|
||||
"endPos": 39
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -1456,6 +1651,78 @@
|
|||
"intent": "Help",
|
||||
"entities": []
|
||||
},
|
||||
{
|
||||
"text": "move calcutta to mumbai",
|
||||
"intent": "Roles",
|
||||
"entities": [
|
||||
{
|
||||
"entity": "geographyV2",
|
||||
"role": "startloc",
|
||||
"startPos": 5,
|
||||
"endPos": 12
|
||||
},
|
||||
{
|
||||
"entity": "geographyV2",
|
||||
"role": "endloc",
|
||||
"startPos": 17,
|
||||
"endPos": 22
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"text": "move jakarta to london",
|
||||
"intent": "Roles",
|
||||
"entities": [
|
||||
{
|
||||
"entity": "geographyV2",
|
||||
"role": "startloc",
|
||||
"startPos": 5,
|
||||
"endPos": 11
|
||||
},
|
||||
{
|
||||
"entity": "geographyV2",
|
||||
"role": "endloc",
|
||||
"startPos": 16,
|
||||
"endPos": 21
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"text": "move london to calcutta",
|
||||
"intent": "Roles",
|
||||
"entities": [
|
||||
{
|
||||
"entity": "geographyV2",
|
||||
"role": "startloc",
|
||||
"startPos": 5,
|
||||
"endPos": 10
|
||||
},
|
||||
{
|
||||
"entity": "geographyV2",
|
||||
"role": "endloc",
|
||||
"startPos": 15,
|
||||
"endPos": 22
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"text": "move london to jakarta",
|
||||
"intent": "Roles",
|
||||
"entities": [
|
||||
{
|
||||
"entity": "geographyV2",
|
||||
"role": "startloc",
|
||||
"startPos": 5,
|
||||
"endPos": 10
|
||||
},
|
||||
{
|
||||
"entity": "geographyV2",
|
||||
"role": "endloc",
|
||||
"startPos": 15,
|
||||
"endPos": 21
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"text": "my name is emad",
|
||||
"intent": "SpecifyName",
|
||||
|
|
|
@ -82,47 +82,7 @@ namespace Microsoft.Bot.Builder.Dialogs.Tests
|
|||
}
|
||||
|
||||
[TestMethod]
|
||||
public async Task RetryAttachmentPrompt()
|
||||
{
|
||||
var convoState = new ConversationState(new MemoryStorage());
|
||||
var dialogState = convoState.CreateProperty<DialogState>("dialogState");
|
||||
|
||||
var adapter = new TestAdapter()
|
||||
.Use(new AutoSaveStateMiddleware(convoState));
|
||||
|
||||
var dialogs = new DialogSet(dialogState);
|
||||
|
||||
var eventPrompt = new EventActivityPrompt("EventActivityPrompt", Validator);
|
||||
dialogs.Add(eventPrompt);
|
||||
|
||||
var eventActivity = new Activity { Type = ActivityTypes.Event, Value = 2 };
|
||||
|
||||
await new TestFlow(adapter, async (turnContext, cancellationToken) =>
|
||||
{
|
||||
var dc = await dialogs.CreateContextAsync(turnContext, cancellationToken);
|
||||
var results = await dc.ContinueDialogAsync(cancellationToken);
|
||||
if (results.Status == DialogTurnStatus.Empty)
|
||||
{
|
||||
var options = new PromptOptions { Prompt = new Activity { Type = ActivityTypes.Message, Text = "please send an event." } };
|
||||
await dc.PromptAsync("EventActivityPrompt", options);
|
||||
}
|
||||
else if (results.Status == DialogTurnStatus.Complete)
|
||||
{
|
||||
var content = (Activity)results.Result;
|
||||
await turnContext.SendActivityAsync(content, cancellationToken);
|
||||
}
|
||||
})
|
||||
.Send("hello")
|
||||
.AssertReply("please send an event.")
|
||||
.Send("hello again")
|
||||
.AssertReply("Please send an 'event'-type Activity with a value of 2.")
|
||||
.Send(eventActivity)
|
||||
.AssertReply("2")
|
||||
.StartTestAsync();
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public async Task ActivityPromptShouldReturnDialogEndOfTurnIfValidationFailed()
|
||||
public async Task ActivityPromptShouldSendRetryPromptIfValidationFailed()
|
||||
{
|
||||
var convoState = new ConversationState(new MemoryStorage());
|
||||
var dialogState = convoState.CreateProperty<DialogState>("dialogState");
|
||||
|
@ -148,7 +108,20 @@ namespace Microsoft.Bot.Builder.Dialogs.Tests
|
|||
var results = await dc.ContinueDialogAsync(cancellationToken);
|
||||
if (results.Status == DialogTurnStatus.Empty)
|
||||
{
|
||||
var options = new PromptOptions { Prompt = new Activity { Type = ActivityTypes.Message, Text = "please send an event." } };
|
||||
var options = new PromptOptions
|
||||
{
|
||||
Prompt = new Activity
|
||||
{
|
||||
Type = ActivityTypes.Message,
|
||||
Text = "please send an event.",
|
||||
},
|
||||
RetryPrompt = new Activity
|
||||
{
|
||||
Type = ActivityTypes.Message,
|
||||
Text = "Retrying - please send an event.",
|
||||
},
|
||||
};
|
||||
|
||||
await dc.PromptAsync("EventActivityPrompt", options);
|
||||
}
|
||||
else if (results.Status == DialogTurnStatus.Complete)
|
||||
|
@ -164,7 +137,7 @@ namespace Microsoft.Bot.Builder.Dialogs.Tests
|
|||
.Send("hello")
|
||||
.AssertReply("please send an event.")
|
||||
.Send("test")
|
||||
.AssertReply("Test complete.")
|
||||
.AssertReply("Retrying - please send an event.")
|
||||
.StartTestAsync();
|
||||
}
|
||||
|
||||
|
@ -195,7 +168,19 @@ namespace Microsoft.Bot.Builder.Dialogs.Tests
|
|||
var results = await dc.ContinueDialogAsync(cancellationToken);
|
||||
if (results.Status == DialogTurnStatus.Empty)
|
||||
{
|
||||
var options = new PromptOptions { Prompt = new Activity { Type = ActivityTypes.Message, Text = "please send an event." } };
|
||||
var options = new PromptOptions
|
||||
{
|
||||
Prompt = new Activity
|
||||
{
|
||||
Type = ActivityTypes.Message,
|
||||
Text = "please send an event.",
|
||||
},
|
||||
RetryPrompt = new Activity
|
||||
{
|
||||
Type = ActivityTypes.Message,
|
||||
Text = "Retrying - please send an event.",
|
||||
},
|
||||
};
|
||||
await dc.PromptAsync("EventActivityPrompt", options);
|
||||
}
|
||||
|
||||
|
@ -208,11 +193,92 @@ namespace Microsoft.Bot.Builder.Dialogs.Tests
|
|||
})
|
||||
.Send("hello")
|
||||
.AssertReply("please send an event.")
|
||||
.AssertReply("please send an event.")
|
||||
.Send("test")
|
||||
.AssertReply("Retrying - please send an event.")
|
||||
.AssertReply("Test complete.")
|
||||
.StartTestAsync();
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public async Task OnPromptOverloadWithoutIsRetryParamReturnsBasicActivityPrompt()
|
||||
{
|
||||
var convoState = new ConversationState(new MemoryStorage());
|
||||
var dialogState = convoState.CreateProperty<DialogState>("dialogState");
|
||||
|
||||
var adapter = new TestAdapter()
|
||||
.Use(new AutoSaveStateMiddleware(convoState));
|
||||
|
||||
// Create new DialogSet.
|
||||
var dialogs = new DialogSet(dialogState);
|
||||
|
||||
// Create and add custom activity prompt to DialogSet.
|
||||
var eventPrompt = new EventActivityWithoutRetryPrompt("EventActivityWithoutRetryPrompt", Validator);
|
||||
dialogs.Add(eventPrompt);
|
||||
|
||||
// Create mock Activity for testing.
|
||||
var eventActivity = new Activity { Type = ActivityTypes.Event, Value = 2 };
|
||||
|
||||
await new TestFlow(adapter, async (turnContext, cancellationToken) =>
|
||||
{
|
||||
var dc = await dialogs.CreateContextAsync(turnContext, cancellationToken);
|
||||
|
||||
var results = await dc.ContinueDialogAsync(cancellationToken);
|
||||
if (results.Status == DialogTurnStatus.Empty)
|
||||
{
|
||||
var options = new PromptOptions { Prompt = new Activity { Type = ActivityTypes.Message, Text = "please send an event." } };
|
||||
await dc.PromptAsync("EventActivityWithoutRetryPrompt", options, cancellationToken);
|
||||
}
|
||||
else if (results.Status == DialogTurnStatus.Complete)
|
||||
{
|
||||
var content = (Activity)results.Result;
|
||||
await turnContext.SendActivityAsync(content, cancellationToken);
|
||||
}
|
||||
})
|
||||
.Send("hello")
|
||||
.AssertReply("please send an event.")
|
||||
.Send(eventActivity)
|
||||
.AssertReply("2")
|
||||
.StartTestAsync();
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[ExpectedException(typeof(ArgumentNullException))]
|
||||
public async Task OnPromptErrorsWithNullContext()
|
||||
{
|
||||
var eventPrompt = new EventActivityPrompt("EventActivityPrompt", Validator);
|
||||
|
||||
var options = new PromptOptions { Prompt = new Activity { Type = ActivityTypes.Message, Text = "please send an event." } };
|
||||
|
||||
await eventPrompt.OnPromptNullContext(options);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[ExpectedException(typeof(ArgumentNullException))]
|
||||
public async Task OnPromptErrorsWithNullOptions()
|
||||
{
|
||||
var convoState = new ConversationState(new MemoryStorage());
|
||||
var dialogState = convoState.CreateProperty<DialogState>("dialogState");
|
||||
|
||||
var adapter = new TestAdapter()
|
||||
.Use(new AutoSaveStateMiddleware(convoState));
|
||||
|
||||
// Create new DialogSet.
|
||||
var dialogs = new DialogSet(dialogState);
|
||||
|
||||
// Create and add custom activity prompt to DialogSet.
|
||||
var eventPrompt = new EventActivityPrompt("EventActivityPrompt", Validator);
|
||||
dialogs.Add(eventPrompt);
|
||||
|
||||
await new TestFlow(adapter, async (turnContext, cancellationToken) =>
|
||||
{
|
||||
var dc = await dialogs.CreateContextAsync(turnContext, cancellationToken);
|
||||
|
||||
await eventPrompt.OnPromptNullOptions(dc);
|
||||
})
|
||||
.Send("hello")
|
||||
.StartTestAsync();
|
||||
}
|
||||
|
||||
private async Task<bool> Validator(PromptValidatorContext<Activity> promptContext, CancellationToken cancellationToken)
|
||||
{
|
||||
Assert.IsTrue(promptContext.AttemptCount > 0);
|
||||
|
|
|
@ -16,5 +16,19 @@ namespace Microsoft.Bot.Builder.Dialogs.Tests
|
|||
: base(dialogId, validator)
|
||||
{
|
||||
}
|
||||
|
||||
public async Task OnPromptNullContext(object options, CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
var opt = (PromptOptions)options;
|
||||
|
||||
// should throw ArgumentNullException
|
||||
await OnPromptAsync(turnContext: null, state: null, options: opt, isRetry: false);
|
||||
}
|
||||
|
||||
public async Task OnPromptNullOptions(DialogContext dc, CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
// should throw ArgumentNullException
|
||||
await OnPromptAsync(dc.Context, state: null, options: null, isRetry: false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,59 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Bot.Schema;
|
||||
|
||||
namespace Microsoft.Bot.Builder.Dialogs.Tests
|
||||
{
|
||||
public class EventActivityWithoutRetryPrompt : ActivityPrompt
|
||||
{
|
||||
private const string PersistedOptions = "options";
|
||||
private const string PersistedState = "state";
|
||||
|
||||
public EventActivityWithoutRetryPrompt(string dialogId, PromptValidator<Activity> validator)
|
||||
: base(dialogId, validator)
|
||||
{
|
||||
}
|
||||
|
||||
public override async Task<DialogTurnResult> BeginDialogAsync(DialogContext dc, object options, CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
if (dc == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(dc));
|
||||
}
|
||||
|
||||
if (!(options is PromptOptions))
|
||||
{
|
||||
throw new ArgumentOutOfRangeException(nameof(options), "Prompt options are required for Prompt dialogs");
|
||||
}
|
||||
|
||||
// Ensure prompts have input hint set
|
||||
var opt = (PromptOptions)options;
|
||||
if (opt.Prompt != null && string.IsNullOrEmpty(opt.Prompt.InputHint))
|
||||
{
|
||||
opt.Prompt.InputHint = InputHints.ExpectingInput;
|
||||
}
|
||||
|
||||
if (opt.RetryPrompt != null && string.IsNullOrEmpty(opt.RetryPrompt.InputHint))
|
||||
{
|
||||
opt.RetryPrompt.InputHint = InputHints.ExpectingInput;
|
||||
}
|
||||
|
||||
// Initialize prompt state
|
||||
var state = dc.ActiveDialog.State;
|
||||
state[PersistedOptions] = opt;
|
||||
state[PersistedState] = new Dictionary<string, object>
|
||||
{
|
||||
{ "AttemptCount", 0 },
|
||||
};
|
||||
|
||||
// Send initial prompt, calling OnPromptAsync() overload that does not have isRetry parameter
|
||||
await OnPromptAsync(dc.Context, (IDictionary<string, object>)state[PersistedState], (PromptOptions)state[PersistedOptions], cancellationToken).ConfigureAwait(false);
|
||||
return EndOfTurn;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -70,6 +70,21 @@ namespace Microsoft.Bot.Builder.Integration.ApplicationInsights.Core.Tests
|
|||
Assert.IsFalse(server.Host.Services.GetService(typeof(TelemetryClient)) == null);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void AppSettings_NoConfig_AppSettings()
|
||||
{
|
||||
ArrangeBotFile(null); // No bot file
|
||||
ArrangeAppSettings("default"); // Appsettings file with instrumentation key
|
||||
var server = new TestServer(new WebHostBuilder()
|
||||
.UseStartup<StartupNoParameters>());
|
||||
|
||||
// Telemetry Client should be active
|
||||
var telemetryClient = server.Host.Services.GetService(typeof(IBotTelemetryClient));
|
||||
Assert.IsNotNull(telemetryClient);
|
||||
Assert.IsFalse(typeof(NullBotTelemetryClient).Equals(telemetryClient.GetType()));
|
||||
Assert.IsFalse(server.Host.Services.GetService(typeof(TelemetryClient)) == null);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void AppSettings_NoBot_AppSettings_InvalidKey()
|
||||
{
|
||||
|
|
|
@ -0,0 +1,37 @@
|
|||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace Microsoft.Bot.Builder.Integration.ApplicationInsights.Core.Tests
|
||||
{
|
||||
internal class StartupNoParameters
|
||||
{
|
||||
public StartupNoParameters(IHostingEnvironment env)
|
||||
{
|
||||
var builder = new ConfigurationBuilder()
|
||||
.SetBasePath(env.ContentRootPath)
|
||||
.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
|
||||
.AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true)
|
||||
.AddEnvironmentVariables();
|
||||
|
||||
Configuration = builder.Build();
|
||||
}
|
||||
|
||||
public IConfiguration Configuration { get; }
|
||||
|
||||
public void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
services.AddBotApplicationInsights();
|
||||
|
||||
// Adding IConfiguration in sample test server. Otherwise this appears to be
|
||||
// registered.
|
||||
services.AddSingleton<IConfiguration>(this.Configuration);
|
||||
}
|
||||
|
||||
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
|
||||
{
|
||||
app.UseBotApplicationInsights();
|
||||
}
|
||||
}
|
||||
}
|
Загрузка…
Ссылка в новой задаче