| | 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 | |
|
| | 11 | | namespace 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 | | { |
| 2 | 39 | | using (var _result = await operations.GenerateAnswerWithHttpMessagesAsync(kbId, generateAnswerPayload, n |
| | 40 | | { |
| 2 | 41 | | return _result.Body; |
| | 42 | | } |
| 2 | 43 | | } |
| | 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 | | { |
| 0 | 62 | | (await operations.TrainWithHttpMessagesAsync(kbId, trainPayload, null, cancellationToken).ConfigureAwait |
| 0 | 63 | | } |
| | 64 | |
|
| | 65 | | } |
| | 66 | | } |