Exemple #1
0
        /// <summary>
        /// Adds a text label to an LUIS intent.
        /// </summary>
        /// <param name="label">Internal request structure for label example.</param>
        /// <param name="versionId">Application version to be used.</param>
        /// <returns>Operation success status.</returns>
        private async Task<bool> AddLabelAsync(LabelRequest label, string versionId = DEFAULT_VERSION_ID)
        {
            if (label == null) throw new ArgumentNullException(nameof(label));

            var uri = CreateHandlerUri($"api/v2.0/apps/{_appId}/versions/{versionId}/example");

            var response = await _httpClient.RestPost(uri, label);
            return true;
        }
Exemple #2
0
        /// <summary>
        /// Adds a text label to an LUIS intent.
        /// </summary>
        /// <param name="text">Text of the example.</param>
        /// <param name="versionId">Application version to be used.</param>
        /// <returns>Operation success status.</returns>
        public async Task<bool> AddLabelAsync(string text, string versionId = DEFAULT_VERSION_ID)
        {
            if (string.IsNullOrEmpty(text)) throw new ArgumentNullException(nameof(text));

            var label = new LabelRequest()
            {
                IntentName = _intentName,
                Text = text
            };

            return await AddLabelAsync(label, versionId);
        }