< Summary

Class:Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.RuntimeExtensions
Assembly:Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker
File(s):C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Knowledge.QnAMaker\src\Generated\RuntimeExtensions.cs
Covered lines:3
Uncovered lines:2
Coverable lines:5
Total lines:66
Line coverage:60% (3 of 5)
Covered branches:0
Total branches:0

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
GenerateAnswerAsync()-100%100%
TrainAsync()-0%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Knowledge.QnAMaker\src\Generated\RuntimeExtensions.cs

#LineLine coverage
 1// <auto-generated>
 2// Copyright (c) Microsoft Corporation. All rights reserved.
 3// Licensed under the MIT License. See License.txt in the project root for
 4// license information.
 5//
 6// Code generated by Microsoft (R) AutoRest Code Generator.
 7// Changes may cause incorrect behavior and will be lost if the code is
 8// regenerated.
 9// </auto-generated>
 10
 11namespace Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker
 12{
 13    using Models;
 14    using System.Threading;
 15    using System.Threading.Tasks;
 16
 17    /// <summary>
 18    /// Extension methods for Runtime.
 19    /// </summary>
 20    public static partial class RuntimeExtensions
 21    {
 22            /// <summary>
 23            /// GenerateAnswer call to query the knowledgebase.
 24            /// </summary>
 25            /// <param name='operations'>
 26            /// The operations group for this extension method.
 27            /// </param>
 28            /// <param name='kbId'>
 29            /// Knowledgebase id.
 30            /// </param>
 31            /// <param name='generateAnswerPayload'>
 32            /// Post body of the request.
 33            /// </param>
 34            /// <param name='cancellationToken'>
 35            /// The cancellation token.
 36            /// </param>
 37            public static async Task<QnASearchResultList> GenerateAnswerAsync(this IRuntime operations, string kbId, Que
 38            {
 239                using (var _result = await operations.GenerateAnswerWithHttpMessagesAsync(kbId, generateAnswerPayload, n
 40                {
 241                    return _result.Body;
 42                }
 243            }
 44
 45            /// <summary>
 46            /// Train call to add suggestions to the knowledgebase.
 47            /// </summary>
 48            /// <param name='operations'>
 49            /// The operations group for this extension method.
 50            /// </param>
 51            /// <param name='kbId'>
 52            /// Knowledgebase id.
 53            /// </param>
 54            /// <param name='trainPayload'>
 55            /// Post body of the request.
 56            /// </param>
 57            /// <param name='cancellationToken'>
 58            /// The cancellation token.
 59            /// </param>
 60            public static async Task TrainAsync(this IRuntime operations, string kbId, FeedbackRecordsDTO trainPayload, 
 61            {
 062                (await operations.TrainWithHttpMessagesAsync(kbId, trainPayload, null, cancellationToken).ConfigureAwait
 063            }
 64
 65    }
 66}

Methods/Properties

GenerateAnswerAsync()
TrainAsync()