diff --git a/sdk/cognitiveservices/Knowledge.QnAMaker/CHANGELOG.md b/sdk/cognitiveservices/Knowledge.QnAMaker/CHANGELOG.md index 63dfe481cb3a..7ec929f33854 100644 --- a/sdk/cognitiveservices/Knowledge.QnAMaker/CHANGELOG.md +++ b/sdk/cognitiveservices/Knowledge.QnAMaker/CHANGELOG.md @@ -1,6 +1,5 @@ -## 2.1.0-preview.2 (Unreleased) - - +## 3.0.0-preview.1 (2020-10-20) + SDK with support for complete V5-preview.1 API and customized Runtime client ## 2.1.0-preview.1 (2020-10-14) SDK with custom clients for V5-preview.1 API ## 2.0.1 (2020-08-13) diff --git a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Customizations/QnAMakerPreviewClient.cs b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Customizations/QnAMakerClient.cs similarity index 50% rename from sdk/cognitiveservices/Knowledge.QnAMaker/src/Customizations/QnAMakerPreviewClient.cs rename to sdk/cognitiveservices/Knowledge.QnAMaker/src/Customizations/QnAMakerClient.cs index f3783330ebcb..407432aaecd1 100644 --- a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Customizations/QnAMakerPreviewClient.cs +++ b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Customizations/QnAMakerClient.cs @@ -1,39 +1,31 @@ -using Microsoft.Rest; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net.Http; -using System.Text; -using System.Threading.Tasks; +using System.Net.Http; namespace Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker { public partial class QnAMakerClient { /// - /// Initializes a new instance of the QnAMakerClient class. + /// Initializes a new instance of the QnAMakerClient class for QnA Maker resources with hosted Runtime. /// /// /// Required. Subscription credentials which uniquely identify client subscription. /// - /// - /// Optional. The flag used to change BaseUri if it is true. - /// - /// - /// Optional. The http client handler used to handle http transport. - /// /// /// Optional. The delegating handlers to add to the http client pipeline. /// /// /// Thrown when a required parameter is null /// - public QnAMakerClient(ServiceClientCredentials credentials, bool isPreview = false, params DelegatingHandler[] handlers) : this(credentials, handlers) - { - if (isPreview) + internal QnAMakerClient(EndpointKeyServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + { + if (credentials == null) { - BaseUri = "{Endpoint}/qnamaker/v5.0-preview.1"; + throw new System.ArgumentNullException("credentials"); } + + Credentials = credentials; + Credentials.InitializeServiceClient(this); + BaseUri = "{Endpoint}/qnamaker"; } } } \ No newline at end of file diff --git a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Customizations/QnAMakerPreviewRuntimeClient.cs b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Customizations/QnAMakerPreviewRuntimeClient.cs deleted file mode 100644 index a6265f468303..000000000000 --- a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Customizations/QnAMakerPreviewRuntimeClient.cs +++ /dev/null @@ -1,39 +0,0 @@ -using Microsoft.Rest; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net.Http; -using System.Text; -using System.Threading.Tasks; - -namespace Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker -{ - public partial class QnAMakerRuntimeClient - { - /// - /// Initializes a new instance of the QnAMakerClient class. - /// - /// - /// Required. Subscription credentials which uniquely identify client subscription. - /// - /// - /// Optional. The flag used to change BaseUri if it is true. - /// - /// - /// Optional. The http client handler used to handle http transport. - /// - /// - /// Optional. The delegating handlers to add to the http client pipeline. - /// - /// - /// Thrown when a required parameter is null - /// - public QnAMakerRuntimeClient(ServiceClientCredentials credentials, bool isPreview = false, params DelegatingHandler[] handlers) : this(credentials, handlers) - { - if (isPreview) - { - BaseUri = "{RuntimeEndpoint}/qnamaker/v5.0-preview.1"; - } - } - } -} \ No newline at end of file diff --git a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Customizations/QnAMakerRuntimeClient.cs b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Customizations/QnAMakerRuntimeClient.cs new file mode 100644 index 000000000000..8a40f40df781 --- /dev/null +++ b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Customizations/QnAMakerRuntimeClient.cs @@ -0,0 +1,58 @@ +using Microsoft.Rest; +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net.Http; +using System.Text; +using System.Threading.Tasks; + +namespace Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker +{ + public class QnAMakerRuntimeClient + { + public Runtime Runtime { get; set; } + private QnAMakerClient client { get; set; } + + public string RuntimeEndpoint { + set + { + if (client != null) + { + client.Endpoint = value; + } + } + + get + { + if (client != null && client.Endpoint != null) + { + return client.Endpoint; + } + else + { + return string.Empty; + } + } + } + + /// + /// Initializes a new instance of the QnAMakerRuntimeClient class. + /// An adapter class for supporting (hosted) Runtime operations using Knowledgebase operations (generateAnswer and train) from QnAMakerClient V5.preview.1. + /// + /// + /// Required. Subscription credentials which uniquely identify client subscription. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public QnAMakerRuntimeClient(EndpointKeyServiceClientCredentials credentials, params DelegatingHandler[] handlers) + { + this.client = new QnAMakerClient(credentials, handlers); + Runtime = new Runtime(this.client); + } + } +} \ No newline at end of file diff --git a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Customizations/Runtime.cs b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Customizations/Runtime.cs new file mode 100644 index 000000000000..c4204af4a9c1 --- /dev/null +++ b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Customizations/Runtime.cs @@ -0,0 +1,70 @@ +namespace Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker +{ + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Customized Runtime operations - using V5.0-preivew.1 Knowledgebase operations for generateAnswer and train APIs. + /// + public class Runtime + { + /// + /// Initializes a new instance of the Runtime class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal Runtime(QnAMakerClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the QnAMakerRuntimeClient + /// + private QnAMakerClient Client { get; set; } + + /// + /// GenerateAnswer call to query the knowledgebase. + /// + /// + /// Knowledgebase id. + /// + /// + /// Post body of the request. + /// + /// + /// The cancellation token. + /// + public async Task GenerateAnswerAsync(string kbId, QueryDTO generateAnswerPayload, CancellationToken cancellationToken = default(CancellationToken)) + { + return await Client.Knowledgebase.GenerateAnswerAsync(kbId, generateAnswerPayload, cancellationToken); + } + + /// + /// Train call to add suggestions to the knowledgebase. + /// + /// + /// Knowledgebase id. + /// + /// + /// Post body of the request. + /// + /// + /// The cancellation token. + /// + public async Task TrainAsync(string kbId, FeedbackRecordsDTO trainPayload, CancellationToken cancellationToken = default(CancellationToken)) + { + await Client.Knowledgebase.TrainAsync(kbId, trainPayload, cancellationToken); + } + + } +} diff --git a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Alterations.cs b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Alterations.cs index ddb65cca37af..1e7263ffbe69 100644 --- a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Alterations.cs +++ b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Alterations.cs @@ -255,6 +255,309 @@ public Alterations(QnAMakerClient client) // Set Headers + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(wordAlterations != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(wordAlterations, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 204) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Download alterations per Knowledgebase (QnAMaker Managed). + /// + /// + /// Knowledgebase id. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetAlterationsForKbWithHttpMessagesAsync(string kbId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.Endpoint == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.Endpoint"); + } + if (kbId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "kbId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("kbId", kbId); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetAlterationsForKb", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri; + var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "alterations/{kbId}"; + _url = _url.Replace("{Endpoint}", Client.Endpoint); + _url = _url.Replace("{kbId}", System.Uri.EscapeDataString(kbId)); + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Replace alterations data per Knowledgebase (QnAMaker Managed). + /// + /// + /// Knowledgebase id. + /// + /// + /// New alterations data. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task ReplaceAlterationsForKbWithHttpMessagesAsync(string kbId, WordAlterationsDTO wordAlterations, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.Endpoint == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.Endpoint"); + } + if (kbId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "kbId"); + } + if (wordAlterations == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "wordAlterations"); + } + if (wordAlterations != null) + { + wordAlterations.Validate(); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("kbId", kbId); + tracingParameters.Add("wordAlterations", wordAlterations); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ReplaceAlterationsForKb", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri; + var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "alterations/{kbId}"; + _url = _url.Replace("{Endpoint}", Client.Endpoint); + _url = _url.Replace("{kbId}", System.Uri.EscapeDataString(kbId)); + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + + if (customHeaders != null) { foreach(var _header in customHeaders) diff --git a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/AlterationsExtensions.cs b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/AlterationsExtensions.cs index f1fc89cb4045..f94a51f60636 100644 --- a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/AlterationsExtensions.cs +++ b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/AlterationsExtensions.cs @@ -53,5 +53,45 @@ public static partial class AlterationsExtensions (await operations.ReplaceWithHttpMessagesAsync(wordAlterations, null, cancellationToken).ConfigureAwait(false)).Dispose(); } + /// + /// Download alterations per Knowledgebase (QnAMaker Managed). + /// + /// + /// The operations group for this extension method. + /// + /// + /// Knowledgebase id. + /// + /// + /// The cancellation token. + /// + public static async Task GetAlterationsForKbAsync(this IAlterations operations, string kbId, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetAlterationsForKbWithHttpMessagesAsync(kbId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Replace alterations data per Knowledgebase (QnAMaker Managed). + /// + /// + /// The operations group for this extension method. + /// + /// + /// Knowledgebase id. + /// + /// + /// New alterations data. + /// + /// + /// The cancellation token. + /// + public static async Task ReplaceAlterationsForKbAsync(this IAlterations operations, string kbId, WordAlterationsDTO wordAlterations, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.ReplaceAlterationsForKbWithHttpMessagesAsync(kbId, wordAlterations, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + } } diff --git a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/EndpointSettings.cs b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/EndpointSettings.cs index f4770420f41c..42098991d6b3 100644 --- a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/EndpointSettings.cs +++ b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/EndpointSettings.cs @@ -209,9 +209,6 @@ public EndpointSettings(QnAMakerClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -221,7 +218,7 @@ public EndpointSettings(QnAMakerClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateSettingsWithHttpMessagesAsync(EndpointSettingsDTO endpointSettingsPayload, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task UpdateSettingsWithHttpMessagesAsync(EndpointSettingsDTO endpointSettingsPayload, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.Endpoint == null) { @@ -294,7 +291,7 @@ public EndpointSettings(QnAMakerClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 204) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -324,27 +321,9 @@ public EndpointSettings(QnAMakerClient client) throw ex; } // Create Result - var _result = new HttpOperationResponse(); + var _result = new HttpOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); diff --git a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/EndpointSettingsExtensions.cs b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/EndpointSettingsExtensions.cs index 701932c1722b..07b8a7a6d430 100644 --- a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/EndpointSettingsExtensions.cs +++ b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/EndpointSettingsExtensions.cs @@ -48,12 +48,9 @@ public static partial class EndpointSettingsExtensions /// /// The cancellation token. /// - public static async Task UpdateSettingsAsync(this IEndpointSettings operations, EndpointSettingsDTO endpointSettingsPayload, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task UpdateSettingsAsync(this IEndpointSettings operations, EndpointSettingsDTO endpointSettingsPayload, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.UpdateSettingsWithHttpMessagesAsync(endpointSettingsPayload, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + (await operations.UpdateSettingsWithHttpMessagesAsync(endpointSettingsPayload, null, cancellationToken).ConfigureAwait(false)).Dispose(); } } diff --git a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/IAlterations.cs b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/IAlterations.cs index 6ffc7bf297d9..dd1b11a2eb22 100644 --- a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/IAlterations.cs +++ b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/IAlterations.cs @@ -60,5 +60,49 @@ public partial interface IAlterations /// Thrown when a required parameter is null /// Task ReplaceWithHttpMessagesAsync(WordAlterationsDTO wordAlterations, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Download alterations per Knowledgebase (QnAMaker Managed). + /// + /// + /// Knowledgebase id. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetAlterationsForKbWithHttpMessagesAsync(string kbId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Replace alterations data per Knowledgebase (QnAMaker Managed). + /// + /// + /// Knowledgebase id. + /// + /// + /// New alterations data. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task ReplaceAlterationsForKbWithHttpMessagesAsync(string kbId, WordAlterationsDTO wordAlterations, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/IEndpointSettings.cs b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/IEndpointSettings.cs index 33dcba88c929..86fc48a9037e 100644 --- a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/IEndpointSettings.cs +++ b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/IEndpointSettings.cs @@ -56,12 +56,9 @@ public partial interface IEndpointSettings /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// - Task> UpdateSettingsWithHttpMessagesAsync(EndpointSettingsDTO endpointSettingsPayload, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task UpdateSettingsWithHttpMessagesAsync(EndpointSettingsDTO endpointSettingsPayload, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/IKnowledgebase.cs b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/IKnowledgebase.cs index 982fe8f5ba5e..a352f4d214ba 100644 --- a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/IKnowledgebase.cs +++ b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/IKnowledgebase.cs @@ -182,6 +182,12 @@ public partial interface IKnowledgebase /// Specifies whether environment is Test or Prod. Possible values /// include: 'Prod', 'Test' /// + /// + /// The source property filter to apply. + /// + /// + /// The last changed status property filter to apply. + /// /// /// The headers that will be added to request. /// @@ -197,6 +203,53 @@ public partial interface IKnowledgebase /// /// Thrown when a required parameter is null /// - Task> DownloadWithHttpMessagesAsync(string kbId, string environment, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> DownloadWithHttpMessagesAsync(string kbId, string environment, string source = default(string), string changedSince = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// GenerateAnswer call to query knowledgebase (QnA Maker Managed). + /// + /// + /// Knowledgebase id. + /// + /// + /// Post body of the request. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GenerateAnswerWithHttpMessagesAsync(string kbId, QueryDTO generateAnswerPayload, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Train call to add suggestions to knowledgebase (QnAMaker Managed). + /// + /// + /// Knowledgebase id. + /// + /// + /// Post body of the request. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task TrainWithHttpMessagesAsync(string kbId, FeedbackRecordsDTO trainPayload, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/IQnAMakerClient.cs b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/IQnAMakerClient.cs index 8133122a671a..fc7527373867 100644 --- a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/IQnAMakerClient.cs +++ b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/IQnAMakerClient.cs @@ -34,8 +34,8 @@ public partial interface IQnAMakerClient : System.IDisposable JsonSerializerSettings DeserializationSettings { get; } /// - /// Supported Cognitive Services endpoints (protocol and hostname, for - /// example: https://westus.api.cognitive.microsoft.com). + /// Supported Cognitive Services endpoint (e.g., https://< + /// qnamaker-resource-name >.api.cognitiveservices.azure.com). /// string Endpoint { get; set; } diff --git a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/IQnAMakerRuntimeClient.cs b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/IQnAMakerRuntimeClient.cs deleted file mode 100644 index d406f3f737a8..000000000000 --- a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/IQnAMakerRuntimeClient.cs +++ /dev/null @@ -1,55 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker -{ - using Microsoft.Rest; - using Models; - using Newtonsoft.Json; - - /// - /// An API for QnAMaker runtime - /// - public partial interface IQnAMakerRuntimeClient : System.IDisposable - { - /// - /// The base URI of the service. - /// - - /// - /// Gets or sets json serialization settings. - /// - JsonSerializerSettings SerializationSettings { get; } - - /// - /// Gets or sets json deserialization settings. - /// - JsonSerializerSettings DeserializationSettings { get; } - - /// - /// QnA Maker App Service endpoint (for example: - /// https://{qnaservice-hostname}.azurewebsites.net). - /// - string RuntimeEndpoint { get; set; } - - /// - /// Subscription credentials which uniquely identify client - /// subscription. - /// - ServiceClientCredentials Credentials { get; } - - - /// - /// Gets the IRuntime. - /// - IRuntime Runtime { get; } - - } -} diff --git a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/IRuntime.cs b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/IRuntime.cs deleted file mode 100644 index fdf4d89ff567..000000000000 --- a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/IRuntime.cs +++ /dev/null @@ -1,73 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker -{ - using Microsoft.Rest; - using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Runtime operations. - /// - public partial interface IRuntime - { - /// - /// GenerateAnswer call to query the knowledgebase. - /// - /// - /// Knowledgebase id. - /// - /// - /// Post body of the request. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> GenerateAnswerWithHttpMessagesAsync(string kbId, QueryDTO generateAnswerPayload, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Train call to add suggestions to the knowledgebase. - /// - /// - /// Knowledgebase id. - /// - /// - /// Post body of the request. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task TrainWithHttpMessagesAsync(string kbId, FeedbackRecordsDTO trainPayload, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Knowledgebase.cs b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Knowledgebase.cs index 8d07f34a1f9d..74dde8089f23 100644 --- a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Knowledgebase.cs +++ b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Knowledgebase.cs @@ -1113,6 +1113,12 @@ public Knowledgebase(QnAMakerClient client) /// Specifies whether environment is Test or Prod. Possible values include: /// 'Prod', 'Test' /// + /// + /// The source property filter to apply. + /// + /// + /// The last changed status property filter to apply. + /// /// /// Headers that will be added to request. /// @@ -1134,7 +1140,7 @@ public Knowledgebase(QnAMakerClient client) /// /// A response object containing the response body and response headers. /// - public async Task> DownloadWithHttpMessagesAsync(string kbId, string environment, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> DownloadWithHttpMessagesAsync(string kbId, string environment, string source = default(string), string changedSince = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.Endpoint == null) { @@ -1157,6 +1163,8 @@ public Knowledgebase(QnAMakerClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("kbId", kbId); tracingParameters.Add("environment", environment); + tracingParameters.Add("source", source); + tracingParameters.Add("changedSince", changedSince); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Download", tracingParameters); } @@ -1166,6 +1174,19 @@ public Knowledgebase(QnAMakerClient client) _url = _url.Replace("{Endpoint}", Client.Endpoint); _url = _url.Replace("{kbId}", System.Uri.EscapeDataString(kbId)); _url = _url.Replace("{environment}", System.Uri.EscapeDataString(environment)); + List _queryParameters = new List(); + if (source != null) + { + _queryParameters.Add(string.Format("source={0}", System.Uri.EscapeDataString(source))); + } + if (changedSince != null) + { + _queryParameters.Add(string.Format("changedSince={0}", System.Uri.EscapeDataString(changedSince))); + } + if (_queryParameters.Count > 0) + { + _url += "?" + string.Join("&", _queryParameters); + } // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; @@ -1266,5 +1287,318 @@ public Knowledgebase(QnAMakerClient client) return _result; } + /// + /// GenerateAnswer call to query knowledgebase (QnA Maker Managed). + /// + /// + /// Knowledgebase id. + /// + /// + /// Post body of the request. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GenerateAnswerWithHttpMessagesAsync(string kbId, QueryDTO generateAnswerPayload, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.Endpoint == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.Endpoint"); + } + if (kbId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "kbId"); + } + if (generateAnswerPayload == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "generateAnswerPayload"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("kbId", kbId); + tracingParameters.Add("generateAnswerPayload", generateAnswerPayload); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GenerateAnswer", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri; + var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "knowledgebases/{kbId}/generateAnswer"; + _url = _url.Replace("{Endpoint}", Client.Endpoint); + _url = _url.Replace("{kbId}", System.Uri.EscapeDataString(kbId)); + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(generateAnswerPayload != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(generateAnswerPayload, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Train call to add suggestions to knowledgebase (QnAMaker Managed). + /// + /// + /// Knowledgebase id. + /// + /// + /// Post body of the request. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task TrainWithHttpMessagesAsync(string kbId, FeedbackRecordsDTO trainPayload, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.Endpoint == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.Endpoint"); + } + if (kbId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "kbId"); + } + if (trainPayload == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "trainPayload"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("kbId", kbId); + tracingParameters.Add("trainPayload", trainPayload); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Train", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri; + var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "knowledgebases/{kbId}/train"; + _url = _url.Replace("{Endpoint}", Client.Endpoint); + _url = _url.Replace("{kbId}", System.Uri.EscapeDataString(kbId)); + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(trainPayload != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(trainPayload, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 204) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + } } diff --git a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/KnowledgebaseExtensions.cs b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/KnowledgebaseExtensions.cs index bfd8fa62c72a..ae582bee8f21 100644 --- a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/KnowledgebaseExtensions.cs +++ b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/KnowledgebaseExtensions.cs @@ -166,16 +166,65 @@ public static partial class KnowledgebaseExtensions /// Specifies whether environment is Test or Prod. Possible values include: /// 'Prod', 'Test' /// + /// + /// The source property filter to apply. + /// + /// + /// The last changed status property filter to apply. + /// /// /// The cancellation token. /// - public static async Task DownloadAsync(this IKnowledgebase operations, string kbId, string environment, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DownloadAsync(this IKnowledgebase operations, string kbId, string environment, string source = default(string), string changedSince = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.DownloadWithHttpMessagesAsync(kbId, environment, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.DownloadWithHttpMessagesAsync(kbId, environment, source, changedSince, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } + /// + /// GenerateAnswer call to query knowledgebase (QnA Maker Managed). + /// + /// + /// The operations group for this extension method. + /// + /// + /// Knowledgebase id. + /// + /// + /// Post body of the request. + /// + /// + /// The cancellation token. + /// + public static async Task GenerateAnswerAsync(this IKnowledgebase operations, string kbId, QueryDTO generateAnswerPayload, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GenerateAnswerWithHttpMessagesAsync(kbId, generateAnswerPayload, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Train call to add suggestions to knowledgebase (QnAMaker Managed). + /// + /// + /// The operations group for this extension method. + /// + /// + /// Knowledgebase id. + /// + /// + /// Post body of the request. + /// + /// + /// The cancellation token. + /// + public static async Task TrainAsync(this IKnowledgebase operations, string kbId, FeedbackRecordsDTO trainPayload, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.TrainWithHttpMessagesAsync(kbId, trainPayload, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + } } diff --git a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/AnswerSpanRequestDTO.cs b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/AnswerSpanRequestDTO.cs new file mode 100644 index 000000000000..42a05e365b96 --- /dev/null +++ b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/AnswerSpanRequestDTO.cs @@ -0,0 +1,90 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// To configure Answer span prediction feature. + /// + public partial class AnswerSpanRequestDTO + { + /// + /// Initializes a new instance of the AnswerSpanRequestDTO class. + /// + public AnswerSpanRequestDTO() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AnswerSpanRequestDTO class. + /// + /// Enable or Disable Answer Span + /// prediction. + /// Minimum threshold score required to + /// include an answer span. + /// Number of Top answers to be + /// considered for span prediction. + public AnswerSpanRequestDTO(bool? enable = default(bool?), double? scoreThreshold = default(double?), int? topAnswersWithSpan = default(int?)) + { + Enable = enable; + ScoreThreshold = scoreThreshold; + TopAnswersWithSpan = topAnswersWithSpan; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets enable or Disable Answer Span prediction. + /// + [JsonProperty(PropertyName = "enable")] + public bool? Enable { get; set; } + + /// + /// Gets or sets minimum threshold score required to include an answer + /// span. + /// + [JsonProperty(PropertyName = "scoreThreshold")] + public double? ScoreThreshold { get; set; } + + /// + /// Gets or sets number of Top answers to be considered for span + /// prediction. + /// + [JsonProperty(PropertyName = "topAnswersWithSpan")] + public int? TopAnswersWithSpan { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (TopAnswersWithSpan > 10) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "TopAnswersWithSpan", 10); + } + if (TopAnswersWithSpan < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "TopAnswersWithSpan", 1); + } + } + } +} diff --git a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/AnswerSpanResponseDTO.cs b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/AnswerSpanResponseDTO.cs new file mode 100644 index 000000000000..ca5def4d12c0 --- /dev/null +++ b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/AnswerSpanResponseDTO.cs @@ -0,0 +1,76 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Answer span object of QnA. + /// + public partial class AnswerSpanResponseDTO + { + /// + /// Initializes a new instance of the AnswerSpanResponseDTO class. + /// + public AnswerSpanResponseDTO() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AnswerSpanResponseDTO class. + /// + /// Predicted text of answer span. + /// Predicted score of answer span. + /// Start index of answer span in + /// answer. + /// End index of answer span in answer. + public AnswerSpanResponseDTO(string text = default(string), double? score = default(double?), int? startIndex = default(int?), int? endIndex = default(int?)) + { + Text = text; + Score = score; + StartIndex = startIndex; + EndIndex = endIndex; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets predicted text of answer span. + /// + [JsonProperty(PropertyName = "text")] + public string Text { get; set; } + + /// + /// Gets or sets predicted score of answer span. + /// + [JsonProperty(PropertyName = "score")] + public double? Score { get; set; } + + /// + /// Gets or sets start index of answer span in answer. + /// + [JsonProperty(PropertyName = "startIndex")] + public int? StartIndex { get; set; } + + /// + /// Gets or sets end index of answer span in answer. + /// + [JsonProperty(PropertyName = "endIndex")] + public int? EndIndex { get; set; } + + } +} diff --git a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/ContextDTO.cs b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/ContextDTO.cs index 77442cff98aa..9a2b93b636cc 100644 --- a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/ContextDTO.cs +++ b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/ContextDTO.cs @@ -10,6 +10,7 @@ namespace Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.Models { + using Microsoft.Rest; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -67,5 +68,28 @@ public ContextDTO() [JsonProperty(PropertyName = "prompts")] public IList Prompts { get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Prompts != null) + { + if (Prompts.Count > 20) + { + throw new ValidationException(ValidationRules.MaxItems, "Prompts", 20); + } + foreach (var element in Prompts) + { + if (element != null) + { + element.Validate(); + } + } + } + } } } diff --git a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/CreateKbDTO.cs b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/CreateKbDTO.cs index 43ec59f51278..5fb29412c3ff 100644 --- a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/CreateKbDTO.cs +++ b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/CreateKbDTO.cs @@ -47,8 +47,15 @@ public CreateKbDTO() /// as the answer in any Q-A which has no extracted answer from the /// document but has a hierarchy. Required when /// EnableHierarchicalExtraction field is set to True. - /// Language of the knowledgebase. - public CreateKbDTO(string name, IList qnaList = default(IList), IList urls = default(IList), IList files = default(IList), bool? enableHierarchicalExtraction = default(bool?), string defaultAnswerUsedForExtraction = default(string), string language = default(string)) + /// Language of the knowledgebase. Please find + /// the list of supported languages <a + /// href="https://aka.ms/qnamaker-languages#languages-supported" + /// target="_blank">here</a>. + /// Set to true to enable + /// creating KBs in different languages for the same resource. + /// Default answer sent to user if no good + /// match is found in the KB. + public CreateKbDTO(string name, IList qnaList = default(IList), IList urls = default(IList), IList files = default(IList), bool? enableHierarchicalExtraction = default(bool?), string defaultAnswerUsedForExtraction = default(string), string language = default(string), bool? enableMultipleLanguages = default(bool?), string defaultAnswer = default(string)) { Name = name; QnaList = qnaList; @@ -57,6 +64,8 @@ public CreateKbDTO() EnableHierarchicalExtraction = enableHierarchicalExtraction; DefaultAnswerUsedForExtraction = defaultAnswerUsedForExtraction; Language = language; + EnableMultipleLanguages = enableMultipleLanguages; + DefaultAnswer = defaultAnswer; CustomInit(); } @@ -106,11 +115,28 @@ public CreateKbDTO() public string DefaultAnswerUsedForExtraction { get; set; } /// - /// Gets or sets language of the knowledgebase. + /// Gets or sets language of the knowledgebase. Please find the list of + /// supported languages &lt;a + /// href="https://aka.ms/qnamaker-languages#languages-supported" + /// target="_blank"&gt;here&lt;/a&gt;. /// [JsonProperty(PropertyName = "language")] public string Language { get; set; } + /// + /// Gets or sets set to true to enable creating KBs in different + /// languages for the same resource. + /// + [JsonProperty(PropertyName = "enableMultipleLanguages")] + public bool? EnableMultipleLanguages { get; set; } + + /// + /// Gets or sets default answer sent to user if no good match is found + /// in the KB. + /// + [JsonProperty(PropertyName = "defaultAnswer")] + public string DefaultAnswer { get; set; } + /// /// Validate the object. /// @@ -123,6 +149,17 @@ public virtual void Validate() { throw new ValidationException(ValidationRules.CannotBeNull, "Name"); } + if (Name != null) + { + if (Name.Length > 100) + { + throw new ValidationException(ValidationRules.MaxLength, "Name", 100); + } + if (Name.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Name", 1); + } + } if (QnaList != null) { foreach (var element in QnaList) @@ -143,6 +180,39 @@ public virtual void Validate() } } } + if (DefaultAnswerUsedForExtraction != null) + { + if (DefaultAnswerUsedForExtraction.Length > 300) + { + throw new ValidationException(ValidationRules.MaxLength, "DefaultAnswerUsedForExtraction", 300); + } + if (DefaultAnswerUsedForExtraction.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "DefaultAnswerUsedForExtraction", 1); + } + } + if (Language != null) + { + if (Language.Length > 100) + { + throw new ValidationException(ValidationRules.MaxLength, "Language", 100); + } + if (Language.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Language", 1); + } + } + if (DefaultAnswer != null) + { + if (DefaultAnswer.Length > 300) + { + throw new ValidationException(ValidationRules.MaxLength, "DefaultAnswer", 300); + } + if (DefaultAnswer.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "DefaultAnswer", 1); + } + } } } } diff --git a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/FeedbackRecordDTO.cs b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/FeedbackRecordDTO.cs index 56adc626c1e4..e77c6c00c327 100644 --- a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/FeedbackRecordDTO.cs +++ b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/FeedbackRecordDTO.cs @@ -10,6 +10,7 @@ namespace Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.Models { + using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; @@ -66,5 +67,21 @@ public FeedbackRecordDTO() [JsonProperty(PropertyName = "qnaId")] public int? QnaId { get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (UserQuestion != null) + { + if (UserQuestion.Length > 1000) + { + throw new ValidationException(ValidationRules.MaxLength, "UserQuestion", 1000); + } + } + } } } diff --git a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/FileDTO.cs b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/FileDTO.cs index cff9f9dfc9b0..3316c9986c48 100644 --- a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/FileDTO.cs +++ b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/FileDTO.cs @@ -74,6 +74,17 @@ public virtual void Validate() { throw new ValidationException(ValidationRules.CannotBeNull, "FileUri"); } + if (FileName != null) + { + if (FileName.Length > 200) + { + throw new ValidationException(ValidationRules.MaxLength, "FileName", 200); + } + if (FileName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "FileName", 1); + } + } } } } diff --git a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/MetadataDTO.cs b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/MetadataDTO.cs index 385e3e888ac6..56af6aa6f305 100644 --- a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/MetadataDTO.cs +++ b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/MetadataDTO.cs @@ -72,6 +72,28 @@ public virtual void Validate() { throw new ValidationException(ValidationRules.CannotBeNull, "Value"); } + if (Name != null) + { + if (Name.Length > 100) + { + throw new ValidationException(ValidationRules.MaxLength, "Name", 100); + } + if (Name.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Name", 1); + } + } + if (Value != null) + { + if (Value.Length > 500) + { + throw new ValidationException(ValidationRules.MaxLength, "Value", 500); + } + if (Value.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Value", 1); + } + } } } } diff --git a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/PromptDTO.cs b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/PromptDTO.cs index b870ee9c59b6..1fcc695d9cff 100644 --- a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/PromptDTO.cs +++ b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/PromptDTO.cs @@ -10,6 +10,7 @@ namespace Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.Models { + using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; @@ -78,5 +79,25 @@ public PromptDTO() [JsonProperty(PropertyName = "displayText")] public string DisplayText { get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Qna != null) + { + Qna.Validate(); + } + if (DisplayText != null) + { + if (DisplayText.Length > 200) + { + throw new ValidationException(ValidationRules.MaxLength, "DisplayText", 200); + } + } + } } } diff --git a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/PromptDTOQna.cs b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/PromptDTOQna.cs index a95fae8e1140..9af99d162a23 100644 --- a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/PromptDTOQna.cs +++ b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/PromptDTOQna.cs @@ -40,8 +40,10 @@ public PromptDTOQna() /// List of metadata associated with the /// answer. /// Context of a QnA - public PromptDTOQna(string answer, IList questions, int? id = default(int?), string source = default(string), IList metadata = default(IList), QnADTOContext context = default(QnADTOContext)) - : base(answer, questions, id, source, metadata, context) + /// Timestamp when the QnA was last + /// updated. + public PromptDTOQna(string answer, IList questions, int? id = default(int?), string source = default(string), IList metadata = default(IList), QnADTOContext context = default(QnADTOContext), string lastUpdatedTimestamp = default(string)) + : base(answer, questions, id, source, metadata, context, lastUpdatedTimestamp) { CustomInit(); } diff --git a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/QnADTO.cs b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/QnADTO.cs index b824a017127d..e523878cb139 100644 --- a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/QnADTO.cs +++ b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/QnADTO.cs @@ -41,7 +41,9 @@ public QnADTO() /// List of metadata associated with the /// answer. /// Context of a QnA - public QnADTO(string answer, IList questions, int? id = default(int?), string source = default(string), IList metadata = default(IList), QnADTOContext context = default(QnADTOContext)) + /// Timestamp when the QnA was last + /// updated. + public QnADTO(string answer, IList questions, int? id = default(int?), string source = default(string), IList metadata = default(IList), QnADTOContext context = default(QnADTOContext), string lastUpdatedTimestamp = default(string)) { Id = id; Answer = answer; @@ -49,6 +51,7 @@ public QnADTO() Questions = questions; Metadata = metadata; Context = context; + LastUpdatedTimestamp = lastUpdatedTimestamp; CustomInit(); } @@ -94,6 +97,12 @@ public QnADTO() [JsonProperty(PropertyName = "context")] public QnADTOContext Context { get; set; } + /// + /// Gets or sets timestamp when the QnA was last updated. + /// + [JsonProperty(PropertyName = "lastUpdatedTimestamp")] + public string LastUpdatedTimestamp { get; set; } + /// /// Validate the object. /// @@ -110,6 +119,24 @@ public virtual void Validate() { throw new ValidationException(ValidationRules.CannotBeNull, "Questions"); } + if (Answer != null) + { + if (Answer.Length > 25000) + { + throw new ValidationException(ValidationRules.MaxLength, "Answer", 25000); + } + if (Answer.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Answer", 1); + } + } + if (Source != null) + { + if (Source.Length > 300) + { + throw new ValidationException(ValidationRules.MaxLength, "Source", 300); + } + } if (Metadata != null) { foreach (var element in Metadata) @@ -120,6 +147,17 @@ public virtual void Validate() } } } + if (Context != null) + { + Context.Validate(); + } + if (LastUpdatedTimestamp != null) + { + if (LastUpdatedTimestamp.Length > 300) + { + throw new ValidationException(ValidationRules.MaxLength, "LastUpdatedTimestamp", 300); + } + } } } } diff --git a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/QnADTOContext.cs b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/QnADTOContext.cs index 3161685f5c45..c663a9710a42 100644 --- a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/QnADTOContext.cs +++ b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/QnADTOContext.cs @@ -49,5 +49,15 @@ public QnADTOContext() /// partial void CustomInit(); + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + } } } diff --git a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/QnASearchResult.cs b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/QnASearchResult.cs index 2e2a56dd6b02..937db55f4065 100644 --- a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/QnASearchResult.cs +++ b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/QnASearchResult.cs @@ -38,7 +38,9 @@ public QnASearchResult() /// Source of QnA result. /// List of metadata. /// Context object of the QnA - public QnASearchResult(IList questions = default(IList), string answer = default(string), double? score = default(double?), int? id = default(int?), string source = default(string), IList metadata = default(IList), QnASearchResultContext context = default(QnASearchResultContext)) + /// Answer span object of QnA with respect to + /// user's question. + public QnASearchResult(IList questions = default(IList), string answer = default(string), double? score = default(double?), int? id = default(int?), string source = default(string), IList metadata = default(IList), QnASearchResultContext context = default(QnASearchResultContext), QnASearchResultAnswerSpan answerSpan = default(QnASearchResultAnswerSpan)) { Questions = questions; Answer = answer; @@ -47,6 +49,7 @@ public QnASearchResult() Source = source; Metadata = metadata; Context = context; + AnswerSpan = answerSpan; CustomInit(); } @@ -97,5 +100,12 @@ public QnASearchResult() [JsonProperty(PropertyName = "context")] public QnASearchResultContext Context { get; set; } + /// + /// Gets or sets answer span object of QnA with respect to user's + /// question. + /// + [JsonProperty(PropertyName = "answerSpan")] + public QnASearchResultAnswerSpan AnswerSpan { get; set; } + } } diff --git a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/QnASearchResultAnswerSpan.cs b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/QnASearchResultAnswerSpan.cs new file mode 100644 index 000000000000..c5f301230ba9 --- /dev/null +++ b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/QnASearchResultAnswerSpan.cs @@ -0,0 +1,48 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.Models +{ + using System.Linq; + + /// + /// Answer span object of QnA with respect to user's question. + /// + public partial class QnASearchResultAnswerSpan : AnswerSpanResponseDTO + { + /// + /// Initializes a new instance of the QnASearchResultAnswerSpan class. + /// + public QnASearchResultAnswerSpan() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the QnASearchResultAnswerSpan class. + /// + /// Predicted text of answer span. + /// Predicted score of answer span. + /// Start index of answer span in + /// answer. + /// End index of answer span in answer. + public QnASearchResultAnswerSpan(string text = default(string), double? score = default(double?), int? startIndex = default(int?), int? endIndex = default(int?)) + : base(text, score, startIndex, endIndex) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/QnASearchResultContext.cs b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/QnASearchResultContext.cs index 3c19508c5e10..f7a01ea1217b 100644 --- a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/QnASearchResultContext.cs +++ b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/QnASearchResultContext.cs @@ -49,5 +49,15 @@ public QnASearchResultContext() /// partial void CustomInit(); + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + } } } diff --git a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/QueryContextDTO.cs b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/QueryContextDTO.cs index fa9d3cc462e2..018ff7770961 100644 --- a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/QueryContextDTO.cs +++ b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/QueryContextDTO.cs @@ -32,7 +32,7 @@ public QueryContextDTO() /// Previous QnA Id - qnaId of the top /// result. /// Previous user query. - public QueryContextDTO(string previousQnaId = default(string), string previousUserQuery = default(string)) + public QueryContextDTO(int? previousQnaId = default(int?), string previousUserQuery = default(string)) { PreviousQnaId = previousQnaId; PreviousUserQuery = previousUserQuery; @@ -48,7 +48,7 @@ public QueryContextDTO() /// Gets or sets previous QnA Id - qnaId of the top result. /// [JsonProperty(PropertyName = "previousQnaId")] - public string PreviousQnaId { get; set; } + public int? PreviousQnaId { get; set; } /// /// Gets or sets previous user query. diff --git a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/QueryDTO.cs b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/QueryDTO.cs index 04e219a5ed45..33e324abc4ec 100644 --- a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/QueryDTO.cs +++ b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/QueryDTO.cs @@ -39,18 +39,20 @@ public QueryDTO() /// question. /// Unique identifier for the user. /// Query against the test index. - /// Threshold for answers returned based - /// on score. + /// Minimum threshold score for + /// answers. /// Context object with previous QnA's /// information. /// Optional field. Set to 'QuestionOnly' for /// using a question only Ranker. - /// Find only answers that contain these - /// metadata. + /// Find QnAs that are associated with the + /// given list of metadata. /// Optional field. - /// Set to OR for using OR as Operation for Strict Filters. Possible + /// Set to 'OR' for using OR operation for strict filters. Possible /// values include: 'AND', 'OR' - public QueryDTO(string qnaId = default(string), string question = default(string), int? top = default(int?), string userId = default(string), bool? isTest = default(bool?), double? scoreThreshold = default(double?), QueryDTOContext context = default(QueryDTOContext), string rankerType = default(string), IList strictFilters = default(IList), string strictFiltersCompoundOperationType = default(string)) + /// To configure Answer span prediction + /// feature. + public QueryDTO(string qnaId = default(string), string question = default(string), int? top = default(int?), string userId = default(string), bool? isTest = default(bool?), double? scoreThreshold = default(double?), QueryDTOContext context = default(QueryDTOContext), string rankerType = default(string), IList strictFilters = default(IList), string strictFiltersCompoundOperationType = default(string), QueryDTOAnswerSpanRequest answerSpanRequest = default(QueryDTOAnswerSpanRequest)) { QnaId = qnaId; Question = question; @@ -62,6 +64,7 @@ public QueryDTO() RankerType = rankerType; StrictFilters = strictFilters; StrictFiltersCompoundOperationType = strictFiltersCompoundOperationType; + AnswerSpanRequest = answerSpanRequest; CustomInit(); } @@ -102,7 +105,7 @@ public QueryDTO() public bool? IsTest { get; set; } /// - /// Gets or sets threshold for answers returned based on score. + /// Gets or sets minimum threshold score for answers. /// [JsonProperty(PropertyName = "scoreThreshold")] public double? ScoreThreshold { get; set; } @@ -121,17 +124,24 @@ public QueryDTO() public string RankerType { get; set; } /// - /// Gets or sets find only answers that contain these metadata. + /// Gets or sets find QnAs that are associated with the given list of + /// metadata. /// [JsonProperty(PropertyName = "strictFilters")] public IList StrictFilters { get; set; } /// - /// Gets or sets optional field. Set to OR for using OR as Operation - /// for Strict Filters. Possible values include: 'AND', 'OR' + /// Gets or sets optional field. Set to 'OR' for using OR operation for + /// strict filters. Possible values include: 'AND', 'OR' /// [JsonProperty(PropertyName = "strictFiltersCompoundOperationType")] public string StrictFiltersCompoundOperationType { get; set; } + /// + /// Gets or sets to configure Answer span prediction feature. + /// + [JsonProperty(PropertyName = "answerSpanRequest")] + public QueryDTOAnswerSpanRequest AnswerSpanRequest { get; set; } + } } diff --git a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/QueryDTOAnswerSpanRequest.cs b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/QueryDTOAnswerSpanRequest.cs new file mode 100644 index 000000000000..4556f8ba2c8a --- /dev/null +++ b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/QueryDTOAnswerSpanRequest.cs @@ -0,0 +1,59 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.Models +{ + using System.Linq; + + /// + /// To configure Answer span prediction feature. + /// + public partial class QueryDTOAnswerSpanRequest : AnswerSpanRequestDTO + { + /// + /// Initializes a new instance of the QueryDTOAnswerSpanRequest class. + /// + public QueryDTOAnswerSpanRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the QueryDTOAnswerSpanRequest class. + /// + /// Enable or Disable Answer Span + /// prediction. + /// Minimum threshold score required to + /// include an answer span. + /// Number of Top answers to be + /// considered for span prediction. + public QueryDTOAnswerSpanRequest(bool? enable = default(bool?), double? scoreThreshold = default(double?), int? topAnswersWithSpan = default(int?)) + : base(enable, scoreThreshold, topAnswersWithSpan) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + } + } +} diff --git a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/QueryDTOContext.cs b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/QueryDTOContext.cs index 7dc405c44daf..2559bb07c434 100644 --- a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/QueryDTOContext.cs +++ b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/QueryDTOContext.cs @@ -31,7 +31,7 @@ public QueryDTOContext() /// Previous QnA Id - qnaId of the top /// result. /// Previous user query. - public QueryDTOContext(string previousQnaId = default(string), string previousUserQuery = default(string)) + public QueryDTOContext(int? previousQnaId = default(int?), string previousUserQuery = default(string)) : base(previousQnaId, previousUserQuery) { CustomInit(); diff --git a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/UpdateKbContentsDTO.cs b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/UpdateKbContentsDTO.cs index 36c4fc7ba295..a2ef152aedbc 100644 --- a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/UpdateKbContentsDTO.cs +++ b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/UpdateKbContentsDTO.cs @@ -10,6 +10,7 @@ namespace Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.Models { + using Microsoft.Rest; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -36,11 +37,14 @@ public UpdateKbContentsDTO() /// knowledgebase. /// List of existing URLs to be refreshed. The /// content will be extracted again and re-indexed. - public UpdateKbContentsDTO(string name = default(string), IList qnaList = default(IList), IList urls = default(IList)) + /// Default answer sent to user if no good + /// match is found in the KB. + public UpdateKbContentsDTO(string name = default(string), IList qnaList = default(IList), IList urls = default(IList), string defaultAnswer = default(string)) { Name = name; QnaList = qnaList; Urls = urls; + DefaultAnswer = defaultAnswer; CustomInit(); } @@ -69,5 +73,42 @@ public UpdateKbContentsDTO() [JsonProperty(PropertyName = "urls")] public IList Urls { get; set; } + /// + /// Gets or sets default answer sent to user if no good match is found + /// in the KB. + /// + [JsonProperty(PropertyName = "defaultAnswer")] + public string DefaultAnswer { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (QnaList != null) + { + foreach (var element in QnaList) + { + if (element != null) + { + element.Validate(); + } + } + } + if (DefaultAnswer != null) + { + if (DefaultAnswer.Length > 300) + { + throw new ValidationException(ValidationRules.MaxLength, "DefaultAnswer", 300); + } + if (DefaultAnswer.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "DefaultAnswer", 1); + } + } + } } } diff --git a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/UpdateKbOperationDTO.cs b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/UpdateKbOperationDTO.cs index 78eb3dce666c..705b53f4ee63 100644 --- a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/UpdateKbOperationDTO.cs +++ b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/UpdateKbOperationDTO.cs @@ -10,6 +10,7 @@ namespace Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.Models { + using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; @@ -93,5 +94,29 @@ public UpdateKbOperationDTO() [JsonProperty(PropertyName = "defaultAnswerUsedForExtraction")] public string DefaultAnswerUsedForExtraction { get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Update != null) + { + Update.Validate(); + } + if (DefaultAnswerUsedForExtraction != null) + { + if (DefaultAnswerUsedForExtraction.Length > 300) + { + throw new ValidationException(ValidationRules.MaxLength, "DefaultAnswerUsedForExtraction", 300); + } + if (DefaultAnswerUsedForExtraction.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "DefaultAnswerUsedForExtraction", 1); + } + } + } } } diff --git a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/UpdateKbOperationDTOUpdate.cs b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/UpdateKbOperationDTOUpdate.cs index 946b91319be1..e0bd6503925f 100644 --- a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/UpdateKbOperationDTOUpdate.cs +++ b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/UpdateKbOperationDTOUpdate.cs @@ -35,8 +35,10 @@ public UpdateKbOperationDTOUpdate() /// knowledgebase. /// List of existing URLs to be refreshed. The /// content will be extracted again and re-indexed. - public UpdateKbOperationDTOUpdate(string name = default(string), IList qnaList = default(IList), IList urls = default(IList)) - : base(name, qnaList, urls) + /// Default answer sent to user if no good + /// match is found in the KB. + public UpdateKbOperationDTOUpdate(string name = default(string), IList qnaList = default(IList), IList urls = default(IList), string defaultAnswer = default(string)) + : base(name, qnaList, urls, defaultAnswer) { CustomInit(); } @@ -46,5 +48,15 @@ public UpdateKbOperationDTOUpdate() /// partial void CustomInit(); + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + } } } diff --git a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/UpdateQnaDTO.cs b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/UpdateQnaDTO.cs index c9dbe8ceb074..37187923fd46 100644 --- a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/UpdateQnaDTO.cs +++ b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Models/UpdateQnaDTO.cs @@ -110,6 +110,13 @@ public virtual void Validate() { throw new ValidationException(ValidationRules.InclusiveMinimum, "Id", 0); } + if (Source != null) + { + if (Source.Length > 300) + { + throw new ValidationException(ValidationRules.MaxLength, "Source", 300); + } + } } } } diff --git a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/QnAMakerClient.cs b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/QnAMakerClient.cs index accd08c0f5ca..d293063ec963 100644 --- a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/QnAMakerClient.cs +++ b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/QnAMakerClient.cs @@ -40,8 +40,8 @@ public partial class QnAMakerClient : ServiceClient, IQnAMakerCl public JsonSerializerSettings DeserializationSettings { get; private set; } /// - /// Supported Cognitive Services endpoints (protocol and hostname, for example: - /// https://westus.api.cognitive.microsoft.com). + /// Supported Cognitive Services endpoint (e.g., https://< + /// qnamaker-resource-name >.api.cognitiveservices.azure.com). /// public string Endpoint { get; set; } @@ -207,7 +207,7 @@ private void Initialize() Alterations = new Alterations(this); Knowledgebase = new Knowledgebase(this); Operations = new Operations(this); - BaseUri = "{Endpoint}/qnamaker/v4.0"; + BaseUri = "{Endpoint}/qnamaker/v5.0-preview.1"; SerializationSettings = new JsonSerializerSettings { Formatting = Newtonsoft.Json.Formatting.Indented, diff --git a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/QnAMakerRuntimeClient.cs b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/QnAMakerRuntimeClient.cs deleted file mode 100644 index 44965c01fc5f..000000000000 --- a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/QnAMakerRuntimeClient.cs +++ /dev/null @@ -1,215 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker -{ - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Net; - using System.Net.Http; - - /// - /// An API for QnAMaker runtime - /// - public partial class QnAMakerRuntimeClient : ServiceClient, IQnAMakerRuntimeClient - { - /// - /// The base URI of the service. - /// - internal string BaseUri {get; set;} - - /// - /// Gets or sets json serialization settings. - /// - public JsonSerializerSettings SerializationSettings { get; private set; } - - /// - /// Gets or sets json deserialization settings. - /// - public JsonSerializerSettings DeserializationSettings { get; private set; } - - /// - /// QnA Maker App Service endpoint (for example: - /// https://{qnaservice-hostname}.azurewebsites.net). - /// - public string RuntimeEndpoint { get; set; } - - /// - /// Subscription credentials which uniquely identify client subscription. - /// - public ServiceClientCredentials Credentials { get; private set; } - - /// - /// Gets the IRuntime. - /// - public virtual IRuntime Runtime { get; private set; } - - /// - /// Initializes a new instance of the QnAMakerRuntimeClient class. - /// - /// - /// HttpClient to be used - /// - /// - /// True: will dispose the provided httpClient on calling QnAMakerRuntimeClient.Dispose(). False: will not dispose provided httpClient - protected QnAMakerRuntimeClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient) - { - Initialize(); - } - - /// - /// Initializes a new instance of the QnAMakerRuntimeClient class. - /// - /// - /// Optional. The delegating handlers to add to the http client pipeline. - /// - protected QnAMakerRuntimeClient(params DelegatingHandler[] handlers) : base(handlers) - { - Initialize(); - } - - /// - /// Initializes a new instance of the QnAMakerRuntimeClient class. - /// - /// - /// Optional. The http client handler used to handle http transport. - /// - /// - /// Optional. The delegating handlers to add to the http client pipeline. - /// - protected QnAMakerRuntimeClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers) - { - Initialize(); - } - - /// - /// Initializes a new instance of the QnAMakerRuntimeClient class. - /// - /// - /// Required. Subscription credentials which uniquely identify client subscription. - /// - /// - /// Optional. The delegating handlers to add to the http client pipeline. - /// - /// - /// Thrown when a required parameter is null - /// - public QnAMakerRuntimeClient(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) - { - if (credentials == null) - { - throw new System.ArgumentNullException("credentials"); - } - Credentials = credentials; - if (Credentials != null) - { - Credentials.InitializeServiceClient(this); - } - } - - /// - /// Initializes a new instance of the QnAMakerRuntimeClient class. - /// - /// - /// Required. Subscription credentials which uniquely identify client subscription. - /// - /// - /// HttpClient to be used - /// - /// - /// True: will dispose the provided httpClient on calling QnAMakerRuntimeClient.Dispose(). False: will not dispose provided httpClient - /// - /// Thrown when a required parameter is null - /// - public QnAMakerRuntimeClient(ServiceClientCredentials credentials, HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient) - { - if (credentials == null) - { - throw new System.ArgumentNullException("credentials"); - } - Credentials = credentials; - if (Credentials != null) - { - Credentials.InitializeServiceClient(this); - } - } - - /// - /// Initializes a new instance of the QnAMakerRuntimeClient class. - /// - /// - /// Required. Subscription credentials which uniquely identify client subscription. - /// - /// - /// Optional. The http client handler used to handle http transport. - /// - /// - /// Optional. The delegating handlers to add to the http client pipeline. - /// - /// - /// Thrown when a required parameter is null - /// - public QnAMakerRuntimeClient(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) - { - if (credentials == null) - { - throw new System.ArgumentNullException("credentials"); - } - Credentials = credentials; - if (Credentials != null) - { - Credentials.InitializeServiceClient(this); - } - } - - /// - /// An optional partial-method to perform custom initialization. - /// - partial void CustomInitialize(); - /// - /// Initializes client properties. - /// - private void Initialize() - { - Runtime = new Runtime(this); - BaseUri = "{RuntimeEndpoint}/qnamaker"; - SerializationSettings = new JsonSerializerSettings - { - Formatting = Newtonsoft.Json.Formatting.Indented, - DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, - DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, - NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, - ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, - ContractResolver = new ReadOnlyJsonContractResolver(), - Converters = new List - { - new Iso8601TimeSpanConverter() - } - }; - DeserializationSettings = new JsonSerializerSettings - { - DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, - DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, - NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, - ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, - ContractResolver = new ReadOnlyJsonContractResolver(), - Converters = new List - { - new Iso8601TimeSpanConverter() - } - }; - CustomInitialize(); - } - } -} diff --git a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Runtime.cs b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Runtime.cs deleted file mode 100644 index 3d9d1956dcfa..000000000000 --- a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/Runtime.cs +++ /dev/null @@ -1,367 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker -{ - using Microsoft.Rest; - using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.IO; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Runtime operations. - /// - public partial class Runtime : IServiceOperations, IRuntime - { - /// - /// Initializes a new instance of the Runtime class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - public Runtime(QnAMakerRuntimeClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the QnAMakerRuntimeClient - /// - public QnAMakerRuntimeClient Client { get; private set; } - - /// - /// GenerateAnswer call to query the knowledgebase. - /// - /// - /// Knowledgebase id. - /// - /// - /// Post body of the request. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task> GenerateAnswerWithHttpMessagesAsync(string kbId, QueryDTO generateAnswerPayload, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.RuntimeEndpoint == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.RuntimeEndpoint"); - } - if (kbId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "kbId"); - } - if (generateAnswerPayload == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "generateAnswerPayload"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("kbId", kbId); - tracingParameters.Add("generateAnswerPayload", generateAnswerPayload); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GenerateAnswer", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri; - var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "knowledgebases/{kbId}/generateAnswer"; - _url = _url.Replace("{RuntimeEndpoint}", Client.RuntimeEndpoint); - _url = _url.Replace("{kbId}", System.Uri.EscapeDataString(kbId)); - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - if(generateAnswerPayload != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(generateAnswerPayload, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new HttpOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Train call to add suggestions to the knowledgebase. - /// - /// - /// Knowledgebase id. - /// - /// - /// Post body of the request. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task TrainWithHttpMessagesAsync(string kbId, FeedbackRecordsDTO trainPayload, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.RuntimeEndpoint == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.RuntimeEndpoint"); - } - if (kbId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "kbId"); - } - if (trainPayload == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "trainPayload"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("kbId", kbId); - tracingParameters.Add("trainPayload", trainPayload); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Train", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri; - var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "knowledgebases/{kbId}/train"; - _url = _url.Replace("{RuntimeEndpoint}", Client.RuntimeEndpoint); - _url = _url.Replace("{kbId}", System.Uri.EscapeDataString(kbId)); - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - if(trainPayload != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(trainPayload, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 204) - { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new HttpOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - } -} diff --git a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/RuntimeExtensions.cs b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/RuntimeExtensions.cs deleted file mode 100644 index df68ae55bf38..000000000000 --- a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/RuntimeExtensions.cs +++ /dev/null @@ -1,66 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker -{ - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for Runtime. - /// - public static partial class RuntimeExtensions - { - /// - /// GenerateAnswer call to query the knowledgebase. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Knowledgebase id. - /// - /// - /// Post body of the request. - /// - /// - /// The cancellation token. - /// - public static async Task GenerateAnswerAsync(this IRuntime operations, string kbId, QueryDTO generateAnswerPayload, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GenerateAnswerWithHttpMessagesAsync(kbId, generateAnswerPayload, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Train call to add suggestions to the knowledgebase. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Knowledgebase id. - /// - /// - /// Post body of the request. - /// - /// - /// The cancellation token. - /// - public static async Task TrainAsync(this IRuntime operations, string kbId, FeedbackRecordsDTO trainPayload, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.TrainWithHttpMessagesAsync(kbId, trainPayload, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - } -} diff --git a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/SdkInfo_QnAMakerRuntimeClient.cs b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/SdkInfo_QnAMakerRuntimeClient.cs deleted file mode 100644 index 907da4101a9f..000000000000 --- a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/SdkInfo_QnAMakerRuntimeClient.cs +++ /dev/null @@ -1,38 +0,0 @@ - -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker -{ - using System; - using System.Collections.Generic; - using System.Linq; - - internal static partial class SdkInfo - { - public static IEnumerable> ApiInfo_QnAMakerRuntimeClient - { - get - { - return new Tuple[] - { - new Tuple("QnAMakerRuntimeClient", "Runtime", "4.0"), - }.AsEnumerable(); - } - } - // BEGIN: Code Generation Metadata Section - public static readonly String AutoRestVersion = "latest"; - public static readonly String AutoRestBootStrapperVersion = "autorest@3.0.6187"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/cognitiveservices/data-plane/QnAMaker/readme.md --csharp --version=latest --reflect-api-versions --csharp-sdks-folder=C:\\azure-sdk-for-net\\azure-sdk-for-net\\sdk"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "3e974736d767fd714b4fb0570aa352e774582ecd"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section - } -} - diff --git a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/code-model-v1 b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/code-model-v1 deleted file mode 100644 index b5f900934188..000000000000 --- a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Generated/code-model-v1 +++ /dev/null @@ -1,3030 +0,0 @@ -{ - "$id": "1", - "modelTypes": [ - { - "$id": "2", - "$type": "CompositeType", - "properties": [ - { - "$id": "3", - "isReadOnly": false, - "realPath": [ - "name" - ], - "collectionFormat": "none", - "defaultValue": { - "$id": "4", - "fixed": false - }, - "deprecated": false, - "documentation": { - "$id": "5", - "fixed": false, - "raw": "Metadata name." - }, - "isRequired": true, - "isConstant": false, - "name": { - "$id": "6", - "fixed": false, - "raw": "name" - }, - "serializedName": "name", - "modelType": { - "$id": "7", - "$type": "PrimaryType", - "knownPrimaryType": "string", - "name": { - "$id": "8", - "fixed": false, - "raw": "String" - }, - "deprecated": false - } - }, - { - "$id": "9", - "isReadOnly": false, - "realPath": [ - "value" - ], - "collectionFormat": "none", - "defaultValue": { - "$id": "10", - "fixed": false - }, - "deprecated": false, - "documentation": { - "$id": "11", - "fixed": false, - "raw": "Metadata value." - }, - "isRequired": true, - "isConstant": false, - "name": { - "$id": "12", - "fixed": false, - "raw": "value" - }, - "serializedName": "value", - "modelType": { - "$id": "13", - "$type": "PrimaryType", - "knownPrimaryType": "string", - "name": { - "$id": "14", - "fixed": false, - "raw": "String" - }, - "deprecated": false - } - } - ], - "serializedName": "MetadataDTO", - "documentation": "Name - value pair of metadata.", - "containsConstantProperties": false, - "name": { - "$id": "15", - "fixed": false, - "raw": "MetadataDTO" - }, - "extensions": { - "x-ms-metadata": { - "apiVersions": [ - "4.0" - ], - "filename": [ - "mem:///129?oai3.shaken.json" - ], - "name": "MetadataDTO", - "originalLocations": [ - "https://github.com/Azure/azure-rest-api-specs/blob/master/specification/cognitiveservices/data-plane/QnAMaker/stable/v4.0/QnAMakerRuntime.json#/components/schemas/MetadataDTO" - ] - } - }, - "deprecated": false - }, - { - "$id": "16", - "$type": "CompositeType", - "serializedName": "QnADTO-context", - "baseModelType": { - "$id": "17", - "$type": "CompositeType", - "properties": [ - { - "$id": "18", - "isReadOnly": false, - "realPath": [ - "isContextOnly" - ], - "collectionFormat": "none", - "defaultValue": { - "$id": "19", - "fixed": false - }, - "deprecated": false, - "documentation": { - "$id": "20", - "fixed": false, - "raw": "To mark if a prompt is relevant only with a previous question or not.\ntrue - Do not include this QnA as search result for queries without context\nfalse - ignores context and includes this QnA in search result" - }, - "isRequired": false, - "isConstant": false, - "name": { - "$id": "21", - "fixed": false, - "raw": "isContextOnly" - }, - "serializedName": "isContextOnly", - "modelType": { - "$id": "22", - "$type": "PrimaryType", - "knownPrimaryType": "boolean", - "name": { - "$id": "23", - "fixed": false, - "raw": "Boolean" - }, - "deprecated": false - } - }, - { - "$id": "24", - "isReadOnly": false, - "realPath": [ - "prompts" - ], - "collectionFormat": "none", - "defaultValue": { - "$id": "25", - "fixed": false - }, - "deprecated": false, - "documentation": { - "$id": "26", - "fixed": false, - "raw": "List of prompts associated with the answer." - }, - "isRequired": false, - "isConstant": false, - "name": { - "$id": "27", - "fixed": false, - "raw": "prompts" - }, - "serializedName": "prompts", - "modelType": { - "$id": "28", - "$type": "SequenceType", - "elementType": { - "$id": "29", - "$type": "CompositeType", - "properties": [ - { - "$id": "30", - "isReadOnly": false, - "realPath": [ - "displayOrder" - ], - "collectionFormat": "none", - "defaultValue": { - "$id": "31", - "fixed": false - }, - "deprecated": false, - "documentation": { - "$id": "32", - "fixed": false, - "raw": "Index of the prompt - used in ordering of the prompts" - }, - "isRequired": false, - "isConstant": false, - "name": { - "$id": "33", - "fixed": false, - "raw": "displayOrder" - }, - "serializedName": "displayOrder", - "modelType": { - "$id": "34", - "$type": "PrimaryType", - "format": "int32", - "knownPrimaryType": "int", - "name": { - "$id": "35", - "fixed": false, - "raw": "Int" - }, - "deprecated": false - } - }, - { - "$id": "36", - "isReadOnly": false, - "realPath": [ - "qnaId" - ], - "collectionFormat": "none", - "defaultValue": { - "$id": "37", - "fixed": false - }, - "deprecated": false, - "documentation": { - "$id": "38", - "fixed": false, - "raw": "Qna id corresponding to the prompt - if QnaId is present, QnADTO object is ignored." - }, - "isRequired": false, - "isConstant": false, - "name": { - "$id": "39", - "fixed": false, - "raw": "qnaId" - }, - "serializedName": "qnaId", - "modelType": { - "$id": "40", - "$type": "PrimaryType", - "format": "int32", - "knownPrimaryType": "int", - "name": { - "$id": "41", - "fixed": false, - "raw": "Int" - }, - "deprecated": false - } - }, - { - "$id": "42", - "isReadOnly": false, - "realPath": [ - "qna" - ], - "collectionFormat": "none", - "defaultValue": { - "$id": "43", - "fixed": false - }, - "deprecated": false, - "documentation": { - "$id": "44", - "fixed": false, - "raw": "QnADTO - Either QnaId or QnADTO needs to be present in a PromptDTO object" - }, - "isRequired": false, - "isConstant": false, - "name": { - "$id": "45", - "fixed": false, - "raw": "qna" - }, - "serializedName": "qna", - "modelType": { - "$id": "46", - "$type": "CompositeType", - "serializedName": "PromptDTO-qna", - "baseModelType": { - "$id": "47", - "$type": "CompositeType", - "properties": [ - { - "$id": "48", - "isReadOnly": false, - "realPath": [ - "id" - ], - "collectionFormat": "none", - "defaultValue": { - "$id": "49", - "fixed": false - }, - "deprecated": false, - "documentation": { - "$id": "50", - "fixed": false, - "raw": "Unique id for the Q-A." - }, - "isRequired": false, - "isConstant": false, - "name": { - "$id": "51", - "fixed": false, - "raw": "id" - }, - "serializedName": "id", - "modelType": { - "$id": "52", - "$type": "PrimaryType", - "format": "int32", - "knownPrimaryType": "int", - "name": { - "$id": "53", - "fixed": false, - "raw": "Int" - }, - "deprecated": false - } - }, - { - "$id": "54", - "isReadOnly": false, - "realPath": [ - "answer" - ], - "collectionFormat": "none", - "defaultValue": { - "$id": "55", - "fixed": false - }, - "deprecated": false, - "documentation": { - "$id": "56", - "fixed": false, - "raw": "Answer text" - }, - "isRequired": true, - "isConstant": false, - "name": { - "$id": "57", - "fixed": false, - "raw": "answer" - }, - "serializedName": "answer", - "modelType": { - "$id": "58", - "$type": "PrimaryType", - "knownPrimaryType": "string", - "name": { - "$id": "59", - "fixed": false, - "raw": "String" - }, - "deprecated": false - } - }, - { - "$id": "60", - "isReadOnly": false, - "realPath": [ - "source" - ], - "collectionFormat": "none", - "defaultValue": { - "$id": "61", - "fixed": false - }, - "deprecated": false, - "documentation": { - "$id": "62", - "fixed": false, - "raw": "Source from which Q-A was indexed. eg. https://docs.microsoft.com/en-us/azure/cognitive-services/QnAMaker/FAQs" - }, - "isRequired": false, - "isConstant": false, - "name": { - "$id": "63", - "fixed": false, - "raw": "source" - }, - "serializedName": "source", - "modelType": { - "$id": "64", - "$type": "PrimaryType", - "knownPrimaryType": "string", - "name": { - "$id": "65", - "fixed": false, - "raw": "String" - }, - "deprecated": false - } - }, - { - "$id": "66", - "isReadOnly": false, - "realPath": [ - "questions" - ], - "collectionFormat": "none", - "defaultValue": { - "$id": "67", - "fixed": false - }, - "deprecated": false, - "documentation": { - "$id": "68", - "fixed": false, - "raw": "List of questions associated with the answer." - }, - "isRequired": true, - "isConstant": false, - "name": { - "$id": "69", - "fixed": false, - "raw": "questions" - }, - "serializedName": "questions", - "modelType": { - "$id": "70", - "$type": "SequenceType", - "elementType": { - "$id": "71", - "$type": "PrimaryType", - "knownPrimaryType": "string", - "name": { - "$id": "72", - "fixed": false, - "raw": "String" - }, - "deprecated": false - }, - "name": { - "$id": "73", - "fixed": false - }, - "deprecated": false - } - }, - { - "$id": "74", - "isReadOnly": false, - "realPath": [ - "metadata" - ], - "collectionFormat": "none", - "defaultValue": { - "$id": "75", - "fixed": false - }, - "deprecated": false, - "documentation": { - "$id": "76", - "fixed": false, - "raw": "List of metadata associated with the answer." - }, - "isRequired": false, - "isConstant": false, - "name": { - "$id": "77", - "fixed": false, - "raw": "metadata" - }, - "serializedName": "metadata", - "modelType": { - "$id": "78", - "$type": "SequenceType", - "elementType": { - "$ref": "2" - }, - "name": { - "$id": "79", - "fixed": false - }, - "deprecated": false - } - }, - { - "$id": "80", - "isReadOnly": false, - "realPath": [ - "context" - ], - "collectionFormat": "none", - "defaultValue": { - "$id": "81", - "fixed": false - }, - "deprecated": false, - "documentation": { - "$id": "82", - "fixed": false, - "raw": "Context of a QnA" - }, - "isRequired": false, - "isConstant": false, - "name": { - "$id": "83", - "fixed": false, - "raw": "context" - }, - "serializedName": "context", - "modelType": { - "$ref": "16" - } - } - ], - "serializedName": "QnADTO", - "documentation": "Q-A object.", - "containsConstantProperties": false, - "name": { - "$id": "84", - "fixed": false, - "raw": "QnADTO" - }, - "extensions": { - "x-ms-metadata": { - "apiVersions": [ - "4.0" - ], - "filename": [ - "mem:///129?oai3.shaken.json" - ], - "name": "QnADTO", - "originalLocations": [ - "https://github.com/Azure/azure-rest-api-specs/blob/master/specification/cognitiveservices/data-plane/QnAMaker/stable/v4.0/QnAMakerRuntime.json#/components/schemas/QnADTO" - ] - } - }, - "deprecated": false - }, - "documentation": "QnADTO - Either QnaId or QnADTO needs to be present in a PromptDTO object", - "containsConstantProperties": false, - "name": { - "$id": "85", - "fixed": false, - "raw": "PromptDTO-qna" - }, - "extensions": { - "x-ms-metadata": { - "apiVersions": [ - "4.0" - ], - "filename": [ - "mem:///129?oai3.shaken.json" - ], - "name": "PromptDTO-qna", - "originalLocations": [ - "https://github.com/Azure/azure-rest-api-specs/blob/master/specification/cognitiveservices/data-plane/QnAMaker/stable/v4.0/QnAMakerRuntime.json#/components/schemas/PromptDTO-qna" - ] - }, - "x-internal-autorest-anonymous-schema": { - "anonymous": true - } - }, - "deprecated": false - } - }, - { - "$id": "86", - "isReadOnly": false, - "realPath": [ - "displayText" - ], - "collectionFormat": "none", - "defaultValue": { - "$id": "87", - "fixed": false - }, - "deprecated": false, - "documentation": { - "$id": "88", - "fixed": false, - "raw": "Text displayed to represent a follow up question prompt" - }, - "isRequired": false, - "isConstant": false, - "name": { - "$id": "89", - "fixed": false, - "raw": "displayText" - }, - "serializedName": "displayText", - "modelType": { - "$id": "90", - "$type": "PrimaryType", - "knownPrimaryType": "string", - "name": { - "$id": "91", - "fixed": false, - "raw": "String" - }, - "deprecated": false - } - } - ], - "serializedName": "PromptDTO", - "documentation": "Prompt for an answer.", - "containsConstantProperties": false, - "name": { - "$id": "92", - "fixed": false, - "raw": "PromptDTO" - }, - "extensions": { - "x-ms-metadata": { - "apiVersions": [ - "4.0" - ], - "filename": [ - "mem:///129?oai3.shaken.json" - ], - "name": "PromptDTO", - "originalLocations": [ - "https://github.com/Azure/azure-rest-api-specs/blob/master/specification/cognitiveservices/data-plane/QnAMaker/stable/v4.0/QnAMakerRuntime.json#/components/schemas/PromptDTO" - ] - } - }, - "deprecated": false - }, - "name": { - "$id": "93", - "fixed": false - }, - "deprecated": false - } - } - ], - "serializedName": "ContextDTO", - "documentation": "Context associated with Qna.", - "containsConstantProperties": false, - "name": { - "$id": "94", - "fixed": false, - "raw": "ContextDTO" - }, - "extensions": { - "x-ms-metadata": { - "apiVersions": [ - "4.0" - ], - "filename": [ - "mem:///129?oai3.shaken.json" - ], - "name": "ContextDTO", - "originalLocations": [ - "https://github.com/Azure/azure-rest-api-specs/blob/master/specification/cognitiveservices/data-plane/QnAMaker/stable/v4.0/QnAMakerRuntime.json#/components/schemas/ContextDTO" - ] - } - }, - "deprecated": false - }, - "documentation": "Context of a QnA", - "containsConstantProperties": false, - "name": { - "$id": "95", - "fixed": false, - "raw": "QnADTO-context" - }, - "extensions": { - "x-ms-metadata": { - "apiVersions": [ - "4.0" - ], - "filename": [ - "mem:///129?oai3.shaken.json" - ], - "name": "QnADTO-context", - "originalLocations": [ - "https://github.com/Azure/azure-rest-api-specs/blob/master/specification/cognitiveservices/data-plane/QnAMaker/stable/v4.0/QnAMakerRuntime.json#/components/schemas/QnADTO-context" - ] - }, - "x-internal-autorest-anonymous-schema": { - "anonymous": true - } - }, - "deprecated": false - }, - { - "$ref": "47" - }, - { - "$ref": "46" - }, - { - "$ref": "29" - }, - { - "$ref": "17" - }, - { - "$id": "96", - "$type": "CompositeType", - "serializedName": "ErrorResponse-error", - "baseModelType": { - "$id": "97", - "$type": "CompositeType", - "properties": [ - { - "$id": "98", - "isReadOnly": false, - "realPath": [ - "code" - ], - "collectionFormat": "none", - "defaultValue": { - "$id": "99", - "fixed": false - }, - "deprecated": false, - "documentation": { - "$id": "100", - "fixed": false, - "raw": "One of a server-defined set of error codes." - }, - "extensions": { - "x-ms-metadata": { - "apiVersions": [ - "4.0" - ], - "filename": [ - "mem:///129?oai3.shaken.json" - ], - "name": "ErrorCodeType", - "originalLocations": [ - "https://github.com/Azure/azure-rest-api-specs/blob/master/specification/cognitiveservices/data-plane/QnAMaker/stable/v4.0/QnAMakerRuntime.json#/components/schemas/ErrorCode" - ] - }, - "x-ms-enum": { - "name": "ErrorCodeType", - "modelAsString": true, - "oldModelAsString": true - } - }, - "isRequired": true, - "isConstant": false, - "name": { - "$id": "101", - "fixed": false, - "raw": "code" - }, - "serializedName": "code", - "modelType": { - "$id": "102", - "$type": "EnumType", - "values": [ - { - "$id": "103", - "name": "BadArgument", - "serializedName": "BadArgument" - }, - { - "$id": "104", - "name": "Forbidden", - "serializedName": "Forbidden" - }, - { - "$id": "105", - "name": "NotFound", - "serializedName": "NotFound" - }, - { - "$id": "106", - "name": "KbNotFound", - "serializedName": "KbNotFound" - }, - { - "$id": "107", - "name": "Unauthorized", - "serializedName": "Unauthorized" - }, - { - "$id": "108", - "name": "Unspecified", - "serializedName": "Unspecified" - }, - { - "$id": "109", - "name": "EndpointKeysError", - "serializedName": "EndpointKeysError" - }, - { - "$id": "110", - "name": "QuotaExceeded", - "serializedName": "QuotaExceeded" - }, - { - "$id": "111", - "name": "QnaRuntimeError", - "serializedName": "QnaRuntimeError" - }, - { - "$id": "112", - "name": "SKULimitExceeded", - "serializedName": "SKULimitExceeded" - }, - { - "$id": "113", - "name": "OperationNotFound", - "serializedName": "OperationNotFound" - }, - { - "$id": "114", - "name": "ServiceError", - "serializedName": "ServiceError" - }, - { - "$id": "115", - "name": "ValidationFailure", - "serializedName": "ValidationFailure" - }, - { - "$id": "116", - "name": "ExtractionFailure", - "serializedName": "ExtractionFailure" - } - ], - "oldModelAsString": true, - "modelAsString": true, - "underlyingType": { - "$id": "117", - "$type": "PrimaryType", - "knownPrimaryType": "string", - "name": { - "$id": "118", - "fixed": false, - "raw": "String" - }, - "deprecated": false - }, - "name": { - "$id": "119", - "fixed": false, - "raw": "ErrorCodeType" - }, - "deprecated": false - } - }, - { - "$id": "120", - "isReadOnly": false, - "realPath": [ - "message" - ], - "collectionFormat": "none", - "defaultValue": { - "$id": "121", - "fixed": false - }, - "deprecated": false, - "documentation": { - "$id": "122", - "fixed": false, - "raw": "A human-readable representation of the error." - }, - "isRequired": false, - "isConstant": false, - "name": { - "$id": "123", - "fixed": false, - "raw": "message" - }, - "serializedName": "message", - "modelType": { - "$id": "124", - "$type": "PrimaryType", - "knownPrimaryType": "string", - "name": { - "$id": "125", - "fixed": false, - "raw": "String" - }, - "deprecated": false - } - }, - { - "$id": "126", - "isReadOnly": false, - "realPath": [ - "target" - ], - "collectionFormat": "none", - "defaultValue": { - "$id": "127", - "fixed": false - }, - "deprecated": false, - "documentation": { - "$id": "128", - "fixed": false, - "raw": "The target of the error." - }, - "isRequired": false, - "isConstant": false, - "name": { - "$id": "129", - "fixed": false, - "raw": "target" - }, - "serializedName": "target", - "modelType": { - "$id": "130", - "$type": "PrimaryType", - "knownPrimaryType": "string", - "name": { - "$id": "131", - "fixed": false, - "raw": "String" - }, - "deprecated": false - } - }, - { - "$id": "132", - "isReadOnly": false, - "realPath": [ - "details" - ], - "collectionFormat": "none", - "defaultValue": { - "$id": "133", - "fixed": false - }, - "deprecated": false, - "documentation": { - "$id": "134", - "fixed": false, - "raw": "An array of details about specific errors that led to this reported error." - }, - "isRequired": false, - "isConstant": false, - "name": { - "$id": "135", - "fixed": false, - "raw": "details" - }, - "serializedName": "details", - "modelType": { - "$id": "136", - "$type": "SequenceType", - "elementType": { - "$ref": "97" - }, - "name": { - "$id": "137", - "fixed": false - }, - "deprecated": false - } - }, - { - "$id": "138", - "isReadOnly": false, - "realPath": [ - "innerError" - ], - "collectionFormat": "none", - "defaultValue": { - "$id": "139", - "fixed": false - }, - "deprecated": false, - "documentation": { - "$id": "140", - "fixed": false, - "raw": "An object containing more specific information than the current object about the error." - }, - "isRequired": false, - "isConstant": false, - "name": { - "$id": "141", - "fixed": false, - "raw": "innerError" - }, - "serializedName": "innerError", - "modelType": { - "$id": "142", - "$type": "CompositeType", - "properties": [ - { - "$id": "143", - "isReadOnly": false, - "realPath": [ - "code" - ], - "collectionFormat": "none", - "defaultValue": { - "$id": "144", - "fixed": false - }, - "deprecated": false, - "documentation": { - "$id": "145", - "fixed": false, - "raw": "A more specific error code than was provided by the containing error." - }, - "isRequired": false, - "isConstant": false, - "name": { - "$id": "146", - "fixed": false, - "raw": "code" - }, - "serializedName": "code", - "modelType": { - "$id": "147", - "$type": "PrimaryType", - "knownPrimaryType": "string", - "name": { - "$id": "148", - "fixed": false, - "raw": "String" - }, - "deprecated": false - } - }, - { - "$id": "149", - "isReadOnly": false, - "realPath": [ - "innerError" - ], - "collectionFormat": "none", - "defaultValue": { - "$id": "150", - "fixed": false - }, - "deprecated": false, - "documentation": { - "$id": "151", - "fixed": false, - "raw": "An object containing more specific information than the current object about the error." - }, - "isRequired": false, - "isConstant": false, - "name": { - "$id": "152", - "fixed": false, - "raw": "innerError" - }, - "serializedName": "innerError", - "modelType": { - "$ref": "142" - } - } - ], - "serializedName": "InnerErrorModel", - "documentation": "An object containing more specific information about the error. As per Microsoft One API guidelines - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses.", - "containsConstantProperties": false, - "name": { - "$id": "153", - "fixed": false, - "raw": "InnerErrorModel" - }, - "extensions": { - "x-ms-metadata": { - "apiVersions": [ - "4.0" - ], - "filename": [ - "mem:///129?oai3.shaken.json" - ], - "name": "InnerErrorModel", - "originalLocations": [ - "https://github.com/Azure/azure-rest-api-specs/blob/master/specification/cognitiveservices/data-plane/QnAMaker/stable/v4.0/QnAMakerRuntime.json#/components/schemas/InnerErrorModel" - ] - } - }, - "deprecated": false - } - } - ], - "serializedName": "Error", - "documentation": "The error object. As per Microsoft One API guidelines - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses.", - "containsConstantProperties": false, - "name": { - "$id": "154", - "fixed": false, - "raw": "Error" - }, - "extensions": { - "x-ms-metadata": { - "apiVersions": [ - "4.0" - ], - "filename": [ - "mem:///129?oai3.shaken.json" - ], - "name": "Error", - "originalLocations": [ - "https://github.com/Azure/azure-rest-api-specs/blob/master/specification/cognitiveservices/data-plane/QnAMaker/stable/v4.0/QnAMakerRuntime.json#/components/schemas/Error" - ] - } - }, - "deprecated": false - }, - "documentation": "The error object.", - "containsConstantProperties": false, - "name": { - "$id": "155", - "fixed": false, - "raw": "ErrorResponse-error" - }, - "extensions": { - "x-ms-metadata": { - "apiVersions": [ - "4.0" - ], - "filename": [ - "mem:///129?oai3.shaken.json" - ], - "name": "ErrorResponse-error", - "originalLocations": [ - "https://github.com/Azure/azure-rest-api-specs/blob/master/specification/cognitiveservices/data-plane/QnAMaker/stable/v4.0/QnAMakerRuntime.json#/components/schemas/ErrorResponse-error" - ] - }, - "x-internal-autorest-anonymous-schema": { - "anonymous": true - } - }, - "deprecated": false - }, - { - "$id": "156", - "$type": "CompositeType", - "properties": [ - { - "$id": "157", - "isReadOnly": false, - "realPath": [ - "error" - ], - "collectionFormat": "none", - "defaultValue": { - "$id": "158", - "fixed": false - }, - "deprecated": false, - "documentation": { - "$id": "159", - "fixed": false, - "raw": "The error object." - }, - "isRequired": false, - "isConstant": false, - "name": { - "$id": "160", - "fixed": false, - "raw": "error" - }, - "serializedName": "error", - "modelType": { - "$ref": "96" - } - } - ], - "serializedName": "ErrorResponse", - "documentation": "Error response. As per Microsoft One API guidelines - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses.", - "containsConstantProperties": false, - "name": { - "$id": "161", - "fixed": false, - "raw": "ErrorResponse" - }, - "extensions": { - "x-ms-metadata": { - "apiVersions": [ - "4.0" - ], - "filename": [ - "mem:///129?oai3.shaken.json" - ], - "name": "ErrorResponse", - "originalLocations": [ - "https://github.com/Azure/azure-rest-api-specs/blob/master/specification/cognitiveservices/data-plane/QnAMaker/stable/v4.0/QnAMakerRuntime.json#/components/schemas/ErrorResponse" - ] - } - }, - "deprecated": false - }, - { - "$ref": "142" - }, - { - "$ref": "97" - }, - { - "$id": "162", - "$type": "CompositeType", - "serializedName": "QueryDTO-context", - "baseModelType": { - "$id": "163", - "$type": "CompositeType", - "properties": [ - { - "$id": "164", - "isReadOnly": false, - "realPath": [ - "previousQnaId" - ], - "collectionFormat": "none", - "defaultValue": { - "$id": "165", - "fixed": false - }, - "deprecated": false, - "documentation": { - "$id": "166", - "fixed": false, - "raw": "Previous QnA Id - qnaId of the top result." - }, - "isRequired": false, - "isConstant": false, - "name": { - "$id": "167", - "fixed": false, - "raw": "previousQnaId" - }, - "serializedName": "previousQnaId", - "modelType": { - "$id": "168", - "$type": "PrimaryType", - "knownPrimaryType": "string", - "name": { - "$id": "169", - "fixed": false, - "raw": "String" - }, - "deprecated": false - } - }, - { - "$id": "170", - "isReadOnly": false, - "realPath": [ - "previousUserQuery" - ], - "collectionFormat": "none", - "defaultValue": { - "$id": "171", - "fixed": false - }, - "deprecated": false, - "documentation": { - "$id": "172", - "fixed": false, - "raw": "Previous user query." - }, - "isRequired": false, - "isConstant": false, - "name": { - "$id": "173", - "fixed": false, - "raw": "previousUserQuery" - }, - "serializedName": "previousUserQuery", - "modelType": { - "$id": "174", - "$type": "PrimaryType", - "knownPrimaryType": "string", - "name": { - "$id": "175", - "fixed": false, - "raw": "String" - }, - "deprecated": false - } - } - ], - "serializedName": "QueryContextDTO", - "documentation": "Context object with previous QnA's information.", - "containsConstantProperties": false, - "name": { - "$id": "176", - "fixed": false, - "raw": "QueryContextDTO" - }, - "extensions": { - "x-ms-metadata": { - "apiVersions": [ - "4.0" - ], - "filename": [ - "mem:///129?oai3.shaken.json" - ], - "name": "QueryContextDTO", - "originalLocations": [ - "https://github.com/Azure/azure-rest-api-specs/blob/master/specification/cognitiveservices/data-plane/QnAMaker/stable/v4.0/QnAMakerRuntime.json#/components/schemas/QueryContextDTO" - ] - } - }, - "deprecated": false - }, - "documentation": "Context object with previous QnA's information.", - "containsConstantProperties": false, - "name": { - "$id": "177", - "fixed": false, - "raw": "QueryDTO-context" - }, - "extensions": { - "x-ms-metadata": { - "apiVersions": [ - "4.0" - ], - "filename": [ - "mem:///129?oai3.shaken.json" - ], - "name": "QueryDTO-context", - "originalLocations": [ - "https://github.com/Azure/azure-rest-api-specs/blob/master/specification/cognitiveservices/data-plane/QnAMaker/stable/v4.0/QnAMakerRuntime.json#/components/schemas/QueryDTO-context" - ] - }, - "x-internal-autorest-anonymous-schema": { - "anonymous": true - } - }, - "deprecated": false - }, - { - "$id": "178", - "$type": "CompositeType", - "properties": [ - { - "$id": "179", - "isReadOnly": false, - "realPath": [ - "qnaId" - ], - "collectionFormat": "none", - "defaultValue": { - "$id": "180", - "fixed": false - }, - "deprecated": false, - "documentation": { - "$id": "181", - "fixed": false, - "raw": "Exact qnaId to fetch from the knowledgebase, this field takes priority over question." - }, - "isRequired": false, - "isConstant": false, - "name": { - "$id": "182", - "fixed": false, - "raw": "qnaId" - }, - "serializedName": "qnaId", - "modelType": { - "$id": "183", - "$type": "PrimaryType", - "knownPrimaryType": "string", - "name": { - "$id": "184", - "fixed": false, - "raw": "String" - }, - "deprecated": false - } - }, - { - "$id": "185", - "isReadOnly": false, - "realPath": [ - "question" - ], - "collectionFormat": "none", - "defaultValue": { - "$id": "186", - "fixed": false - }, - "deprecated": false, - "documentation": { - "$id": "187", - "fixed": false, - "raw": "User question to query against the knowledge base." - }, - "isRequired": false, - "isConstant": false, - "name": { - "$id": "188", - "fixed": false, - "raw": "question" - }, - "serializedName": "question", - "modelType": { - "$id": "189", - "$type": "PrimaryType", - "knownPrimaryType": "string", - "name": { - "$id": "190", - "fixed": false, - "raw": "String" - }, - "deprecated": false - } - }, - { - "$id": "191", - "isReadOnly": false, - "realPath": [ - "top" - ], - "collectionFormat": "none", - "defaultValue": { - "$id": "192", - "fixed": false - }, - "deprecated": false, - "documentation": { - "$id": "193", - "fixed": false, - "raw": "Max number of answers to be returned for the question." - }, - "isRequired": false, - "isConstant": false, - "name": { - "$id": "194", - "fixed": false, - "raw": "top" - }, - "serializedName": "top", - "modelType": { - "$id": "195", - "$type": "PrimaryType", - "format": "int32", - "knownPrimaryType": "int", - "name": { - "$id": "196", - "fixed": false, - "raw": "Int" - }, - "deprecated": false - } - }, - { - "$id": "197", - "isReadOnly": false, - "realPath": [ - "userId" - ], - "collectionFormat": "none", - "defaultValue": { - "$id": "198", - "fixed": false - }, - "deprecated": false, - "documentation": { - "$id": "199", - "fixed": false, - "raw": "Unique identifier for the user." - }, - "isRequired": false, - "isConstant": false, - "name": { - "$id": "200", - "fixed": false, - "raw": "userId" - }, - "serializedName": "userId", - "modelType": { - "$id": "201", - "$type": "PrimaryType", - "knownPrimaryType": "string", - "name": { - "$id": "202", - "fixed": false, - "raw": "String" - }, - "deprecated": false - } - }, - { - "$id": "203", - "isReadOnly": false, - "realPath": [ - "isTest" - ], - "collectionFormat": "none", - "defaultValue": { - "$id": "204", - "fixed": false - }, - "deprecated": false, - "documentation": { - "$id": "205", - "fixed": false, - "raw": "Query against the test index." - }, - "isRequired": false, - "isConstant": false, - "name": { - "$id": "206", - "fixed": false, - "raw": "isTest" - }, - "serializedName": "isTest", - "modelType": { - "$id": "207", - "$type": "PrimaryType", - "knownPrimaryType": "boolean", - "name": { - "$id": "208", - "fixed": false, - "raw": "Boolean" - }, - "deprecated": false - } - }, - { - "$id": "209", - "isReadOnly": false, - "realPath": [ - "scoreThreshold" - ], - "collectionFormat": "none", - "defaultValue": { - "$id": "210", - "fixed": false - }, - "deprecated": false, - "documentation": { - "$id": "211", - "fixed": false, - "raw": "Threshold for answers returned based on score." - }, - "isRequired": false, - "isConstant": false, - "name": { - "$id": "212", - "fixed": false, - "raw": "scoreThreshold" - }, - "serializedName": "scoreThreshold", - "modelType": { - "$id": "213", - "$type": "PrimaryType", - "knownPrimaryType": "double", - "name": { - "$id": "214", - "fixed": false, - "raw": "Double" - }, - "deprecated": false - } - }, - { - "$id": "215", - "isReadOnly": false, - "realPath": [ - "context" - ], - "collectionFormat": "none", - "defaultValue": { - "$id": "216", - "fixed": false - }, - "deprecated": false, - "documentation": { - "$id": "217", - "fixed": false, - "raw": "Context object with previous QnA's information." - }, - "isRequired": false, - "isConstant": false, - "name": { - "$id": "218", - "fixed": false, - "raw": "context" - }, - "serializedName": "context", - "modelType": { - "$ref": "162" - } - }, - { - "$id": "219", - "isReadOnly": false, - "realPath": [ - "rankerType" - ], - "collectionFormat": "none", - "defaultValue": { - "$id": "220", - "fixed": false - }, - "deprecated": false, - "documentation": { - "$id": "221", - "fixed": false, - "raw": "Optional field. Set to 'QuestionOnly' for using a question only Ranker." - }, - "isRequired": false, - "isConstant": false, - "name": { - "$id": "222", - "fixed": false, - "raw": "rankerType" - }, - "serializedName": "rankerType", - "modelType": { - "$id": "223", - "$type": "PrimaryType", - "knownPrimaryType": "string", - "name": { - "$id": "224", - "fixed": false, - "raw": "String" - }, - "deprecated": false - } - }, - { - "$id": "225", - "isReadOnly": false, - "realPath": [ - "strictFilters" - ], - "collectionFormat": "none", - "defaultValue": { - "$id": "226", - "fixed": false - }, - "deprecated": false, - "documentation": { - "$id": "227", - "fixed": false, - "raw": "Find only answers that contain these metadata." - }, - "isRequired": false, - "isConstant": false, - "name": { - "$id": "228", - "fixed": false, - "raw": "strictFilters" - }, - "serializedName": "strictFilters", - "modelType": { - "$id": "229", - "$type": "SequenceType", - "elementType": { - "$ref": "2" - }, - "name": { - "$id": "230", - "fixed": false - }, - "deprecated": false - } - }, - { - "$id": "231", - "isReadOnly": false, - "realPath": [ - "strictFiltersCompoundOperationType" - ], - "collectionFormat": "none", - "defaultValue": { - "$id": "232", - "fixed": false - }, - "deprecated": false, - "documentation": { - "$id": "233", - "fixed": false, - "raw": "Optional field. Set to OR for using OR as Operation for Strict Filters." - }, - "extensions": { - "x-ms-metadata": { - "apiVersions": [ - "4.0" - ], - "filename": [ - "mem:///129?oai3.shaken.json" - ], - "name": "StrictFiltersCompoundOperationType", - "originalLocations": [ - "https://github.com/Azure/azure-rest-api-specs/blob/master/specification/cognitiveservices/data-plane/QnAMaker/stable/v4.0/QnAMakerRuntime.json#/components/schemas/QueryDTO-strictFiltersCompoundOperationType" - ] - }, - "x-ms-enum": { - "name": "StrictFiltersCompoundOperationType", - "modelAsString": true, - "oldModelAsString": true - } - }, - "isRequired": false, - "isConstant": false, - "name": { - "$id": "234", - "fixed": false, - "raw": "strictFiltersCompoundOperationType" - }, - "serializedName": "strictFiltersCompoundOperationType", - "modelType": { - "$id": "235", - "$type": "EnumType", - "values": [ - { - "$id": "236", - "name": "AND", - "serializedName": "AND" - }, - { - "$id": "237", - "name": "OR", - "serializedName": "OR" - } - ], - "oldModelAsString": true, - "modelAsString": true, - "underlyingType": { - "$id": "238", - "$type": "PrimaryType", - "knownPrimaryType": "string", - "name": { - "$id": "239", - "fixed": false, - "raw": "String" - }, - "deprecated": false - }, - "name": { - "$id": "240", - "fixed": false, - "raw": "StrictFiltersCompoundOperationType" - }, - "deprecated": false - } - } - ], - "serializedName": "QueryDTO", - "documentation": "POST body schema to query the knowledgebase.", - "containsConstantProperties": false, - "name": { - "$id": "241", - "fixed": false, - "raw": "QueryDTO" - }, - "extensions": { - "x-ms-metadata": { - "apiVersions": [ - "4.0" - ], - "filename": [ - "mem:///129?oai3.shaken.json" - ], - "name": "QueryDTO", - "originalLocations": [ - "https://github.com/Azure/azure-rest-api-specs/blob/master/specification/cognitiveservices/data-plane/QnAMaker/stable/v4.0/QnAMakerRuntime.json#/components/schemas/QueryDTO" - ] - } - }, - "deprecated": false - }, - { - "$ref": "163" - }, - { - "$id": "242", - "$type": "CompositeType", - "serializedName": "QnASearchResult-context", - "baseModelType": { - "$ref": "17" - }, - "documentation": "Context object of the QnA", - "containsConstantProperties": false, - "name": { - "$id": "243", - "fixed": false, - "raw": "QnASearchResult-context" - }, - "extensions": { - "x-ms-metadata": { - "apiVersions": [ - "4.0" - ], - "filename": [ - "mem:///129?oai3.shaken.json" - ], - "name": "QnASearchResult-context", - "originalLocations": [ - "https://github.com/Azure/azure-rest-api-specs/blob/master/specification/cognitiveservices/data-plane/QnAMaker/stable/v4.0/QnAMakerRuntime.json#/components/schemas/QnASearchResult-context" - ] - }, - "x-internal-autorest-anonymous-schema": { - "anonymous": true - } - }, - "deprecated": false - }, - { - "$id": "244", - "$type": "CompositeType", - "properties": [ - { - "$id": "245", - "isReadOnly": false, - "realPath": [ - "questions" - ], - "collectionFormat": "none", - "defaultValue": { - "$id": "246", - "fixed": false - }, - "deprecated": false, - "documentation": { - "$id": "247", - "fixed": false, - "raw": "List of questions." - }, - "isRequired": false, - "isConstant": false, - "name": { - "$id": "248", - "fixed": false, - "raw": "questions" - }, - "serializedName": "questions", - "modelType": { - "$id": "249", - "$type": "SequenceType", - "elementType": { - "$id": "250", - "$type": "PrimaryType", - "knownPrimaryType": "string", - "name": { - "$id": "251", - "fixed": false, - "raw": "String" - }, - "deprecated": false - }, - "name": { - "$id": "252", - "fixed": false - }, - "deprecated": false - } - }, - { - "$id": "253", - "isReadOnly": false, - "realPath": [ - "answer" - ], - "collectionFormat": "none", - "defaultValue": { - "$id": "254", - "fixed": false - }, - "deprecated": false, - "documentation": { - "$id": "255", - "fixed": false, - "raw": "Answer." - }, - "isRequired": false, - "isConstant": false, - "name": { - "$id": "256", - "fixed": false, - "raw": "answer" - }, - "serializedName": "answer", - "modelType": { - "$id": "257", - "$type": "PrimaryType", - "knownPrimaryType": "string", - "name": { - "$id": "258", - "fixed": false, - "raw": "String" - }, - "deprecated": false - } - }, - { - "$id": "259", - "isReadOnly": false, - "realPath": [ - "score" - ], - "collectionFormat": "none", - "defaultValue": { - "$id": "260", - "fixed": false - }, - "deprecated": false, - "documentation": { - "$id": "261", - "fixed": false, - "raw": "Search result score." - }, - "isRequired": false, - "isConstant": false, - "name": { - "$id": "262", - "fixed": false, - "raw": "score" - }, - "serializedName": "score", - "modelType": { - "$id": "263", - "$type": "PrimaryType", - "knownPrimaryType": "double", - "name": { - "$id": "264", - "fixed": false, - "raw": "Double" - }, - "deprecated": false - } - }, - { - "$id": "265", - "isReadOnly": false, - "realPath": [ - "id" - ], - "collectionFormat": "none", - "defaultValue": { - "$id": "266", - "fixed": false - }, - "deprecated": false, - "documentation": { - "$id": "267", - "fixed": false, - "raw": "Id of the QnA result." - }, - "isRequired": false, - "isConstant": false, - "name": { - "$id": "268", - "fixed": false, - "raw": "id" - }, - "serializedName": "id", - "modelType": { - "$id": "269", - "$type": "PrimaryType", - "format": "int32", - "knownPrimaryType": "int", - "name": { - "$id": "270", - "fixed": false, - "raw": "Int" - }, - "deprecated": false - } - }, - { - "$id": "271", - "isReadOnly": false, - "realPath": [ - "source" - ], - "collectionFormat": "none", - "defaultValue": { - "$id": "272", - "fixed": false - }, - "deprecated": false, - "documentation": { - "$id": "273", - "fixed": false, - "raw": "Source of QnA result." - }, - "isRequired": false, - "isConstant": false, - "name": { - "$id": "274", - "fixed": false, - "raw": "source" - }, - "serializedName": "source", - "modelType": { - "$id": "275", - "$type": "PrimaryType", - "knownPrimaryType": "string", - "name": { - "$id": "276", - "fixed": false, - "raw": "String" - }, - "deprecated": false - } - }, - { - "$id": "277", - "isReadOnly": false, - "realPath": [ - "metadata" - ], - "collectionFormat": "none", - "defaultValue": { - "$id": "278", - "fixed": false - }, - "deprecated": false, - "documentation": { - "$id": "279", - "fixed": false, - "raw": "List of metadata." - }, - "isRequired": false, - "isConstant": false, - "name": { - "$id": "280", - "fixed": false, - "raw": "metadata" - }, - "serializedName": "metadata", - "modelType": { - "$id": "281", - "$type": "SequenceType", - "elementType": { - "$ref": "2" - }, - "name": { - "$id": "282", - "fixed": false - }, - "deprecated": false - } - }, - { - "$id": "283", - "isReadOnly": false, - "realPath": [ - "context" - ], - "collectionFormat": "none", - "defaultValue": { - "$id": "284", - "fixed": false - }, - "deprecated": false, - "documentation": { - "$id": "285", - "fixed": false, - "raw": "Context object of the QnA" - }, - "isRequired": false, - "isConstant": false, - "name": { - "$id": "286", - "fixed": false, - "raw": "context" - }, - "serializedName": "context", - "modelType": { - "$ref": "242" - } - } - ], - "serializedName": "QnASearchResult", - "documentation": "Represents Search Result.", - "containsConstantProperties": false, - "name": { - "$id": "287", - "fixed": false, - "raw": "QnASearchResult" - }, - "extensions": { - "x-ms-metadata": { - "apiVersions": [ - "4.0" - ], - "filename": [ - "mem:///129?oai3.shaken.json" - ], - "name": "QnASearchResult", - "originalLocations": [ - "https://github.com/Azure/azure-rest-api-specs/blob/master/specification/cognitiveservices/data-plane/QnAMaker/stable/v4.0/QnAMakerRuntime.json#/components/schemas/QnASearchResult" - ] - } - }, - "deprecated": false - }, - { - "$id": "288", - "$type": "CompositeType", - "properties": [ - { - "$id": "289", - "isReadOnly": false, - "realPath": [ - "answers" - ], - "collectionFormat": "none", - "defaultValue": { - "$id": "290", - "fixed": false - }, - "deprecated": false, - "documentation": { - "$id": "291", - "fixed": false, - "raw": "Represents Search Result list." - }, - "isRequired": false, - "isConstant": false, - "name": { - "$id": "292", - "fixed": false, - "raw": "answers" - }, - "serializedName": "answers", - "modelType": { - "$id": "293", - "$type": "SequenceType", - "elementType": { - "$ref": "244" - }, - "name": { - "$id": "294", - "fixed": false - }, - "deprecated": false - } - } - ], - "serializedName": "QnASearchResultList", - "documentation": "Represents List of Question Answers.", - "containsConstantProperties": false, - "name": { - "$id": "295", - "fixed": false, - "raw": "QnASearchResultList" - }, - "extensions": { - "x-ms-metadata": { - "apiVersions": [ - "4.0" - ], - "filename": [ - "mem:///129?oai3.shaken.json" - ], - "name": "QnASearchResultList", - "originalLocations": [ - "https://github.com/Azure/azure-rest-api-specs/blob/master/specification/cognitiveservices/data-plane/QnAMaker/stable/v4.0/QnAMakerRuntime.json#/components/schemas/QnASearchResultList" - ] - } - }, - "deprecated": false - }, - { - "$id": "296", - "$type": "CompositeType", - "properties": [ - { - "$id": "297", - "isReadOnly": false, - "realPath": [ - "userId" - ], - "collectionFormat": "none", - "defaultValue": { - "$id": "298", - "fixed": false - }, - "deprecated": false, - "documentation": { - "$id": "299", - "fixed": false, - "raw": "Unique identifier for the user." - }, - "isRequired": false, - "isConstant": false, - "name": { - "$id": "300", - "fixed": false, - "raw": "userId" - }, - "serializedName": "userId", - "modelType": { - "$id": "301", - "$type": "PrimaryType", - "knownPrimaryType": "string", - "name": { - "$id": "302", - "fixed": false, - "raw": "String" - }, - "deprecated": false - } - }, - { - "$id": "303", - "isReadOnly": false, - "realPath": [ - "userQuestion" - ], - "collectionFormat": "none", - "defaultValue": { - "$id": "304", - "fixed": false - }, - "deprecated": false, - "documentation": { - "$id": "305", - "fixed": false, - "raw": "The suggested question being provided as feedback." - }, - "isRequired": false, - "isConstant": false, - "name": { - "$id": "306", - "fixed": false, - "raw": "userQuestion" - }, - "serializedName": "userQuestion", - "modelType": { - "$id": "307", - "$type": "PrimaryType", - "knownPrimaryType": "string", - "name": { - "$id": "308", - "fixed": false, - "raw": "String" - }, - "deprecated": false - } - }, - { - "$id": "309", - "isReadOnly": false, - "realPath": [ - "qnaId" - ], - "collectionFormat": "none", - "defaultValue": { - "$id": "310", - "fixed": false - }, - "deprecated": false, - "documentation": { - "$id": "311", - "fixed": false, - "raw": "The qnaId for which the suggested question is provided as feedback." - }, - "isRequired": false, - "isConstant": false, - "name": { - "$id": "312", - "fixed": false, - "raw": "qnaId" - }, - "serializedName": "qnaId", - "modelType": { - "$id": "313", - "$type": "PrimaryType", - "format": "int32", - "knownPrimaryType": "int", - "name": { - "$id": "314", - "fixed": false, - "raw": "Int" - }, - "deprecated": false - } - } - ], - "serializedName": "FeedbackRecordDTO", - "documentation": "Active learning feedback record.", - "containsConstantProperties": false, - "name": { - "$id": "315", - "fixed": false, - "raw": "FeedbackRecordDTO" - }, - "extensions": { - "x-ms-metadata": { - "apiVersions": [ - "4.0" - ], - "filename": [ - "mem:///129?oai3.shaken.json" - ], - "name": "FeedbackRecordDTO", - "originalLocations": [ - "https://github.com/Azure/azure-rest-api-specs/blob/master/specification/cognitiveservices/data-plane/QnAMaker/stable/v4.0/QnAMakerRuntime.json#/components/schemas/FeedbackRecordDTO" - ] - } - }, - "deprecated": false - }, - { - "$id": "316", - "$type": "CompositeType", - "properties": [ - { - "$id": "317", - "isReadOnly": false, - "realPath": [ - "feedbackRecords" - ], - "collectionFormat": "none", - "defaultValue": { - "$id": "318", - "fixed": false - }, - "deprecated": false, - "documentation": { - "$id": "319", - "fixed": false, - "raw": "List of feedback records." - }, - "isRequired": false, - "isConstant": false, - "name": { - "$id": "320", - "fixed": false, - "raw": "feedbackRecords" - }, - "serializedName": "feedbackRecords", - "modelType": { - "$id": "321", - "$type": "SequenceType", - "elementType": { - "$ref": "296" - }, - "name": { - "$id": "322", - "fixed": false - }, - "deprecated": false - } - } - ], - "serializedName": "FeedbackRecordsDTO", - "documentation": "Active learning feedback records.", - "containsConstantProperties": false, - "name": { - "$id": "323", - "fixed": false, - "raw": "FeedbackRecordsDTO" - }, - "extensions": { - "x-ms-metadata": { - "apiVersions": [ - "4.0" - ], - "filename": [ - "mem:///129?oai3.shaken.json" - ], - "name": "FeedbackRecordsDTO", - "originalLocations": [ - "https://github.com/Azure/azure-rest-api-specs/blob/master/specification/cognitiveservices/data-plane/QnAMaker/stable/v4.0/QnAMakerRuntime.json#/components/schemas/FeedbackRecordsDTO" - ] - } - }, - "deprecated": false - } - ], - "errorTypes": [ - { - "$ref": "156" - } - ], - "enumTypes": [ - { - "$ref": "102" - }, - { - "$ref": "235" - } - ], - "hostParametersFront": [ - { - "$id": "324", - "clientProperty": { - "$id": "325", - "isReadOnly": false, - "realPath": [ - "RuntimeEndpoint" - ], - "collectionFormat": "none", - "defaultValue": { - "$id": "326", - "fixed": false - }, - "deprecated": false, - "documentation": { - "$id": "327", - "fixed": false, - "raw": "QnA Maker App Service endpoint (for example: https://{qnaservice-hostname}.azurewebsites.net)." - }, - "extensions": { - "x-ms-metadata": { - "apiVersions": [ - "4.0" - ], - "filename": [ - "mem:///129?oai3.shaken.json" - ], - "name": "RuntimeEndpoint", - "originalLocations": [ - "https://github.com/Azure/azure-rest-api-specs/blob/master/specification/cognitiveservices/data-plane/QnAMaker/stable/v4.0/QnAMakerRuntime.json#/components/parameters/RuntimeEndpoint" - ] - }, - "x-ms-parameter-location": "client", - "x-ms-skip-url-encoding": true - }, - "isRequired": true, - "isConstant": false, - "name": { - "$id": "328", - "fixed": false, - "raw": "RuntimeEndpoint" - }, - "serializedName": "RuntimeEndpoint", - "modelType": { - "$id": "329", - "$type": "PrimaryType", - "knownPrimaryType": "string", - "name": { - "$id": "330", - "fixed": false, - "raw": "String" - }, - "deprecated": false - } - }, - "location": "path", - "collectionFormat": "none", - "defaultValue": { - "$id": "331", - "fixed": false, - "raw": "" - }, - "deprecated": false, - "documentation": { - "$id": "332", - "fixed": false, - "raw": "QnA Maker App Service endpoint (for example: https://{qnaservice-hostname}.azurewebsites.net)." - }, - "extensions": { - "x-name": "RuntimeEndpoint", - "x-ms-parameter-location": "client", - "x-required": true, - "x-type": "string", - "x-in": "path", - "x-ms-skip-url-encoding": true, - "x-ms-original": { - "$ref": "#/components/parameters/parameters:1" - }, - "hostParameter": true - }, - "isRequired": true, - "isConstant": false, - "name": { - "$id": "333", - "fixed": false, - "raw": "RuntimeEndpoint" - }, - "serializedName": "RuntimeEndpoint", - "modelType": { - "$id": "334", - "$type": "PrimaryType", - "knownPrimaryType": "string", - "name": { - "$id": "335", - "fixed": false, - "raw": "String" - }, - "deprecated": false - } - } - ], - "name": "QnAMakerRuntimeClient", - "namespace": "Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker", - "modelsName": "Models", - "apiVersion": "4.0", - "baseUrl": "{RuntimeEndpoint}/qnamaker", - "documentation": "An API for QnAMaker runtime", - "extensions": { - "security": [ - { - "auth_key": [] - } - ], - "x-ms-parameterized-host": true - }, - "properties": [ - { - "$id": "336", - "isReadOnly": false, - "realPath": [ - "kbId" - ], - "collectionFormat": "none", - "defaultValue": { - "$id": "337", - "fixed": false - }, - "deprecated": false, - "documentation": { - "$id": "338", - "fixed": false, - "raw": "Knowledgebase id." - }, - "extensions": { - "x-ms-metadata": { - "apiVersions": [ - "4.0" - ], - "filename": [ - "mem:///129?oai3.shaken.json" - ], - "name": "KbId", - "originalLocations": [ - "https://github.com/Azure/azure-rest-api-specs/blob/master/specification/cognitiveservices/data-plane/QnAMaker/stable/v4.0/QnAMakerRuntime.json#/components/parameters/KbId" - ] - }, - "x-ms-parameter-location": "method" - }, - "isRequired": true, - "isConstant": false, - "name": { - "$id": "339", - "fixed": false, - "raw": "kbId" - }, - "serializedName": "kbId", - "modelType": { - "$id": "340", - "$type": "PrimaryType", - "knownPrimaryType": "string", - "name": { - "$id": "341", - "fixed": false, - "raw": "String" - }, - "deprecated": false - } - }, - { - "$ref": "325" - } - ], - "operations": [ - { - "$id": "342", - "methods": [ - { - "$id": "343", - "parameters": [ - { - "$id": "344", - "clientProperty": { - "$ref": "336" - }, - "location": "path", - "collectionFormat": "none", - "defaultValue": { - "$id": "345", - "fixed": false - }, - "deprecated": false, - "documentation": { - "$id": "346", - "fixed": false, - "raw": "Knowledgebase id." - }, - "extensions": { - "x-ms-metadata": { - "apiVersions": [ - "4.0" - ], - "filename": [ - "mem:///129?oai3.shaken.json" - ], - "name": "KbId", - "originalLocations": [ - "https://github.com/Azure/azure-rest-api-specs/blob/master/specification/cognitiveservices/data-plane/QnAMaker/stable/v4.0/QnAMakerRuntime.json#/components/parameters/KbId" - ] - }, - "x-ms-parameter-location": "method" - }, - "isRequired": true, - "isConstant": false, - "name": { - "$id": "347", - "fixed": false, - "raw": "kbId" - }, - "serializedName": "kbId", - "modelType": { - "$id": "348", - "$type": "PrimaryType", - "knownPrimaryType": "string", - "name": { - "$id": "349", - "fixed": false, - "raw": "String" - }, - "deprecated": false - } - }, - { - "$id": "350", - "location": "body", - "collectionFormat": "none", - "defaultValue": { - "$id": "351", - "fixed": false - }, - "deprecated": false, - "documentation": { - "$id": "352", - "fixed": false, - "raw": "Post body of the request." - }, - "extensions": { - "x-ms-metadata": { - "apiVersions": [ - "4.0" - ], - "filename": [ - "mem:///129?oai3.shaken.json" - ], - "name": "paths·kqllak·knowledgebases-kbid-generateanswer·post·requestbody", - "originalLocations": [ - "https://github.com/Azure/azure-rest-api-specs/blob/master/specification/cognitiveservices/data-plane/QnAMaker/stable/v4.0/QnAMakerRuntime.json#/components/requestBodies/paths·kqllak·knowledgebases-kbid-generateanswer·post·requestbody" - ] - }, - "x-ms-parameter-location": "method", - "x-nullable": true, - "x-ms-requestBody-name": "generateAnswerPayload" - }, - "isRequired": true, - "isConstant": false, - "name": { - "$id": "353", - "fixed": false, - "raw": "generateAnswerPayload" - }, - "serializedName": "generateAnswerPayload", - "modelType": { - "$ref": "178" - } - } - ], - "name": { - "$id": "354", - "fixed": false, - "raw": "GenerateAnswer" - }, - "group": { - "$id": "355", - "fixed": false, - "raw": "Runtime" - }, - "serializedName": "Runtime_GenerateAnswer", - "url": "/knowledgebases/{kbId}/generateAnswer", - "isAbsoluteUrl": false, - "httpMethod": "post", - "responses": { - "OK": { - "$id": "356", - "body": { - "$ref": "288" - }, - "extensions": { - "$id": "357", - "x-ms-metadata": { - "apiVersions": [ - "4.0" - ], - "filename": [ - "mem:///129?oai3.shaken.json" - ], - "name": "paths·1ag94u1·knowledgebases-kbid-generateanswer·post·responses·200", - "originalLocations": [ - "https://github.com/Azure/azure-rest-api-specs/blob/master/specification/cognitiveservices/data-plane/QnAMaker/stable/v4.0/QnAMakerRuntime.json#/components/responses/paths·1ag94u1·knowledgebases-kbid-generateanswer·post·responses·200" - ] - } - }, - "isNullable": true - } - }, - "defaultResponse": { - "$id": "358", - "body": { - "$ref": "156" - }, - "extensions": { - "$id": "359", - "x-ms-metadata": { - "apiVersions": [ - "4.0" - ], - "filename": [ - "mem:///129?oai3.shaken.json" - ], - "name": "paths·2qg083·knowledgebases-kbid-generateanswer·post·responses·default", - "originalLocations": [ - "https://github.com/Azure/azure-rest-api-specs/blob/master/specification/cognitiveservices/data-plane/QnAMaker/stable/v4.0/QnAMakerRuntime.json#/components/responses/paths·2qg083·knowledgebases-kbid-generateanswer·post·responses·default" - ] - } - }, - "isNullable": true - }, - "returnType": { - "$id": "360", - "body": { - "$ref": "288" - }, - "isNullable": true - }, - "summary": "GenerateAnswer call to query the knowledgebase.", - "requestContentType": "application/json; charset=utf-8", - "responseContentTypes": [ - "application/json" - ], - "extensions": { - "servers": [ - { - "url": "{RuntimeEndpoint}/qnamaker", - "variables": { - "RuntimeEndpoint": { - "x-name": "RuntimeEndpoint", - "description": "QnA Maker App Service endpoint (for example: https://{qnaservice-hostname}.azurewebsites.net).", - "x-ms-parameter-location": "client", - "x-required": true, - "x-type": "string", - "x-in": "path", - "x-ms-skip-url-encoding": true, - "x-ms-original": { - "$ref": "#/components/parameters/parameters:1" - }, - "default": "" - } - } - } - ], - "x-ms-requestBody-index": "1", - "x-ms-examples": { - "Successful query": { - "parameters": { - "RuntimeEndpoint": "{RuntimeEndpoint}", - "Authorization": "EndpointKey {Primary/Secondary EndpointKey}", - "Content-Type": "application/json", - "kbId": "9d091697-fb8c-4ed5-9ac0-35bf8273bfff", - "generateAnswerPayload": { - "question": "qna maker and luis", - "top": "6", - "isTest": true, - "scoreThreshold": "20", - "strictFilters": [ - { - "name": "category", - "value": "api" - } - ], - "userId": "sd53lsY=" - } - }, - "responses": { - "200": { - "headers": {}, - "body": { - "answers": [ - { - "score": "28.54820341616869", - "id": "20", - "answer": "There is no direct integration of LUIS with QnA Maker. But, in your bot code, you can use LUIS and QnA Maker together.", - "source": "Custom Editorial", - "questions": [ - "How can I integrate LUIS with QnA Maker?" - ], - "metadata": [ - { - "name": "category", - "value": "api" - } - ] - } - ] - } - } - } - } - } - }, - "deprecated": false, - "hidden": false - }, - { - "$id": "361", - "parameters": [ - { - "$id": "362", - "clientProperty": { - "$ref": "336" - }, - "location": "path", - "collectionFormat": "none", - "defaultValue": { - "$id": "363", - "fixed": false - }, - "deprecated": false, - "documentation": { - "$id": "364", - "fixed": false, - "raw": "Knowledgebase id." - }, - "extensions": { - "x-ms-metadata": { - "apiVersions": [ - "4.0" - ], - "filename": [ - "mem:///129?oai3.shaken.json" - ], - "name": "KbId", - "originalLocations": [ - "https://github.com/Azure/azure-rest-api-specs/blob/master/specification/cognitiveservices/data-plane/QnAMaker/stable/v4.0/QnAMakerRuntime.json#/components/parameters/KbId" - ] - }, - "x-ms-parameter-location": "method" - }, - "isRequired": true, - "isConstant": false, - "name": { - "$id": "365", - "fixed": false, - "raw": "kbId" - }, - "serializedName": "kbId", - "modelType": { - "$id": "366", - "$type": "PrimaryType", - "knownPrimaryType": "string", - "name": { - "$id": "367", - "fixed": false, - "raw": "String" - }, - "deprecated": false - } - }, - { - "$id": "368", - "location": "body", - "collectionFormat": "none", - "defaultValue": { - "$id": "369", - "fixed": false - }, - "deprecated": false, - "documentation": { - "$id": "370", - "fixed": false, - "raw": "Post body of the request." - }, - "extensions": { - "x-ms-metadata": { - "apiVersions": [ - "4.0" - ], - "filename": [ - "mem:///129?oai3.shaken.json" - ], - "name": "paths·1p0wnwz·knowledgebases-kbid-train·post·requestbody", - "originalLocations": [ - "https://github.com/Azure/azure-rest-api-specs/blob/master/specification/cognitiveservices/data-plane/QnAMaker/stable/v4.0/QnAMakerRuntime.json#/components/requestBodies/paths·1p0wnwz·knowledgebases-kbid-train·post·requestbody" - ] - }, - "x-ms-parameter-location": "method", - "x-nullable": true, - "x-ms-requestBody-name": "trainPayload" - }, - "isRequired": true, - "isConstant": false, - "name": { - "$id": "371", - "fixed": false, - "raw": "trainPayload" - }, - "serializedName": "trainPayload", - "modelType": { - "$ref": "316" - } - } - ], - "name": { - "$id": "372", - "fixed": false, - "raw": "Train" - }, - "group": { - "$id": "373", - "fixed": false, - "raw": "Runtime" - }, - "serializedName": "Runtime_Train", - "url": "/knowledgebases/{kbId}/train", - "isAbsoluteUrl": false, - "httpMethod": "post", - "responses": { - "NoContent": { - "$id": "374", - "extensions": { - "$id": "375", - "x-ms-metadata": { - "apiVersions": [ - "4.0" - ], - "filename": [ - "mem:///129?oai3.shaken.json" - ], - "name": "paths·2l7fj6·knowledgebases-kbid-train·post·responses·204", - "originalLocations": [ - "https://github.com/Azure/azure-rest-api-specs/blob/master/specification/cognitiveservices/data-plane/QnAMaker/stable/v4.0/QnAMakerRuntime.json#/components/responses/paths·2l7fj6·knowledgebases-kbid-train·post·responses·204" - ] - } - }, - "isNullable": true - } - }, - "defaultResponse": { - "$id": "376", - "body": { - "$ref": "156" - }, - "extensions": { - "$id": "377", - "x-ms-metadata": { - "apiVersions": [ - "4.0" - ], - "filename": [ - "mem:///129?oai3.shaken.json" - ], - "name": "paths·1v30x2q·knowledgebases-kbid-train·post·responses·default", - "originalLocations": [ - "https://github.com/Azure/azure-rest-api-specs/blob/master/specification/cognitiveservices/data-plane/QnAMaker/stable/v4.0/QnAMakerRuntime.json#/components/responses/paths·1v30x2q·knowledgebases-kbid-train·post·responses·default" - ] - } - }, - "isNullable": true - }, - "returnType": { - "$id": "378", - "isNullable": true - }, - "summary": "Train call to add suggestions to the knowledgebase.", - "requestContentType": "application/json; charset=utf-8", - "responseContentTypes": [ - "application/json" - ], - "extensions": { - "servers": [ - { - "url": "{RuntimeEndpoint}/qnamaker", - "variables": { - "RuntimeEndpoint": { - "x-name": "RuntimeEndpoint", - "description": "QnA Maker App Service endpoint (for example: https://{qnaservice-hostname}.azurewebsites.net).", - "x-ms-parameter-location": "client", - "x-required": true, - "x-type": "string", - "x-in": "path", - "x-ms-skip-url-encoding": true, - "x-ms-original": { - "$ref": "#/components/parameters/parameters:1" - }, - "default": "" - } - } - } - ], - "x-ms-requestBody-index": "1", - "x-ms-examples": { - "Successful query": { - "parameters": { - "RuntimeEndpoint": "{RuntimeEndpoint}", - "Authorization": "EndpointKey {Primary/Secondary Endpoint Key}", - "Content-Type": "application/json", - "kbId": "9d091697-fb8c-4ed5-9ac0-35bf8273bfff", - "trainPayload": { - "feedbackRecords": [ - { - "userId": "sd53lsY=", - "userQuestion": "qna maker with luis", - "qnaId": "4" - } - ] - } - }, - "responses": { - "204": {} - } - } - } - }, - "deprecated": false, - "hidden": false - } - ], - "name": { - "$id": "379", - "fixed": false, - "raw": "Runtime" - }, - "typeName": { - "$id": "380", - "fixed": false - }, - "nameForProperty": "Runtime" - } - ] -} \ No newline at end of file diff --git a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.csproj b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.csproj index 8909d7e3239f..376556795ae3 100644 --- a/sdk/cognitiveservices/Knowledge.QnAMaker/src/Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.csproj +++ b/sdk/cognitiveservices/Knowledge.QnAMaker/src/Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.csproj @@ -3,8 +3,7 @@ Microsoft Cognitive Services QnAMaker SDK Provides access to the Microsoft Cognitive Services QnAMaker APIs. This client library provides access to the Microsoft Cognitive Services QnAMaker APIs. - 2.1.0-preview.2 - 2.0.1 + 3.0.0-preview.1 Microsoft Cognitive Services;Cognitive Services;Cognitive Services SDK;REST HTTP client;QnAMaker;QnAMaker API;QnAMaker SDK;QnAMakerV2;QnAMakerV5-preview.1;netcore451511 + { + new AlterationsDTO + { + Alterations = new List{ "qnamaker", "qna maker"} + } + } + }).Wait(); + + + // Read + var alterations = client.Alterations.GetAlterationsForKbAsync(KbId).Result; + Assert.Equal(1, alterations.WordAlterations.Count); + Assert.True(alterations.WordAlterations[0].Alterations.Contains("qnamaker")); + } + } } } diff --git a/sdk/cognitiveservices/Knowledge.QnAMaker/tests/QnAMakerEndpointSettingsTests.cs b/sdk/cognitiveservices/Knowledge.QnAMaker/tests/QnAMakerEndpointSettingsTests.cs new file mode 100644 index 000000000000..0a22efde080e --- /dev/null +++ b/sdk/cognitiveservices/Knowledge.QnAMaker/tests/QnAMakerEndpointSettingsTests.cs @@ -0,0 +1,37 @@ +using Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker; +using Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.Models; +using Microsoft.Azure.Test.HttpRecorder; +using Microsoft.Rest.ClientRuntime.Azure.TestFramework; +using System; +using System.Collections.Generic; +using System.Text; +using Xunit; + +namespace QnAMaker.Tests +{ + public class QnAMakerEndpointSettingsTests : BaseTests + { + [Fact] + public void QnAMakerEndpointSettingsReadUpdate() + { + using (MockContext context = MockContext.Start(this.GetType())) + { + HttpMockServer.Initialize(this.GetType(), "QnAMakerEndpointSettingsReadUpdate"); + IQnAMakerClient client = GetQnAMakerClient(HttpMockServer.CreateInstance()); + + client.EndpointSettings.UpdateSettingsAsync(new EndpointSettingsDTO + { + ActiveLearning = new EndpointSettingsDTOActiveLearning() + { + Enable = "true" + } + }).Wait(); + + + // Read + var endpointSettings = client.EndpointSettings.GetSettingsAsync().Result; + Assert.True(bool.Parse(endpointSettings.ActiveLearning.Enable)); + } + } + } +} diff --git a/sdk/cognitiveservices/Knowledge.QnAMaker/tests/QnAMakerKnowledgebasePreviewTests.cs b/sdk/cognitiveservices/Knowledge.QnAMaker/tests/QnAMakerKnowledgebasePreviewTests.cs index 5cef4216952d..651767e681fe 100644 --- a/sdk/cognitiveservices/Knowledge.QnAMaker/tests/QnAMakerKnowledgebasePreviewTests.cs +++ b/sdk/cognitiveservices/Knowledge.QnAMaker/tests/QnAMakerKnowledgebasePreviewTests.cs @@ -18,7 +18,7 @@ public void QnAMakerKnowledgebasePreviewCrud() using (MockContext context = MockContext.Start(this.GetType())) { HttpMockServer.Initialize(this.GetType(), "QnAMakerKnowledgebasePreviewCrud"); - IQnAMakerClient client = GetQnAMakerPreviewClient(HttpMockServer.CreateInstance()); + IQnAMakerClient client = GetQnAMakerClient(HttpMockServer.CreateInstance()); // Create var createOp = client.Knowledgebase.CreateAsync(new CreateKbDTO { Name = "testqna", QnaList = new List { new QnADTO { Questions = new List { "hi" }, Answer = "hello" } } }).Result; @@ -26,7 +26,7 @@ public void QnAMakerKnowledgebasePreviewCrud() // Loop while operation is success createOp = OperationHelper.MonitorOperation(createOp, client); - Assert.Equal(createOp.OperationState, OperationStateType.Succeeded); + Assert.Equal(OperationStateType.Succeeded, createOp.OperationState); var kbid = createOp.ResourceLocation.Replace("/knowledgebases/", string.Empty); Assert.NotEmpty(kbid); diff --git a/sdk/cognitiveservices/Knowledge.QnAMaker/tests/QnAMakerPreviewRuntimeTests.cs b/sdk/cognitiveservices/Knowledge.QnAMaker/tests/QnAMakerPreviewRuntimeTests.cs index e9af39487c75..c62a7368a682 100644 --- a/sdk/cognitiveservices/Knowledge.QnAMaker/tests/QnAMakerPreviewRuntimeTests.cs +++ b/sdk/cognitiveservices/Knowledge.QnAMaker/tests/QnAMakerPreviewRuntimeTests.cs @@ -11,6 +11,8 @@ namespace QnAMaker.Tests { public class QnAMakerPreviewRuntimeTests : BaseTests { + private static readonly string KbId = "0667a3c4-fd61-4f13-9ada-a7fc0e257112"; + [Fact] public void QnAMakerPreviewRuntimeGenerateAnswerTest() { @@ -18,12 +20,21 @@ public void QnAMakerPreviewRuntimeGenerateAnswerTest() { HttpMockServer.Initialize(this.GetType(), "QnAMakerPreviewRuntimeGenerateAnswerTest"); - var client = GetQnAMakerPreviewRuntimeClient(HttpMockServer.CreateInstance()); + var client = GetQnAMakerClient(HttpMockServer.CreateInstance()); var queryDTO = new QueryDTO(); queryDTO.Question = "new question"; + queryDTO.Top = 3; queryDTO.IsTest = true; - var answer = client.Runtime.GenerateAnswerAsync("192233e1-0ec8-44dc-8285-57a541b7c79c", queryDTO).Result; + queryDTO.AnswerSpanRequest = new QueryDTOAnswerSpanRequest() + { + Enable = true, + ScoreThreshold = 5.0, + TopAnswersWithSpan = 1 + }; + + var answer = client.Knowledgebase.GenerateAnswerAsync(KbId , queryDTO).Result; Assert.Equal(1, answer.Answers.Count); + Assert.NotEmpty(answer.Answers[0].AnswerSpan.Text); Assert.Equal(100, answer.Answers[0].Score); } } diff --git a/sdk/cognitiveservices/Knowledge.QnAMaker/tests/QnAMakerRuntimeTests.cs b/sdk/cognitiveservices/Knowledge.QnAMaker/tests/QnAMakerRuntimeTests.cs index f684e68a0197..19e5d47d3b6c 100644 --- a/sdk/cognitiveservices/Knowledge.QnAMaker/tests/QnAMakerRuntimeTests.cs +++ b/sdk/cognitiveservices/Knowledge.QnAMaker/tests/QnAMakerRuntimeTests.cs @@ -20,11 +20,9 @@ public void QnAMakerRuntimeGenerateAnswerTest() var client = GetQnAMakerRuntimeClient(HttpMockServer.CreateInstance()); var queryDTO = new QueryDTO(); - queryDTO.StrictFiltersCompoundOperationType = StrictFiltersCompoundOperationType.OR; - queryDTO.StrictFilters = new List(); - queryDTO.StrictFilters.Add(new MetadataDTO("question", "good afternoon")); - queryDTO.StrictFilters.Add(new MetadataDTO("question", "good morning")); - var answer = client.Runtime.GenerateAnswerAsync("8758c6af-fa29-4e03-a517-9c36927f558f", queryDTO).Result; + queryDTO.Question = "hello"; + queryDTO.IsTest = true; + var answer = client.Runtime.GenerateAnswerAsync("43de8400-ed9b-44ff-829d-e1dd3c5c7cb0", queryDTO).Result; Assert.Equal(1, answer.Answers.Count); Assert.Equal(100, answer.Answers[0].Score); } diff --git a/sdk/cognitiveservices/Knowledge.QnAMaker/tests/SessionRecords/QnAMakerAlterationsTests/QnAMakerAlterationsForKbReadUpdate.json b/sdk/cognitiveservices/Knowledge.QnAMaker/tests/SessionRecords/QnAMakerAlterationsTests/QnAMakerAlterationsForKbReadUpdate.json new file mode 100644 index 000000000000..a91af98bbcbd --- /dev/null +++ b/sdk/cognitiveservices/Knowledge.QnAMaker/tests/SessionRecords/QnAMakerAlterationsTests/QnAMakerAlterationsForKbReadUpdate.json @@ -0,0 +1,99 @@ +{ + "Entries": [ + { + "RequestUri": "/qnamaker/v5.0-preview.1/alterations/0667a3c4-fd61-4f13-9ada-a7fc0e257112", + "EncodedRequestUri": "L3FuYW1ha2VyL3Y1LjAtcHJldmlldy4xL2FsdGVyYXRpb25zLzA2NjdhM2M0LWZkNjEtNGYxMy05YWRhLWE3ZmMwZTI1NzExMg==", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"wordAlterations\": [\r\n {\r\n \"alterations\": [\r\n \"qnamaker\",\r\n \"qna maker\"\r\n ]\r\n }\r\n ]\r\n}", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": [ + "7942ed8406a748309d63728b2b7f7378" + ], + "User-Agent": [ + "FxVersion/4.6.29220.03", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.QnAMakerClient/2.1.0.0" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "122" + ] + }, + "ResponseHeaders": { + "csp-billing-usage": [ + "CognitiveServices.QnAMakerV2.Transaction=1" + ], + "x-envoy-upstream-service-time": [ + "631" + ], + "apim-request-id": [ + "e2522f35-972d-4262-9e8e-9148fe9a4492" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains; preload" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Mon, 19 Oct 2020 17:43:11 GMT" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 204 + }, + { + "RequestUri": "/qnamaker/v5.0-preview.1/alterations/0667a3c4-fd61-4f13-9ada-a7fc0e257112", + "EncodedRequestUri": "L3FuYW1ha2VyL3Y1LjAtcHJldmlldy4xL2FsdGVyYXRpb25zLzA2NjdhM2M0LWZkNjEtNGYxMy05YWRhLWE3ZmMwZTI1NzExMg==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": [ + "7942ed8406a748309d63728b2b7f7378" + ], + "User-Agent": [ + "FxVersion/4.6.29220.03", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.QnAMakerClient/2.1.0.0" + ] + }, + "ResponseHeaders": { + "csp-billing-usage": [ + "CognitiveServices.QnAMakerV2.Transaction=1" + ], + "x-envoy-upstream-service-time": [ + "410" + ], + "apim-request-id": [ + "39106810-5795-4f75-97f8-a93d6a7eb3c5" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains; preload" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Mon, 19 Oct 2020 17:43:12 GMT" + ], + "Content-Length": [ + "113" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ] + }, + "ResponseBody": "{\r\n \"wordAlterations\": [\r\n {\r\n \"alterations\": [\r\n \"qnamaker\",\r\n \"qna maker\"\r\n ]\r\n }\r\n ]\r\n}", + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": {} +} \ No newline at end of file diff --git a/sdk/cognitiveservices/Knowledge.QnAMaker/tests/SessionRecords/QnAMakerAlterationsTests/QnAMakerAlterationsReadUpdate.json b/sdk/cognitiveservices/Knowledge.QnAMaker/tests/SessionRecords/QnAMakerAlterationsTests/QnAMakerAlterationsReadUpdate.json index 6eaacf6a1dda..f0c438187ee9 100644 --- a/sdk/cognitiveservices/Knowledge.QnAMaker/tests/SessionRecords/QnAMakerAlterationsTests/QnAMakerAlterationsReadUpdate.json +++ b/sdk/cognitiveservices/Knowledge.QnAMaker/tests/SessionRecords/QnAMakerAlterationsTests/QnAMakerAlterationsReadUpdate.json @@ -1,19 +1,19 @@ { "Entries": [ { - "RequestUri": "/qnamaker/v4.0/alterations", - "EncodedRequestUri": "L3FuYW1ha2VyL3Y0LjAvYWx0ZXJhdGlvbnM=", + "RequestUri": "/qnamaker/v5.0-preview.1/alterations/some-placeholder-string", + "EncodedRequestUri": "L3FuYW1ha2VyL3Y1LjAtcHJldmlldy4xL2FsdGVyYXRpb25zL3NvbWUtcGxhY2Vob2xkZXItc3RyaW5n", "RequestMethod": "PUT", "RequestBody": "{\r\n \"wordAlterations\": [\r\n {\r\n \"alterations\": [\r\n \"qnamaker\",\r\n \"qna maker\"\r\n ]\r\n }\r\n ]\r\n}", "RequestHeaders": { "Ocp-Apim-Subscription-Key": [ - "" + "7afcaa16ba1747328eb7a77de8316445" ], "User-Agent": [ - "FxVersion/4.6.26614.01", + "FxVersion/4.6.29220.03", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.17763.", - "Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.QnAMakerClient/2.2.0.0" + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.QnAMakerClient/2.1.0.0" ], "Content-Type": [ "application/json; charset=utf-8" @@ -23,21 +23,21 @@ ] }, "ResponseHeaders": { - "Date": [ - "Thu, 22 Nov 2018 11:31:43 GMT" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "X-Powered-By": [ - "ASP.NET" + "x-envoy-upstream-service-time": [ + "375" ], "apim-request-id": [ - "9da9a3e5-ef07-4006-88b4-189e2566570c" + "e4919bf7-2b56-49a5-8404-5b5762b35373" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains; preload" ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Mon, 19 Oct 2020 18:06:33 GMT" + ], "Content-Length": [ "0" ] @@ -46,39 +46,39 @@ "StatusCode": 204 }, { - "RequestUri": "/qnamaker/v4.0/alterations", - "EncodedRequestUri": "L3FuYW1ha2VyL3Y0LjAvYWx0ZXJhdGlvbnM=", + "RequestUri": "/qnamaker/v5.0-preview.1/alterations/any-other-placeholder-string", + "EncodedRequestUri": "L3FuYW1ha2VyL3Y1LjAtcHJldmlldy4xL2FsdGVyYXRpb25zL2FueS1vdGhlci1wbGFjZWhvbGRlci1zdHJpbmc=", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "Ocp-Apim-Subscription-Key": [ - "" + "7afcaa16ba1747328eb7a77de8316445" ], "User-Agent": [ - "FxVersion/4.6.26614.01", + "FxVersion/4.6.29220.03", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.17763.", - "Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.QnAMakerClient/2.2.0.0" + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.QnAMakerClient/2.1.0.0" ] }, "ResponseHeaders": { - "Date": [ - "Thu, 22 Nov 2018 11:31:43 GMT" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "X-Powered-By": [ - "ASP.NET" + "x-envoy-upstream-service-time": [ + "323" ], "apim-request-id": [ - "22dab7e1-fb34-418c-9a46-9e498228b409" + "361ee1f8-6f74-456a-86ea-b70bf484b43b" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains; preload" ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Mon, 19 Oct 2020 18:06:35 GMT" + ], "Content-Length": [ - "122" + "113" ], "Content-Type": [ "application/json; charset=utf-8" diff --git a/sdk/cognitiveservices/Knowledge.QnAMaker/tests/SessionRecords/QnAMakerEndpointKeysTests/QnAMakerEndpointKeysGetEnpointKeys.json b/sdk/cognitiveservices/Knowledge.QnAMaker/tests/SessionRecords/QnAMakerEndpointKeysTests/QnAMakerEndpointKeysGetEnpointKeys.json index a963dfec1512..f3e1ae5cd4c8 100644 --- a/sdk/cognitiveservices/Knowledge.QnAMaker/tests/SessionRecords/QnAMakerEndpointKeysTests/QnAMakerEndpointKeysGetEnpointKeys.json +++ b/sdk/cognitiveservices/Knowledge.QnAMaker/tests/SessionRecords/QnAMakerEndpointKeysTests/QnAMakerEndpointKeysGetEnpointKeys.json @@ -1,45 +1,45 @@ { "Entries": [ { - "RequestUri": "/qnamaker/v4.0/endpointkeys", - "EncodedRequestUri": "L3FuYW1ha2VyL3Y0LjAvZW5kcG9pbnRrZXlz", + "RequestUri": "/qnamaker/v5.0-preview.1/endpointkeys", + "EncodedRequestUri": "L3FuYW1ha2VyL3Y1LjAtcHJldmlldy4xL2VuZHBvaW50a2V5cw==", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "Ocp-Apim-Subscription-Key": [ - "" + "7afcaa16ba1747328eb7a77de8316445" ], "User-Agent": [ - "FxVersion/4.6.26614.01", + "FxVersion/4.6.29220.03", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.17763.", - "Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.QnAMakerClient/2.2.0.0" + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.QnAMakerClient/2.1.0.0" ] }, "ResponseHeaders": { - "Date": [ - "Thu, 22 Nov 2018 09:36:19 GMT" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "X-Powered-By": [ - "ASP.NET" + "x-envoy-upstream-service-time": [ + "360" ], "apim-request-id": [ - "18e34d0e-d33f-4be0-b13f-b5afd2b83755" + "6588d9b8-84cd-4cd0-a66d-bbf7a75293cf" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains; preload" ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Mon, 19 Oct 2020 17:43:09 GMT" + ], "Content-Length": [ - "200" + "222" ], "Content-Type": [ "application/json; charset=utf-8" ] }, - "ResponseBody": "{\r\n \"primaryEndpointKey\": \"087bdae3-a4d0-4ae7-afdc-9d86d913e738\",\r\n \"secondaryEndpointKey\": \"07c5ac2a-4eed-4804-af12-844d055240dc\",\r\n \"installedVersion\": \"4.2.0\",\r\n \"lastStableVersion\": \"4.2.0\"\r\n}", + "ResponseBody": "{\r\n \"primaryEndpointKey\": \"9e0f6780-def9-4f40-ab87-7493951c2c50\",\r\n \"secondaryEndpointKey\": \"f4c98028-a841-42fe-8976-e559a10436be\",\r\n \"installedVersion\": \"5.45.0\",\r\n \"lastStableVersion\": \"5.45.0\",\r\n \"language\": \"English\"\r\n}", "StatusCode": 200 } ], diff --git a/sdk/cognitiveservices/Knowledge.QnAMaker/tests/SessionRecords/QnAMakerEndpointKeysTests/QnAMakerEndpointKeysRefreshKeys.json b/sdk/cognitiveservices/Knowledge.QnAMaker/tests/SessionRecords/QnAMakerEndpointKeysTests/QnAMakerEndpointKeysRefreshKeys.json index 647d7378d156..cd8c836dc253 100644 --- a/sdk/cognitiveservices/Knowledge.QnAMaker/tests/SessionRecords/QnAMakerEndpointKeysTests/QnAMakerEndpointKeysRefreshKeys.json +++ b/sdk/cognitiveservices/Knowledge.QnAMaker/tests/SessionRecords/QnAMakerEndpointKeysTests/QnAMakerEndpointKeysRefreshKeys.json @@ -1,45 +1,45 @@ { "Entries": [ { - "RequestUri": "/qnamaker/v4.0/endpointkeys/SecondaryKey", - "EncodedRequestUri": "L3FuYW1ha2VyL3Y0LjAvZW5kcG9pbnRrZXlzL1NlY29uZGFyeUtleQ==", + "RequestUri": "/qnamaker/v5.0-preview.1/endpointkeys/SecondaryKey", + "EncodedRequestUri": "L3FuYW1ha2VyL3Y1LjAtcHJldmlldy4xL2VuZHBvaW50a2V5cy9TZWNvbmRhcnlLZXk=", "RequestMethod": "PATCH", "RequestBody": "", "RequestHeaders": { "Ocp-Apim-Subscription-Key": [ - "" + "7afcaa16ba1747328eb7a77de8316445" ], "User-Agent": [ - "FxVersion/4.6.26614.01", + "FxVersion/4.6.29220.03", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.17763.", - "Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.QnAMakerClient/2.2.0.0" + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.QnAMakerClient/2.1.0.0" ] }, "ResponseHeaders": { - "Date": [ - "Thu, 22 Nov 2018 09:50:39 GMT" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "X-Powered-By": [ - "ASP.NET" + "x-envoy-upstream-service-time": [ + "393" ], "apim-request-id": [ - "17d6b38a-e13c-4c68-b3db-74176db6a16f" + "8a7046e9-011c-48d9-a206-a0b796dcba8c" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains; preload" ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Mon, 19 Oct 2020 17:43:09 GMT" + ], "Content-Length": [ - "167" + "221" ], "Content-Type": [ "application/json; charset=utf-8" ] }, - "ResponseBody": "{\r\n \"primaryEndpointKey\": \"087bdae3-a4d0-4ae7-afdc-9d86d913e738\",\r\n \"secondaryEndpointKey\": \"39ac1bda-3cc4-4f59-899f-e8da3a0cae67\",\r\n \"installedVersion\": \"4.2.0\"\r\n,\r\n \"lastStableVersion\": \"4.2.0\"\r\n}", + "ResponseBody": "{\r\n \"primaryEndpointKey\": \"9e0f6780-def9-4f40-ab87-7493951c2c50\",\r\n \"secondaryEndpointKey\": \"f4c98028-a841-42fe-8976-e559a10436be\",\r\n \"installedVersion\": \"5.45.0\",\r\n \"lastStableVersion\": \"5.45.0\",\r\n \"language\": \"Others\"\r\n}", "StatusCode": 200 } ], diff --git a/sdk/cognitiveservices/Knowledge.QnAMaker/tests/SessionRecords/QnAMakerEndpointSettingsTests/QnAMakerEndpointSettingsReadUpdate.json b/sdk/cognitiveservices/Knowledge.QnAMaker/tests/SessionRecords/QnAMakerEndpointSettingsTests/QnAMakerEndpointSettingsReadUpdate.json new file mode 100644 index 000000000000..87de956231c1 --- /dev/null +++ b/sdk/cognitiveservices/Knowledge.QnAMaker/tests/SessionRecords/QnAMakerEndpointSettingsTests/QnAMakerEndpointSettingsReadUpdate.json @@ -0,0 +1,93 @@ +{ + "Entries": [ + { + "RequestUri": "/qnamaker/v5.0-preview.1/endpointSettings", + "EncodedRequestUri": "L3FuYW1ha2VyL3Y1LjAtcHJldmlldy4xL2VuZHBvaW50U2V0dGluZ3M=", + "RequestMethod": "PATCH", + "RequestBody": "{\r\n \"activeLearning\": {\r\n \"enable\": \"true\"\r\n }\r\n}", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": [ + "7afcaa16ba1747328eb7a77de8316445" + ], + "User-Agent": [ + "FxVersion/4.6.29220.03", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.QnAMakerClient/2.1.0.0" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "54" + ] + }, + "ResponseHeaders": { + "x-envoy-upstream-service-time": [ + "702" + ], + "apim-request-id": [ + "b9eca69a-5d45-4900-b41a-0397c9505538" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains; preload" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Mon, 19 Oct 2020 18:57:52 GMT" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 204 + }, + { + "RequestUri": "/qnamaker/v5.0-preview.1/endpointSettings", + "EncodedRequestUri": "L3FuYW1ha2VyL3Y1LjAtcHJldmlldy4xL2VuZHBvaW50U2V0dGluZ3M=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "Ocp-Apim-Subscription-Key": [ + "7afcaa16ba1747328eb7a77de8316445" + ], + "User-Agent": [ + "FxVersion/4.6.29220.03", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.QnAMakerClient/2.1.0.0" + ] + }, + "ResponseHeaders": { + "x-envoy-upstream-service-time": [ + "566" + ], + "apim-request-id": [ + "80a5594f-7456-4328-93d4-4deafd02c8a6" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains; preload" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Mon, 19 Oct 2020 18:57:52 GMT" + ], + "Content-Length": [ + "50" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ] + }, + "ResponseBody": "{\r\n \"activeLearning\": {\r\n \"enable\": \"True\"\r\n }\r\n}", + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": {} +} \ No newline at end of file diff --git a/sdk/cognitiveservices/Knowledge.QnAMaker/tests/SessionRecords/QnAMakerKnowledgebasePreviewTests/QnAMakerKnowledgebasePreviewCrud.json b/sdk/cognitiveservices/Knowledge.QnAMaker/tests/SessionRecords/QnAMakerKnowledgebasePreviewTests/QnAMakerKnowledgebasePreviewCrud.json index d2f4f4898f9f..a9eaeadffac8 100644 --- a/sdk/cognitiveservices/Knowledge.QnAMaker/tests/SessionRecords/QnAMakerKnowledgebasePreviewTests/QnAMakerKnowledgebasePreviewCrud.json +++ b/sdk/cognitiveservices/Knowledge.QnAMaker/tests/SessionRecords/QnAMakerKnowledgebasePreviewTests/QnAMakerKnowledgebasePreviewCrud.json @@ -7,7 +7,7 @@ "RequestBody": "{\r\n \"name\": \"testqna\",\r\n \"qnaList\": [\r\n {\r\n \"answer\": \"hello\",\r\n \"questions\": [\r\n \"hi\"\r\n ]\r\n }\r\n ]\r\n}", "RequestHeaders": { "Ocp-Apim-Subscription-Key": [ - "c692f6f64dd54468b25eefd0c6c67c71" + "7942ed8406a748309d63728b2b7f7378" ], "User-Agent": [ "FxVersion/4.6.29220.03", @@ -24,16 +24,16 @@ }, "ResponseHeaders": { "Location": [ - "/operations/707462a7-f8a2-453e-b596-ba26363479aa" + "/operations/2608e164-7bb4-4012-98f6-9a862b2218a6" ], "csp-billing-usage": [ "CognitiveServices.QnAMakerV2.Transaction=1" ], "x-envoy-upstream-service-time": [ - "1716" + "247" ], "apim-request-id": [ - "6cfd3b6a-bae5-4715-a56b-8b99a7852101" + "c53bc2be-e728-4d23-9aa1-df96210ae28d" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains; preload" @@ -42,7 +42,7 @@ "nosniff" ], "Date": [ - "Wed, 14 Oct 2020 08:28:34 GMT" + "Mon, 19 Oct 2020 17:43:29 GMT" ], "Content-Length": [ "252" @@ -51,17 +51,17 @@ "application/json; charset=utf-8" ] }, - "ResponseBody": "{\r\n \"operationState\": \"NotStarted\",\r\n \"createdTimestamp\": \"2020-10-14T08:28:35.0627291Z\",\r\n \"lastActionTimestamp\": \"2020-10-14T08:28:35.0627291Z\",\r\n \"userId\": \"50c22b7204fd4ef8bf9ed68e837abedb\",\r\n \"operationId\": \"707462a7-f8a2-453e-b596-ba26363479aa\"\r\n}", + "ResponseBody": "{\r\n \"operationState\": \"NotStarted\",\r\n \"createdTimestamp\": \"2020-10-19T17:43:29.5314865Z\",\r\n \"lastActionTimestamp\": \"2020-10-19T17:43:29.5314865Z\",\r\n \"userId\": \"c8ce37c9fd4e4634b93f0ebc3017a9cb\",\r\n \"operationId\": \"2608e164-7bb4-4012-98f6-9a862b2218a6\"\r\n}", "StatusCode": 202 }, { - "RequestUri": "/qnamaker/v5.0-preview.1/operations/707462a7-f8a2-453e-b596-ba26363479aa", - "EncodedRequestUri": "L3FuYW1ha2VyL3Y1LjAtcHJldmlldy4xL29wZXJhdGlvbnMvNzA3NDYyYTctZjhhMi00NTNlLWI1OTYtYmEyNjM2MzQ3OWFh", + "RequestUri": "/qnamaker/v5.0-preview.1/operations/2608e164-7bb4-4012-98f6-9a862b2218a6", + "EncodedRequestUri": "L3FuYW1ha2VyL3Y1LjAtcHJldmlldy4xL29wZXJhdGlvbnMvMjYwOGUxNjQtN2JiNC00MDEyLTk4ZjYtOWE4NjJiMjIxOGE2", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "Ocp-Apim-Subscription-Key": [ - "c692f6f64dd54468b25eefd0c6c67c71" + "7942ed8406a748309d63728b2b7f7378" ], "User-Agent": [ "FxVersion/4.6.29220.03", @@ -78,10 +78,10 @@ "CognitiveServices.QnAMakerV2.Transaction=1" ], "x-envoy-upstream-service-time": [ - "16" + "10" ], "apim-request-id": [ - "3458a825-1201-47de-b092-cfd489aca7c8" + "01c0c6a2-0325-4b0b-ad41-dbc6c7093a07" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains; preload" @@ -90,7 +90,7 @@ "nosniff" ], "Date": [ - "Wed, 14 Oct 2020 08:28:37 GMT" + "Mon, 19 Oct 2020 17:43:30 GMT" ], "Content-Length": [ "243" @@ -99,113 +99,17 @@ "application/json; charset=utf-8" ] }, - "ResponseBody": "{\r\n \"operationState\": \"Running\",\r\n \"createdTimestamp\": \"2020-10-14T13:58:35+05:30\",\r\n \"lastActionTimestamp\": \"2020-10-14T13:58:36+05:30\",\r\n \"userId\": \"50c22b7204fd4ef8bf9ed68e837abedb\",\r\n \"operationId\": \"707462a7-f8a2-453e-b596-ba26363479aa\"\r\n}", + "ResponseBody": "{\r\n \"operationState\": \"Running\",\r\n \"createdTimestamp\": \"2020-10-19T23:13:29+05:30\",\r\n \"lastActionTimestamp\": \"2020-10-19T23:13:29+05:30\",\r\n \"userId\": \"c8ce37c9fd4e4634b93f0ebc3017a9cb\",\r\n \"operationId\": \"2608e164-7bb4-4012-98f6-9a862b2218a6\"\r\n}", "StatusCode": 200 }, { - "RequestUri": "/qnamaker/v5.0-preview.1/operations/707462a7-f8a2-453e-b596-ba26363479aa", - "EncodedRequestUri": "L3FuYW1ha2VyL3Y1LjAtcHJldmlldy4xL29wZXJhdGlvbnMvNzA3NDYyYTctZjhhMi00NTNlLWI1OTYtYmEyNjM2MzQ3OWFh", + "RequestUri": "/qnamaker/v5.0-preview.1/operations/2608e164-7bb4-4012-98f6-9a862b2218a6", + "EncodedRequestUri": "L3FuYW1ha2VyL3Y1LjAtcHJldmlldy4xL29wZXJhdGlvbnMvMjYwOGUxNjQtN2JiNC00MDEyLTk4ZjYtOWE4NjJiMjIxOGE2", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "Ocp-Apim-Subscription-Key": [ - "c692f6f64dd54468b25eefd0c6c67c71" - ], - "User-Agent": [ - "FxVersion/4.6.29220.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.QnAMakerClient/2.1.0.0" - ] - }, - "ResponseHeaders": { - "Retry-After": [ - "00:00:30" - ], - "csp-billing-usage": [ - "CognitiveServices.QnAMakerV2.Transaction=1" - ], - "x-envoy-upstream-service-time": [ - "6" - ], - "apim-request-id": [ - "3d5dadc0-5522-4f82-9799-4e7a1d7b79b2" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains; preload" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Wed, 14 Oct 2020 08:28:38 GMT" - ], - "Content-Length": [ - "243" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ] - }, - "ResponseBody": "{\r\n \"operationState\": \"Running\",\r\n \"createdTimestamp\": \"2020-10-14T13:58:35+05:30\",\r\n \"lastActionTimestamp\": \"2020-10-14T13:58:36+05:30\",\r\n \"userId\": \"50c22b7204fd4ef8bf9ed68e837abedb\",\r\n \"operationId\": \"707462a7-f8a2-453e-b596-ba26363479aa\"\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/qnamaker/v5.0-preview.1/operations/707462a7-f8a2-453e-b596-ba26363479aa", - "EncodedRequestUri": "L3FuYW1ha2VyL3Y1LjAtcHJldmlldy4xL29wZXJhdGlvbnMvNzA3NDYyYTctZjhhMi00NTNlLWI1OTYtYmEyNjM2MzQ3OWFh", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "Ocp-Apim-Subscription-Key": [ - "c692f6f64dd54468b25eefd0c6c67c71" - ], - "User-Agent": [ - "FxVersion/4.6.29220.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.QnAMakerClient/2.1.0.0" - ] - }, - "ResponseHeaders": { - "Retry-After": [ - "00:00:30" - ], - "csp-billing-usage": [ - "CognitiveServices.QnAMakerV2.Transaction=1" - ], - "x-envoy-upstream-service-time": [ - "6" - ], - "apim-request-id": [ - "8cf742a8-1307-4293-adc6-81ca0ac58ac1" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains; preload" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Wed, 14 Oct 2020 08:28:39 GMT" - ], - "Content-Length": [ - "243" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ] - }, - "ResponseBody": "{\r\n \"operationState\": \"Running\",\r\n \"createdTimestamp\": \"2020-10-14T13:58:35+05:30\",\r\n \"lastActionTimestamp\": \"2020-10-14T13:58:36+05:30\",\r\n \"userId\": \"50c22b7204fd4ef8bf9ed68e837abedb\",\r\n \"operationId\": \"707462a7-f8a2-453e-b596-ba26363479aa\"\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/qnamaker/v5.0-preview.1/operations/707462a7-f8a2-453e-b596-ba26363479aa", - "EncodedRequestUri": "L3FuYW1ha2VyL3Y1LjAtcHJldmlldy4xL29wZXJhdGlvbnMvNzA3NDYyYTctZjhhMi00NTNlLWI1OTYtYmEyNjM2MzQ3OWFh", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "Ocp-Apim-Subscription-Key": [ - "c692f6f64dd54468b25eefd0c6c67c71" + "7942ed8406a748309d63728b2b7f7378" ], "User-Agent": [ "FxVersion/4.6.29220.03", @@ -225,7 +129,7 @@ "7" ], "apim-request-id": [ - "743d6bc0-0de9-4168-97c3-b756ac4c6ffc" + "bd89d638-6b99-458a-b6e0-6cec623d59e3" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains; preload" @@ -234,7 +138,7 @@ "nosniff" ], "Date": [ - "Wed, 14 Oct 2020 08:28:40 GMT" + "Mon, 19 Oct 2020 17:43:31 GMT" ], "Content-Length": [ "243" @@ -243,17 +147,17 @@ "application/json; charset=utf-8" ] }, - "ResponseBody": "{\r\n \"operationState\": \"Running\",\r\n \"createdTimestamp\": \"2020-10-14T13:58:35+05:30\",\r\n \"lastActionTimestamp\": \"2020-10-14T13:58:36+05:30\",\r\n \"userId\": \"50c22b7204fd4ef8bf9ed68e837abedb\",\r\n \"operationId\": \"707462a7-f8a2-453e-b596-ba26363479aa\"\r\n}", + "ResponseBody": "{\r\n \"operationState\": \"Running\",\r\n \"createdTimestamp\": \"2020-10-19T23:13:29+05:30\",\r\n \"lastActionTimestamp\": \"2020-10-19T23:13:29+05:30\",\r\n \"userId\": \"c8ce37c9fd4e4634b93f0ebc3017a9cb\",\r\n \"operationId\": \"2608e164-7bb4-4012-98f6-9a862b2218a6\"\r\n}", "StatusCode": 200 }, { - "RequestUri": "/qnamaker/v5.0-preview.1/operations/707462a7-f8a2-453e-b596-ba26363479aa", - "EncodedRequestUri": "L3FuYW1ha2VyL3Y1LjAtcHJldmlldy4xL29wZXJhdGlvbnMvNzA3NDYyYTctZjhhMi00NTNlLWI1OTYtYmEyNjM2MzQ3OWFh", + "RequestUri": "/qnamaker/v5.0-preview.1/operations/2608e164-7bb4-4012-98f6-9a862b2218a6", + "EncodedRequestUri": "L3FuYW1ha2VyL3Y1LjAtcHJldmlldy4xL29wZXJhdGlvbnMvMjYwOGUxNjQtN2JiNC00MDEyLTk4ZjYtOWE4NjJiMjIxOGE2", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "Ocp-Apim-Subscription-Key": [ - "c692f6f64dd54468b25eefd0c6c67c71" + "7942ed8406a748309d63728b2b7f7378" ], "User-Agent": [ "FxVersion/4.6.29220.03", @@ -273,7 +177,7 @@ "7" ], "apim-request-id": [ - "ef99a5a3-9c92-4591-9a81-478f9407bbf2" + "f567bce7-4cfd-47a8-80c4-49360da73aad" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains; preload" @@ -282,7 +186,7 @@ "nosniff" ], "Date": [ - "Wed, 14 Oct 2020 08:28:41 GMT" + "Mon, 19 Oct 2020 17:43:32 GMT" ], "Content-Length": [ "243" @@ -291,17 +195,17 @@ "application/json; charset=utf-8" ] }, - "ResponseBody": "{\r\n \"operationState\": \"Running\",\r\n \"createdTimestamp\": \"2020-10-14T13:58:35+05:30\",\r\n \"lastActionTimestamp\": \"2020-10-14T13:58:36+05:30\",\r\n \"userId\": \"50c22b7204fd4ef8bf9ed68e837abedb\",\r\n \"operationId\": \"707462a7-f8a2-453e-b596-ba26363479aa\"\r\n}", + "ResponseBody": "{\r\n \"operationState\": \"Running\",\r\n \"createdTimestamp\": \"2020-10-19T23:13:29+05:30\",\r\n \"lastActionTimestamp\": \"2020-10-19T23:13:29+05:30\",\r\n \"userId\": \"c8ce37c9fd4e4634b93f0ebc3017a9cb\",\r\n \"operationId\": \"2608e164-7bb4-4012-98f6-9a862b2218a6\"\r\n}", "StatusCode": 200 }, { - "RequestUri": "/qnamaker/v5.0-preview.1/operations/707462a7-f8a2-453e-b596-ba26363479aa", - "EncodedRequestUri": "L3FuYW1ha2VyL3Y1LjAtcHJldmlldy4xL29wZXJhdGlvbnMvNzA3NDYyYTctZjhhMi00NTNlLWI1OTYtYmEyNjM2MzQ3OWFh", + "RequestUri": "/qnamaker/v5.0-preview.1/operations/2608e164-7bb4-4012-98f6-9a862b2218a6", + "EncodedRequestUri": "L3FuYW1ha2VyL3Y1LjAtcHJldmlldy4xL29wZXJhdGlvbnMvMjYwOGUxNjQtN2JiNC00MDEyLTk4ZjYtOWE4NjJiMjIxOGE2", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "Ocp-Apim-Subscription-Key": [ - "c692f6f64dd54468b25eefd0c6c67c71" + "7942ed8406a748309d63728b2b7f7378" ], "User-Agent": [ "FxVersion/4.6.29220.03", @@ -311,57 +215,6 @@ ] }, "ResponseHeaders": { - "Retry-After": [ - "00:00:30" - ], - "csp-billing-usage": [ - "CognitiveServices.QnAMakerV2.Transaction=1" - ], - "x-envoy-upstream-service-time": [ - "6" - ], - "apim-request-id": [ - "f299260f-226d-4b20-b35f-5ade615d1a3e" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains; preload" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Wed, 14 Oct 2020 08:28:43 GMT" - ], - "Content-Length": [ - "243" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ] - }, - "ResponseBody": "{\r\n \"operationState\": \"Running\",\r\n \"createdTimestamp\": \"2020-10-14T13:58:35+05:30\",\r\n \"lastActionTimestamp\": \"2020-10-14T13:58:36+05:30\",\r\n \"userId\": \"50c22b7204fd4ef8bf9ed68e837abedb\",\r\n \"operationId\": \"707462a7-f8a2-453e-b596-ba26363479aa\"\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/qnamaker/v5.0-preview.1/operations/707462a7-f8a2-453e-b596-ba26363479aa", - "EncodedRequestUri": "L3FuYW1ha2VyL3Y1LjAtcHJldmlldy4xL29wZXJhdGlvbnMvNzA3NDYyYTctZjhhMi00NTNlLWI1OTYtYmEyNjM2MzQ3OWFh", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "Ocp-Apim-Subscription-Key": [ - "c692f6f64dd54468b25eefd0c6c67c71" - ], - "User-Agent": [ - "FxVersion/4.6.29220.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.QnAMakerClient/2.1.0.0" - ] - }, - "ResponseHeaders": { - "Retry-After": [ - "00:00:30" - ], "csp-billing-usage": [ "CognitiveServices.QnAMakerV2.Transaction=1" ], @@ -369,55 +222,7 @@ "6" ], "apim-request-id": [ - "544cbb57-ad1e-4997-86d3-8551416dd7dd" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains; preload" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Wed, 14 Oct 2020 08:28:45 GMT" - ], - "Content-Length": [ - "243" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ] - }, - "ResponseBody": "{\r\n \"operationState\": \"Running\",\r\n \"createdTimestamp\": \"2020-10-14T13:58:35+05:30\",\r\n \"lastActionTimestamp\": \"2020-10-14T13:58:36+05:30\",\r\n \"userId\": \"50c22b7204fd4ef8bf9ed68e837abedb\",\r\n \"operationId\": \"707462a7-f8a2-453e-b596-ba26363479aa\"\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/qnamaker/v5.0-preview.1/operations/707462a7-f8a2-453e-b596-ba26363479aa", - "EncodedRequestUri": "L3FuYW1ha2VyL3Y1LjAtcHJldmlldy4xL29wZXJhdGlvbnMvNzA3NDYyYTctZjhhMi00NTNlLWI1OTYtYmEyNjM2MzQ3OWFh", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "Ocp-Apim-Subscription-Key": [ - "c692f6f64dd54468b25eefd0c6c67c71" - ], - "User-Agent": [ - "FxVersion/4.6.29220.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.QnAMakerClient/2.1.0.0" - ] - }, - "ResponseHeaders": { - "Retry-After": [ - "00:00:30" - ], - "csp-billing-usage": [ - "CognitiveServices.QnAMakerV2.Transaction=1" - ], - "x-envoy-upstream-service-time": [ - "8" - ], - "apim-request-id": [ - "76d9876c-5625-4161-8324-6160ed42136c" + "c5146cce-9c63-4ade-9174-699cce83a3af" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains; preload" @@ -426,52 +231,7 @@ "nosniff" ], "Date": [ - "Wed, 14 Oct 2020 08:28:46 GMT" - ], - "Content-Length": [ - "243" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ] - }, - "ResponseBody": "{\r\n \"operationState\": \"Running\",\r\n \"createdTimestamp\": \"2020-10-14T13:58:35+05:30\",\r\n \"lastActionTimestamp\": \"2020-10-14T13:58:36+05:30\",\r\n \"userId\": \"50c22b7204fd4ef8bf9ed68e837abedb\",\r\n \"operationId\": \"707462a7-f8a2-453e-b596-ba26363479aa\"\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/qnamaker/v5.0-preview.1/operations/707462a7-f8a2-453e-b596-ba26363479aa", - "EncodedRequestUri": "L3FuYW1ha2VyL3Y1LjAtcHJldmlldy4xL29wZXJhdGlvbnMvNzA3NDYyYTctZjhhMi00NTNlLWI1OTYtYmEyNjM2MzQ3OWFh", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "Ocp-Apim-Subscription-Key": [ - "c692f6f64dd54468b25eefd0c6c67c71" - ], - "User-Agent": [ - "FxVersion/4.6.29220.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.QnAMakerClient/2.1.0.0" - ] - }, - "ResponseHeaders": { - "csp-billing-usage": [ - "CognitiveServices.QnAMakerV2.Transaction=1" - ], - "x-envoy-upstream-service-time": [ - "7" - ], - "apim-request-id": [ - "4cebe6c5-ac9b-456e-8262-4f664cddbbbb" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains; preload" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Wed, 14 Oct 2020 08:28:47 GMT" + "Mon, 19 Oct 2020 17:43:33 GMT" ], "Content-Length": [ "323" @@ -480,17 +240,17 @@ "application/json; charset=utf-8" ] }, - "ResponseBody": "{\r\n \"operationState\": \"Succeeded\",\r\n \"createdTimestamp\": \"2020-10-14T13:58:35+05:30\",\r\n \"lastActionTimestamp\": \"2020-10-14T13:58:47+05:30\",\r\n \"resourceLocation\": \"/knowledgebases/1df865d8-3968-4a88-8bbb-40d715df36cb\",\r\n \"userId\": \"50c22b7204fd4ef8bf9ed68e837abedb\",\r\n \"operationId\": \"707462a7-f8a2-453e-b596-ba26363479aa\"\r\n}", + "ResponseBody": "{\r\n \"operationState\": \"Succeeded\",\r\n \"createdTimestamp\": \"2020-10-19T23:13:29+05:30\",\r\n \"lastActionTimestamp\": \"2020-10-19T23:13:33+05:30\",\r\n \"resourceLocation\": \"/knowledgebases/64ca8089-c36d-4de7-b8b1-0439d0ee0928\",\r\n \"userId\": \"c8ce37c9fd4e4634b93f0ebc3017a9cb\",\r\n \"operationId\": \"2608e164-7bb4-4012-98f6-9a862b2218a6\"\r\n}", "StatusCode": 200 }, { - "RequestUri": "/qnamaker/v5.0-preview.1/knowledgebases/1df865d8-3968-4a88-8bbb-40d715df36cb", - "EncodedRequestUri": "L3FuYW1ha2VyL3Y1LjAtcHJldmlldy4xL2tub3dsZWRnZWJhc2VzLzFkZjg2NWQ4LTM5NjgtNGE4OC04YmJiLTQwZDcxNWRmMzZjYg==", + "RequestUri": "/qnamaker/v5.0-preview.1/knowledgebases/64ca8089-c36d-4de7-b8b1-0439d0ee0928", + "EncodedRequestUri": "L3FuYW1ha2VyL3Y1LjAtcHJldmlldy4xL2tub3dsZWRnZWJhc2VzLzY0Y2E4MDg5LWMzNmQtNGRlNy1iOGIxLTA0MzlkMGVlMDkyOA==", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "Ocp-Apim-Subscription-Key": [ - "c692f6f64dd54468b25eefd0c6c67c71" + "7942ed8406a748309d63728b2b7f7378" ], "User-Agent": [ "FxVersion/4.6.29220.03", @@ -504,10 +264,10 @@ "CognitiveServices.QnAMakerV2.Transaction=1" ], "x-envoy-upstream-service-time": [ - "11" + "10" ], "apim-request-id": [ - "d25a0c25-4386-44e3-bf85-be9ee83433a7" + "3329f3b8-e09b-4164-8f4e-e7333ec87785" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains; preload" @@ -516,7 +276,7 @@ "nosniff" ], "Date": [ - "Wed, 14 Oct 2020 08:28:47 GMT" + "Mon, 19 Oct 2020 17:43:34 GMT" ], "Content-Length": [ "505" @@ -525,17 +285,17 @@ "application/json; charset=utf-8" ] }, - "ResponseBody": "{\r\n \"id\": \"1df865d8-3968-4a88-8bbb-40d715df36cb\",\r\n \"hostName\": \"http://svc--runtimeweb.qnamaker-runtime.svc.cluster.local\",\r\n \"lastAccessedTimestamp\": \"2020-10-14T08:28:38Z\",\r\n \"lastChangedTimestamp\": \"2020-10-14T08:28:38Z\",\r\n \"name\": \"testqna\",\r\n \"userId\": \"50c22b7204fd4ef8bf9ed68e837abedb\",\r\n \"urls\": [],\r\n \"sources\": [\r\n \"Editorial\"\r\n ],\r\n \"language\": \"English\",\r\n \"enableHierarchicalExtraction\": false,\r\n \"createdTimestamp\": \"2020-10-14T08:28:38Z\",\r\n \"defaultAnswer\": \"No good match found in KB\"\r\n}", + "ResponseBody": "{\r\n \"id\": \"64ca8089-c36d-4de7-b8b1-0439d0ee0928\",\r\n \"hostName\": \"http://svc--runtimeweb.qnamaker-runtime.svc.cluster.local\",\r\n \"lastAccessedTimestamp\": \"2020-10-19T17:43:30Z\",\r\n \"lastChangedTimestamp\": \"2020-10-19T17:43:30Z\",\r\n \"name\": \"testqna\",\r\n \"userId\": \"c8ce37c9fd4e4634b93f0ebc3017a9cb\",\r\n \"urls\": [],\r\n \"sources\": [\r\n \"Editorial\"\r\n ],\r\n \"language\": \"English\",\r\n \"enableHierarchicalExtraction\": false,\r\n \"createdTimestamp\": \"2020-10-19T17:43:30Z\",\r\n \"defaultAnswer\": \"No good match found in KB\"\r\n}", "StatusCode": 200 }, { - "RequestUri": "/qnamaker/v5.0-preview.1/knowledgebases/1df865d8-3968-4a88-8bbb-40d715df36cb/Test/qna", - "EncodedRequestUri": "L3FuYW1ha2VyL3Y1LjAtcHJldmlldy4xL2tub3dsZWRnZWJhc2VzLzFkZjg2NWQ4LTM5NjgtNGE4OC04YmJiLTQwZDcxNWRmMzZjYi9UZXN0L3FuYQ==", + "RequestUri": "/qnamaker/v5.0-preview.1/knowledgebases/64ca8089-c36d-4de7-b8b1-0439d0ee0928/Test/qna", + "EncodedRequestUri": "L3FuYW1ha2VyL3Y1LjAtcHJldmlldy4xL2tub3dsZWRnZWJhc2VzLzY0Y2E4MDg5LWMzNmQtNGRlNy1iOGIxLTA0MzlkMGVlMDkyOC9UZXN0L3FuYQ==", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "Ocp-Apim-Subscription-Key": [ - "c692f6f64dd54468b25eefd0c6c67c71" + "7942ed8406a748309d63728b2b7f7378" ], "User-Agent": [ "FxVersion/4.6.29220.03", @@ -549,10 +309,10 @@ "CognitiveServices.QnAMakerV2.Transaction=1" ], "x-envoy-upstream-service-time": [ - "3351" + "5962" ], "apim-request-id": [ - "a934cf22-e319-49ff-b594-dbcffc7598a7" + "b27efb21-6da9-4d77-8e34-75d462a9e609" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains; preload" @@ -561,7 +321,7 @@ "nosniff" ], "Date": [ - "Wed, 14 Oct 2020 08:28:51 GMT" + "Mon, 19 Oct 2020 17:43:40 GMT" ], "Content-Length": [ "359" @@ -570,17 +330,17 @@ "application/json; charset=utf-8" ] }, - "ResponseBody": "{\r\n \"qnaDocuments\": [\r\n {\r\n \"id\": 1,\r\n \"answer\": \"hello\",\r\n \"source\": \"Editorial\",\r\n \"questions\": [\r\n \"hi\"\r\n ],\r\n \"metadata\": [],\r\n \"alternateQuestionClusters\": [],\r\n \"context\": {\r\n \"isContextOnly\": false,\r\n \"prompts\": []\r\n },\r\n \"lastUpdatedTimestampUTC\": \"2020-10-14T13:58:40.383+05:30\"\r\n }\r\n ]\r\n}", + "ResponseBody": "{\r\n \"qnaDocuments\": [\r\n {\r\n \"id\": 1,\r\n \"answer\": \"hello\",\r\n \"source\": \"Editorial\",\r\n \"questions\": [\r\n \"hi\"\r\n ],\r\n \"metadata\": [],\r\n \"alternateQuestionClusters\": [],\r\n \"context\": {\r\n \"isContextOnly\": false,\r\n \"prompts\": []\r\n },\r\n \"lastUpdatedTimestampUTC\": \"2020-10-19T23:13:30.943+05:30\"\r\n }\r\n ]\r\n}", "StatusCode": 200 }, { - "RequestUri": "/qnamaker/v5.0-preview.1/knowledgebases/1df865d8-3968-4a88-8bbb-40d715df36cb/Test/qna", - "EncodedRequestUri": "L3FuYW1ha2VyL3Y1LjAtcHJldmlldy4xL2tub3dsZWRnZWJhc2VzLzFkZjg2NWQ4LTM5NjgtNGE4OC04YmJiLTQwZDcxNWRmMzZjYi9UZXN0L3FuYQ==", + "RequestUri": "/qnamaker/v5.0-preview.1/knowledgebases/64ca8089-c36d-4de7-b8b1-0439d0ee0928/Test/qna", + "EncodedRequestUri": "L3FuYW1ha2VyL3Y1LjAtcHJldmlldy4xL2tub3dsZWRnZWJhc2VzLzY0Y2E4MDg5LWMzNmQtNGRlNy1iOGIxLTA0MzlkMGVlMDkyOC9UZXN0L3FuYQ==", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "Ocp-Apim-Subscription-Key": [ - "c692f6f64dd54468b25eefd0c6c67c71" + "7942ed8406a748309d63728b2b7f7378" ], "User-Agent": [ "FxVersion/4.6.29220.03", @@ -594,10 +354,10 @@ "CognitiveServices.QnAMakerV2.Transaction=1" ], "x-envoy-upstream-service-time": [ - "790" + "1021" ], "apim-request-id": [ - "3c0de9af-ab80-4e32-a799-4ef490b70f9b" + "c0a93a82-fa67-432d-8a95-d5052ba1b233" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains; preload" @@ -606,7 +366,7 @@ "nosniff" ], "Date": [ - "Wed, 14 Oct 2020 08:28:58 GMT" + "Mon, 19 Oct 2020 17:43:46 GMT" ], "Content-Length": [ "695" @@ -615,17 +375,17 @@ "application/json; charset=utf-8" ] }, - "ResponseBody": "{\r\n \"qnaDocuments\": [\r\n {\r\n \"id\": 1,\r\n \"answer\": \"hello\",\r\n \"source\": \"Editorial\",\r\n \"questions\": [\r\n \"hi\"\r\n ],\r\n \"metadata\": [],\r\n \"alternateQuestionClusters\": [],\r\n \"context\": {\r\n \"isContextOnly\": false,\r\n \"prompts\": []\r\n },\r\n \"lastUpdatedTimestampUTC\": \"2020-10-14T13:58:40.383+05:30\"\r\n },\r\n {\r\n \"id\": 2,\r\n \"answer\": \"goodbye\",\r\n \"source\": \"Editorial\",\r\n \"questions\": [\r\n \"bye\"\r\n ],\r\n \"metadata\": [],\r\n \"alternateQuestionClusters\": [],\r\n \"context\": {\r\n \"isContextOnly\": false,\r\n \"prompts\": []\r\n },\r\n \"lastUpdatedTimestampUTC\": \"2020-10-14T13:58:55.545+05:30\"\r\n }\r\n ]\r\n}", + "ResponseBody": "{\r\n \"qnaDocuments\": [\r\n {\r\n \"id\": 1,\r\n \"answer\": \"hello\",\r\n \"source\": \"Editorial\",\r\n \"questions\": [\r\n \"hi\"\r\n ],\r\n \"metadata\": [],\r\n \"alternateQuestionClusters\": [],\r\n \"context\": {\r\n \"isContextOnly\": false,\r\n \"prompts\": []\r\n },\r\n \"lastUpdatedTimestampUTC\": \"2020-10-19T23:13:30.943+05:30\"\r\n },\r\n {\r\n \"id\": 2,\r\n \"answer\": \"goodbye\",\r\n \"source\": \"Editorial\",\r\n \"questions\": [\r\n \"bye\"\r\n ],\r\n \"metadata\": [],\r\n \"alternateQuestionClusters\": [],\r\n \"context\": {\r\n \"isContextOnly\": false,\r\n \"prompts\": []\r\n },\r\n \"lastUpdatedTimestampUTC\": \"2020-10-19T23:13:42.207+05:30\"\r\n }\r\n ]\r\n}", "StatusCode": 200 }, { - "RequestUri": "/qnamaker/v5.0-preview.1/knowledgebases/1df865d8-3968-4a88-8bbb-40d715df36cb", - "EncodedRequestUri": "L3FuYW1ha2VyL3Y1LjAtcHJldmlldy4xL2tub3dsZWRnZWJhc2VzLzFkZjg2NWQ4LTM5NjgtNGE4OC04YmJiLTQwZDcxNWRmMzZjYg==", + "RequestUri": "/qnamaker/v5.0-preview.1/knowledgebases/64ca8089-c36d-4de7-b8b1-0439d0ee0928", + "EncodedRequestUri": "L3FuYW1ha2VyL3Y1LjAtcHJldmlldy4xL2tub3dsZWRnZWJhc2VzLzY0Y2E4MDg5LWMzNmQtNGRlNy1iOGIxLTA0MzlkMGVlMDkyOA==", "RequestMethod": "PATCH", "RequestBody": "{\r\n \"add\": {\r\n \"qnaList\": [\r\n {\r\n \"answer\": \"goodbye\",\r\n \"questions\": [\r\n \"bye\"\r\n ]\r\n }\r\n ]\r\n }\r\n}", "RequestHeaders": { "Ocp-Apim-Subscription-Key": [ - "c692f6f64dd54468b25eefd0c6c67c71" + "7942ed8406a748309d63728b2b7f7378" ], "User-Agent": [ "FxVersion/4.6.29220.03", @@ -642,16 +402,16 @@ }, "ResponseHeaders": { "Location": [ - "/operations/580849f6-074e-41b9-9b34-42f65c10a0f1" + "/operations/f944e987-712b-40d5-9faa-e3add229a67d" ], "csp-billing-usage": [ "CognitiveServices.QnAMakerV2.Transaction=1" ], "x-envoy-upstream-service-time": [ - "60" + "56" ], "apim-request-id": [ - "ab92a9d1-f377-453e-b0ee-1f9c73c712f6" + "d5a78203-1783-44f4-877f-b34dc5daf6a8" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains; preload" @@ -660,7 +420,7 @@ "nosniff" ], "Date": [ - "Wed, 14 Oct 2020 08:28:51 GMT" + "Mon, 19 Oct 2020 17:43:40 GMT" ], "Content-Length": [ "252" @@ -669,17 +429,17 @@ "application/json; charset=utf-8" ] }, - "ResponseBody": "{\r\n \"operationState\": \"NotStarted\",\r\n \"createdTimestamp\": \"2020-10-14T08:28:52.0882503Z\",\r\n \"lastActionTimestamp\": \"2020-10-14T08:28:52.0882503Z\",\r\n \"userId\": \"50c22b7204fd4ef8bf9ed68e837abedb\",\r\n \"operationId\": \"580849f6-074e-41b9-9b34-42f65c10a0f1\"\r\n}", + "ResponseBody": "{\r\n \"operationState\": \"NotStarted\",\r\n \"createdTimestamp\": \"2020-10-19T17:43:40.5986611Z\",\r\n \"lastActionTimestamp\": \"2020-10-19T17:43:40.5986611Z\",\r\n \"userId\": \"c8ce37c9fd4e4634b93f0ebc3017a9cb\",\r\n \"operationId\": \"f944e987-712b-40d5-9faa-e3add229a67d\"\r\n}", "StatusCode": 202 }, { - "RequestUri": "/qnamaker/v5.0-preview.1/operations/580849f6-074e-41b9-9b34-42f65c10a0f1", - "EncodedRequestUri": "L3FuYW1ha2VyL3Y1LjAtcHJldmlldy4xL29wZXJhdGlvbnMvNTgwODQ5ZjYtMDc0ZS00MWI5LTliMzQtNDJmNjVjMTBhMGYx", + "RequestUri": "/qnamaker/v5.0-preview.1/operations/f944e987-712b-40d5-9faa-e3add229a67d", + "EncodedRequestUri": "L3FuYW1ha2VyL3Y1LjAtcHJldmlldy4xL29wZXJhdGlvbnMvZjk0NGU5ODctNzEyYi00MGQ1LTlmYWEtZTNhZGQyMjlhNjdk", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "Ocp-Apim-Subscription-Key": [ - "c692f6f64dd54468b25eefd0c6c67c71" + "7942ed8406a748309d63728b2b7f7378" ], "User-Agent": [ "FxVersion/4.6.29220.03", @@ -696,58 +456,10 @@ "CognitiveServices.QnAMakerV2.Transaction=1" ], "x-envoy-upstream-service-time": [ - "6" - ], - "apim-request-id": [ - "2e89c79e-8dc3-480a-b9c1-f9589aa55e72" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains; preload" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "Date": [ - "Wed, 14 Oct 2020 08:28:52 GMT" - ], - "Content-Length": [ - "243" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ] - }, - "ResponseBody": "{\r\n \"operationState\": \"Running\",\r\n \"createdTimestamp\": \"2020-10-14T13:58:52+05:30\",\r\n \"lastActionTimestamp\": \"2020-10-14T13:58:52+05:30\",\r\n \"userId\": \"50c22b7204fd4ef8bf9ed68e837abedb\",\r\n \"operationId\": \"580849f6-074e-41b9-9b34-42f65c10a0f1\"\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/qnamaker/v5.0-preview.1/operations/580849f6-074e-41b9-9b34-42f65c10a0f1", - "EncodedRequestUri": "L3FuYW1ha2VyL3Y1LjAtcHJldmlldy4xL29wZXJhdGlvbnMvNTgwODQ5ZjYtMDc0ZS00MWI5LTliMzQtNDJmNjVjMTBhMGYx", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "Ocp-Apim-Subscription-Key": [ - "c692f6f64dd54468b25eefd0c6c67c71" - ], - "User-Agent": [ - "FxVersion/4.6.29220.03", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.QnAMakerClient/2.1.0.0" - ] - }, - "ResponseHeaders": { - "Retry-After": [ - "00:00:30" - ], - "csp-billing-usage": [ - "CognitiveServices.QnAMakerV2.Transaction=1" - ], - "x-envoy-upstream-service-time": [ - "46" + "7" ], "apim-request-id": [ - "2534f17a-4ba7-405b-8212-92cffe8a9dec" + "4cd42686-4f6e-4d11-9b98-8c5ca029992c" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains; preload" @@ -756,7 +468,7 @@ "nosniff" ], "Date": [ - "Wed, 14 Oct 2020 08:28:54 GMT" + "Mon, 19 Oct 2020 17:43:41 GMT" ], "Content-Length": [ "243" @@ -765,17 +477,17 @@ "application/json; charset=utf-8" ] }, - "ResponseBody": "{\r\n \"operationState\": \"Running\",\r\n \"createdTimestamp\": \"2020-10-14T13:58:52+05:30\",\r\n \"lastActionTimestamp\": \"2020-10-14T13:58:52+05:30\",\r\n \"userId\": \"50c22b7204fd4ef8bf9ed68e837abedb\",\r\n \"operationId\": \"580849f6-074e-41b9-9b34-42f65c10a0f1\"\r\n}", + "ResponseBody": "{\r\n \"operationState\": \"Running\",\r\n \"createdTimestamp\": \"2020-10-19T23:13:40+05:30\",\r\n \"lastActionTimestamp\": \"2020-10-19T23:13:40+05:30\",\r\n \"userId\": \"c8ce37c9fd4e4634b93f0ebc3017a9cb\",\r\n \"operationId\": \"f944e987-712b-40d5-9faa-e3add229a67d\"\r\n}", "StatusCode": 200 }, { - "RequestUri": "/qnamaker/v5.0-preview.1/operations/580849f6-074e-41b9-9b34-42f65c10a0f1", - "EncodedRequestUri": "L3FuYW1ha2VyL3Y1LjAtcHJldmlldy4xL29wZXJhdGlvbnMvNTgwODQ5ZjYtMDc0ZS00MWI5LTliMzQtNDJmNjVjMTBhMGYx", + "RequestUri": "/qnamaker/v5.0-preview.1/operations/f944e987-712b-40d5-9faa-e3add229a67d", + "EncodedRequestUri": "L3FuYW1ha2VyL3Y1LjAtcHJldmlldy4xL29wZXJhdGlvbnMvZjk0NGU5ODctNzEyYi00MGQ1LTlmYWEtZTNhZGQyMjlhNjdk", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "Ocp-Apim-Subscription-Key": [ - "c692f6f64dd54468b25eefd0c6c67c71" + "7942ed8406a748309d63728b2b7f7378" ], "User-Agent": [ "FxVersion/4.6.29220.03", @@ -795,7 +507,7 @@ "6" ], "apim-request-id": [ - "f1963153-bea7-4b39-8858-bf18decd12c1" + "ef90f585-79c1-4ce0-b12c-d452048f0d84" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains; preload" @@ -804,7 +516,7 @@ "nosniff" ], "Date": [ - "Wed, 14 Oct 2020 08:28:55 GMT" + "Mon, 19 Oct 2020 17:43:42 GMT" ], "Content-Length": [ "243" @@ -813,17 +525,17 @@ "application/json; charset=utf-8" ] }, - "ResponseBody": "{\r\n \"operationState\": \"Running\",\r\n \"createdTimestamp\": \"2020-10-14T13:58:52+05:30\",\r\n \"lastActionTimestamp\": \"2020-10-14T13:58:52+05:30\",\r\n \"userId\": \"50c22b7204fd4ef8bf9ed68e837abedb\",\r\n \"operationId\": \"580849f6-074e-41b9-9b34-42f65c10a0f1\"\r\n}", + "ResponseBody": "{\r\n \"operationState\": \"Running\",\r\n \"createdTimestamp\": \"2020-10-19T23:13:40+05:30\",\r\n \"lastActionTimestamp\": \"2020-10-19T23:13:40+05:30\",\r\n \"userId\": \"c8ce37c9fd4e4634b93f0ebc3017a9cb\",\r\n \"operationId\": \"f944e987-712b-40d5-9faa-e3add229a67d\"\r\n}", "StatusCode": 200 }, { - "RequestUri": "/qnamaker/v5.0-preview.1/operations/580849f6-074e-41b9-9b34-42f65c10a0f1", - "EncodedRequestUri": "L3FuYW1ha2VyL3Y1LjAtcHJldmlldy4xL29wZXJhdGlvbnMvNTgwODQ5ZjYtMDc0ZS00MWI5LTliMzQtNDJmNjVjMTBhMGYx", + "RequestUri": "/qnamaker/v5.0-preview.1/operations/f944e987-712b-40d5-9faa-e3add229a67d", + "EncodedRequestUri": "L3FuYW1ha2VyL3Y1LjAtcHJldmlldy4xL29wZXJhdGlvbnMvZjk0NGU5ODctNzEyYi00MGQ1LTlmYWEtZTNhZGQyMjlhNjdk", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "Ocp-Apim-Subscription-Key": [ - "c692f6f64dd54468b25eefd0c6c67c71" + "7942ed8406a748309d63728b2b7f7378" ], "User-Agent": [ "FxVersion/4.6.29220.03", @@ -840,10 +552,10 @@ "CognitiveServices.QnAMakerV2.Transaction=1" ], "x-envoy-upstream-service-time": [ - "7" + "9" ], "apim-request-id": [ - "8b8cc68b-d65e-4616-8546-5ae069f1daa4" + "d5e0b1b4-4782-4fe2-a313-56c3a8ea6992" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains; preload" @@ -852,7 +564,7 @@ "nosniff" ], "Date": [ - "Wed, 14 Oct 2020 08:28:56 GMT" + "Mon, 19 Oct 2020 17:43:43 GMT" ], "Content-Length": [ "243" @@ -861,17 +573,17 @@ "application/json; charset=utf-8" ] }, - "ResponseBody": "{\r\n \"operationState\": \"Running\",\r\n \"createdTimestamp\": \"2020-10-14T13:58:52+05:30\",\r\n \"lastActionTimestamp\": \"2020-10-14T13:58:52+05:30\",\r\n \"userId\": \"50c22b7204fd4ef8bf9ed68e837abedb\",\r\n \"operationId\": \"580849f6-074e-41b9-9b34-42f65c10a0f1\"\r\n}", + "ResponseBody": "{\r\n \"operationState\": \"Running\",\r\n \"createdTimestamp\": \"2020-10-19T23:13:40+05:30\",\r\n \"lastActionTimestamp\": \"2020-10-19T23:13:40+05:30\",\r\n \"userId\": \"c8ce37c9fd4e4634b93f0ebc3017a9cb\",\r\n \"operationId\": \"f944e987-712b-40d5-9faa-e3add229a67d\"\r\n}", "StatusCode": 200 }, { - "RequestUri": "/qnamaker/v5.0-preview.1/operations/580849f6-074e-41b9-9b34-42f65c10a0f1", - "EncodedRequestUri": "L3FuYW1ha2VyL3Y1LjAtcHJldmlldy4xL29wZXJhdGlvbnMvNTgwODQ5ZjYtMDc0ZS00MWI5LTliMzQtNDJmNjVjMTBhMGYx", + "RequestUri": "/qnamaker/v5.0-preview.1/operations/f944e987-712b-40d5-9faa-e3add229a67d", + "EncodedRequestUri": "L3FuYW1ha2VyL3Y1LjAtcHJldmlldy4xL29wZXJhdGlvbnMvZjk0NGU5ODctNzEyYi00MGQ1LTlmYWEtZTNhZGQyMjlhNjdk", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "Ocp-Apim-Subscription-Key": [ - "c692f6f64dd54468b25eefd0c6c67c71" + "7942ed8406a748309d63728b2b7f7378" ], "User-Agent": [ "FxVersion/4.6.29220.03", @@ -885,10 +597,10 @@ "CognitiveServices.QnAMakerV2.Transaction=1" ], "x-envoy-upstream-service-time": [ - "6" + "9" ], "apim-request-id": [ - "8c855fd2-95f5-4be0-893d-4c99c09274f1" + "b71c248c-0bb9-4ad7-9dbe-8f87033607c5" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains; preload" @@ -897,7 +609,7 @@ "nosniff" ], "Date": [ - "Wed, 14 Oct 2020 08:28:58 GMT" + "Mon, 19 Oct 2020 17:43:44 GMT" ], "Content-Length": [ "323" @@ -906,17 +618,17 @@ "application/json; charset=utf-8" ] }, - "ResponseBody": "{\r\n \"operationState\": \"Succeeded\",\r\n \"createdTimestamp\": \"2020-10-14T13:58:52+05:30\",\r\n \"lastActionTimestamp\": \"2020-10-14T13:58:57+05:30\",\r\n \"resourceLocation\": \"/knowledgebases/1df865d8-3968-4a88-8bbb-40d715df36cb\",\r\n \"userId\": \"50c22b7204fd4ef8bf9ed68e837abedb\",\r\n \"operationId\": \"580849f6-074e-41b9-9b34-42f65c10a0f1\"\r\n}", + "ResponseBody": "{\r\n \"operationState\": \"Succeeded\",\r\n \"createdTimestamp\": \"2020-10-19T23:13:40+05:30\",\r\n \"lastActionTimestamp\": \"2020-10-19T23:13:44+05:30\",\r\n \"resourceLocation\": \"/knowledgebases/64ca8089-c36d-4de7-b8b1-0439d0ee0928\",\r\n \"userId\": \"c8ce37c9fd4e4634b93f0ebc3017a9cb\",\r\n \"operationId\": \"f944e987-712b-40d5-9faa-e3add229a67d\"\r\n}", "StatusCode": 200 }, { - "RequestUri": "/qnamaker/v5.0-preview.1/knowledgebases/1df865d8-3968-4a88-8bbb-40d715df36cb", - "EncodedRequestUri": "L3FuYW1ha2VyL3Y1LjAtcHJldmlldy4xL2tub3dsZWRnZWJhc2VzLzFkZjg2NWQ4LTM5NjgtNGE4OC04YmJiLTQwZDcxNWRmMzZjYg==", + "RequestUri": "/qnamaker/v5.0-preview.1/knowledgebases/64ca8089-c36d-4de7-b8b1-0439d0ee0928", + "EncodedRequestUri": "L3FuYW1ha2VyL3Y1LjAtcHJldmlldy4xL2tub3dsZWRnZWJhc2VzLzY0Y2E4MDg5LWMzNmQtNGRlNy1iOGIxLTA0MzlkMGVlMDkyOA==", "RequestMethod": "DELETE", "RequestBody": "", "RequestHeaders": { "Ocp-Apim-Subscription-Key": [ - "c692f6f64dd54468b25eefd0c6c67c71" + "7942ed8406a748309d63728b2b7f7378" ], "User-Agent": [ "FxVersion/4.6.29220.03", @@ -930,10 +642,10 @@ "CognitiveServices.QnAMakerV2.Transaction=1" ], "x-envoy-upstream-service-time": [ - "8205" + "2773" ], "apim-request-id": [ - "b0ed617e-f75c-4434-9f34-fd0d1b8af009" + "dab8ade2-8cc1-48f6-92a3-78f290f1ba68" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains; preload" @@ -942,7 +654,7 @@ "nosniff" ], "Date": [ - "Wed, 14 Oct 2020 08:29:06 GMT" + "Mon, 19 Oct 2020 17:43:48 GMT" ], "Content-Length": [ "0" diff --git a/sdk/cognitiveservices/Knowledge.QnAMaker/tests/SessionRecords/QnAMakerKnowledgebaseTests/QnAMakerKnowledgebaseCrud.json b/sdk/cognitiveservices/Knowledge.QnAMaker/tests/SessionRecords/QnAMakerKnowledgebaseTests/QnAMakerKnowledgebaseCrud.json index 73a601d37999..8b9ec633a318 100644 --- a/sdk/cognitiveservices/Knowledge.QnAMaker/tests/SessionRecords/QnAMakerKnowledgebaseTests/QnAMakerKnowledgebaseCrud.json +++ b/sdk/cognitiveservices/Knowledge.QnAMaker/tests/SessionRecords/QnAMakerKnowledgebaseTests/QnAMakerKnowledgebaseCrud.json @@ -1,19 +1,19 @@ { "Entries": [ { - "RequestUri": "/qnamaker/v4.0/knowledgebases/create", - "EncodedRequestUri": "L3FuYW1ha2VyL3Y0LjAva25vd2xlZGdlYmFzZXMvY3JlYXRl", + "RequestUri": "/qnamaker/v5.0-preview.1/knowledgebases/create", + "EncodedRequestUri": "L3FuYW1ha2VyL3Y1LjAtcHJldmlldy4xL2tub3dsZWRnZWJhc2VzL2NyZWF0ZQ==", "RequestMethod": "POST", "RequestBody": "{\r\n \"name\": \"testqna\",\r\n \"qnaList\": [\r\n {\r\n \"answer\": \"hello\",\r\n \"questions\": [\r\n \"hi\"\r\n ]\r\n }\r\n ]\r\n}", "RequestHeaders": { "Ocp-Apim-Subscription-Key": [ - "" + "7afcaa16ba1747328eb7a77de8316445" ], "User-Agent": [ - "FxVersion/4.6.26614.01", + "FxVersion/4.6.29220.03", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.17763.", - "Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.QnAMakerClient/2.2.0.0" + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.QnAMakerClient/2.1.0.0" ], "Content-Type": [ "application/json; charset=utf-8" @@ -23,576 +23,396 @@ ] }, "ResponseHeaders": { - "Date": [ - "Thu, 22 Nov 2018 11:20:16 GMT" - ], "Location": [ - "/operations/f6b7ab17-dca2-47e9-9af8-afbb18cef86e" + "/operations/778b1802-f592-41e6-80be-5b94c1f9ae18" ], - "X-Content-Type-Options": [ - "nosniff" - ], - "X-Powered-By": [ - "ASP.NET" + "x-envoy-upstream-service-time": [ + "210" ], "apim-request-id": [ - "d14c86ef-89d0-428e-bbf8-eefd45d1a87b" + "0976a557-e0de-4b8f-858b-2bf1e50eb9b5" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains; preload" ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Mon, 19 Oct 2020 17:43:14 GMT" + ], "Content-Length": [ - "242" + "252" ], "Content-Type": [ "application/json; charset=utf-8" ] }, - "ResponseBody": "{\r\n \"operationState\": \"NotStarted\",\r\n \"createdTimestamp\": \"2018-11-22T11:20:16Z\",\r\n \"lastActionTimestamp\": \"2018-11-22T11:20:16Z\",\r\n \"userId\": \"d2749ec6c84549b291aba09d0f56ede2\",\r\n \"operationId\": \"f6b7ab17-dca2-47e9-9af8-afbb18cef86e\"\r\n}", + "ResponseBody": "{\r\n \"operationState\": \"NotStarted\",\r\n \"createdTimestamp\": \"2020-10-19T17:43:14.7315453Z\",\r\n \"lastActionTimestamp\": \"2020-10-19T17:43:14.7315453Z\",\r\n \"userId\": \"120771e22f1f4c48a48d50c9f8086de4\",\r\n \"operationId\": \"778b1802-f592-41e6-80be-5b94c1f9ae18\"\r\n}", "StatusCode": 202 }, { - "RequestUri": "/qnamaker/v4.0/operations/f6b7ab17-dca2-47e9-9af8-afbb18cef86e", - "EncodedRequestUri": "L3FuYW1ha2VyL3Y0LjAvb3BlcmF0aW9ucy9mNmI3YWIxNy1kY2EyLTQ3ZTktOWFmOC1hZmJiMThjZWY4NmU=", + "RequestUri": "/qnamaker/v5.0-preview.1/operations/778b1802-f592-41e6-80be-5b94c1f9ae18", + "EncodedRequestUri": "L3FuYW1ha2VyL3Y1LjAtcHJldmlldy4xL29wZXJhdGlvbnMvNzc4YjE4MDItZjU5Mi00MWU2LTgwYmUtNWI5NGMxZjlhZTE4", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "Ocp-Apim-Subscription-Key": [ - "" + "7afcaa16ba1747328eb7a77de8316445" ], "User-Agent": [ - "FxVersion/4.6.26614.01", + "FxVersion/4.6.29220.03", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.17763.", - "Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.QnAMakerClient/2.2.0.0" + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.QnAMakerClient/2.1.0.0" ] }, "ResponseHeaders": { - "Date": [ - "Thu, 22 Nov 2018 11:20:17 GMT" - ], "Retry-After": [ - "30" + "00:00:30" ], - "X-Content-Type-Options": [ - "nosniff" - ], - "X-Powered-By": [ - "ASP.NET" + "x-envoy-upstream-service-time": [ + "6" ], "apim-request-id": [ - "3a081f44-96fa-42b6-b594-ad34e10dcaae" + "6f81a5aa-973d-4c78-9ddb-51937c0c1091" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains; preload" ], - "Content-Length": [ - "239" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ] - }, - "ResponseBody": "{\r\n \"operationState\": \"Running\",\r\n \"createdTimestamp\": \"2018-11-22T11:20:16Z\",\r\n \"lastActionTimestamp\": \"2018-11-22T11:20:17Z\",\r\n \"userId\": \"d2749ec6c84549b291aba09d0f56ede2\",\r\n \"operationId\": \"f6b7ab17-dca2-47e9-9af8-afbb18cef86e\"\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/qnamaker/v4.0/operations/f6b7ab17-dca2-47e9-9af8-afbb18cef86e", - "EncodedRequestUri": "L3FuYW1ha2VyL3Y0LjAvb3BlcmF0aW9ucy9mNmI3YWIxNy1kY2EyLTQ3ZTktOWFmOC1hZmJiMThjZWY4NmU=", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "Ocp-Apim-Subscription-Key": [ - "" - ], - "User-Agent": [ - "FxVersion/4.6.26614.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.17763.", - "Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.QnAMakerClient/2.2.0.0" - ] - }, - "ResponseHeaders": { - "Date": [ - "Thu, 22 Nov 2018 11:20:19 GMT" - ], - "Retry-After": [ - "30" - ], "X-Content-Type-Options": [ "nosniff" ], - "X-Powered-By": [ - "ASP.NET" - ], - "apim-request-id": [ - "15885448-127f-49da-9584-b9963c5d34ba" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains; preload" + "Date": [ + "Mon, 19 Oct 2020 17:43:15 GMT" ], "Content-Length": [ - "239" + "243" ], "Content-Type": [ "application/json; charset=utf-8" ] }, - "ResponseBody": "{\r\n \"operationState\": \"Running\",\r\n \"createdTimestamp\": \"2018-11-22T11:20:16Z\",\r\n \"lastActionTimestamp\": \"2018-11-22T11:20:17Z\",\r\n \"userId\": \"d2749ec6c84549b291aba09d0f56ede2\",\r\n \"operationId\": \"f6b7ab17-dca2-47e9-9af8-afbb18cef86e\"\r\n}", + "ResponseBody": "{\r\n \"operationState\": \"Running\",\r\n \"createdTimestamp\": \"2020-10-19T23:13:14+05:30\",\r\n \"lastActionTimestamp\": \"2020-10-19T23:13:15+05:30\",\r\n \"userId\": \"120771e22f1f4c48a48d50c9f8086de4\",\r\n \"operationId\": \"778b1802-f592-41e6-80be-5b94c1f9ae18\"\r\n}", "StatusCode": 200 }, { - "RequestUri": "/qnamaker/v4.0/operations/f6b7ab17-dca2-47e9-9af8-afbb18cef86e", - "EncodedRequestUri": "L3FuYW1ha2VyL3Y0LjAvb3BlcmF0aW9ucy9mNmI3YWIxNy1kY2EyLTQ3ZTktOWFmOC1hZmJiMThjZWY4NmU=", + "RequestUri": "/qnamaker/v5.0-preview.1/operations/778b1802-f592-41e6-80be-5b94c1f9ae18", + "EncodedRequestUri": "L3FuYW1ha2VyL3Y1LjAtcHJldmlldy4xL29wZXJhdGlvbnMvNzc4YjE4MDItZjU5Mi00MWU2LTgwYmUtNWI5NGMxZjlhZTE4", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "Ocp-Apim-Subscription-Key": [ - "" + "7afcaa16ba1747328eb7a77de8316445" ], "User-Agent": [ - "FxVersion/4.6.26614.01", + "FxVersion/4.6.29220.03", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.17763.", - "Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.QnAMakerClient/2.2.0.0" + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.QnAMakerClient/2.1.0.0" ] }, "ResponseHeaders": { - "Date": [ - "Thu, 22 Nov 2018 11:20:20 GMT" - ], "Retry-After": [ - "30" - ], - "X-Content-Type-Options": [ - "nosniff" + "00:00:30" ], - "X-Powered-By": [ - "ASP.NET" + "x-envoy-upstream-service-time": [ + "8" ], "apim-request-id": [ - "632f593a-5bc1-4e34-a837-f176d08cae02" + "71c8511e-8d19-4f8a-9de1-6eb5a9d1bed5" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains; preload" ], - "Content-Length": [ - "239" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ] - }, - "ResponseBody": "{\r\n \"operationState\": \"Running\",\r\n \"createdTimestamp\": \"2018-11-22T11:20:16Z\",\r\n \"lastActionTimestamp\": \"2018-11-22T11:20:17Z\",\r\n \"userId\": \"d2749ec6c84549b291aba09d0f56ede2\",\r\n \"operationId\": \"f6b7ab17-dca2-47e9-9af8-afbb18cef86e\"\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/qnamaker/v4.0/operations/f6b7ab17-dca2-47e9-9af8-afbb18cef86e", - "EncodedRequestUri": "L3FuYW1ha2VyL3Y0LjAvb3BlcmF0aW9ucy9mNmI3YWIxNy1kY2EyLTQ3ZTktOWFmOC1hZmJiMThjZWY4NmU=", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "Ocp-Apim-Subscription-Key": [ - "" - ], - "User-Agent": [ - "FxVersion/4.6.26614.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.17763.", - "Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.QnAMakerClient/2.2.0.0" - ] - }, - "ResponseHeaders": { - "Date": [ - "Thu, 22 Nov 2018 11:20:21 GMT" - ], - "Retry-After": [ - "30" - ], "X-Content-Type-Options": [ "nosniff" ], - "X-Powered-By": [ - "ASP.NET" - ], - "apim-request-id": [ - "b13fcd6a-d72c-4d7c-9398-a40ec9025a0f" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains; preload" + "Date": [ + "Mon, 19 Oct 2020 17:43:16 GMT" ], "Content-Length": [ - "239" + "243" ], "Content-Type": [ "application/json; charset=utf-8" ] }, - "ResponseBody": "{\r\n \"operationState\": \"Running\",\r\n \"createdTimestamp\": \"2018-11-22T11:20:16Z\",\r\n \"lastActionTimestamp\": \"2018-11-22T11:20:17Z\",\r\n \"userId\": \"d2749ec6c84549b291aba09d0f56ede2\",\r\n \"operationId\": \"f6b7ab17-dca2-47e9-9af8-afbb18cef86e\"\r\n}", + "ResponseBody": "{\r\n \"operationState\": \"Running\",\r\n \"createdTimestamp\": \"2020-10-19T23:13:14+05:30\",\r\n \"lastActionTimestamp\": \"2020-10-19T23:13:15+05:30\",\r\n \"userId\": \"120771e22f1f4c48a48d50c9f8086de4\",\r\n \"operationId\": \"778b1802-f592-41e6-80be-5b94c1f9ae18\"\r\n}", "StatusCode": 200 }, { - "RequestUri": "/qnamaker/v4.0/operations/f6b7ab17-dca2-47e9-9af8-afbb18cef86e", - "EncodedRequestUri": "L3FuYW1ha2VyL3Y0LjAvb3BlcmF0aW9ucy9mNmI3YWIxNy1kY2EyLTQ3ZTktOWFmOC1hZmJiMThjZWY4NmU=", + "RequestUri": "/qnamaker/v5.0-preview.1/operations/778b1802-f592-41e6-80be-5b94c1f9ae18", + "EncodedRequestUri": "L3FuYW1ha2VyL3Y1LjAtcHJldmlldy4xL29wZXJhdGlvbnMvNzc4YjE4MDItZjU5Mi00MWU2LTgwYmUtNWI5NGMxZjlhZTE4", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "Ocp-Apim-Subscription-Key": [ - "" + "7afcaa16ba1747328eb7a77de8316445" ], "User-Agent": [ - "FxVersion/4.6.26614.01", + "FxVersion/4.6.29220.03", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.17763.", - "Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.QnAMakerClient/2.2.0.0" + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.QnAMakerClient/2.1.0.0" ] }, "ResponseHeaders": { - "Date": [ - "Thu, 22 Nov 2018 11:20:22 GMT" - ], "Retry-After": [ - "30" + "00:00:30" ], - "X-Content-Type-Options": [ - "nosniff" - ], - "X-Powered-By": [ - "ASP.NET" + "x-envoy-upstream-service-time": [ + "7" ], "apim-request-id": [ - "f85a41f2-3843-4194-bc0c-418f35452f70" + "d6cb06c6-23f8-4bf0-8fea-48082280fe78" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains; preload" ], - "Content-Length": [ - "239" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ] - }, - "ResponseBody": "{\r\n \"operationState\": \"Running\",\r\n \"createdTimestamp\": \"2018-11-22T11:20:16Z\",\r\n \"lastActionTimestamp\": \"2018-11-22T11:20:17Z\",\r\n \"userId\": \"d2749ec6c84549b291aba09d0f56ede2\",\r\n \"operationId\": \"f6b7ab17-dca2-47e9-9af8-afbb18cef86e\"\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/qnamaker/v4.0/operations/f6b7ab17-dca2-47e9-9af8-afbb18cef86e", - "EncodedRequestUri": "L3FuYW1ha2VyL3Y0LjAvb3BlcmF0aW9ucy9mNmI3YWIxNy1kY2EyLTQ3ZTktOWFmOC1hZmJiMThjZWY4NmU=", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "Ocp-Apim-Subscription-Key": [ - "" - ], - "User-Agent": [ - "FxVersion/4.6.26614.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.17763.", - "Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.QnAMakerClient/2.2.0.0" - ] - }, - "ResponseHeaders": { - "Date": [ - "Thu, 22 Nov 2018 11:20:23 GMT" - ], - "Retry-After": [ - "30" - ], "X-Content-Type-Options": [ "nosniff" ], - "X-Powered-By": [ - "ASP.NET" - ], - "apim-request-id": [ - "e92cec35-15c9-4770-897b-cdf9c2432b45" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains; preload" + "Date": [ + "Mon, 19 Oct 2020 17:43:18 GMT" ], "Content-Length": [ - "239" + "243" ], "Content-Type": [ "application/json; charset=utf-8" ] }, - "ResponseBody": "{\r\n \"operationState\": \"Running\",\r\n \"createdTimestamp\": \"2018-11-22T11:20:16Z\",\r\n \"lastActionTimestamp\": \"2018-11-22T11:20:17Z\",\r\n \"userId\": \"d2749ec6c84549b291aba09d0f56ede2\",\r\n \"operationId\": \"f6b7ab17-dca2-47e9-9af8-afbb18cef86e\"\r\n}", + "ResponseBody": "{\r\n \"operationState\": \"Running\",\r\n \"createdTimestamp\": \"2020-10-19T23:13:14+05:30\",\r\n \"lastActionTimestamp\": \"2020-10-19T23:13:15+05:30\",\r\n \"userId\": \"120771e22f1f4c48a48d50c9f8086de4\",\r\n \"operationId\": \"778b1802-f592-41e6-80be-5b94c1f9ae18\"\r\n}", "StatusCode": 200 }, { - "RequestUri": "/qnamaker/v4.0/operations/f6b7ab17-dca2-47e9-9af8-afbb18cef86e", - "EncodedRequestUri": "L3FuYW1ha2VyL3Y0LjAvb3BlcmF0aW9ucy9mNmI3YWIxNy1kY2EyLTQ3ZTktOWFmOC1hZmJiMThjZWY4NmU=", + "RequestUri": "/qnamaker/v5.0-preview.1/operations/778b1802-f592-41e6-80be-5b94c1f9ae18", + "EncodedRequestUri": "L3FuYW1ha2VyL3Y1LjAtcHJldmlldy4xL29wZXJhdGlvbnMvNzc4YjE4MDItZjU5Mi00MWU2LTgwYmUtNWI5NGMxZjlhZTE4", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "Ocp-Apim-Subscription-Key": [ - "" + "7afcaa16ba1747328eb7a77de8316445" ], "User-Agent": [ - "FxVersion/4.6.26614.01", + "FxVersion/4.6.29220.03", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.17763.", - "Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.QnAMakerClient/2.2.0.0" + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.QnAMakerClient/2.1.0.0" ] }, "ResponseHeaders": { - "Date": [ - "Thu, 22 Nov 2018 11:20:25 GMT" - ], "Retry-After": [ - "30" - ], - "X-Content-Type-Options": [ - "nosniff" + "00:00:30" ], - "X-Powered-By": [ - "ASP.NET" + "x-envoy-upstream-service-time": [ + "8" ], "apim-request-id": [ - "450c11f0-b34d-4d65-9cba-ac8d03383b83" + "5c378cb1-7968-4bf2-add3-9b3acca0f8fe" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains; preload" ], - "Content-Length": [ - "239" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ] - }, - "ResponseBody": "{\r\n \"operationState\": \"Running\",\r\n \"createdTimestamp\": \"2018-11-22T11:20:16Z\",\r\n \"lastActionTimestamp\": \"2018-11-22T11:20:17Z\",\r\n \"userId\": \"d2749ec6c84549b291aba09d0f56ede2\",\r\n \"operationId\": \"f6b7ab17-dca2-47e9-9af8-afbb18cef86e\"\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/qnamaker/v4.0/operations/f6b7ab17-dca2-47e9-9af8-afbb18cef86e", - "EncodedRequestUri": "L3FuYW1ha2VyL3Y0LjAvb3BlcmF0aW9ucy9mNmI3YWIxNy1kY2EyLTQ3ZTktOWFmOC1hZmJiMThjZWY4NmU=", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "Ocp-Apim-Subscription-Key": [ - "" - ], - "User-Agent": [ - "FxVersion/4.6.26614.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.17763.", - "Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.QnAMakerClient/2.2.0.0" - ] - }, - "ResponseHeaders": { - "Date": [ - "Thu, 22 Nov 2018 11:20:26 GMT" - ], - "Retry-After": [ - "30" - ], "X-Content-Type-Options": [ "nosniff" ], - "X-Powered-By": [ - "ASP.NET" - ], - "apim-request-id": [ - "bfbf3a48-5b2b-4a0e-b040-bb68f42dfdb2" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains; preload" + "Date": [ + "Mon, 19 Oct 2020 17:43:19 GMT" ], "Content-Length": [ - "239" + "243" ], "Content-Type": [ "application/json; charset=utf-8" ] }, - "ResponseBody": "{\r\n \"operationState\": \"Running\",\r\n \"createdTimestamp\": \"2018-11-22T11:20:16Z\",\r\n \"lastActionTimestamp\": \"2018-11-22T11:20:17Z\",\r\n \"userId\": \"d2749ec6c84549b291aba09d0f56ede2\",\r\n \"operationId\": \"f6b7ab17-dca2-47e9-9af8-afbb18cef86e\"\r\n}", + "ResponseBody": "{\r\n \"operationState\": \"Running\",\r\n \"createdTimestamp\": \"2020-10-19T23:13:14+05:30\",\r\n \"lastActionTimestamp\": \"2020-10-19T23:13:15+05:30\",\r\n \"userId\": \"120771e22f1f4c48a48d50c9f8086de4\",\r\n \"operationId\": \"778b1802-f592-41e6-80be-5b94c1f9ae18\"\r\n}", "StatusCode": 200 }, { - "RequestUri": "/qnamaker/v4.0/operations/f6b7ab17-dca2-47e9-9af8-afbb18cef86e", - "EncodedRequestUri": "L3FuYW1ha2VyL3Y0LjAvb3BlcmF0aW9ucy9mNmI3YWIxNy1kY2EyLTQ3ZTktOWFmOC1hZmJiMThjZWY4NmU=", + "RequestUri": "/qnamaker/v5.0-preview.1/operations/778b1802-f592-41e6-80be-5b94c1f9ae18", + "EncodedRequestUri": "L3FuYW1ha2VyL3Y1LjAtcHJldmlldy4xL29wZXJhdGlvbnMvNzc4YjE4MDItZjU5Mi00MWU2LTgwYmUtNWI5NGMxZjlhZTE4", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "Ocp-Apim-Subscription-Key": [ - "" + "7afcaa16ba1747328eb7a77de8316445" ], "User-Agent": [ - "FxVersion/4.6.26614.01", + "FxVersion/4.6.29220.03", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.17763.", - "Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.QnAMakerClient/2.2.0.0" + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.QnAMakerClient/2.1.0.0" ] }, "ResponseHeaders": { - "Date": [ - "Thu, 22 Nov 2018 11:20:27 GMT" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "X-Powered-By": [ - "ASP.NET" + "x-envoy-upstream-service-time": [ + "7" ], "apim-request-id": [ - "d0bf9bc5-f020-4155-b7f1-003e7af1b301" + "074897c3-2c26-4cd7-bbad-5d47fca3793f" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains; preload" ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Mon, 19 Oct 2020 17:43:20 GMT" + ], "Content-Length": [ - "320" + "323" ], "Content-Type": [ "application/json; charset=utf-8" ] }, - "ResponseBody": "{\r\n \"operationState\": \"Succeeded\",\r\n \"createdTimestamp\": \"2018-11-22T11:20:16Z\",\r\n \"lastActionTimestamp\": \"2018-11-22T11:20:27Z\",\r\n \"resourceLocation\": \"/knowledgebases/b2f95ec5-0d5f-40b6-a7d1-904aa6bb45b2\",\r\n \"userId\": \"d2749ec6c84549b291aba09d0f56ede2\",\r\n \"operationId\": \"f6b7ab17-dca2-47e9-9af8-afbb18cef86e\"\r\n}", + "ResponseBody": "{\r\n \"operationState\": \"Succeeded\",\r\n \"createdTimestamp\": \"2020-10-19T23:13:14+05:30\",\r\n \"lastActionTimestamp\": \"2020-10-19T23:13:20+05:30\",\r\n \"resourceLocation\": \"/knowledgebases/57a001ad-0626-4724-84c8-7eb0c17a7212\",\r\n \"userId\": \"120771e22f1f4c48a48d50c9f8086de4\",\r\n \"operationId\": \"778b1802-f592-41e6-80be-5b94c1f9ae18\"\r\n}", "StatusCode": 200 }, { - "RequestUri": "/qnamaker/v4.0/knowledgebases/b2f95ec5-0d5f-40b6-a7d1-904aa6bb45b2", - "EncodedRequestUri": "L3FuYW1ha2VyL3Y0LjAva25vd2xlZGdlYmFzZXMvYjJmOTVlYzUtMGQ1Zi00MGI2LWE3ZDEtOTA0YWE2YmI0NWIy", + "RequestUri": "/qnamaker/v5.0-preview.1/knowledgebases/57a001ad-0626-4724-84c8-7eb0c17a7212", + "EncodedRequestUri": "L3FuYW1ha2VyL3Y1LjAtcHJldmlldy4xL2tub3dsZWRnZWJhc2VzLzU3YTAwMWFkLTA2MjYtNDcyNC04NGM4LTdlYjBjMTdhNzIxMg==", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "Ocp-Apim-Subscription-Key": [ - "" + "7afcaa16ba1747328eb7a77de8316445" ], "User-Agent": [ - "FxVersion/4.6.26614.01", + "FxVersion/4.6.29220.03", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.17763.", - "Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.QnAMakerClient/2.2.0.0" + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.QnAMakerClient/2.1.0.0" ] }, "ResponseHeaders": { - "Date": [ - "Thu, 22 Nov 2018 11:20:27 GMT" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "X-Powered-By": [ - "ASP.NET" + "x-envoy-upstream-service-time": [ + "7" ], "apim-request-id": [ - "f4d57894-7c1e-449b-ad79-e4a3f71df763" + "d2a0a4e0-2540-4a57-9462-31c679c4e46d" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains; preload" ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Mon, 19 Oct 2020 17:43:20 GMT" + ], "Content-Length": [ - "353" + "431" ], "Content-Type": [ "application/json; charset=utf-8" ] }, - "ResponseBody": "{\r\n \"id\": \"b2f95ec5-0d5f-40b6-a7d1-904aa6bb45b2\",\r\n \"hostName\": \"https://qnamakerintegrationtestppega.azurewebsites.net\",\r\n \"lastAccessedTimestamp\": \"2018-11-22T11:20:17Z\",\r\n \"lastChangedTimestamp\": \"2018-11-22T11:20:17Z\",\r\n \"name\": \"testqna\",\r\n \"userId\": \"d2749ec6c84549b291aba09d0f56ede2\",\r\n \"urls\": [],\r\n \"sources\": [\r\n \"Editorial\"\r\n ]\r\n}", + "ResponseBody": "{\r\n \"id\": \"57a001ad-0626-4724-84c8-7eb0c17a7212\",\r\n \"hostName\": \"https://sk4cs.azurewebsites.net\",\r\n \"lastAccessedTimestamp\": \"2020-10-19T17:43:18Z\",\r\n \"lastChangedTimestamp\": \"2020-10-19T17:43:18Z\",\r\n \"name\": \"testqna\",\r\n \"userId\": \"120771e22f1f4c48a48d50c9f8086de4\",\r\n \"urls\": [],\r\n \"sources\": [\r\n \"Editorial\"\r\n ],\r\n \"language\": \"English\",\r\n \"enableHierarchicalExtraction\": false,\r\n \"createdTimestamp\": \"2020-10-19T17:43:18Z\"\r\n}", "StatusCode": 200 }, { - "RequestUri": "/qnamaker/v4.0/knowledgebases/b2f95ec5-0d5f-40b6-a7d1-904aa6bb45b2/Test/qna", - "EncodedRequestUri": "L3FuYW1ha2VyL3Y0LjAva25vd2xlZGdlYmFzZXMvYjJmOTVlYzUtMGQ1Zi00MGI2LWE3ZDEtOTA0YWE2YmI0NWIyL1Rlc3QvcW5h", + "RequestUri": "/qnamaker/v5.0-preview.1/knowledgebases/57a001ad-0626-4724-84c8-7eb0c17a7212/Test/qna", + "EncodedRequestUri": "L3FuYW1ha2VyL3Y1LjAtcHJldmlldy4xL2tub3dsZWRnZWJhc2VzLzU3YTAwMWFkLTA2MjYtNDcyNC04NGM4LTdlYjBjMTdhNzIxMi9UZXN0L3FuYQ==", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "Ocp-Apim-Subscription-Key": [ - "" + "7afcaa16ba1747328eb7a77de8316445" ], "User-Agent": [ - "FxVersion/4.6.26614.01", + "FxVersion/4.6.29220.03", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.17763.", - "Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.QnAMakerClient/2.2.0.0" + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.QnAMakerClient/2.1.0.0" ] }, "ResponseHeaders": { - "Date": [ - "Thu, 22 Nov 2018 11:20:27 GMT" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "X-Powered-By": [ - "ASP.NET" + "x-envoy-upstream-service-time": [ + "233" ], "apim-request-id": [ - "0b3f4ee9-2450-4df0-b271-67e7aa1dfc4d" + "e5a096b5-d8ac-4676-b511-d886dea7d32a" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains; preload" ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Mon, 19 Oct 2020 17:43:21 GMT" + ], "Content-Length": [ - "184" + "359" ], "Content-Type": [ "application/json; charset=utf-8" ] }, - "ResponseBody": "{\r\n \"qnaDocuments\": [\r\n {\r\n \"id\": 1,\r\n \"answer\": \"hello\",\r\n \"source\": \"Editorial\",\r\n \"questions\": [\r\n \"hi\"\r\n ],\r\n \"metadata\": []\r\n }\r\n ]\r\n}", + "ResponseBody": "{\r\n \"qnaDocuments\": [\r\n {\r\n \"id\": 1,\r\n \"answer\": \"hello\",\r\n \"source\": \"Editorial\",\r\n \"questions\": [\r\n \"hi\"\r\n ],\r\n \"metadata\": [],\r\n \"alternateQuestionClusters\": [],\r\n \"context\": {\r\n \"isContextOnly\": false,\r\n \"prompts\": []\r\n },\r\n \"lastUpdatedTimestampUTC\": \"2020-10-19T23:13:18.396+05:30\"\r\n }\r\n ]\r\n}", "StatusCode": 200 }, { - "RequestUri": "/qnamaker/v4.0/knowledgebases/b2f95ec5-0d5f-40b6-a7d1-904aa6bb45b2/Test/qna", - "EncodedRequestUri": "L3FuYW1ha2VyL3Y0LjAva25vd2xlZGdlYmFzZXMvYjJmOTVlYzUtMGQ1Zi00MGI2LWE3ZDEtOTA0YWE2YmI0NWIyL1Rlc3QvcW5h", + "RequestUri": "/qnamaker/v5.0-preview.1/knowledgebases/57a001ad-0626-4724-84c8-7eb0c17a7212/Test/qna", + "EncodedRequestUri": "L3FuYW1ha2VyL3Y1LjAtcHJldmlldy4xL2tub3dsZWRnZWJhc2VzLzU3YTAwMWFkLTA2MjYtNDcyNC04NGM4LTdlYjBjMTdhNzIxMi9UZXN0L3FuYQ==", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "Ocp-Apim-Subscription-Key": [ - "" + "7afcaa16ba1747328eb7a77de8316445" ], "User-Agent": [ - "FxVersion/4.6.26614.01", + "FxVersion/4.6.29220.03", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.17763.", - "Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.QnAMakerClient/2.2.0.0" + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.QnAMakerClient/2.1.0.0" ] }, "ResponseHeaders": { - "Date": [ - "Thu, 22 Nov 2018 11:20:40 GMT" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "X-Powered-By": [ - "ASP.NET" + "x-envoy-upstream-service-time": [ + "268" ], "apim-request-id": [ - "25380ee1-f1d8-443d-ba65-06785af6acb9" + "0df989d8-73fe-4410-8071-40d67c2d62cb" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains; preload" ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Mon, 19 Oct 2020 17:43:25 GMT" + ], "Content-Length": [ - "342" + "694" ], "Content-Type": [ "application/json; charset=utf-8" ] }, - "ResponseBody": "{\r\n \"qnaDocuments\": [\r\n {\r\n \"id\": 1,\r\n \"answer\": \"hello\",\r\n \"source\": \"Editorial\",\r\n \"questions\": [\r\n \"hi\"\r\n ],\r\n \"metadata\": []\r\n },\r\n {\r\n \"id\": 2,\r\n \"answer\": \"goodbye\",\r\n \"source\": \"Editorial\",\r\n \"questions\": [\r\n \"bye\"\r\n ],\r\n \"metadata\": []\r\n }\r\n ]\r\n}", + "ResponseBody": "{\r\n \"qnaDocuments\": [\r\n {\r\n \"id\": 1,\r\n \"answer\": \"hello\",\r\n \"source\": \"Editorial\",\r\n \"questions\": [\r\n \"hi\"\r\n ],\r\n \"metadata\": [],\r\n \"alternateQuestionClusters\": [],\r\n \"context\": {\r\n \"isContextOnly\": false,\r\n \"prompts\": []\r\n },\r\n \"lastUpdatedTimestampUTC\": \"2020-10-19T23:13:18.396+05:30\"\r\n },\r\n {\r\n \"id\": 2,\r\n \"answer\": \"goodbye\",\r\n \"source\": \"Editorial\",\r\n \"questions\": [\r\n \"bye\"\r\n ],\r\n \"metadata\": [],\r\n \"alternateQuestionClusters\": [],\r\n \"context\": {\r\n \"isContextOnly\": false,\r\n \"prompts\": []\r\n },\r\n \"lastUpdatedTimestampUTC\": \"2020-10-19T23:13:23.53+05:30\"\r\n }\r\n ]\r\n}", "StatusCode": 200 }, { - "RequestUri": "/qnamaker/v4.0/knowledgebases/b2f95ec5-0d5f-40b6-a7d1-904aa6bb45b2", - "EncodedRequestUri": "L3FuYW1ha2VyL3Y0LjAva25vd2xlZGdlYmFzZXMvYjJmOTVlYzUtMGQ1Zi00MGI2LWE3ZDEtOTA0YWE2YmI0NWIy", + "RequestUri": "/qnamaker/v5.0-preview.1/knowledgebases/57a001ad-0626-4724-84c8-7eb0c17a7212", + "EncodedRequestUri": "L3FuYW1ha2VyL3Y1LjAtcHJldmlldy4xL2tub3dsZWRnZWJhc2VzLzU3YTAwMWFkLTA2MjYtNDcyNC04NGM4LTdlYjBjMTdhNzIxMg==", "RequestMethod": "PATCH", "RequestBody": "{\r\n \"add\": {\r\n \"qnaList\": [\r\n {\r\n \"answer\": \"goodbye\",\r\n \"questions\": [\r\n \"bye\"\r\n ]\r\n }\r\n ]\r\n }\r\n}", "RequestHeaders": { "Ocp-Apim-Subscription-Key": [ - "" + "7afcaa16ba1747328eb7a77de8316445" ], "User-Agent": [ - "FxVersion/4.6.26614.01", + "FxVersion/4.6.29220.03", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.17763.", - "Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.QnAMakerClient/2.2.0.0" + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.QnAMakerClient/2.1.0.0" ], "Content-Type": [ "application/json; charset=utf-8" @@ -602,467 +422,197 @@ ] }, "ResponseHeaders": { - "Date": [ - "Thu, 22 Nov 2018 11:20:28 GMT" - ], "Location": [ - "/operations/38059ef3-15ce-4782-9cfc-c9d914e77730" - ], - "X-Content-Type-Options": [ - "nosniff" + "/operations/ac91f0a1-82d8-469f-a729-36111b7d4516" ], - "X-Powered-By": [ - "ASP.NET" + "x-envoy-upstream-service-time": [ + "47" ], "apim-request-id": [ - "7b9a6f4f-a3b2-44d3-8fb2-8aa74da8138c" + "a2c14574-0642-4701-9010-e7caa0a6c513" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains; preload" ], - "Content-Length": [ - "242" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ] - }, - "ResponseBody": "{\r\n \"operationState\": \"NotStarted\",\r\n \"createdTimestamp\": \"2018-11-22T11:20:28Z\",\r\n \"lastActionTimestamp\": \"2018-11-22T11:20:28Z\",\r\n \"userId\": \"d2749ec6c84549b291aba09d0f56ede2\",\r\n \"operationId\": \"38059ef3-15ce-4782-9cfc-c9d914e77730\"\r\n}", - "StatusCode": 202 - }, - { - "RequestUri": "/qnamaker/v4.0/operations/38059ef3-15ce-4782-9cfc-c9d914e77730", - "EncodedRequestUri": "L3FuYW1ha2VyL3Y0LjAvb3BlcmF0aW9ucy8zODA1OWVmMy0xNWNlLTQ3ODItOWNmYy1jOWQ5MTRlNzc3MzA=", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "Ocp-Apim-Subscription-Key": [ - "" - ], - "User-Agent": [ - "FxVersion/4.6.26614.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.17763.", - "Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.QnAMakerClient/2.2.0.0" - ] - }, - "ResponseHeaders": { - "Date": [ - "Thu, 22 Nov 2018 11:20:29 GMT" - ], - "Retry-After": [ - "30" - ], "X-Content-Type-Options": [ "nosniff" ], - "X-Powered-By": [ - "ASP.NET" - ], - "apim-request-id": [ - "0696ef9c-7fcc-46d1-b413-04f3e363bcb6" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains; preload" - ], - "Content-Length": [ - "239" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ] - }, - "ResponseBody": "{\r\n \"operationState\": \"Running\",\r\n \"createdTimestamp\": \"2018-11-22T11:20:28Z\",\r\n \"lastActionTimestamp\": \"2018-11-22T11:20:29Z\",\r\n \"userId\": \"d2749ec6c84549b291aba09d0f56ede2\",\r\n \"operationId\": \"38059ef3-15ce-4782-9cfc-c9d914e77730\"\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/qnamaker/v4.0/operations/38059ef3-15ce-4782-9cfc-c9d914e77730", - "EncodedRequestUri": "L3FuYW1ha2VyL3Y0LjAvb3BlcmF0aW9ucy8zODA1OWVmMy0xNWNlLTQ3ODItOWNmYy1jOWQ5MTRlNzc3MzA=", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "Ocp-Apim-Subscription-Key": [ - "" - ], - "User-Agent": [ - "FxVersion/4.6.26614.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.17763.", - "Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.QnAMakerClient/2.2.0.0" - ] - }, - "ResponseHeaders": { "Date": [ - "Thu, 22 Nov 2018 11:20:31 GMT" - ], - "Retry-After": [ - "30" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "X-Powered-By": [ - "ASP.NET" - ], - "apim-request-id": [ - "3104aeac-e35f-4d11-8edb-095259885ae7" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains; preload" + "Mon, 19 Oct 2020 17:43:21 GMT" ], "Content-Length": [ - "239" + "252" ], "Content-Type": [ "application/json; charset=utf-8" ] }, - "ResponseBody": "{\r\n \"operationState\": \"Running\",\r\n \"createdTimestamp\": \"2018-11-22T11:20:28Z\",\r\n \"lastActionTimestamp\": \"2018-11-22T11:20:29Z\",\r\n \"userId\": \"d2749ec6c84549b291aba09d0f56ede2\",\r\n \"operationId\": \"38059ef3-15ce-4782-9cfc-c9d914e77730\"\r\n}", - "StatusCode": 200 + "ResponseBody": "{\r\n \"operationState\": \"NotStarted\",\r\n \"createdTimestamp\": \"2020-10-19T17:43:22.0516263Z\",\r\n \"lastActionTimestamp\": \"2020-10-19T17:43:22.0516263Z\",\r\n \"userId\": \"120771e22f1f4c48a48d50c9f8086de4\",\r\n \"operationId\": \"ac91f0a1-82d8-469f-a729-36111b7d4516\"\r\n}", + "StatusCode": 202 }, { - "RequestUri": "/qnamaker/v4.0/operations/38059ef3-15ce-4782-9cfc-c9d914e77730", - "EncodedRequestUri": "L3FuYW1ha2VyL3Y0LjAvb3BlcmF0aW9ucy8zODA1OWVmMy0xNWNlLTQ3ODItOWNmYy1jOWQ5MTRlNzc3MzA=", + "RequestUri": "/qnamaker/v5.0-preview.1/operations/ac91f0a1-82d8-469f-a729-36111b7d4516", + "EncodedRequestUri": "L3FuYW1ha2VyL3Y1LjAtcHJldmlldy4xL29wZXJhdGlvbnMvYWM5MWYwYTEtODJkOC00NjlmLWE3MjktMzYxMTFiN2Q0NTE2", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "Ocp-Apim-Subscription-Key": [ - "" + "7afcaa16ba1747328eb7a77de8316445" ], "User-Agent": [ - "FxVersion/4.6.26614.01", + "FxVersion/4.6.29220.03", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.17763.", - "Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.QnAMakerClient/2.2.0.0" + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.QnAMakerClient/2.1.0.0" ] }, "ResponseHeaders": { - "Date": [ - "Thu, 22 Nov 2018 11:20:32 GMT" - ], "Retry-After": [ - "30" - ], - "X-Content-Type-Options": [ - "nosniff" + "00:00:30" ], - "X-Powered-By": [ - "ASP.NET" + "x-envoy-upstream-service-time": [ + "6" ], "apim-request-id": [ - "25b4929b-23c0-478b-a217-e675337357c8" + "241cfbcb-f0fa-4a50-93ad-64a2d398f227" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains; preload" ], - "Content-Length": [ - "239" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ] - }, - "ResponseBody": "{\r\n \"operationState\": \"Running\",\r\n \"createdTimestamp\": \"2018-11-22T11:20:28Z\",\r\n \"lastActionTimestamp\": \"2018-11-22T11:20:29Z\",\r\n \"userId\": \"d2749ec6c84549b291aba09d0f56ede2\",\r\n \"operationId\": \"38059ef3-15ce-4782-9cfc-c9d914e77730\"\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/qnamaker/v4.0/operations/38059ef3-15ce-4782-9cfc-c9d914e77730", - "EncodedRequestUri": "L3FuYW1ha2VyL3Y0LjAvb3BlcmF0aW9ucy8zODA1OWVmMy0xNWNlLTQ3ODItOWNmYy1jOWQ5MTRlNzc3MzA=", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "Ocp-Apim-Subscription-Key": [ - "" - ], - "User-Agent": [ - "FxVersion/4.6.26614.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.17763.", - "Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.QnAMakerClient/2.2.0.0" - ] - }, - "ResponseHeaders": { - "Date": [ - "Thu, 22 Nov 2018 11:20:33 GMT" - ], - "Retry-After": [ - "30" - ], "X-Content-Type-Options": [ "nosniff" ], - "X-Powered-By": [ - "ASP.NET" - ], - "apim-request-id": [ - "63ae7805-1115-453d-92fe-0da77d847787" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains; preload" + "Date": [ + "Mon, 19 Oct 2020 17:43:22 GMT" ], "Content-Length": [ - "239" + "243" ], "Content-Type": [ "application/json; charset=utf-8" ] }, - "ResponseBody": "{\r\n \"operationState\": \"Running\",\r\n \"createdTimestamp\": \"2018-11-22T11:20:28Z\",\r\n \"lastActionTimestamp\": \"2018-11-22T11:20:29Z\",\r\n \"userId\": \"d2749ec6c84549b291aba09d0f56ede2\",\r\n \"operationId\": \"38059ef3-15ce-4782-9cfc-c9d914e77730\"\r\n}", + "ResponseBody": "{\r\n \"operationState\": \"Running\",\r\n \"createdTimestamp\": \"2020-10-19T23:13:22+05:30\",\r\n \"lastActionTimestamp\": \"2020-10-19T23:13:22+05:30\",\r\n \"userId\": \"120771e22f1f4c48a48d50c9f8086de4\",\r\n \"operationId\": \"ac91f0a1-82d8-469f-a729-36111b7d4516\"\r\n}", "StatusCode": 200 }, { - "RequestUri": "/qnamaker/v4.0/operations/38059ef3-15ce-4782-9cfc-c9d914e77730", - "EncodedRequestUri": "L3FuYW1ha2VyL3Y0LjAvb3BlcmF0aW9ucy8zODA1OWVmMy0xNWNlLTQ3ODItOWNmYy1jOWQ5MTRlNzc3MzA=", + "RequestUri": "/qnamaker/v5.0-preview.1/operations/ac91f0a1-82d8-469f-a729-36111b7d4516", + "EncodedRequestUri": "L3FuYW1ha2VyL3Y1LjAtcHJldmlldy4xL29wZXJhdGlvbnMvYWM5MWYwYTEtODJkOC00NjlmLWE3MjktMzYxMTFiN2Q0NTE2", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "Ocp-Apim-Subscription-Key": [ - "" + "7afcaa16ba1747328eb7a77de8316445" ], "User-Agent": [ - "FxVersion/4.6.26614.01", + "FxVersion/4.6.29220.03", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.17763.", - "Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.QnAMakerClient/2.2.0.0" + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.QnAMakerClient/2.1.0.0" ] }, "ResponseHeaders": { - "Date": [ - "Thu, 22 Nov 2018 11:20:34 GMT" - ], "Retry-After": [ - "30" - ], - "X-Content-Type-Options": [ - "nosniff" + "00:00:30" ], - "X-Powered-By": [ - "ASP.NET" + "x-envoy-upstream-service-time": [ + "8" ], "apim-request-id": [ - "f56a5033-eb14-40ca-88db-ccf0ba03a32f" + "6787345c-c0e2-4d44-9714-73ccb191565c" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains; preload" ], - "Content-Length": [ - "239" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ] - }, - "ResponseBody": "{\r\n \"operationState\": \"Running\",\r\n \"createdTimestamp\": \"2018-11-22T11:20:28Z\",\r\n \"lastActionTimestamp\": \"2018-11-22T11:20:29Z\",\r\n \"userId\": \"d2749ec6c84549b291aba09d0f56ede2\",\r\n \"operationId\": \"38059ef3-15ce-4782-9cfc-c9d914e77730\"\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/qnamaker/v4.0/operations/38059ef3-15ce-4782-9cfc-c9d914e77730", - "EncodedRequestUri": "L3FuYW1ha2VyL3Y0LjAvb3BlcmF0aW9ucy8zODA1OWVmMy0xNWNlLTQ3ODItOWNmYy1jOWQ5MTRlNzc3MzA=", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "Ocp-Apim-Subscription-Key": [ - "" - ], - "User-Agent": [ - "FxVersion/4.6.26614.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.17763.", - "Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.QnAMakerClient/2.2.0.0" - ] - }, - "ResponseHeaders": { - "Date": [ - "Thu, 22 Nov 2018 11:20:35 GMT" - ], - "Retry-After": [ - "30" - ], "X-Content-Type-Options": [ "nosniff" ], - "X-Powered-By": [ - "ASP.NET" - ], - "apim-request-id": [ - "c1b9cca2-143f-4485-8238-47cd49e808af" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains; preload" + "Date": [ + "Mon, 19 Oct 2020 17:43:23 GMT" ], "Content-Length": [ - "239" + "243" ], "Content-Type": [ "application/json; charset=utf-8" ] }, - "ResponseBody": "{\r\n \"operationState\": \"Running\",\r\n \"createdTimestamp\": \"2018-11-22T11:20:28Z\",\r\n \"lastActionTimestamp\": \"2018-11-22T11:20:29Z\",\r\n \"userId\": \"d2749ec6c84549b291aba09d0f56ede2\",\r\n \"operationId\": \"38059ef3-15ce-4782-9cfc-c9d914e77730\"\r\n}", + "ResponseBody": "{\r\n \"operationState\": \"Running\",\r\n \"createdTimestamp\": \"2020-10-19T23:13:22+05:30\",\r\n \"lastActionTimestamp\": \"2020-10-19T23:13:22+05:30\",\r\n \"userId\": \"120771e22f1f4c48a48d50c9f8086de4\",\r\n \"operationId\": \"ac91f0a1-82d8-469f-a729-36111b7d4516\"\r\n}", "StatusCode": 200 }, { - "RequestUri": "/qnamaker/v4.0/operations/38059ef3-15ce-4782-9cfc-c9d914e77730", - "EncodedRequestUri": "L3FuYW1ha2VyL3Y0LjAvb3BlcmF0aW9ucy8zODA1OWVmMy0xNWNlLTQ3ODItOWNmYy1jOWQ5MTRlNzc3MzA=", + "RequestUri": "/qnamaker/v5.0-preview.1/operations/ac91f0a1-82d8-469f-a729-36111b7d4516", + "EncodedRequestUri": "L3FuYW1ha2VyL3Y1LjAtcHJldmlldy4xL29wZXJhdGlvbnMvYWM5MWYwYTEtODJkOC00NjlmLWE3MjktMzYxMTFiN2Q0NTE2", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "Ocp-Apim-Subscription-Key": [ - "" + "7afcaa16ba1747328eb7a77de8316445" ], "User-Agent": [ - "FxVersion/4.6.26614.01", + "FxVersion/4.6.29220.03", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.17763.", - "Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.QnAMakerClient/2.2.0.0" + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.QnAMakerClient/2.1.0.0" ] }, "ResponseHeaders": { - "Date": [ - "Thu, 22 Nov 2018 11:20:36 GMT" - ], - "Retry-After": [ - "30" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "X-Powered-By": [ - "ASP.NET" + "x-envoy-upstream-service-time": [ + "6" ], "apim-request-id": [ - "7db84cd0-b815-4945-8be1-7e1ad5badd23" + "e43bb1cb-aab9-4042-8248-d51b9e768a57" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains; preload" ], - "Content-Length": [ - "239" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ] - }, - "ResponseBody": "{\r\n \"operationState\": \"Running\",\r\n \"createdTimestamp\": \"2018-11-22T11:20:28Z\",\r\n \"lastActionTimestamp\": \"2018-11-22T11:20:29Z\",\r\n \"userId\": \"d2749ec6c84549b291aba09d0f56ede2\",\r\n \"operationId\": \"38059ef3-15ce-4782-9cfc-c9d914e77730\"\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/qnamaker/v4.0/operations/38059ef3-15ce-4782-9cfc-c9d914e77730", - "EncodedRequestUri": "L3FuYW1ha2VyL3Y0LjAvb3BlcmF0aW9ucy8zODA1OWVmMy0xNWNlLTQ3ODItOWNmYy1jOWQ5MTRlNzc3MzA=", - "RequestMethod": "GET", - "RequestBody": "", - "RequestHeaders": { - "Ocp-Apim-Subscription-Key": [ - "" - ], - "User-Agent": [ - "FxVersion/4.6.26614.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.17763.", - "Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.QnAMakerClient/2.2.0.0" - ] - }, - "ResponseHeaders": { - "Date": [ - "Thu, 22 Nov 2018 11:20:37 GMT" - ], - "Retry-After": [ - "30" - ], "X-Content-Type-Options": [ "nosniff" ], - "X-Powered-By": [ - "ASP.NET" - ], - "apim-request-id": [ - "6586d1ea-a760-42a1-8c87-aa4bb354773d" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains; preload" + "Date": [ + "Mon, 19 Oct 2020 17:43:25 GMT" ], "Content-Length": [ - "239" + "323" ], "Content-Type": [ "application/json; charset=utf-8" ] }, - "ResponseBody": "{\r\n \"operationState\": \"Running\",\r\n \"createdTimestamp\": \"2018-11-22T11:20:28Z\",\r\n \"lastActionTimestamp\": \"2018-11-22T11:20:29Z\",\r\n \"userId\": \"d2749ec6c84549b291aba09d0f56ede2\",\r\n \"operationId\": \"38059ef3-15ce-4782-9cfc-c9d914e77730\"\r\n}", + "ResponseBody": "{\r\n \"operationState\": \"Succeeded\",\r\n \"createdTimestamp\": \"2020-10-19T23:13:22+05:30\",\r\n \"lastActionTimestamp\": \"2020-10-19T23:13:25+05:30\",\r\n \"resourceLocation\": \"/knowledgebases/57a001ad-0626-4724-84c8-7eb0c17a7212\",\r\n \"userId\": \"120771e22f1f4c48a48d50c9f8086de4\",\r\n \"operationId\": \"ac91f0a1-82d8-469f-a729-36111b7d4516\"\r\n}", "StatusCode": 200 }, { - "RequestUri": "/qnamaker/v4.0/operations/38059ef3-15ce-4782-9cfc-c9d914e77730", - "EncodedRequestUri": "L3FuYW1ha2VyL3Y0LjAvb3BlcmF0aW9ucy8zODA1OWVmMy0xNWNlLTQ3ODItOWNmYy1jOWQ5MTRlNzc3MzA=", - "RequestMethod": "GET", + "RequestUri": "/qnamaker/v5.0-preview.1/knowledgebases/57a001ad-0626-4724-84c8-7eb0c17a7212", + "EncodedRequestUri": "L3FuYW1ha2VyL3Y1LjAtcHJldmlldy4xL2tub3dsZWRnZWJhc2VzLzU3YTAwMWFkLTA2MjYtNDcyNC04NGM4LTdlYjBjMTdhNzIxMg==", + "RequestMethod": "DELETE", "RequestBody": "", "RequestHeaders": { "Ocp-Apim-Subscription-Key": [ - "" + "7afcaa16ba1747328eb7a77de8316445" ], "User-Agent": [ - "FxVersion/4.6.26614.01", + "FxVersion/4.6.29220.03", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.17763.", - "Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.QnAMakerClient/2.2.0.0" + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.QnAMakerClient/2.1.0.0" ] }, "ResponseHeaders": { - "Date": [ - "Thu, 22 Nov 2018 11:20:39 GMT" - ], - "X-Content-Type-Options": [ - "nosniff" - ], - "X-Powered-By": [ - "ASP.NET" + "x-envoy-upstream-service-time": [ + "2297" ], "apim-request-id": [ - "864a4cb8-181b-429e-a3fc-cfa4739a8400" + "76dfbe65-fdfc-43eb-8c1c-3415f08e161c" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains; preload" ], - "Content-Length": [ - "320" - ], - "Content-Type": [ - "application/json; charset=utf-8" - ] - }, - "ResponseBody": "{\r\n \"operationState\": \"Succeeded\",\r\n \"createdTimestamp\": \"2018-11-22T11:20:28Z\",\r\n \"lastActionTimestamp\": \"2018-11-22T11:20:39Z\",\r\n \"resourceLocation\": \"/knowledgebases/b2f95ec5-0d5f-40b6-a7d1-904aa6bb45b2\",\r\n \"userId\": \"d2749ec6c84549b291aba09d0f56ede2\",\r\n \"operationId\": \"38059ef3-15ce-4782-9cfc-c9d914e77730\"\r\n}", - "StatusCode": 200 - }, - { - "RequestUri": "/qnamaker/v4.0/knowledgebases/b2f95ec5-0d5f-40b6-a7d1-904aa6bb45b2", - "EncodedRequestUri": "L3FuYW1ha2VyL3Y0LjAva25vd2xlZGdlYmFzZXMvYjJmOTVlYzUtMGQ1Zi00MGI2LWE3ZDEtOTA0YWE2YmI0NWIy", - "RequestMethod": "DELETE", - "RequestBody": "", - "RequestHeaders": { - "Ocp-Apim-Subscription-Key": [ - "" - ], - "User-Agent": [ - "FxVersion/4.6.26614.01", - "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.17763.", - "Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.QnAMakerClient/2.2.0.0" - ] - }, - "ResponseHeaders": { - "Date": [ - "Thu, 22 Nov 2018 11:20:42 GMT" - ], "X-Content-Type-Options": [ "nosniff" ], - "X-Powered-By": [ - "ASP.NET" - ], - "apim-request-id": [ - "f0c09d15-cd8f-40c9-8ba9-5228d01e7b6a" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains; preload" + "Date": [ + "Mon, 19 Oct 2020 17:43:28 GMT" ], "Content-Length": [ "0" diff --git a/sdk/cognitiveservices/Knowledge.QnAMaker/tests/SessionRecords/QnAMakerPreviewRuntimeTests/QnAMakerPreviewRuntimeGenerateAnswerTest.json b/sdk/cognitiveservices/Knowledge.QnAMaker/tests/SessionRecords/QnAMakerPreviewRuntimeTests/QnAMakerPreviewRuntimeGenerateAnswerTest.json index c361b27a28bd..9f7be9481731 100644 --- a/sdk/cognitiveservices/Knowledge.QnAMaker/tests/SessionRecords/QnAMakerPreviewRuntimeTests/QnAMakerPreviewRuntimeGenerateAnswerTest.json +++ b/sdk/cognitiveservices/Knowledge.QnAMaker/tests/SessionRecords/QnAMakerPreviewRuntimeTests/QnAMakerPreviewRuntimeGenerateAnswerTest.json @@ -1,25 +1,25 @@ { "Entries": [ { - "RequestUri": "/qnamaker/v5.0-preview.1/knowledgebases/192233e1-0ec8-44dc-8285-57a541b7c79c/generateAnswer", - "EncodedRequestUri": "L3FuYW1ha2VyL3Y1LjAtcHJldmlldy4xL2tub3dsZWRnZWJhc2VzLzE5MjIzM2UxLTBlYzgtNDRkYy04Mjg1LTU3YTU0MWI3Yzc5Yy9nZW5lcmF0ZUFuc3dlcg==", + "RequestUri": "/qnamaker/v5.0-preview.1/knowledgebases/0667a3c4-fd61-4f13-9ada-a7fc0e257112/generateAnswer", + "EncodedRequestUri": "L3FuYW1ha2VyL3Y1LjAtcHJldmlldy4xL2tub3dsZWRnZWJhc2VzLzA2NjdhM2M0LWZkNjEtNGYxMy05YWRhLWE3ZmMwZTI1NzExMi9nZW5lcmF0ZUFuc3dlcg==", "RequestMethod": "POST", - "RequestBody": "{\r\n \"question\": \"new question\",\r\n \"isTest\": true\r\n}", + "RequestBody": "{\r\n \"question\": \"new question\",\r\n \"top\": 3,\r\n \"isTest\": true,\r\n \"answerSpanRequest\": {\r\n \"enable\": true,\r\n \"scoreThreshold\": 5.0,\r\n \"topAnswersWithSpan\": 1\r\n }\r\n}", "RequestHeaders": { "Ocp-Apim-Subscription-Key": [ - "c692f6f64dd54468b25eefd0c6c67c71" + "7942ed8406a748309d63728b2b7f7378" ], "User-Agent": [ "FxVersion/4.6.29220.03", "OSName/Windows", "OSVersion/Microsoft.Windows.10.0.18363.", - "Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.QnAMakerRuntimeClient/2.1.0.0" + "Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.QnAMakerClient/2.1.0.0" ], "Content-Type": [ "application/json; charset=utf-8" ], "Content-Length": [ - "53" + "176" ] }, "ResponseHeaders": { @@ -27,10 +27,10 @@ "CognitiveServices.QnAMakerV2.Transaction=1" ], "x-envoy-upstream-service-time": [ - "3359" + "6034" ], "apim-request-id": [ - "8347223a-b784-45f2-a47c-6a73a44ef100" + "73d9298a-54a6-432a-b1ce-7ed446ba5de6" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains; preload" @@ -39,16 +39,16 @@ "nosniff" ], "Date": [ - "Wed, 14 Oct 2020 18:28:38 GMT" + "Mon, 19 Oct 2020 17:43:05 GMT" ], "Content-Length": [ - "320" + "720" ], "Content-Type": [ "application/json; charset=utf-8" ] }, - "ResponseBody": "{\r\n \"answers\": [\r\n {\r\n \"questions\": [\r\n \"new question\"\r\n ],\r\n \"answer\": \"new answer\",\r\n \"score\": 100.0,\r\n \"id\": 91,\r\n \"source\": \"Editorial\",\r\n \"metadata\": [],\r\n \"context\": {\r\n \"isContextOnly\": false,\r\n \"prompts\": []\r\n }\r\n }\r\n ],\r\n \"activeLearningEnabled\": true\r\n}", + "ResponseBody": "{\r\n \"answers\": [\r\n {\r\n \"questions\": [\r\n \"new question\"\r\n ],\r\n \"answer\": \"Every question has an answer. I can answer any question as long as it is in the syllabus. If it is out of syllabus. You get a default answer called \\\"No match found in the KB\\\". If you are not happy with that answer, you can change it in the settings page.\",\r\n \"score\": 100.0,\r\n \"id\": 11,\r\n \"source\": \"Editorial\",\r\n \"metadata\": [],\r\n \"context\": {\r\n \"isContextOnly\": false,\r\n \"prompts\": []\r\n },\r\n \"answerSpan\": {\r\n \"text\": \"\\\"No match found in the KB\\\".\",\r\n \"score\": 8.32,\r\n \"startIndex\": 148,\r\n \"endIndex\": 175\r\n }\r\n }\r\n ],\r\n \"activeLearningEnabled\": true\r\n}", "StatusCode": 200 } ], diff --git a/sdk/cognitiveservices/Knowledge.QnAMaker/tests/SessionRecords/QnAMakerRuntimeTests/QnAMakerRuntimeGenerateAnswerTest.json b/sdk/cognitiveservices/Knowledge.QnAMaker/tests/SessionRecords/QnAMakerRuntimeTests/QnAMakerRuntimeGenerateAnswerTest.json index d96eb48abdac..65cb86ce4c9b 100644 --- a/sdk/cognitiveservices/Knowledge.QnAMaker/tests/SessionRecords/QnAMakerRuntimeTests/QnAMakerRuntimeGenerateAnswerTest.json +++ b/sdk/cognitiveservices/Knowledge.QnAMaker/tests/SessionRecords/QnAMakerRuntimeTests/QnAMakerRuntimeGenerateAnswerTest.json @@ -1,22 +1,22 @@ { "Entries": [ { - "RequestUri": "/qnamaker/knowledgebases/8758c6af-fa29-4e03-a517-9c36927f558f/generateAnswer", - "EncodedRequestUri": "L3FuYW1ha2VyL2tub3dsZWRnZWJhc2VzLzg3NThjNmFmLWZhMjktNGUwMy1hNTE3LTljMzY5MjdmNTU4Zi9nZW5lcmF0ZUFuc3dlcg==", + "RequestUri": "/qnamaker/knowledgebases/43de8400-ed9b-44ff-829d-e1dd3c5c7cb0/generateAnswer", + "EncodedRequestUri": "L3FuYW1ha2VyL2tub3dsZWRnZWJhc2VzLzQzZGU4NDAwLWVkOWItNDRmZi04MjlkLWUxZGQzYzVjN2NiMC9nZW5lcmF0ZUFuc3dlcg==", "RequestMethod": "POST", - "RequestBody": "{\r\n \"question\": \"good afternoon\"\r\n}", + "RequestBody": "{\r\n \"question\": \"hello\",\r\n \"isTest\": true\r\n}", "RequestHeaders": { "User-Agent": [ - "FxVersion/4.6.27617.04", + "FxVersion/4.6.29220.03", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.18362.", - "Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.QnAMakerRuntimeClient/1.0.0.0" + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.QnAMakerClient/2.1.0.0" ], "Content-Type": [ "application/json; charset=utf-8" ], "Content-Length": [ - "36" + "46" ] }, "ResponseHeaders": { @@ -26,14 +26,11 @@ "Pragma": [ "no-cache" ], - "Transfer-Encoding": [ - "chunked" - ], "Server": [ "Kestrel" ], "Request-Context": [ - "appId=cid-v1:57fe7dc2-cca1-4cfc-98d1-5f1f2f34f969" + "appId=cid-v1:b1a17ffe-70ae-45b9-ace2-463467459d35" ], "X-AspNet-Version": [ "4.0.30319" @@ -48,10 +45,14 @@ "max-age=31536000" ], "Set-Cookie": [ - "ARRAffinity=7adbf14d8e75f98367e830cf2e4b1f04857993258b74780366c7f67db243f6f5;Path=/;HttpOnly;Domain=paidtestbot.azurewebsites.net" + "ARRAffinity=643da09f0404d87e0f12cd06d58428e9c5c4dc563c548b31276fa1f2a7ae5535;Path=/;HttpOnly;Secure;Domain=sk4cs.azurewebsites.net", + "ARRAffinitySameSite=643da09f0404d87e0f12cd06d58428e9c5c4dc563c548b31276fa1f2a7ae5535;Path=/;HttpOnly;SameSite=None;Secure;Domain=sk4cs.azurewebsites.net" ], "Date": [ - "Mon, 08 Jul 2019 11:40:27 GMT" + "Mon, 19 Oct 2020 17:43:07 GMT" + ], + "Content-Length": [ + "475" ], "Content-Type": [ "application/json; charset=utf-8" @@ -60,7 +61,7 @@ "-1" ] }, - "ResponseBody": "{\r\n \"answers\": [\r\n {\r\n \"questions\": [\r\n \"Good Afternoon !\"\r\n ],\r\n \"answer\": \"Good Afternoon! I hope you are doing well\",\r\n \"score\": 100.0,\r\n \"id\": 191,\r\n \"source\": \"out.txt\",\r\n \"metadata\": [],\r\n \"context\": {\r\n \"isContextOnly\": false,\r\n \"prompts\": []\r\n }\r\n }\r\n ],\r\n \"debugInfo\": null\r\n}", + "ResponseBody": "{\r\n \"answers\": [\r\n {\r\n \"questions\": [\r\n \"hello\",\r\n \"hi\",\r\n \"start\"\r\n ],\r\n \"answer\": \"Hello, please select from the list of questions or enter a new question to continue.\",\r\n \"score\": 100.0,\r\n \"id\": 31,\r\n \"source\": \"Editorial\",\r\n \"metadata\": [\r\n {\r\n \"name\": \"category\",\r\n \"value\": \"chitchat\"\r\n },\r\n {\r\n \"name\": \"chitchat\",\r\n \"value\": \"begin\"\r\n }\r\n ],\r\n \"context\": {\r\n \"isContextOnly\": false,\r\n \"prompts\": [\r\n {\r\n \"displayOrder\": 1,\r\n \"qnaId\": 1,\r\n \"displayText\": \"Use REST\"\r\n },\r\n {\r\n \"displayOrder\": 2,\r\n \"qnaId\": 2,\r\n \"displayText\": \"Use .NET NuGet package\"\r\n }\r\n ]\r\n }\r\n }\r\n ],\r\n \"activeLearningEnabled\": false\r\n}", "StatusCode": 200 } ],