xml/Azure.AI.Language.QuestionAnswering.Authoring/QuestionAnsweringAuthoringClient.xml (3,571 lines of code) (raw):
<Type Name="QuestionAnsweringAuthoringClient" FullName="Azure.AI.Language.QuestionAnswering.Authoring.QuestionAnsweringAuthoringClient">
<TypeSignature Language="C#" Value="public class QuestionAnsweringAuthoringClient" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit QuestionAnsweringAuthoringClient extends System.Object" />
<TypeSignature Language="DocId" Value="T:Azure.AI.Language.QuestionAnswering.Authoring.QuestionAnsweringAuthoringClient" />
<TypeSignature Language="VB.NET" Value="Public Class QuestionAnsweringAuthoringClient" />
<TypeSignature Language="F#" Value="type QuestionAnsweringAuthoringClient = class" />
<AssemblyInfo>
<AssemblyName>Azure.AI.Language.QuestionAnswering</AssemblyName>
<AssemblyVersion>1.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Object</BaseTypeName>
</Base>
<Interfaces />
<Docs>
<summary> The QuestionAnsweringAuthoring service client. </summary>
<remarks>To be added.</remarks>
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="protected QuestionAnsweringAuthoringClient ();" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig specialname rtspecialname instance void .ctor() cil managed" />
<MemberSignature Language="DocId" Value="M:Azure.AI.Language.QuestionAnswering.Authoring.QuestionAnsweringAuthoringClient.#ctor" />
<MemberSignature Language="VB.NET" Value="Protected Sub New ()" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>Azure.AI.Language.QuestionAnswering</AssemblyName>
<AssemblyVersion>1.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters />
<Docs>
<summary> Initializes a new instance of QuestionAnsweringAuthoringClient for mocking. </summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public QuestionAnsweringAuthoringClient (Uri endpoint, Azure.AzureKeyCredential credential);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(class System.Uri endpoint, class Azure.AzureKeyCredential credential) cil managed" />
<MemberSignature Language="DocId" Value="M:Azure.AI.Language.QuestionAnswering.Authoring.QuestionAnsweringAuthoringClient.#ctor(System.Uri,Azure.AzureKeyCredential)" />
<MemberSignature Language="VB.NET" Value="Public Sub New (endpoint As Uri, credential As AzureKeyCredential)" />
<MemberSignature Language="F#" Value="new Azure.AI.Language.QuestionAnswering.Authoring.QuestionAnsweringAuthoringClient : Uri * Azure.AzureKeyCredential -> Azure.AI.Language.QuestionAnswering.Authoring.QuestionAnsweringAuthoringClient" Usage="new Azure.AI.Language.QuestionAnswering.Authoring.QuestionAnsweringAuthoringClient (endpoint, credential)" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>Azure.AI.Language.QuestionAnswering</AssemblyName>
<AssemblyVersion>1.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="endpoint" Type="System.Uri" />
<Parameter Name="credential" Type="Azure.AzureKeyCredential" />
</Parameters>
<Docs>
<param name="endpoint"> Supported Cognitive Services endpoint (e.g., https://<resource-name>.api.cognitiveservices.azure.com). </param>
<param name="credential"> A credential used to authenticate to an Azure Service. </param>
<summary> Initializes a new instance of QuestionAnsweringAuthoringClient. </summary>
<remarks>To be added.</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="endpoint" /> or <paramref name="credential" /> is null. </exception>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public QuestionAnsweringAuthoringClient (Uri endpoint, Azure.Core.TokenCredential credential);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(class System.Uri endpoint, class Azure.Core.TokenCredential credential) cil managed" />
<MemberSignature Language="DocId" Value="M:Azure.AI.Language.QuestionAnswering.Authoring.QuestionAnsweringAuthoringClient.#ctor(System.Uri,Azure.Core.TokenCredential)" />
<MemberSignature Language="VB.NET" Value="Public Sub New (endpoint As Uri, credential As TokenCredential)" />
<MemberSignature Language="F#" Value="new Azure.AI.Language.QuestionAnswering.Authoring.QuestionAnsweringAuthoringClient : Uri * Azure.Core.TokenCredential -> Azure.AI.Language.QuestionAnswering.Authoring.QuestionAnsweringAuthoringClient" Usage="new Azure.AI.Language.QuestionAnswering.Authoring.QuestionAnsweringAuthoringClient (endpoint, credential)" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>Azure.AI.Language.QuestionAnswering</AssemblyName>
<AssemblyVersion>1.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="endpoint" Type="System.Uri" />
<Parameter Name="credential" Type="Azure.Core.TokenCredential" />
</Parameters>
<Docs>
<param name="endpoint"> Supported Cognitive Services endpoint (e.g., https://<resource-name>.cognitiveservices.azure.com). </param>
<param name="credential"> A credential used to authenticate to an Azure Service. </param>
<summary> Initializes a new instance of QuestionAnsweringAuthoringClient. </summary>
<remarks>To be added.</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="endpoint" /> or <paramref name="credential" /> is null. </exception>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public QuestionAnsweringAuthoringClient (Uri endpoint, Azure.AzureKeyCredential credential, Azure.AI.Language.QuestionAnswering.QuestionAnsweringClientOptions options);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(class System.Uri endpoint, class Azure.AzureKeyCredential credential, class Azure.AI.Language.QuestionAnswering.QuestionAnsweringClientOptions options) cil managed" />
<MemberSignature Language="DocId" Value="M:Azure.AI.Language.QuestionAnswering.Authoring.QuestionAnsweringAuthoringClient.#ctor(System.Uri,Azure.AzureKeyCredential,Azure.AI.Language.QuestionAnswering.QuestionAnsweringClientOptions)" />
<MemberSignature Language="VB.NET" Value="Public Sub New (endpoint As Uri, credential As AzureKeyCredential, options As QuestionAnsweringClientOptions)" />
<MemberSignature Language="F#" Value="new Azure.AI.Language.QuestionAnswering.Authoring.QuestionAnsweringAuthoringClient : Uri * Azure.AzureKeyCredential * Azure.AI.Language.QuestionAnswering.QuestionAnsweringClientOptions -> Azure.AI.Language.QuestionAnswering.Authoring.QuestionAnsweringAuthoringClient" Usage="new Azure.AI.Language.QuestionAnswering.Authoring.QuestionAnsweringAuthoringClient (endpoint, credential, options)" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>Azure.AI.Language.QuestionAnswering</AssemblyName>
<AssemblyVersion>1.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="endpoint" Type="System.Uri" />
<Parameter Name="credential" Type="Azure.AzureKeyCredential" />
<Parameter Name="options" Type="Azure.AI.Language.QuestionAnswering.QuestionAnsweringClientOptions" />
</Parameters>
<Docs>
<param name="endpoint"> Supported Cognitive Services endpoint (e.g., https://<resource-name>.api.cognitiveservices.azure.com). </param>
<param name="credential"> A credential used to authenticate to an Azure Service. </param>
<param name="options"> The options for configuring the client. </param>
<summary> Initializes a new instance of QuestionAnsweringAuthoringClient. </summary>
<remarks>To be added.</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="endpoint" /> or <paramref name="credential" /> is null. </exception>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public QuestionAnsweringAuthoringClient (Uri endpoint, Azure.Core.TokenCredential credential, Azure.AI.Language.QuestionAnswering.QuestionAnsweringClientOptions options);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(class System.Uri endpoint, class Azure.Core.TokenCredential credential, class Azure.AI.Language.QuestionAnswering.QuestionAnsweringClientOptions options) cil managed" />
<MemberSignature Language="DocId" Value="M:Azure.AI.Language.QuestionAnswering.Authoring.QuestionAnsweringAuthoringClient.#ctor(System.Uri,Azure.Core.TokenCredential,Azure.AI.Language.QuestionAnswering.QuestionAnsweringClientOptions)" />
<MemberSignature Language="VB.NET" Value="Public Sub New (endpoint As Uri, credential As TokenCredential, options As QuestionAnsweringClientOptions)" />
<MemberSignature Language="F#" Value="new Azure.AI.Language.QuestionAnswering.Authoring.QuestionAnsweringAuthoringClient : Uri * Azure.Core.TokenCredential * Azure.AI.Language.QuestionAnswering.QuestionAnsweringClientOptions -> Azure.AI.Language.QuestionAnswering.Authoring.QuestionAnsweringAuthoringClient" Usage="new Azure.AI.Language.QuestionAnswering.Authoring.QuestionAnsweringAuthoringClient (endpoint, credential, options)" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>Azure.AI.Language.QuestionAnswering</AssemblyName>
<AssemblyVersion>1.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="endpoint" Type="System.Uri" />
<Parameter Name="credential" Type="Azure.Core.TokenCredential" />
<Parameter Name="options" Type="Azure.AI.Language.QuestionAnswering.QuestionAnsweringClientOptions" />
</Parameters>
<Docs>
<param name="endpoint"> Supported Cognitive Services endpoint (e.g., https://<resource-name>.cognitiveservices.azure.com). </param>
<param name="credential"> A credential used to authenticate to an Azure Service. </param>
<param name="options"> The options for configuring the client. </param>
<summary> Initializes a new instance of QuestionAnsweringAuthoringClient. </summary>
<remarks>To be added.</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="endpoint" /> or <paramref name="credential" /> is null. </exception>
</Docs>
</Member>
<Member MemberName="AddFeedback">
<MemberSignature Language="C#" Value="public virtual Azure.Response AddFeedback (string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = default);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class Azure.Response AddFeedback(string projectName, class Azure.Core.RequestContent content, class Azure.RequestContext context) cil managed" />
<MemberSignature Language="DocId" Value="M:Azure.AI.Language.QuestionAnswering.Authoring.QuestionAnsweringAuthoringClient.AddFeedback(System.String,Azure.Core.RequestContent,Azure.RequestContext)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function AddFeedback (projectName As String, content As RequestContent, Optional context As RequestContext = Nothing) As Response" />
<MemberSignature Language="F#" Value="abstract member AddFeedback : string * Azure.Core.RequestContent * Azure.RequestContext -> Azure.Response
override this.AddFeedback : string * Azure.Core.RequestContent * Azure.RequestContext -> Azure.Response" Usage="questionAnsweringAuthoringClient.AddFeedback (projectName, content, context)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Azure.AI.Language.QuestionAnswering</AssemblyName>
<AssemblyVersion>1.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Azure.Response</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="projectName" Type="System.String" />
<Parameter Name="content" Type="Azure.Core.RequestContent" />
<Parameter Name="context" Type="Azure.RequestContext" />
</Parameters>
<Docs>
<param name="projectName"> The name of the project to use. </param>
<param name="content"> The content to send as the body of the request. Details of the request body schema are in the Remarks section below. </param>
<param name="context"> The request context, which can override default behaviors of the client pipeline on a per-call basis. </param>
<summary> Add Active Learning feedback. </summary>
<returns> The response returned from the service. </returns>
<remarks>
Below is the JSON schema for the request payload.
Additional information can be found in the service REST API documentation:
https://learn.microsoft.com/rest/api/cognitiveservices/questionanswering/question-answering-projects/add-feedback
Request Body:
Schema for <c>ActiveLearningFeedback</c>:
<code>{
records: [
{
userId: string, # Optional. Unique identifier of the user.
userQuestion: string, # Optional. User suggested question for the QnA.
qnaId: number, # Optional. Unique ID of the QnA.
}
], # Optional. A list of Feedback Records for Active Learning.
}
</code></remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="projectName" /> or <paramref name="content" /> is null. </exception>
<exception cref="T:System.ArgumentException">
<paramref name="projectName" /> is an empty string, and was expected to be non-empty. </exception>
<exception cref="T:Azure.RequestFailedException"> Service returned a non-success status code. </exception>
<example>
This sample shows how to call AddFeedback with required parameters.
<code><![CDATA[
var credential = new AzureKeyCredential("<key>");
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new QuestionAnsweringAuthoringClient(endpoint, credential);
var data = new {};
Response response = client.AddFeedback("<projectName>", RequestContent.Create(data));
Console.WriteLine(response.Status);
]]></code>
This sample shows how to call AddFeedback with all parameters and request content.
<code><![CDATA[
var credential = new AzureKeyCredential("<key>");
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new QuestionAnsweringAuthoringClient(endpoint, credential);
var data = new {
records = new[] {
new {
userId = "<userId>",
userQuestion = "<userQuestion>",
qnaId = 1234,
}
},
};
Response response = client.AddFeedback("<projectName>", RequestContent.Create(data));
Console.WriteLine(response.Status);
]]></code></example>
</Docs>
</Member>
<Member MemberName="AddFeedbackAsync">
<MemberSignature Language="C#" Value="public virtual System.Threading.Tasks.Task<Azure.Response> AddFeedbackAsync (string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = default);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class System.Threading.Tasks.Task`1<class Azure.Response> AddFeedbackAsync(string projectName, class Azure.Core.RequestContent content, class Azure.RequestContext context) cil managed" />
<MemberSignature Language="DocId" Value="M:Azure.AI.Language.QuestionAnswering.Authoring.QuestionAnsweringAuthoringClient.AddFeedbackAsync(System.String,Azure.Core.RequestContent,Azure.RequestContext)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function AddFeedbackAsync (projectName As String, content As RequestContent, Optional context As RequestContext = Nothing) As Task(Of Response)" />
<MemberSignature Language="F#" Value="abstract member AddFeedbackAsync : string * Azure.Core.RequestContent * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.AddFeedbackAsync : string * Azure.Core.RequestContent * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>" Usage="questionAnsweringAuthoringClient.AddFeedbackAsync (projectName, content, context)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Azure.AI.Language.QuestionAnswering</AssemblyName>
<AssemblyVersion>1.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Threading.Tasks.Task<Azure.Response></ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="projectName" Type="System.String" />
<Parameter Name="content" Type="Azure.Core.RequestContent" />
<Parameter Name="context" Type="Azure.RequestContext" />
</Parameters>
<Docs>
<param name="projectName"> The name of the project to use. </param>
<param name="content"> The content to send as the body of the request. Details of the request body schema are in the Remarks section below. </param>
<param name="context"> The request context, which can override default behaviors of the client pipeline on a per-call basis. </param>
<summary> Add Active Learning feedback. </summary>
<returns> The response returned from the service. </returns>
<remarks>
Below is the JSON schema for the request payload.
Additional information can be found in the service REST API documentation:
https://learn.microsoft.com/rest/api/cognitiveservices/questionanswering/question-answering-projects/add-feedback
Request Body:
Schema for <c>ActiveLearningFeedback</c>:
<code>{
records: [
{
userId: string, # Optional. Unique identifier of the user.
userQuestion: string, # Optional. User suggested question for the QnA.
qnaId: number, # Optional. Unique ID of the QnA.
}
], # Optional. A list of Feedback Records for Active Learning.
}
</code></remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="projectName" /> or <paramref name="content" /> is null. </exception>
<exception cref="T:System.ArgumentException">
<paramref name="projectName" /> is an empty string, and was expected to be non-empty. </exception>
<exception cref="T:Azure.RequestFailedException"> Service returned a non-success status code. </exception>
<example>
This sample shows how to call AddFeedbackAsync with required parameters.
<code><![CDATA[
var credential = new AzureKeyCredential("<key>");
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new QuestionAnsweringAuthoringClient(endpoint, credential);
var data = new {};
Response response = await client.AddFeedbackAsync("<projectName>", RequestContent.Create(data));
Console.WriteLine(response.Status);
]]></code>
This sample shows how to call AddFeedbackAsync with all parameters and request content.
<code><![CDATA[
var credential = new AzureKeyCredential("<key>");
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new QuestionAnsweringAuthoringClient(endpoint, credential);
var data = new {
records = new[] {
new {
userId = "<userId>",
userQuestion = "<userQuestion>",
qnaId = 1234,
}
},
};
Response response = await client.AddFeedbackAsync("<projectName>", RequestContent.Create(data));
Console.WriteLine(response.Status);
]]></code></example>
</Docs>
</Member>
<Member MemberName="CreateProject">
<MemberSignature Language="C#" Value="public virtual Azure.Response CreateProject (string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = default);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class Azure.Response CreateProject(string projectName, class Azure.Core.RequestContent content, class Azure.RequestContext context) cil managed" />
<MemberSignature Language="DocId" Value="M:Azure.AI.Language.QuestionAnswering.Authoring.QuestionAnsweringAuthoringClient.CreateProject(System.String,Azure.Core.RequestContent,Azure.RequestContext)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function CreateProject (projectName As String, content As RequestContent, Optional context As RequestContext = Nothing) As Response" />
<MemberSignature Language="F#" Value="abstract member CreateProject : string * Azure.Core.RequestContent * Azure.RequestContext -> Azure.Response
override this.CreateProject : string * Azure.Core.RequestContent * Azure.RequestContext -> Azure.Response" Usage="questionAnsweringAuthoringClient.CreateProject (projectName, content, context)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Azure.AI.Language.QuestionAnswering</AssemblyName>
<AssemblyVersion>1.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Azure.Response</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="projectName" Type="System.String" />
<Parameter Name="content" Type="Azure.Core.RequestContent" />
<Parameter Name="context" Type="Azure.RequestContext" />
</Parameters>
<Docs>
<param name="projectName"> The name of the project to use. </param>
<param name="content"> The content to send as the body of the request. Details of the request body schema are in the Remarks section below. </param>
<param name="context"> The request context, which can override default behaviors of the client pipeline on a per-call basis. </param>
<summary> Create or update a project. </summary>
<returns> The response returned from the service. Details of the response body schema are in the Remarks section below. </returns>
<remarks>
Below is the JSON schema for the request and response payloads.
Additional information can be found in the service REST API documentation:
https://learn.microsoft.com/rest/api/cognitiveservices/questionanswering/question-answering-projects/create-project
Request Body:
Schema for <c>CreateProjectOptions</c>:
<code>{
description: string, # Optional. Description of the project.
language: string, # Required. Language of the text records. This is BCP-47 representation of a language. For example, use "en" for English; "es" for Spanish etc. If not set, use "en" for English as default.
multilingualResource: boolean, # Optional. Set to true to enable creating knowledgebases in different languages for the same resource.
settings: {
defaultAnswer: string, # Optional. Default Answer response when no good match is found in the knowledge base.
}, # Optional. Configurable settings of the Project.
}
</code>
Response Body:
Schema for <c>ProjectMetadata</c>:
<code>{
projectName: string, # Optional. Name of the project.
description: string, # Optional. Description of the project.
language: string, # Optional. Language of the text records. This is BCP-47 representation of a language. For example, use "en" for English; "es" for Spanish etc. If not set, use "en" for English as default.
multilingualResource: boolean, # Optional. Resource enabled for multiple languages across projects or not.
settings: {
defaultAnswer: string, # Optional. Default Answer response when no good match is found in the knowledge base.
}, # Optional. Configurable settings of the Project.
createdDateTime: string (ISO 8601 Format), # Optional. Project creation date-time.
lastModifiedDateTime: string (ISO 8601 Format), # Optional. Represents the project last modified date-time.
lastDeployedDateTime: string (ISO 8601 Format), # Optional. Represents the project last deployment date-time.
}
</code></remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="projectName" /> or <paramref name="content" /> is null. </exception>
<exception cref="T:System.ArgumentException">
<paramref name="projectName" /> is an empty string, and was expected to be non-empty. </exception>
<exception cref="T:Azure.RequestFailedException"> Service returned a non-success status code. </exception>
<example>
This sample shows how to call CreateProject with required parameters and request content, and how to parse the result.
<code><![CDATA[
var credential = new AzureKeyCredential("<key>");
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new QuestionAnsweringAuthoringClient(endpoint, credential);
var data = new {
language = "<language>",
};
Response response = client.CreateProject("<projectName>", RequestContent.Create(data));
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.ToString());
]]></code>
This sample shows how to call CreateProject with all parameters and request content, and how to parse the result.
<code><![CDATA[
var credential = new AzureKeyCredential("<key>");
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new QuestionAnsweringAuthoringClient(endpoint, credential);
var data = new {
description = "<description>",
language = "<language>",
multilingualResource = true,
settings = new {
defaultAnswer = "<defaultAnswer>",
},
};
Response response = client.CreateProject("<projectName>", RequestContent.Create(data));
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("projectName").ToString());
Console.WriteLine(result.GetProperty("description").ToString());
Console.WriteLine(result.GetProperty("language").ToString());
Console.WriteLine(result.GetProperty("multilingualResource").ToString());
Console.WriteLine(result.GetProperty("settings").GetProperty("defaultAnswer").ToString());
Console.WriteLine(result.GetProperty("createdDateTime").ToString());
Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString());
Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString());
]]></code></example>
</Docs>
</Member>
<Member MemberName="CreateProjectAsync">
<MemberSignature Language="C#" Value="public virtual System.Threading.Tasks.Task<Azure.Response> CreateProjectAsync (string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = default);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class System.Threading.Tasks.Task`1<class Azure.Response> CreateProjectAsync(string projectName, class Azure.Core.RequestContent content, class Azure.RequestContext context) cil managed" />
<MemberSignature Language="DocId" Value="M:Azure.AI.Language.QuestionAnswering.Authoring.QuestionAnsweringAuthoringClient.CreateProjectAsync(System.String,Azure.Core.RequestContent,Azure.RequestContext)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function CreateProjectAsync (projectName As String, content As RequestContent, Optional context As RequestContext = Nothing) As Task(Of Response)" />
<MemberSignature Language="F#" Value="abstract member CreateProjectAsync : string * Azure.Core.RequestContent * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.CreateProjectAsync : string * Azure.Core.RequestContent * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>" Usage="questionAnsweringAuthoringClient.CreateProjectAsync (projectName, content, context)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Azure.AI.Language.QuestionAnswering</AssemblyName>
<AssemblyVersion>1.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Threading.Tasks.Task<Azure.Response></ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="projectName" Type="System.String" />
<Parameter Name="content" Type="Azure.Core.RequestContent" />
<Parameter Name="context" Type="Azure.RequestContext" />
</Parameters>
<Docs>
<param name="projectName"> The name of the project to use. </param>
<param name="content"> The content to send as the body of the request. Details of the request body schema are in the Remarks section below. </param>
<param name="context"> The request context, which can override default behaviors of the client pipeline on a per-call basis. </param>
<summary> Create or update a project. </summary>
<returns> The response returned from the service. Details of the response body schema are in the Remarks section below. </returns>
<remarks>
Below is the JSON schema for the request and response payloads.
Additional information can be found in the service REST API documentation:
https://learn.microsoft.com/rest/api/cognitiveservices/questionanswering/question-answering-projects/create-project
Request Body:
Schema for <c>CreateProjectOptions</c>:
<code>{
description: string, # Optional. Description of the project.
language: string, # Required. Language of the text records. This is BCP-47 representation of a language. For example, use "en" for English; "es" for Spanish etc. If not set, use "en" for English as default.
multilingualResource: boolean, # Optional. Set to true to enable creating knowledgebases in different languages for the same resource.
settings: {
defaultAnswer: string, # Optional. Default Answer response when no good match is found in the knowledge base.
}, # Optional. Configurable settings of the Project.
}
</code>
Response Body:
Schema for <c>ProjectMetadata</c>:
<code>{
projectName: string, # Optional. Name of the project.
description: string, # Optional. Description of the project.
language: string, # Optional. Language of the text records. This is BCP-47 representation of a language. For example, use "en" for English; "es" for Spanish etc. If not set, use "en" for English as default.
multilingualResource: boolean, # Optional. Resource enabled for multiple languages across projects or not.
settings: {
defaultAnswer: string, # Optional. Default Answer response when no good match is found in the knowledge base.
}, # Optional. Configurable settings of the Project.
createdDateTime: string (ISO 8601 Format), # Optional. Project creation date-time.
lastModifiedDateTime: string (ISO 8601 Format), # Optional. Represents the project last modified date-time.
lastDeployedDateTime: string (ISO 8601 Format), # Optional. Represents the project last deployment date-time.
}
</code></remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="projectName" /> or <paramref name="content" /> is null. </exception>
<exception cref="T:System.ArgumentException">
<paramref name="projectName" /> is an empty string, and was expected to be non-empty. </exception>
<exception cref="T:Azure.RequestFailedException"> Service returned a non-success status code. </exception>
<example>
This sample shows how to call CreateProjectAsync with required parameters and request content, and how to parse the result.
<code><![CDATA[
var credential = new AzureKeyCredential("<key>");
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new QuestionAnsweringAuthoringClient(endpoint, credential);
var data = new {
language = "<language>",
};
Response response = await client.CreateProjectAsync("<projectName>", RequestContent.Create(data));
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.ToString());
]]></code>
This sample shows how to call CreateProjectAsync with all parameters and request content, and how to parse the result.
<code><![CDATA[
var credential = new AzureKeyCredential("<key>");
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new QuestionAnsweringAuthoringClient(endpoint, credential);
var data = new {
description = "<description>",
language = "<language>",
multilingualResource = true,
settings = new {
defaultAnswer = "<defaultAnswer>",
},
};
Response response = await client.CreateProjectAsync("<projectName>", RequestContent.Create(data));
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("projectName").ToString());
Console.WriteLine(result.GetProperty("description").ToString());
Console.WriteLine(result.GetProperty("language").ToString());
Console.WriteLine(result.GetProperty("multilingualResource").ToString());
Console.WriteLine(result.GetProperty("settings").GetProperty("defaultAnswer").ToString());
Console.WriteLine(result.GetProperty("createdDateTime").ToString());
Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString());
Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString());
]]></code></example>
</Docs>
</Member>
<Member MemberName="DeleteProject">
<MemberSignature Language="C#" Value="public virtual Azure.Operation DeleteProject (Azure.WaitUntil waitUntil, string projectName, Azure.RequestContext context = default);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class Azure.Operation DeleteProject(valuetype Azure.WaitUntil waitUntil, string projectName, class Azure.RequestContext context) cil managed" />
<MemberSignature Language="DocId" Value="M:Azure.AI.Language.QuestionAnswering.Authoring.QuestionAnsweringAuthoringClient.DeleteProject(Azure.WaitUntil,System.String,Azure.RequestContext)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function DeleteProject (waitUntil As WaitUntil, projectName As String, Optional context As RequestContext = Nothing) As Operation" />
<MemberSignature Language="F#" Value="abstract member DeleteProject : Azure.WaitUntil * string * Azure.RequestContext -> Azure.Operation
override this.DeleteProject : Azure.WaitUntil * string * Azure.RequestContext -> Azure.Operation" Usage="questionAnsweringAuthoringClient.DeleteProject (waitUntil, projectName, context)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Azure.AI.Language.QuestionAnswering</AssemblyName>
<AssemblyVersion>1.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Azure.Operation</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="waitUntil" Type="Azure.WaitUntil" />
<Parameter Name="projectName" Type="System.String" />
<Parameter Name="context" Type="Azure.RequestContext" />
</Parameters>
<Docs>
<param name="waitUntil">
<see cref="F:Azure.WaitUntil.Completed" /> if the method should wait to return until the long-running operation has completed on the service; <see cref="F:Azure.WaitUntil.Started" /> if it should return after starting the operation. For more information on long-running operations, please see <see href="https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/LongRunningOperations.md"> Azure.Core Long-Running Operation samples</see>. </param>
<param name="projectName"> The name of the project to use. </param>
<param name="context"> The request context, which can override default behaviors of the client pipeline on a per-call basis. </param>
<summary> Delete the project. </summary>
<returns> The <see cref="T:Azure.Operation" /> representing an asynchronous operation on the service. </returns>
<remarks>To be added.</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="projectName" /> is null. </exception>
<exception cref="T:System.ArgumentException">
<paramref name="projectName" /> is an empty string, and was expected to be non-empty. </exception>
<exception cref="T:Azure.RequestFailedException"> Service returned a non-success status code. </exception>
<example>
This sample shows how to call DeleteProject with required parameters.
<code><![CDATA[
var credential = new AzureKeyCredential("<key>");
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new QuestionAnsweringAuthoringClient(endpoint, credential);
var operation = client.DeleteProject(WaitUntil.Completed, "<projectName>");
var response = operation.WaitForCompletionResponse();
Console.WriteLine(response.Status)
]]></code></example>
</Docs>
</Member>
<Member MemberName="DeleteProjectAsync">
<MemberSignature Language="C#" Value="public virtual System.Threading.Tasks.Task<Azure.Operation> DeleteProjectAsync (Azure.WaitUntil waitUntil, string projectName, Azure.RequestContext context = default);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class System.Threading.Tasks.Task`1<class Azure.Operation> DeleteProjectAsync(valuetype Azure.WaitUntil waitUntil, string projectName, class Azure.RequestContext context) cil managed" />
<MemberSignature Language="DocId" Value="M:Azure.AI.Language.QuestionAnswering.Authoring.QuestionAnsweringAuthoringClient.DeleteProjectAsync(Azure.WaitUntil,System.String,Azure.RequestContext)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function DeleteProjectAsync (waitUntil As WaitUntil, projectName As String, Optional context As RequestContext = Nothing) As Task(Of Operation)" />
<MemberSignature Language="F#" Value="abstract member DeleteProjectAsync : Azure.WaitUntil * string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Operation>
override this.DeleteProjectAsync : Azure.WaitUntil * string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Operation>" Usage="questionAnsweringAuthoringClient.DeleteProjectAsync (waitUntil, projectName, context)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Azure.AI.Language.QuestionAnswering</AssemblyName>
<AssemblyVersion>1.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Threading.Tasks.Task<Azure.Operation></ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="waitUntil" Type="Azure.WaitUntil" />
<Parameter Name="projectName" Type="System.String" />
<Parameter Name="context" Type="Azure.RequestContext" />
</Parameters>
<Docs>
<param name="waitUntil">
<see cref="F:Azure.WaitUntil.Completed" /> if the method should wait to return until the long-running operation has completed on the service; <see cref="F:Azure.WaitUntil.Started" /> if it should return after starting the operation. For more information on long-running operations, please see <see href="https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/LongRunningOperations.md"> Azure.Core Long-Running Operation samples</see>. </param>
<param name="projectName"> The name of the project to use. </param>
<param name="context"> The request context, which can override default behaviors of the client pipeline on a per-call basis. </param>
<summary> Delete the project. </summary>
<returns> The <see cref="T:Azure.Operation" /> representing an asynchronous operation on the service. </returns>
<remarks>To be added.</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="projectName" /> is null. </exception>
<exception cref="T:System.ArgumentException">
<paramref name="projectName" /> is an empty string, and was expected to be non-empty. </exception>
<exception cref="T:Azure.RequestFailedException"> Service returned a non-success status code. </exception>
<example>
This sample shows how to call DeleteProjectAsync with required parameters.
<code><![CDATA[
var credential = new AzureKeyCredential("<key>");
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new QuestionAnsweringAuthoringClient(endpoint, credential);
var operation = await client.DeleteProjectAsync(WaitUntil.Completed, "<projectName>");
var response = await operation.WaitForCompletionResponseAsync();
Console.WriteLine(response.Status)
]]></code></example>
</Docs>
</Member>
<Member MemberName="DeployProject">
<MemberSignature Language="C#" Value="public virtual Azure.Operation<BinaryData> DeployProject (Azure.WaitUntil waitUntil, string projectName, string deploymentName, Azure.RequestContext context = default);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class Azure.Operation`1<class System.BinaryData> DeployProject(valuetype Azure.WaitUntil waitUntil, string projectName, string deploymentName, class Azure.RequestContext context) cil managed" />
<MemberSignature Language="DocId" Value="M:Azure.AI.Language.QuestionAnswering.Authoring.QuestionAnsweringAuthoringClient.DeployProject(Azure.WaitUntil,System.String,System.String,Azure.RequestContext)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function DeployProject (waitUntil As WaitUntil, projectName As String, deploymentName As String, Optional context As RequestContext = Nothing) As Operation(Of BinaryData)" />
<MemberSignature Language="F#" Value="abstract member DeployProject : Azure.WaitUntil * string * string * Azure.RequestContext -> Azure.Operation<BinaryData>
override this.DeployProject : Azure.WaitUntil * string * string * Azure.RequestContext -> Azure.Operation<BinaryData>" Usage="questionAnsweringAuthoringClient.DeployProject (waitUntil, projectName, deploymentName, context)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Azure.AI.Language.QuestionAnswering</AssemblyName>
<AssemblyVersion>1.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Azure.Operation<System.BinaryData></ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="waitUntil" Type="Azure.WaitUntil" />
<Parameter Name="projectName" Type="System.String" />
<Parameter Name="deploymentName" Type="System.String" />
<Parameter Name="context" Type="Azure.RequestContext" />
</Parameters>
<Docs>
<param name="waitUntil">
<see cref="F:Azure.WaitUntil.Completed" /> if the method should wait to return until the long-running operation has completed on the service; <see cref="F:Azure.WaitUntil.Started" /> if it should return after starting the operation. For more information on long-running operations, please see <see href="https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/LongRunningOperations.md"> Azure.Core Long-Running Operation samples</see>. </param>
<param name="projectName"> The name of the project to use. </param>
<param name="deploymentName"> The name of the specific deployment of the project to use. </param>
<param name="context"> The request context, which can override default behaviors of the client pipeline on a per-call basis. </param>
<summary> Deploy project to production. </summary>
<returns> The <see cref="T:Azure.Operation`1" /> from the service that will contain a <see cref="T:System.BinaryData" /> object once the asynchronous operation on the service has completed. Details of the body schema for the operation's final value are in the Remarks section below. </returns>
<remarks>
Below is the JSON schema for the response payload.
Additional information can be found in the service REST API documentation:
https://learn.microsoft.com/rest/api/cognitiveservices/questionanswering/question-answering-projects/deploy-project
Response Body:
Schema for <c>ProjectDeployment</c>:
<code>{
deploymentName: string, # Optional. Name of the deployment.
lastDeployedDateTime: string (ISO 8601 Format), # Optional. Represents the project last deployment date-time.
}
</code></remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="projectName" /> or <paramref name="deploymentName" /> is null. </exception>
<exception cref="T:System.ArgumentException">
<paramref name="projectName" /> or <paramref name="deploymentName" /> is an empty string, and was expected to be non-empty. </exception>
<exception cref="T:Azure.RequestFailedException"> Service returned a non-success status code. </exception>
<example>
This sample shows how to call DeployProject with required parameters and parse the result.
<code><![CDATA[
var credential = new AzureKeyCredential("<key>");
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new QuestionAnsweringAuthoringClient(endpoint, credential);
var operation = client.DeployProject(WaitUntil.Completed, "<projectName>", "<deploymentName>");
BinaryData data = operation.WaitForCompletion();
JsonElement result = JsonDocument.Parse(data.ToStream()).RootElement;
Console.WriteLine(result.GetProperty("deploymentName").ToString());
Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString());
]]></code></example>
</Docs>
</Member>
<Member MemberName="DeployProjectAsync">
<MemberSignature Language="C#" Value="public virtual System.Threading.Tasks.Task<Azure.Operation<BinaryData>> DeployProjectAsync (Azure.WaitUntil waitUntil, string projectName, string deploymentName, Azure.RequestContext context = default);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class System.Threading.Tasks.Task`1<class Azure.Operation`1<class System.BinaryData>> DeployProjectAsync(valuetype Azure.WaitUntil waitUntil, string projectName, string deploymentName, class Azure.RequestContext context) cil managed" />
<MemberSignature Language="DocId" Value="M:Azure.AI.Language.QuestionAnswering.Authoring.QuestionAnsweringAuthoringClient.DeployProjectAsync(Azure.WaitUntil,System.String,System.String,Azure.RequestContext)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function DeployProjectAsync (waitUntil As WaitUntil, projectName As String, deploymentName As String, Optional context As RequestContext = Nothing) As Task(Of Operation(Of BinaryData))" />
<MemberSignature Language="F#" Value="abstract member DeployProjectAsync : Azure.WaitUntil * string * string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Operation<BinaryData>>
override this.DeployProjectAsync : Azure.WaitUntil * string * string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Operation<BinaryData>>" Usage="questionAnsweringAuthoringClient.DeployProjectAsync (waitUntil, projectName, deploymentName, context)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Azure.AI.Language.QuestionAnswering</AssemblyName>
<AssemblyVersion>1.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Threading.Tasks.Task<Azure.Operation<System.BinaryData>></ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="waitUntil" Type="Azure.WaitUntil" />
<Parameter Name="projectName" Type="System.String" />
<Parameter Name="deploymentName" Type="System.String" />
<Parameter Name="context" Type="Azure.RequestContext" />
</Parameters>
<Docs>
<param name="waitUntil">
<see cref="F:Azure.WaitUntil.Completed" /> if the method should wait to return until the long-running operation has completed on the service; <see cref="F:Azure.WaitUntil.Started" /> if it should return after starting the operation. For more information on long-running operations, please see <see href="https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/LongRunningOperations.md"> Azure.Core Long-Running Operation samples</see>. </param>
<param name="projectName"> The name of the project to use. </param>
<param name="deploymentName"> The name of the specific deployment of the project to use. </param>
<param name="context"> The request context, which can override default behaviors of the client pipeline on a per-call basis. </param>
<summary> Deploy project to production. </summary>
<returns> The <see cref="T:Azure.Operation`1" /> from the service that will contain a <see cref="T:System.BinaryData" /> object once the asynchronous operation on the service has completed. Details of the body schema for the operation's final value are in the Remarks section below. </returns>
<remarks>
Below is the JSON schema for the response payload.
Additional information can be found in the service REST API documentation:
https://learn.microsoft.com/rest/api/cognitiveservices/questionanswering/question-answering-projects/deploy-project
Response Body:
Schema for <c>ProjectDeployment</c>:
<code>{
deploymentName: string, # Optional. Name of the deployment.
lastDeployedDateTime: string (ISO 8601 Format), # Optional. Represents the project last deployment date-time.
}
</code></remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="projectName" /> or <paramref name="deploymentName" /> is null. </exception>
<exception cref="T:System.ArgumentException">
<paramref name="projectName" /> or <paramref name="deploymentName" /> is an empty string, and was expected to be non-empty. </exception>
<exception cref="T:Azure.RequestFailedException"> Service returned a non-success status code. </exception>
<example>
This sample shows how to call DeployProjectAsync with required parameters and parse the result.
<code><![CDATA[
var credential = new AzureKeyCredential("<key>");
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new QuestionAnsweringAuthoringClient(endpoint, credential);
var operation = await client.DeployProjectAsync(WaitUntil.Completed, "<projectName>", "<deploymentName>");
BinaryData data = await operation.WaitForCompletionAsync();
JsonElement result = JsonDocument.Parse(data.ToStream()).RootElement;
Console.WriteLine(result.GetProperty("deploymentName").ToString());
Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString());
]]></code></example>
</Docs>
</Member>
<Member MemberName="Export">
<MemberSignature Language="C#" Value="public virtual Azure.Operation<BinaryData> Export (Azure.WaitUntil waitUntil, string projectName, string format = default, string assetKind = default, Azure.RequestContext context = default);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class Azure.Operation`1<class System.BinaryData> Export(valuetype Azure.WaitUntil waitUntil, string projectName, string format, string assetKind, class Azure.RequestContext context) cil managed" />
<MemberSignature Language="DocId" Value="M:Azure.AI.Language.QuestionAnswering.Authoring.QuestionAnsweringAuthoringClient.Export(Azure.WaitUntil,System.String,System.String,System.String,Azure.RequestContext)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function Export (waitUntil As WaitUntil, projectName As String, Optional format As String = Nothing, Optional assetKind As String = Nothing, Optional context As RequestContext = Nothing) As Operation(Of BinaryData)" />
<MemberSignature Language="F#" Value="abstract member Export : Azure.WaitUntil * string * string * string * Azure.RequestContext -> Azure.Operation<BinaryData>
override this.Export : Azure.WaitUntil * string * string * string * Azure.RequestContext -> Azure.Operation<BinaryData>" Usage="questionAnsweringAuthoringClient.Export (waitUntil, projectName, format, assetKind, context)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Azure.AI.Language.QuestionAnswering</AssemblyName>
<AssemblyVersion>1.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Azure.Operation<System.BinaryData></ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="waitUntil" Type="Azure.WaitUntil" />
<Parameter Name="projectName" Type="System.String" />
<Parameter Name="format" Type="System.String" />
<Parameter Name="assetKind" Type="System.String" />
<Parameter Name="context" Type="Azure.RequestContext" />
</Parameters>
<Docs>
<param name="waitUntil">
<see cref="F:Azure.WaitUntil.Completed" /> if the method should wait to return until the long-running operation has completed on the service; <see cref="F:Azure.WaitUntil.Started" /> if it should return after starting the operation. For more information on long-running operations, please see <see href="https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/LongRunningOperations.md"> Azure.Core Long-Running Operation samples</see>. </param>
<param name="projectName"> The name of the project to use. </param>
<param name="format"> Knowledge base Import or Export format. Allowed values: "json" | "tsv" | "excel". </param>
<param name="assetKind"> Kind of the asset of the project. Allowed values: "qnas" | "synonyms". </param>
<param name="context"> The request context, which can override default behaviors of the client pipeline on a per-call basis. </param>
<summary> Export project metadata and assets. </summary>
<returns> The <see cref="T:Azure.Operation`1" /> from the service that will contain a <see cref="T:System.BinaryData" /> object once the asynchronous operation on the service has completed. Details of the body schema for the operation's final value are in the Remarks section below. </returns>
<remarks>
Below is the JSON schema for the response payload.
Additional information can be found in the service REST API documentation:
https://learn.microsoft.com/rest/api/cognitiveservices/questionanswering/question-answering-projects/export
Response Body:
Schema for <c>ExportJobState</c>:
<code>{
createdDateTime: string (ISO 8601 Format), # Required.
expirationDateTime: string (ISO 8601 Format), # Optional.
jobId: string, # Required.
lastUpdatedDateTime: string (ISO 8601 Format), # Required.
status: "notStarted" | "running" | "succeeded" | "failed" | "cancelled" | "cancelling" | "partiallyCompleted", # Required. Job Status.
}
</code></remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="projectName" /> is null. </exception>
<exception cref="T:System.ArgumentException">
<paramref name="projectName" /> is an empty string, and was expected to be non-empty. </exception>
<exception cref="T:Azure.RequestFailedException"> Service returned a non-success status code. </exception>
<example>
This sample shows how to call Export with required parameters and parse the result.
<code><![CDATA[
var credential = new AzureKeyCredential("<key>");
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new QuestionAnsweringAuthoringClient(endpoint, credential);
var operation = client.Export(WaitUntil.Completed, "<projectName>");
BinaryData data = operation.WaitForCompletion();
JsonElement result = JsonDocument.Parse(data.ToStream()).RootElement;
Console.WriteLine(result.GetProperty("createdDateTime").ToString());
Console.WriteLine(result.GetProperty("jobId").ToString());
Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
Console.WriteLine(result.GetProperty("status").ToString());
]]></code>
This sample shows how to call Export with all parameters, and how to parse the result.
<code><![CDATA[
var credential = new AzureKeyCredential("<key>");
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new QuestionAnsweringAuthoringClient(endpoint, credential);
var operation = client.Export(WaitUntil.Completed, "<projectName>", "<format>", "<assetKind>");
BinaryData data = operation.WaitForCompletion();
JsonElement result = JsonDocument.Parse(data.ToStream()).RootElement;
Console.WriteLine(result.GetProperty("createdDateTime").ToString());
Console.WriteLine(result.GetProperty("expirationDateTime").ToString());
Console.WriteLine(result.GetProperty("jobId").ToString());
Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
Console.WriteLine(result.GetProperty("status").ToString());
]]></code></example>
</Docs>
</Member>
<Member MemberName="ExportAsync">
<MemberSignature Language="C#" Value="public virtual System.Threading.Tasks.Task<Azure.Operation<BinaryData>> ExportAsync (Azure.WaitUntil waitUntil, string projectName, string format = default, string assetKind = default, Azure.RequestContext context = default);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class System.Threading.Tasks.Task`1<class Azure.Operation`1<class System.BinaryData>> ExportAsync(valuetype Azure.WaitUntil waitUntil, string projectName, string format, string assetKind, class Azure.RequestContext context) cil managed" />
<MemberSignature Language="DocId" Value="M:Azure.AI.Language.QuestionAnswering.Authoring.QuestionAnsweringAuthoringClient.ExportAsync(Azure.WaitUntil,System.String,System.String,System.String,Azure.RequestContext)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function ExportAsync (waitUntil As WaitUntil, projectName As String, Optional format As String = Nothing, Optional assetKind As String = Nothing, Optional context As RequestContext = Nothing) As Task(Of Operation(Of BinaryData))" />
<MemberSignature Language="F#" Value="abstract member ExportAsync : Azure.WaitUntil * string * string * string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Operation<BinaryData>>
override this.ExportAsync : Azure.WaitUntil * string * string * string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Operation<BinaryData>>" Usage="questionAnsweringAuthoringClient.ExportAsync (waitUntil, projectName, format, assetKind, context)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Azure.AI.Language.QuestionAnswering</AssemblyName>
<AssemblyVersion>1.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Threading.Tasks.Task<Azure.Operation<System.BinaryData>></ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="waitUntil" Type="Azure.WaitUntil" />
<Parameter Name="projectName" Type="System.String" />
<Parameter Name="format" Type="System.String" />
<Parameter Name="assetKind" Type="System.String" />
<Parameter Name="context" Type="Azure.RequestContext" />
</Parameters>
<Docs>
<param name="waitUntil">
<see cref="F:Azure.WaitUntil.Completed" /> if the method should wait to return until the long-running operation has completed on the service; <see cref="F:Azure.WaitUntil.Started" /> if it should return after starting the operation. For more information on long-running operations, please see <see href="https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/LongRunningOperations.md"> Azure.Core Long-Running Operation samples</see>. </param>
<param name="projectName"> The name of the project to use. </param>
<param name="format"> Knowledge base Import or Export format. Allowed values: "json" | "tsv" | "excel". </param>
<param name="assetKind"> Kind of the asset of the project. Allowed values: "qnas" | "synonyms". </param>
<param name="context"> The request context, which can override default behaviors of the client pipeline on a per-call basis. </param>
<summary> Export project metadata and assets. </summary>
<returns> The <see cref="T:Azure.Operation`1" /> from the service that will contain a <see cref="T:System.BinaryData" /> object once the asynchronous operation on the service has completed. Details of the body schema for the operation's final value are in the Remarks section below. </returns>
<remarks>
Below is the JSON schema for the response payload.
Additional information can be found in the service REST API documentation:
https://learn.microsoft.com/rest/api/cognitiveservices/questionanswering/question-answering-projects/export
Response Body:
Schema for <c>ExportJobState</c>:
<code>{
createdDateTime: string (ISO 8601 Format), # Required.
expirationDateTime: string (ISO 8601 Format), # Optional.
jobId: string, # Required.
lastUpdatedDateTime: string (ISO 8601 Format), # Required.
status: "notStarted" | "running" | "succeeded" | "failed" | "cancelled" | "cancelling" | "partiallyCompleted", # Required. Job Status.
}
</code></remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="projectName" /> is null. </exception>
<exception cref="T:System.ArgumentException">
<paramref name="projectName" /> is an empty string, and was expected to be non-empty. </exception>
<exception cref="T:Azure.RequestFailedException"> Service returned a non-success status code. </exception>
<example>
This sample shows how to call ExportAsync with required parameters and parse the result.
<code><![CDATA[
var credential = new AzureKeyCredential("<key>");
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new QuestionAnsweringAuthoringClient(endpoint, credential);
var operation = await client.ExportAsync(WaitUntil.Completed, "<projectName>");
BinaryData data = await operation.WaitForCompletionAsync();
JsonElement result = JsonDocument.Parse(data.ToStream()).RootElement;
Console.WriteLine(result.GetProperty("createdDateTime").ToString());
Console.WriteLine(result.GetProperty("jobId").ToString());
Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
Console.WriteLine(result.GetProperty("status").ToString());
]]></code>
This sample shows how to call ExportAsync with all parameters, and how to parse the result.
<code><![CDATA[
var credential = new AzureKeyCredential("<key>");
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new QuestionAnsweringAuthoringClient(endpoint, credential);
var operation = await client.ExportAsync(WaitUntil.Completed, "<projectName>", "<format>", "<assetKind>");
BinaryData data = await operation.WaitForCompletionAsync();
JsonElement result = JsonDocument.Parse(data.ToStream()).RootElement;
Console.WriteLine(result.GetProperty("createdDateTime").ToString());
Console.WriteLine(result.GetProperty("expirationDateTime").ToString());
Console.WriteLine(result.GetProperty("jobId").ToString());
Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
Console.WriteLine(result.GetProperty("status").ToString());
]]></code></example>
</Docs>
</Member>
<Member MemberName="GetDeleteStatus">
<MemberSignature Language="C#" Value="public virtual Azure.Response GetDeleteStatus (string jobId, Azure.RequestContext context = default);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class Azure.Response GetDeleteStatus(string jobId, class Azure.RequestContext context) cil managed" />
<MemberSignature Language="DocId" Value="M:Azure.AI.Language.QuestionAnswering.Authoring.QuestionAnsweringAuthoringClient.GetDeleteStatus(System.String,Azure.RequestContext)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function GetDeleteStatus (jobId As String, Optional context As RequestContext = Nothing) As Response" />
<MemberSignature Language="F#" Value="abstract member GetDeleteStatus : string * Azure.RequestContext -> Azure.Response
override this.GetDeleteStatus : string * Azure.RequestContext -> Azure.Response" Usage="questionAnsweringAuthoringClient.GetDeleteStatus (jobId, context)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Azure.AI.Language.QuestionAnswering</AssemblyName>
<AssemblyVersion>1.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Azure.Response</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="jobId" Type="System.String" />
<Parameter Name="context" Type="Azure.RequestContext" />
</Parameters>
<Docs>
<param name="jobId"> Job ID. </param>
<param name="context"> The request context, which can override default behaviors of the client pipeline on a per-call basis. </param>
<summary> Gets the status of a Project delete job. </summary>
<returns> The response returned from the service. Details of the response body schema are in the Remarks section below. </returns>
<remarks>
Below is the JSON schema for the response payload.
Additional information can be found in the service REST API documentation:
https://learn.microsoft.com/rest/api/cognitiveservices/questionanswering/question-answering-projects/get-delete-status
Response Body:
<details><summary>ExportJobState</summary>Schema for <c>ExportJobState</c>:
<code>{
createdDateTime: string (ISO 8601 Format), # Required.
expirationDateTime: string (ISO 8601 Format), # Optional.
jobId: string, # Required.
lastUpdatedDateTime: string (ISO 8601 Format), # Required.
status: "notStarted" | "running" | "succeeded" | "failed" | "cancelled" | "cancelling" | "partiallyCompleted", # Required. Job Status.
}
</code></details></remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="jobId" /> is null. </exception>
<exception cref="T:System.ArgumentException">
<paramref name="jobId" /> is an empty string, and was expected to be non-empty. </exception>
<exception cref="T:Azure.RequestFailedException"> Service returned a non-success status code. </exception>
<example>
This sample shows how to call GetDeleteStatus with required parameters and parse the result.
<code><![CDATA[
var credential = new AzureKeyCredential("<key>");
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new QuestionAnsweringAuthoringClient(endpoint, credential);
Response response = client.GetDeleteStatus("<jobId>");
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("createdDateTime").ToString());
Console.WriteLine(result.GetProperty("expirationDateTime").ToString());
Console.WriteLine(result.GetProperty("jobId").ToString());
Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
Console.WriteLine(result.GetProperty("status").ToString());
]]></code></example>
</Docs>
</Member>
<Member MemberName="GetDeleteStatusAsync">
<MemberSignature Language="C#" Value="public virtual System.Threading.Tasks.Task<Azure.Response> GetDeleteStatusAsync (string jobId, Azure.RequestContext context = default);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class System.Threading.Tasks.Task`1<class Azure.Response> GetDeleteStatusAsync(string jobId, class Azure.RequestContext context) cil managed" />
<MemberSignature Language="DocId" Value="M:Azure.AI.Language.QuestionAnswering.Authoring.QuestionAnsweringAuthoringClient.GetDeleteStatusAsync(System.String,Azure.RequestContext)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function GetDeleteStatusAsync (jobId As String, Optional context As RequestContext = Nothing) As Task(Of Response)" />
<MemberSignature Language="F#" Value="abstract member GetDeleteStatusAsync : string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.GetDeleteStatusAsync : string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>" Usage="questionAnsweringAuthoringClient.GetDeleteStatusAsync (jobId, context)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Azure.AI.Language.QuestionAnswering</AssemblyName>
<AssemblyVersion>1.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Threading.Tasks.Task<Azure.Response></ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="jobId" Type="System.String" />
<Parameter Name="context" Type="Azure.RequestContext" />
</Parameters>
<Docs>
<param name="jobId"> Job ID. </param>
<param name="context"> The request context, which can override default behaviors of the client pipeline on a per-call basis. </param>
<summary> Gets the status of a Project delete job. </summary>
<returns> The response returned from the service. Details of the response body schema are in the Remarks section below. </returns>
<remarks>
Below is the JSON schema for the response payload.
Additional information can be found in the service REST API documentation:
https://learn.microsoft.com/rest/api/cognitiveservices/questionanswering/question-answering-projects/get-delete-status
Response Body:
<details><summary>ExportJobState</summary>Schema for <c>ExportJobState</c>:
<code>{
createdDateTime: string (ISO 8601 Format), # Required.
expirationDateTime: string (ISO 8601 Format), # Optional.
jobId: string, # Required.
lastUpdatedDateTime: string (ISO 8601 Format), # Required.
status: "notStarted" | "running" | "succeeded" | "failed" | "cancelled" | "cancelling" | "partiallyCompleted", # Required. Job Status.
}
</code></details></remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="jobId" /> is null. </exception>
<exception cref="T:System.ArgumentException">
<paramref name="jobId" /> is an empty string, and was expected to be non-empty. </exception>
<exception cref="T:Azure.RequestFailedException"> Service returned a non-success status code. </exception>
<example>
This sample shows how to call GetDeleteStatusAsync with required parameters and parse the result.
<code><![CDATA[
var credential = new AzureKeyCredential("<key>");
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new QuestionAnsweringAuthoringClient(endpoint, credential);
Response response = await client.GetDeleteStatusAsync("<jobId>");
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("createdDateTime").ToString());
Console.WriteLine(result.GetProperty("expirationDateTime").ToString());
Console.WriteLine(result.GetProperty("jobId").ToString());
Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
Console.WriteLine(result.GetProperty("status").ToString());
]]></code></example>
</Docs>
</Member>
<Member MemberName="GetDeployments">
<MemberSignature Language="C#" Value="public virtual Azure.Pageable<BinaryData> GetDeployments (string projectName, Azure.RequestContext context = default);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class Azure.Pageable`1<class System.BinaryData> GetDeployments(string projectName, class Azure.RequestContext context) cil managed" />
<MemberSignature Language="DocId" Value="M:Azure.AI.Language.QuestionAnswering.Authoring.QuestionAnsweringAuthoringClient.GetDeployments(System.String,Azure.RequestContext)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function GetDeployments (projectName As String, Optional context As RequestContext = Nothing) As Pageable(Of BinaryData)" />
<MemberSignature Language="F#" Value="abstract member GetDeployments : string * Azure.RequestContext -> Azure.Pageable<BinaryData>
override this.GetDeployments : string * Azure.RequestContext -> Azure.Pageable<BinaryData>" Usage="questionAnsweringAuthoringClient.GetDeployments (projectName, context)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Azure.AI.Language.QuestionAnswering</AssemblyName>
<AssemblyVersion>1.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Azure.Pageable<System.BinaryData></ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="projectName" Type="System.String" />
<Parameter Name="context" Type="Azure.RequestContext" />
</Parameters>
<Docs>
<param name="projectName"> The name of the project to use. </param>
<param name="context"> The request context, which can override default behaviors of the client pipeline on a per-call basis. </param>
<summary> List all deployments of a project. </summary>
<returns> The <see cref="T:Azure.Pageable`1" /> from the service containing a list of <see cref="T:System.BinaryData" /> objects. Details of the body schema for each item in the collection are in the Remarks section below. </returns>
<remarks>
Below is the JSON schema for one item in the pageable response.
Additional information can be found in the service REST API documentation:
https://learn.microsoft.com/rest/api/cognitiveservices/questionanswering/question-answering-projects/list-deployments
Response Body:
Schema for <c>ProjectDeploymentsList</c>:
<code>{
deploymentName: string, # Optional. Name of the deployment.
lastDeployedDateTime: string (ISO 8601 Format), # Optional. Represents the project last deployment date-time.
}
</code></remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="projectName" /> is null. </exception>
<exception cref="T:System.ArgumentException">
<paramref name="projectName" /> is an empty string, and was expected to be non-empty. </exception>
<exception cref="T:Azure.RequestFailedException"> Service returned a non-success status code. </exception>
<example>
This sample shows how to call GetDeployments with required parameters and parse the result.
<code><![CDATA[
var credential = new AzureKeyCredential("<key>");
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new QuestionAnsweringAuthoringClient(endpoint, credential);
foreach (var data in client.GetDeployments("<projectName>"))
{
JsonElement result = JsonDocument.Parse(data.ToStream()).RootElement;
Console.WriteLine(result.GetProperty("deploymentName").ToString());
Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString());
}
]]></code></example>
</Docs>
</Member>
<Member MemberName="GetDeploymentsAsync">
<MemberSignature Language="C#" Value="public virtual Azure.AsyncPageable<BinaryData> GetDeploymentsAsync (string projectName, Azure.RequestContext context = default);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class Azure.AsyncPageable`1<class System.BinaryData> GetDeploymentsAsync(string projectName, class Azure.RequestContext context) cil managed" />
<MemberSignature Language="DocId" Value="M:Azure.AI.Language.QuestionAnswering.Authoring.QuestionAnsweringAuthoringClient.GetDeploymentsAsync(System.String,Azure.RequestContext)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function GetDeploymentsAsync (projectName As String, Optional context As RequestContext = Nothing) As AsyncPageable(Of BinaryData)" />
<MemberSignature Language="F#" Value="abstract member GetDeploymentsAsync : string * Azure.RequestContext -> Azure.AsyncPageable<BinaryData>
override this.GetDeploymentsAsync : string * Azure.RequestContext -> Azure.AsyncPageable<BinaryData>" Usage="questionAnsweringAuthoringClient.GetDeploymentsAsync (projectName, context)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Azure.AI.Language.QuestionAnswering</AssemblyName>
<AssemblyVersion>1.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Azure.AsyncPageable<System.BinaryData></ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="projectName" Type="System.String" />
<Parameter Name="context" Type="Azure.RequestContext" />
</Parameters>
<Docs>
<param name="projectName"> The name of the project to use. </param>
<param name="context"> The request context, which can override default behaviors of the client pipeline on a per-call basis. </param>
<summary> List all deployments of a project. </summary>
<returns> The <see cref="T:Azure.AsyncPageable`1" /> from the service containing a list of <see cref="T:System.BinaryData" /> objects. Details of the body schema for each item in the collection are in the Remarks section below. </returns>
<remarks>
Below is the JSON schema for one item in the pageable response.
Additional information can be found in the service REST API documentation:
https://learn.microsoft.com/rest/api/cognitiveservices/questionanswering/question-answering-projects/list-deployments
Response Body:
Schema for <c>ProjectDeploymentsList</c>:
<code>{
deploymentName: string, # Optional. Name of the deployment.
lastDeployedDateTime: string (ISO 8601 Format), # Optional. Represents the project last deployment date-time.
}
</code></remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="projectName" /> is null. </exception>
<exception cref="T:System.ArgumentException">
<paramref name="projectName" /> is an empty string, and was expected to be non-empty. </exception>
<exception cref="T:Azure.RequestFailedException"> Service returned a non-success status code. </exception>
<example>
This sample shows how to call GetDeploymentsAsync with required parameters and parse the result.
<code><![CDATA[
var credential = new AzureKeyCredential("<key>");
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new QuestionAnsweringAuthoringClient(endpoint, credential);
await foreach (var data in client.GetDeploymentsAsync("<projectName>"))
{
JsonElement result = JsonDocument.Parse(data.ToStream()).RootElement;
Console.WriteLine(result.GetProperty("deploymentName").ToString());
Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString());
}
]]></code></example>
</Docs>
</Member>
<Member MemberName="GetDeployStatus">
<MemberSignature Language="C#" Value="public virtual Azure.Response GetDeployStatus (string projectName, string deploymentName, string jobId, Azure.RequestContext context = default);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class Azure.Response GetDeployStatus(string projectName, string deploymentName, string jobId, class Azure.RequestContext context) cil managed" />
<MemberSignature Language="DocId" Value="M:Azure.AI.Language.QuestionAnswering.Authoring.QuestionAnsweringAuthoringClient.GetDeployStatus(System.String,System.String,System.String,Azure.RequestContext)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function GetDeployStatus (projectName As String, deploymentName As String, jobId As String, Optional context As RequestContext = Nothing) As Response" />
<MemberSignature Language="F#" Value="abstract member GetDeployStatus : string * string * string * Azure.RequestContext -> Azure.Response
override this.GetDeployStatus : string * string * string * Azure.RequestContext -> Azure.Response" Usage="questionAnsweringAuthoringClient.GetDeployStatus (projectName, deploymentName, jobId, context)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Azure.AI.Language.QuestionAnswering</AssemblyName>
<AssemblyVersion>1.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Azure.Response</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="projectName" Type="System.String" />
<Parameter Name="deploymentName" Type="System.String" />
<Parameter Name="jobId" Type="System.String" />
<Parameter Name="context" Type="Azure.RequestContext" />
</Parameters>
<Docs>
<param name="projectName"> The name of the project to use. </param>
<param name="deploymentName"> The name of the specific deployment of the project to use. </param>
<param name="jobId"> Job ID. </param>
<param name="context"> The request context, which can override default behaviors of the client pipeline on a per-call basis. </param>
<summary> Gets the status of a Deploy job. </summary>
<returns> The response returned from the service. Details of the response body schema are in the Remarks section below. </returns>
<remarks>
Below is the JSON schema for the response payload.
Additional information can be found in the service REST API documentation:
https://learn.microsoft.com/rest/api/cognitiveservices/questionanswering/question-answering-projects/get-deploy-status
Response Body:
<details><summary>ExportJobState</summary>Schema for <c>ExportJobState</c>:
<code>{
createdDateTime: string (ISO 8601 Format), # Required.
expirationDateTime: string (ISO 8601 Format), # Optional.
jobId: string, # Required.
lastUpdatedDateTime: string (ISO 8601 Format), # Required.
status: "notStarted" | "running" | "succeeded" | "failed" | "cancelled" | "cancelling" | "partiallyCompleted", # Required. Job Status.
}
</code></details></remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="projectName" />, <paramref name="deploymentName" /> or <paramref name="jobId" /> is null. </exception>
<exception cref="T:System.ArgumentException">
<paramref name="projectName" />, <paramref name="deploymentName" /> or <paramref name="jobId" /> is an empty string, and was expected to be non-empty. </exception>
<exception cref="T:Azure.RequestFailedException"> Service returned a non-success status code. </exception>
<example>
This sample shows how to call GetDeployStatus with required parameters and parse the result.
<code><![CDATA[
var credential = new AzureKeyCredential("<key>");
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new QuestionAnsweringAuthoringClient(endpoint, credential);
Response response = client.GetDeployStatus("<projectName>", "<deploymentName>", "<jobId>");
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("createdDateTime").ToString());
Console.WriteLine(result.GetProperty("expirationDateTime").ToString());
Console.WriteLine(result.GetProperty("jobId").ToString());
Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
Console.WriteLine(result.GetProperty("status").ToString());
]]></code></example>
</Docs>
</Member>
<Member MemberName="GetDeployStatusAsync">
<MemberSignature Language="C#" Value="public virtual System.Threading.Tasks.Task<Azure.Response> GetDeployStatusAsync (string projectName, string deploymentName, string jobId, Azure.RequestContext context = default);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class System.Threading.Tasks.Task`1<class Azure.Response> GetDeployStatusAsync(string projectName, string deploymentName, string jobId, class Azure.RequestContext context) cil managed" />
<MemberSignature Language="DocId" Value="M:Azure.AI.Language.QuestionAnswering.Authoring.QuestionAnsweringAuthoringClient.GetDeployStatusAsync(System.String,System.String,System.String,Azure.RequestContext)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function GetDeployStatusAsync (projectName As String, deploymentName As String, jobId As String, Optional context As RequestContext = Nothing) As Task(Of Response)" />
<MemberSignature Language="F#" Value="abstract member GetDeployStatusAsync : string * string * string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.GetDeployStatusAsync : string * string * string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>" Usage="questionAnsweringAuthoringClient.GetDeployStatusAsync (projectName, deploymentName, jobId, context)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Azure.AI.Language.QuestionAnswering</AssemblyName>
<AssemblyVersion>1.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Threading.Tasks.Task<Azure.Response></ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="projectName" Type="System.String" />
<Parameter Name="deploymentName" Type="System.String" />
<Parameter Name="jobId" Type="System.String" />
<Parameter Name="context" Type="Azure.RequestContext" />
</Parameters>
<Docs>
<param name="projectName"> The name of the project to use. </param>
<param name="deploymentName"> The name of the specific deployment of the project to use. </param>
<param name="jobId"> Job ID. </param>
<param name="context"> The request context, which can override default behaviors of the client pipeline on a per-call basis. </param>
<summary> Gets the status of a Deploy job. </summary>
<returns> The response returned from the service. Details of the response body schema are in the Remarks section below. </returns>
<remarks>
Below is the JSON schema for the response payload.
Additional information can be found in the service REST API documentation:
https://learn.microsoft.com/rest/api/cognitiveservices/questionanswering/question-answering-projects/get-deploy-status
Response Body:
<details><summary>ExportJobState</summary>Schema for <c>ExportJobState</c>:
<code>{
createdDateTime: string (ISO 8601 Format), # Required.
expirationDateTime: string (ISO 8601 Format), # Optional.
jobId: string, # Required.
lastUpdatedDateTime: string (ISO 8601 Format), # Required.
status: "notStarted" | "running" | "succeeded" | "failed" | "cancelled" | "cancelling" | "partiallyCompleted", # Required. Job Status.
}
</code></details></remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="projectName" />, <paramref name="deploymentName" /> or <paramref name="jobId" /> is null. </exception>
<exception cref="T:System.ArgumentException">
<paramref name="projectName" />, <paramref name="deploymentName" /> or <paramref name="jobId" /> is an empty string, and was expected to be non-empty. </exception>
<exception cref="T:Azure.RequestFailedException"> Service returned a non-success status code. </exception>
<example>
This sample shows how to call GetDeployStatusAsync with required parameters and parse the result.
<code><![CDATA[
var credential = new AzureKeyCredential("<key>");
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new QuestionAnsweringAuthoringClient(endpoint, credential);
Response response = await client.GetDeployStatusAsync("<projectName>", "<deploymentName>", "<jobId>");
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("createdDateTime").ToString());
Console.WriteLine(result.GetProperty("expirationDateTime").ToString());
Console.WriteLine(result.GetProperty("jobId").ToString());
Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
Console.WriteLine(result.GetProperty("status").ToString());
]]></code></example>
</Docs>
</Member>
<Member MemberName="GetExportStatus">
<MemberSignature Language="C#" Value="public virtual Azure.Response GetExportStatus (string projectName, string jobId, Azure.RequestContext context = default);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class Azure.Response GetExportStatus(string projectName, string jobId, class Azure.RequestContext context) cil managed" />
<MemberSignature Language="DocId" Value="M:Azure.AI.Language.QuestionAnswering.Authoring.QuestionAnsweringAuthoringClient.GetExportStatus(System.String,System.String,Azure.RequestContext)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function GetExportStatus (projectName As String, jobId As String, Optional context As RequestContext = Nothing) As Response" />
<MemberSignature Language="F#" Value="abstract member GetExportStatus : string * string * Azure.RequestContext -> Azure.Response
override this.GetExportStatus : string * string * Azure.RequestContext -> Azure.Response" Usage="questionAnsweringAuthoringClient.GetExportStatus (projectName, jobId, context)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Azure.AI.Language.QuestionAnswering</AssemblyName>
<AssemblyVersion>1.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Azure.Response</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="projectName" Type="System.String" />
<Parameter Name="jobId" Type="System.String" />
<Parameter Name="context" Type="Azure.RequestContext" />
</Parameters>
<Docs>
<param name="projectName"> The name of the project to use. </param>
<param name="jobId"> Job ID. </param>
<param name="context"> The request context, which can override default behaviors of the client pipeline on a per-call basis. </param>
<summary> Gets the status of an Export job, once job completes, returns the project metadata, and assets. </summary>
<returns> The response returned from the service. Details of the response body schema are in the Remarks section below. </returns>
<remarks>
Below is the JSON schema for the response payload.
Additional information can be found in the service REST API documentation:
https://learn.microsoft.com/rest/api/cognitiveservices/questionanswering/question-answering-projects/get-export-status
Response Body:
Schema for <c>ExportJobState</c>:
<code>{
createdDateTime: string (ISO 8601 Format), # Required.
expirationDateTime: string (ISO 8601 Format), # Optional.
jobId: string, # Required.
lastUpdatedDateTime: string (ISO 8601 Format), # Required.
status: "notStarted" | "running" | "succeeded" | "failed" | "cancelled" | "cancelling" | "partiallyCompleted", # Required. Job Status.
}
</code></remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="projectName" /> or <paramref name="jobId" /> is null. </exception>
<exception cref="T:System.ArgumentException">
<paramref name="projectName" /> or <paramref name="jobId" /> is an empty string, and was expected to be non-empty. </exception>
<exception cref="T:Azure.RequestFailedException"> Service returned a non-success status code. </exception>
<example>
This sample shows how to call GetExportStatus with required parameters and parse the result.
<code><![CDATA[
var credential = new AzureKeyCredential("<key>");
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new QuestionAnsweringAuthoringClient(endpoint, credential);
Response response = client.GetExportStatus("<projectName>", "<jobId>");
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("createdDateTime").ToString());
Console.WriteLine(result.GetProperty("expirationDateTime").ToString());
Console.WriteLine(result.GetProperty("jobId").ToString());
Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
Console.WriteLine(result.GetProperty("status").ToString());
]]></code></example>
</Docs>
</Member>
<Member MemberName="GetExportStatusAsync">
<MemberSignature Language="C#" Value="public virtual System.Threading.Tasks.Task<Azure.Response> GetExportStatusAsync (string projectName, string jobId, Azure.RequestContext context = default);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class System.Threading.Tasks.Task`1<class Azure.Response> GetExportStatusAsync(string projectName, string jobId, class Azure.RequestContext context) cil managed" />
<MemberSignature Language="DocId" Value="M:Azure.AI.Language.QuestionAnswering.Authoring.QuestionAnsweringAuthoringClient.GetExportStatusAsync(System.String,System.String,Azure.RequestContext)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function GetExportStatusAsync (projectName As String, jobId As String, Optional context As RequestContext = Nothing) As Task(Of Response)" />
<MemberSignature Language="F#" Value="abstract member GetExportStatusAsync : string * string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.GetExportStatusAsync : string * string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>" Usage="questionAnsweringAuthoringClient.GetExportStatusAsync (projectName, jobId, context)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Azure.AI.Language.QuestionAnswering</AssemblyName>
<AssemblyVersion>1.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Threading.Tasks.Task<Azure.Response></ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="projectName" Type="System.String" />
<Parameter Name="jobId" Type="System.String" />
<Parameter Name="context" Type="Azure.RequestContext" />
</Parameters>
<Docs>
<param name="projectName"> The name of the project to use. </param>
<param name="jobId"> Job ID. </param>
<param name="context"> The request context, which can override default behaviors of the client pipeline on a per-call basis. </param>
<summary> Gets the status of an Export job, once job completes, returns the project metadata, and assets. </summary>
<returns> The response returned from the service. Details of the response body schema are in the Remarks section below. </returns>
<remarks>
Below is the JSON schema for the response payload.
Additional information can be found in the service REST API documentation:
https://learn.microsoft.com/rest/api/cognitiveservices/questionanswering/question-answering-projects/get-export-status
Response Body:
Schema for <c>ExportJobState</c>:
<code>{
createdDateTime: string (ISO 8601 Format), # Required.
expirationDateTime: string (ISO 8601 Format), # Optional.
jobId: string, # Required.
lastUpdatedDateTime: string (ISO 8601 Format), # Required.
status: "notStarted" | "running" | "succeeded" | "failed" | "cancelled" | "cancelling" | "partiallyCompleted", # Required. Job Status.
}
</code></remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="projectName" /> or <paramref name="jobId" /> is null. </exception>
<exception cref="T:System.ArgumentException">
<paramref name="projectName" /> or <paramref name="jobId" /> is an empty string, and was expected to be non-empty. </exception>
<exception cref="T:Azure.RequestFailedException"> Service returned a non-success status code. </exception>
<example>
This sample shows how to call GetExportStatusAsync with required parameters and parse the result.
<code><![CDATA[
var credential = new AzureKeyCredential("<key>");
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new QuestionAnsweringAuthoringClient(endpoint, credential);
Response response = await client.GetExportStatusAsync("<projectName>", "<jobId>");
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("createdDateTime").ToString());
Console.WriteLine(result.GetProperty("expirationDateTime").ToString());
Console.WriteLine(result.GetProperty("jobId").ToString());
Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
Console.WriteLine(result.GetProperty("status").ToString());
]]></code></example>
</Docs>
</Member>
<Member MemberName="GetImportStatus">
<MemberSignature Language="C#" Value="public virtual Azure.Response GetImportStatus (string projectName, string jobId, Azure.RequestContext context = default);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class Azure.Response GetImportStatus(string projectName, string jobId, class Azure.RequestContext context) cil managed" />
<MemberSignature Language="DocId" Value="M:Azure.AI.Language.QuestionAnswering.Authoring.QuestionAnsweringAuthoringClient.GetImportStatus(System.String,System.String,Azure.RequestContext)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function GetImportStatus (projectName As String, jobId As String, Optional context As RequestContext = Nothing) As Response" />
<MemberSignature Language="F#" Value="abstract member GetImportStatus : string * string * Azure.RequestContext -> Azure.Response
override this.GetImportStatus : string * string * Azure.RequestContext -> Azure.Response" Usage="questionAnsweringAuthoringClient.GetImportStatus (projectName, jobId, context)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Azure.AI.Language.QuestionAnswering</AssemblyName>
<AssemblyVersion>1.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Azure.Response</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="projectName" Type="System.String" />
<Parameter Name="jobId" Type="System.String" />
<Parameter Name="context" Type="Azure.RequestContext" />
</Parameters>
<Docs>
<param name="projectName"> The name of the project to use. </param>
<param name="jobId"> Job ID. </param>
<param name="context"> The request context, which can override default behaviors of the client pipeline on a per-call basis. </param>
<summary> Gets the status of an Import job. </summary>
<returns> The response returned from the service. Details of the response body schema are in the Remarks section below. </returns>
<remarks>
Below is the JSON schema for the response payload.
Additional information can be found in the service REST API documentation:
https://learn.microsoft.com/rest/api/cognitiveservices/questionanswering/question-answering-projects/get-import-status
Response Body:
<details><summary>ExportJobState</summary>Schema for <c>ExportJobState</c>:
<code>{
createdDateTime: string (ISO 8601 Format), # Required.
expirationDateTime: string (ISO 8601 Format), # Optional.
jobId: string, # Required.
lastUpdatedDateTime: string (ISO 8601 Format), # Required.
status: "notStarted" | "running" | "succeeded" | "failed" | "cancelled" | "cancelling" | "partiallyCompleted", # Required. Job Status.
}
</code></details></remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="projectName" /> or <paramref name="jobId" /> is null. </exception>
<exception cref="T:System.ArgumentException">
<paramref name="projectName" /> or <paramref name="jobId" /> is an empty string, and was expected to be non-empty. </exception>
<exception cref="T:Azure.RequestFailedException"> Service returned a non-success status code. </exception>
<example>
This sample shows how to call GetImportStatus with required parameters and parse the result.
<code><![CDATA[
var credential = new AzureKeyCredential("<key>");
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new QuestionAnsweringAuthoringClient(endpoint, credential);
Response response = client.GetImportStatus("<projectName>", "<jobId>");
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("createdDateTime").ToString());
Console.WriteLine(result.GetProperty("expirationDateTime").ToString());
Console.WriteLine(result.GetProperty("jobId").ToString());
Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
Console.WriteLine(result.GetProperty("status").ToString());
]]></code></example>
</Docs>
</Member>
<Member MemberName="GetImportStatusAsync">
<MemberSignature Language="C#" Value="public virtual System.Threading.Tasks.Task<Azure.Response> GetImportStatusAsync (string projectName, string jobId, Azure.RequestContext context = default);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class System.Threading.Tasks.Task`1<class Azure.Response> GetImportStatusAsync(string projectName, string jobId, class Azure.RequestContext context) cil managed" />
<MemberSignature Language="DocId" Value="M:Azure.AI.Language.QuestionAnswering.Authoring.QuestionAnsweringAuthoringClient.GetImportStatusAsync(System.String,System.String,Azure.RequestContext)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function GetImportStatusAsync (projectName As String, jobId As String, Optional context As RequestContext = Nothing) As Task(Of Response)" />
<MemberSignature Language="F#" Value="abstract member GetImportStatusAsync : string * string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.GetImportStatusAsync : string * string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>" Usage="questionAnsweringAuthoringClient.GetImportStatusAsync (projectName, jobId, context)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Azure.AI.Language.QuestionAnswering</AssemblyName>
<AssemblyVersion>1.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Threading.Tasks.Task<Azure.Response></ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="projectName" Type="System.String" />
<Parameter Name="jobId" Type="System.String" />
<Parameter Name="context" Type="Azure.RequestContext" />
</Parameters>
<Docs>
<param name="projectName"> The name of the project to use. </param>
<param name="jobId"> Job ID. </param>
<param name="context"> The request context, which can override default behaviors of the client pipeline on a per-call basis. </param>
<summary> Gets the status of an Import job. </summary>
<returns> The response returned from the service. Details of the response body schema are in the Remarks section below. </returns>
<remarks>
Below is the JSON schema for the response payload.
Additional information can be found in the service REST API documentation:
https://learn.microsoft.com/rest/api/cognitiveservices/questionanswering/question-answering-projects/get-import-status
Response Body:
<details><summary>ExportJobState</summary>Schema for <c>ExportJobState</c>:
<code>{
createdDateTime: string (ISO 8601 Format), # Required.
expirationDateTime: string (ISO 8601 Format), # Optional.
jobId: string, # Required.
lastUpdatedDateTime: string (ISO 8601 Format), # Required.
status: "notStarted" | "running" | "succeeded" | "failed" | "cancelled" | "cancelling" | "partiallyCompleted", # Required. Job Status.
}
</code></details></remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="projectName" /> or <paramref name="jobId" /> is null. </exception>
<exception cref="T:System.ArgumentException">
<paramref name="projectName" /> or <paramref name="jobId" /> is an empty string, and was expected to be non-empty. </exception>
<exception cref="T:Azure.RequestFailedException"> Service returned a non-success status code. </exception>
<example>
This sample shows how to call GetImportStatusAsync with required parameters and parse the result.
<code><![CDATA[
var credential = new AzureKeyCredential("<key>");
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new QuestionAnsweringAuthoringClient(endpoint, credential);
Response response = await client.GetImportStatusAsync("<projectName>", "<jobId>");
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("createdDateTime").ToString());
Console.WriteLine(result.GetProperty("expirationDateTime").ToString());
Console.WriteLine(result.GetProperty("jobId").ToString());
Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
Console.WriteLine(result.GetProperty("status").ToString());
]]></code></example>
</Docs>
</Member>
<Member MemberName="GetProjectDetails">
<MemberSignature Language="C#" Value="public virtual Azure.Response GetProjectDetails (string projectName, Azure.RequestContext context = default);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class Azure.Response GetProjectDetails(string projectName, class Azure.RequestContext context) cil managed" />
<MemberSignature Language="DocId" Value="M:Azure.AI.Language.QuestionAnswering.Authoring.QuestionAnsweringAuthoringClient.GetProjectDetails(System.String,Azure.RequestContext)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function GetProjectDetails (projectName As String, Optional context As RequestContext = Nothing) As Response" />
<MemberSignature Language="F#" Value="abstract member GetProjectDetails : string * Azure.RequestContext -> Azure.Response
override this.GetProjectDetails : string * Azure.RequestContext -> Azure.Response" Usage="questionAnsweringAuthoringClient.GetProjectDetails (projectName, context)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Azure.AI.Language.QuestionAnswering</AssemblyName>
<AssemblyVersion>1.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Azure.Response</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="projectName" Type="System.String" />
<Parameter Name="context" Type="Azure.RequestContext" />
</Parameters>
<Docs>
<param name="projectName"> The name of the project to use. </param>
<param name="context"> The request context, which can override default behaviors of the client pipeline on a per-call basis. </param>
<summary> Get the requested project metadata. </summary>
<returns> The response returned from the service. Details of the response body schema are in the Remarks section below. </returns>
<remarks>
Below is the JSON schema for the response payload.
Additional information can be found in the service REST API documentation:
https://learn.microsoft.com/rest/api/cognitiveservices/questionanswering/question-answering-projects/get-project-details
Response Body:
Schema for <c>ProjectMetadata</c>:
<code>{
projectName: string, # Optional. Name of the project.
description: string, # Optional. Description of the project.
language: string, # Optional. Language of the text records. This is BCP-47 representation of a language. For example, use "en" for English; "es" for Spanish etc. If not set, use "en" for English as default.
multilingualResource: boolean, # Optional. Resource enabled for multiple languages across projects or not.
settings: {
defaultAnswer: string, # Optional. Default Answer response when no good match is found in the knowledge base.
}, # Optional. Configurable settings of the Project.
createdDateTime: string (ISO 8601 Format), # Optional. Project creation date-time.
lastModifiedDateTime: string (ISO 8601 Format), # Optional. Represents the project last modified date-time.
lastDeployedDateTime: string (ISO 8601 Format), # Optional. Represents the project last deployment date-time.
}
</code></remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="projectName" /> is null. </exception>
<exception cref="T:System.ArgumentException">
<paramref name="projectName" /> is an empty string, and was expected to be non-empty. </exception>
<exception cref="T:Azure.RequestFailedException"> Service returned a non-success status code. </exception>
<example>
This sample shows how to call GetProjectDetails with required parameters and parse the result.
<code><![CDATA[
var credential = new AzureKeyCredential("<key>");
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new QuestionAnsweringAuthoringClient(endpoint, credential);
Response response = client.GetProjectDetails("<projectName>");
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("projectName").ToString());
Console.WriteLine(result.GetProperty("description").ToString());
Console.WriteLine(result.GetProperty("language").ToString());
Console.WriteLine(result.GetProperty("multilingualResource").ToString());
Console.WriteLine(result.GetProperty("settings").GetProperty("defaultAnswer").ToString());
Console.WriteLine(result.GetProperty("createdDateTime").ToString());
Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString());
Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString());
]]></code></example>
</Docs>
</Member>
<Member MemberName="GetProjectDetailsAsync">
<MemberSignature Language="C#" Value="public virtual System.Threading.Tasks.Task<Azure.Response> GetProjectDetailsAsync (string projectName, Azure.RequestContext context = default);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class System.Threading.Tasks.Task`1<class Azure.Response> GetProjectDetailsAsync(string projectName, class Azure.RequestContext context) cil managed" />
<MemberSignature Language="DocId" Value="M:Azure.AI.Language.QuestionAnswering.Authoring.QuestionAnsweringAuthoringClient.GetProjectDetailsAsync(System.String,Azure.RequestContext)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function GetProjectDetailsAsync (projectName As String, Optional context As RequestContext = Nothing) As Task(Of Response)" />
<MemberSignature Language="F#" Value="abstract member GetProjectDetailsAsync : string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.GetProjectDetailsAsync : string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>" Usage="questionAnsweringAuthoringClient.GetProjectDetailsAsync (projectName, context)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Azure.AI.Language.QuestionAnswering</AssemblyName>
<AssemblyVersion>1.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Threading.Tasks.Task<Azure.Response></ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="projectName" Type="System.String" />
<Parameter Name="context" Type="Azure.RequestContext" />
</Parameters>
<Docs>
<param name="projectName"> The name of the project to use. </param>
<param name="context"> The request context, which can override default behaviors of the client pipeline on a per-call basis. </param>
<summary> Get the requested project metadata. </summary>
<returns> The response returned from the service. Details of the response body schema are in the Remarks section below. </returns>
<remarks>
Below is the JSON schema for the response payload.
Additional information can be found in the service REST API documentation:
https://learn.microsoft.com/rest/api/cognitiveservices/questionanswering/question-answering-projects/get-project-details
Response Body:
Schema for <c>ProjectMetadata</c>:
<code>{
projectName: string, # Optional. Name of the project.
description: string, # Optional. Description of the project.
language: string, # Optional. Language of the text records. This is BCP-47 representation of a language. For example, use "en" for English; "es" for Spanish etc. If not set, use "en" for English as default.
multilingualResource: boolean, # Optional. Resource enabled for multiple languages across projects or not.
settings: {
defaultAnswer: string, # Optional. Default Answer response when no good match is found in the knowledge base.
}, # Optional. Configurable settings of the Project.
createdDateTime: string (ISO 8601 Format), # Optional. Project creation date-time.
lastModifiedDateTime: string (ISO 8601 Format), # Optional. Represents the project last modified date-time.
lastDeployedDateTime: string (ISO 8601 Format), # Optional. Represents the project last deployment date-time.
}
</code></remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="projectName" /> is null. </exception>
<exception cref="T:System.ArgumentException">
<paramref name="projectName" /> is an empty string, and was expected to be non-empty. </exception>
<exception cref="T:Azure.RequestFailedException"> Service returned a non-success status code. </exception>
<example>
This sample shows how to call GetProjectDetailsAsync with required parameters and parse the result.
<code><![CDATA[
var credential = new AzureKeyCredential("<key>");
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new QuestionAnsweringAuthoringClient(endpoint, credential);
Response response = await client.GetProjectDetailsAsync("<projectName>");
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("projectName").ToString());
Console.WriteLine(result.GetProperty("description").ToString());
Console.WriteLine(result.GetProperty("language").ToString());
Console.WriteLine(result.GetProperty("multilingualResource").ToString());
Console.WriteLine(result.GetProperty("settings").GetProperty("defaultAnswer").ToString());
Console.WriteLine(result.GetProperty("createdDateTime").ToString());
Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString());
Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString());
]]></code></example>
</Docs>
</Member>
<Member MemberName="GetProjects">
<MemberSignature Language="C#" Value="public virtual Azure.Pageable<BinaryData> GetProjects (Azure.RequestContext context = default);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class Azure.Pageable`1<class System.BinaryData> GetProjects(class Azure.RequestContext context) cil managed" />
<MemberSignature Language="DocId" Value="M:Azure.AI.Language.QuestionAnswering.Authoring.QuestionAnsweringAuthoringClient.GetProjects(Azure.RequestContext)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function GetProjects (Optional context As RequestContext = Nothing) As Pageable(Of BinaryData)" />
<MemberSignature Language="F#" Value="abstract member GetProjects : Azure.RequestContext -> Azure.Pageable<BinaryData>
override this.GetProjects : Azure.RequestContext -> Azure.Pageable<BinaryData>" Usage="questionAnsweringAuthoringClient.GetProjects context" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Azure.AI.Language.QuestionAnswering</AssemblyName>
<AssemblyVersion>1.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Azure.Pageable<System.BinaryData></ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="context" Type="Azure.RequestContext" />
</Parameters>
<Docs>
<param name="context"> The request context, which can override default behaviors of the client pipeline on a per-call basis. </param>
<summary> Gets all projects for a user. </summary>
<returns> The <see cref="T:Azure.Pageable`1" /> from the service containing a list of <see cref="T:System.BinaryData" /> objects. Details of the body schema for each item in the collection are in the Remarks section below. </returns>
<remarks>
Below is the JSON schema for one item in the pageable response.
Additional information can be found in the service REST API documentation:
https://learn.microsoft.com/rest/api/cognitiveservices/questionanswering/question-answering-projects/list-projects
Response Body:
Schema for <c>ProjectsMetadataValue</c>:
<code>{
projectName: string, # Optional. Name of the project.
description: string, # Optional. Description of the project.
language: string, # Optional. Language of the text records. This is BCP-47 representation of a language. For example, use "en" for English; "es" for Spanish etc. If not set, use "en" for English as default.
multilingualResource: boolean, # Optional. Resource enabled for multiple languages across projects or not.
settings: {
defaultAnswer: string, # Optional. Default Answer response when no good match is found in the knowledge base.
}, # Optional. Configurable settings of the Project.
createdDateTime: string (ISO 8601 Format), # Optional. Project creation date-time.
lastModifiedDateTime: string (ISO 8601 Format), # Optional. Represents the project last modified date-time.
lastDeployedDateTime: string (ISO 8601 Format), # Optional. Represents the project last deployment date-time.
}
</code></remarks>
<exception cref="T:Azure.RequestFailedException"> Service returned a non-success status code. </exception>
<example>
This sample shows how to call GetProjects and parse the result.
<code><![CDATA[
var credential = new AzureKeyCredential("<key>");
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new QuestionAnsweringAuthoringClient(endpoint, credential);
foreach (var data in client.GetProjects())
{
JsonElement result = JsonDocument.Parse(data.ToStream()).RootElement;
Console.WriteLine(result.GetProperty("projectName").ToString());
Console.WriteLine(result.GetProperty("description").ToString());
Console.WriteLine(result.GetProperty("language").ToString());
Console.WriteLine(result.GetProperty("multilingualResource").ToString());
Console.WriteLine(result.GetProperty("settings").GetProperty("defaultAnswer").ToString());
Console.WriteLine(result.GetProperty("createdDateTime").ToString());
Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString());
Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString());
}
]]></code></example>
</Docs>
</Member>
<Member MemberName="GetProjectsAsync">
<MemberSignature Language="C#" Value="public virtual Azure.AsyncPageable<BinaryData> GetProjectsAsync (Azure.RequestContext context = default);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class Azure.AsyncPageable`1<class System.BinaryData> GetProjectsAsync(class Azure.RequestContext context) cil managed" />
<MemberSignature Language="DocId" Value="M:Azure.AI.Language.QuestionAnswering.Authoring.QuestionAnsweringAuthoringClient.GetProjectsAsync(Azure.RequestContext)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function GetProjectsAsync (Optional context As RequestContext = Nothing) As AsyncPageable(Of BinaryData)" />
<MemberSignature Language="F#" Value="abstract member GetProjectsAsync : Azure.RequestContext -> Azure.AsyncPageable<BinaryData>
override this.GetProjectsAsync : Azure.RequestContext -> Azure.AsyncPageable<BinaryData>" Usage="questionAnsweringAuthoringClient.GetProjectsAsync context" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Azure.AI.Language.QuestionAnswering</AssemblyName>
<AssemblyVersion>1.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Azure.AsyncPageable<System.BinaryData></ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="context" Type="Azure.RequestContext" />
</Parameters>
<Docs>
<param name="context"> The request context, which can override default behaviors of the client pipeline on a per-call basis. </param>
<summary> Gets all projects for a user. </summary>
<returns> The <see cref="T:Azure.AsyncPageable`1" /> from the service containing a list of <see cref="T:System.BinaryData" /> objects. Details of the body schema for each item in the collection are in the Remarks section below. </returns>
<remarks>
Below is the JSON schema for one item in the pageable response.
Additional information can be found in the service REST API documentation:
https://learn.microsoft.com/rest/api/cognitiveservices/questionanswering/question-answering-projects/list-projects
Response Body:
Schema for <c>ProjectsMetadataValue</c>:
<code>{
projectName: string, # Optional. Name of the project.
description: string, # Optional. Description of the project.
language: string, # Optional. Language of the text records. This is BCP-47 representation of a language. For example, use "en" for English; "es" for Spanish etc. If not set, use "en" for English as default.
multilingualResource: boolean, # Optional. Resource enabled for multiple languages across projects or not.
settings: {
defaultAnswer: string, # Optional. Default Answer response when no good match is found in the knowledge base.
}, # Optional. Configurable settings of the Project.
createdDateTime: string (ISO 8601 Format), # Optional. Project creation date-time.
lastModifiedDateTime: string (ISO 8601 Format), # Optional. Represents the project last modified date-time.
lastDeployedDateTime: string (ISO 8601 Format), # Optional. Represents the project last deployment date-time.
}
</code></remarks>
<exception cref="T:Azure.RequestFailedException"> Service returned a non-success status code. </exception>
<example>
This sample shows how to call GetProjectsAsync and parse the result.
<code><![CDATA[
var credential = new AzureKeyCredential("<key>");
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new QuestionAnsweringAuthoringClient(endpoint, credential);
await foreach (var data in client.GetProjectsAsync())
{
JsonElement result = JsonDocument.Parse(data.ToStream()).RootElement;
Console.WriteLine(result.GetProperty("projectName").ToString());
Console.WriteLine(result.GetProperty("description").ToString());
Console.WriteLine(result.GetProperty("language").ToString());
Console.WriteLine(result.GetProperty("multilingualResource").ToString());
Console.WriteLine(result.GetProperty("settings").GetProperty("defaultAnswer").ToString());
Console.WriteLine(result.GetProperty("createdDateTime").ToString());
Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString());
Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString());
}
]]></code></example>
</Docs>
</Member>
<Member MemberName="GetQnas">
<MemberSignature Language="C#" Value="public virtual Azure.Pageable<BinaryData> GetQnas (string projectName, string source = default, Azure.RequestContext context = default);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class Azure.Pageable`1<class System.BinaryData> GetQnas(string projectName, string source, class Azure.RequestContext context) cil managed" />
<MemberSignature Language="DocId" Value="M:Azure.AI.Language.QuestionAnswering.Authoring.QuestionAnsweringAuthoringClient.GetQnas(System.String,System.String,Azure.RequestContext)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function GetQnas (projectName As String, Optional source As String = Nothing, Optional context As RequestContext = Nothing) As Pageable(Of BinaryData)" />
<MemberSignature Language="F#" Value="abstract member GetQnas : string * string * Azure.RequestContext -> Azure.Pageable<BinaryData>
override this.GetQnas : string * string * Azure.RequestContext -> Azure.Pageable<BinaryData>" Usage="questionAnsweringAuthoringClient.GetQnas (projectName, source, context)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Azure.AI.Language.QuestionAnswering</AssemblyName>
<AssemblyVersion>1.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Azure.Pageable<System.BinaryData></ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="projectName" Type="System.String" />
<Parameter Name="source" Type="System.String" />
<Parameter Name="context" Type="Azure.RequestContext" />
</Parameters>
<Docs>
<param name="projectName"> The name of the project to use. </param>
<param name="source"> Source of the QnA. </param>
<param name="context"> The request context, which can override default behaviors of the client pipeline on a per-call basis. </param>
<summary> Gets all the QnAs of a project. </summary>
<returns> The <see cref="T:Azure.Pageable`1" /> from the service containing a list of <see cref="T:System.BinaryData" /> objects. Details of the body schema for each item in the collection are in the Remarks section below. </returns>
<remarks>
Below is the JSON schema for one item in the pageable response.
Additional information can be found in the service REST API documentation:
https://learn.microsoft.com/rest/api/cognitiveservices/questionanswering/question-answering-projects/get-qnas
Response Body:
Schema for <c>QnaAsset</c>:
<code>{
id: number, # Optional. Unique ID for the QnA.
answer: string, # Optional. Answer text.
source: string, # Optional. Source from which QnA was indexed e.g. https://docs.microsoft.com/en-us/azure/cognitive-services/QnAMaker/FAQs .
questions: [string], # Optional. List of questions associated with the answer.
metadata: Dictionary<string, string>, # Optional. Metadata associated with the answer, useful to categorize or filter question answers.
dialog: {
isContextOnly: boolean, # Optional. To mark if a prompt is relevant only with a previous question or not. If true, do not include this QnA as answer for queries without context; otherwise, ignores context and includes this QnA in answers.
prompts: [
{
displayOrder: number, # Optional. Index of the prompt. It is used for ordering of the prompts.
qnaId: number, # Optional. ID of the QnA corresponding to the prompt.
qna: {
id: number, # Optional. Unique ID for the QnA.
answer: string, # Optional. Answer text.
source: string, # Optional. Source from which QnA was indexed e.g. https://docs.microsoft.com/en-us/azure/cognitive-services/QnAMaker/FAQs .
questions: [string], # Optional. List of questions associated with the answer.
metadata: Dictionary<string, string>, # Optional. Metadata associated with the answer, useful to categorize or filter question answers.
dialog: QnaDialog, # Optional. Context of a QnA.
activeLearningSuggestions: [
{
clusterHead: string, # Optional. Question chosen as the head of suggested questions cluster by Active Learning clustering algorithm.
suggestedQuestions: [
{
question: string, # Optional. Question suggested by the Active Learning feature.
userSuggestedCount: number, # Optional. The number of times the question was suggested explicitly by the user.
autoSuggestedCount: number, # Optional. The number of times the question was suggested automatically by the Active Learning algorithm.
}
], # Optional. List of all suggested questions for the QnA.
}
], # Optional. List of Active Learning suggestions for the QnA.
}, # Optional. QnA record. Either QnAId or QnA record needs to be present in a Prompt.
displayText: string, # Optional. Text displayed to represent a follow up question prompt.
}
], # Optional. List of prompts associated with the answer.
}, # Optional. Context of a QnA.
activeLearningSuggestions: [SuggestedQuestionsCluster], # Optional. List of Active Learning suggestions for the QnA.
}
</code></remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="projectName" /> is null. </exception>
<exception cref="T:System.ArgumentException">
<paramref name="projectName" /> is an empty string, and was expected to be non-empty. </exception>
<exception cref="T:Azure.RequestFailedException"> Service returned a non-success status code. </exception>
<example>
This sample shows how to call GetQnas with required parameters and parse the result.
<code><![CDATA[
var credential = new AzureKeyCredential("<key>");
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new QuestionAnsweringAuthoringClient(endpoint, credential);
foreach (var data in client.GetQnas("<projectName>"))
{
JsonElement result = JsonDocument.Parse(data.ToStream()).RootElement;
Console.WriteLine(result.ToString());
}
]]></code>
This sample shows how to call GetQnas with all parameters, and how to parse the result.
<code><![CDATA[
var credential = new AzureKeyCredential("<key>");
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new QuestionAnsweringAuthoringClient(endpoint, credential);
foreach (var data in client.GetQnas("<projectName>", "<source>"))
{
JsonElement result = JsonDocument.Parse(data.ToStream()).RootElement;
Console.WriteLine(result.GetProperty("id").ToString());
Console.WriteLine(result.GetProperty("answer").ToString());
Console.WriteLine(result.GetProperty("source").ToString());
Console.WriteLine(result.GetProperty("questions")[0].ToString());
Console.WriteLine(result.GetProperty("metadata").GetProperty("<test>").ToString());
Console.WriteLine(result.GetProperty("dialog").GetProperty("isContextOnly").ToString());
Console.WriteLine(result.GetProperty("dialog").GetProperty("prompts")[0].GetProperty("displayOrder").ToString());
Console.WriteLine(result.GetProperty("dialog").GetProperty("prompts")[0].GetProperty("qnaId").ToString());
Console.WriteLine(result.GetProperty("dialog").GetProperty("prompts")[0].GetProperty("qna").GetProperty("id").ToString());
Console.WriteLine(result.GetProperty("dialog").GetProperty("prompts")[0].GetProperty("qna").GetProperty("answer").ToString());
Console.WriteLine(result.GetProperty("dialog").GetProperty("prompts")[0].GetProperty("qna").GetProperty("source").ToString());
Console.WriteLine(result.GetProperty("dialog").GetProperty("prompts")[0].GetProperty("qna").GetProperty("questions")[0].ToString());
Console.WriteLine(result.GetProperty("dialog").GetProperty("prompts")[0].GetProperty("qna").GetProperty("metadata").GetProperty("<test>").ToString());
Console.WriteLine(result.GetProperty("dialog").GetProperty("prompts")[0].GetProperty("qna").GetProperty("activeLearningSuggestions")[0].GetProperty("clusterHead").ToString());
Console.WriteLine(result.GetProperty("dialog").GetProperty("prompts")[0].GetProperty("qna").GetProperty("activeLearningSuggestions")[0].GetProperty("suggestedQuestions")[0].GetProperty("question").ToString());
Console.WriteLine(result.GetProperty("dialog").GetProperty("prompts")[0].GetProperty("qna").GetProperty("activeLearningSuggestions")[0].GetProperty("suggestedQuestions")[0].GetProperty("userSuggestedCount").ToString());
Console.WriteLine(result.GetProperty("dialog").GetProperty("prompts")[0].GetProperty("qna").GetProperty("activeLearningSuggestions")[0].GetProperty("suggestedQuestions")[0].GetProperty("autoSuggestedCount").ToString());
Console.WriteLine(result.GetProperty("dialog").GetProperty("prompts")[0].GetProperty("displayText").ToString());
Console.WriteLine(result.GetProperty("activeLearningSuggestions")[0].GetProperty("clusterHead").ToString());
Console.WriteLine(result.GetProperty("activeLearningSuggestions")[0].GetProperty("suggestedQuestions")[0].GetProperty("question").ToString());
Console.WriteLine(result.GetProperty("activeLearningSuggestions")[0].GetProperty("suggestedQuestions")[0].GetProperty("userSuggestedCount").ToString());
Console.WriteLine(result.GetProperty("activeLearningSuggestions")[0].GetProperty("suggestedQuestions")[0].GetProperty("autoSuggestedCount").ToString());
}
]]></code></example>
</Docs>
</Member>
<Member MemberName="GetQnasAsync">
<MemberSignature Language="C#" Value="public virtual Azure.AsyncPageable<BinaryData> GetQnasAsync (string projectName, string source = default, Azure.RequestContext context = default);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class Azure.AsyncPageable`1<class System.BinaryData> GetQnasAsync(string projectName, string source, class Azure.RequestContext context) cil managed" />
<MemberSignature Language="DocId" Value="M:Azure.AI.Language.QuestionAnswering.Authoring.QuestionAnsweringAuthoringClient.GetQnasAsync(System.String,System.String,Azure.RequestContext)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function GetQnasAsync (projectName As String, Optional source As String = Nothing, Optional context As RequestContext = Nothing) As AsyncPageable(Of BinaryData)" />
<MemberSignature Language="F#" Value="abstract member GetQnasAsync : string * string * Azure.RequestContext -> Azure.AsyncPageable<BinaryData>
override this.GetQnasAsync : string * string * Azure.RequestContext -> Azure.AsyncPageable<BinaryData>" Usage="questionAnsweringAuthoringClient.GetQnasAsync (projectName, source, context)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Azure.AI.Language.QuestionAnswering</AssemblyName>
<AssemblyVersion>1.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Azure.AsyncPageable<System.BinaryData></ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="projectName" Type="System.String" />
<Parameter Name="source" Type="System.String" />
<Parameter Name="context" Type="Azure.RequestContext" />
</Parameters>
<Docs>
<param name="projectName"> The name of the project to use. </param>
<param name="source"> Source of the QnA. </param>
<param name="context"> The request context, which can override default behaviors of the client pipeline on a per-call basis. </param>
<summary> Gets all the QnAs of a project. </summary>
<returns> The <see cref="T:Azure.AsyncPageable`1" /> from the service containing a list of <see cref="T:System.BinaryData" /> objects. Details of the body schema for each item in the collection are in the Remarks section below. </returns>
<remarks>
Below is the JSON schema for one item in the pageable response.
Additional information can be found in the service REST API documentation:
https://learn.microsoft.com/rest/api/cognitiveservices/questionanswering/question-answering-projects/get-qnas
Response Body:
Schema for <c>QnaAsset</c>:
<code>{
id: number, # Optional. Unique ID for the QnA.
answer: string, # Optional. Answer text.
source: string, # Optional. Source from which QnA was indexed e.g. https://docs.microsoft.com/en-us/azure/cognitive-services/QnAMaker/FAQs .
questions: [string], # Optional. List of questions associated with the answer.
metadata: Dictionary<string, string>, # Optional. Metadata associated with the answer, useful to categorize or filter question answers.
dialog: {
isContextOnly: boolean, # Optional. To mark if a prompt is relevant only with a previous question or not. If true, do not include this QnA as answer for queries without context; otherwise, ignores context and includes this QnA in answers.
prompts: [
{
displayOrder: number, # Optional. Index of the prompt. It is used for ordering of the prompts.
qnaId: number, # Optional. ID of the QnA corresponding to the prompt.
qna: {
id: number, # Optional. Unique ID for the QnA.
answer: string, # Optional. Answer text.
source: string, # Optional. Source from which QnA was indexed e.g. https://docs.microsoft.com/en-us/azure/cognitive-services/QnAMaker/FAQs .
questions: [string], # Optional. List of questions associated with the answer.
metadata: Dictionary<string, string>, # Optional. Metadata associated with the answer, useful to categorize or filter question answers.
dialog: QnaDialog, # Optional. Context of a QnA.
activeLearningSuggestions: [
{
clusterHead: string, # Optional. Question chosen as the head of suggested questions cluster by Active Learning clustering algorithm.
suggestedQuestions: [
{
question: string, # Optional. Question suggested by the Active Learning feature.
userSuggestedCount: number, # Optional. The number of times the question was suggested explicitly by the user.
autoSuggestedCount: number, # Optional. The number of times the question was suggested automatically by the Active Learning algorithm.
}
], # Optional. List of all suggested questions for the QnA.
}
], # Optional. List of Active Learning suggestions for the QnA.
}, # Optional. QnA record. Either QnAId or QnA record needs to be present in a Prompt.
displayText: string, # Optional. Text displayed to represent a follow up question prompt.
}
], # Optional. List of prompts associated with the answer.
}, # Optional. Context of a QnA.
activeLearningSuggestions: [SuggestedQuestionsCluster], # Optional. List of Active Learning suggestions for the QnA.
}
</code></remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="projectName" /> is null. </exception>
<exception cref="T:System.ArgumentException">
<paramref name="projectName" /> is an empty string, and was expected to be non-empty. </exception>
<exception cref="T:Azure.RequestFailedException"> Service returned a non-success status code. </exception>
<example>
This sample shows how to call GetQnasAsync with required parameters and parse the result.
<code><![CDATA[
var credential = new AzureKeyCredential("<key>");
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new QuestionAnsweringAuthoringClient(endpoint, credential);
await foreach (var data in client.GetQnasAsync("<projectName>"))
{
JsonElement result = JsonDocument.Parse(data.ToStream()).RootElement;
Console.WriteLine(result.ToString());
}
]]></code>
This sample shows how to call GetQnasAsync with all parameters, and how to parse the result.
<code><![CDATA[
var credential = new AzureKeyCredential("<key>");
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new QuestionAnsweringAuthoringClient(endpoint, credential);
await foreach (var data in client.GetQnasAsync("<projectName>", "<source>"))
{
JsonElement result = JsonDocument.Parse(data.ToStream()).RootElement;
Console.WriteLine(result.GetProperty("id").ToString());
Console.WriteLine(result.GetProperty("answer").ToString());
Console.WriteLine(result.GetProperty("source").ToString());
Console.WriteLine(result.GetProperty("questions")[0].ToString());
Console.WriteLine(result.GetProperty("metadata").GetProperty("<test>").ToString());
Console.WriteLine(result.GetProperty("dialog").GetProperty("isContextOnly").ToString());
Console.WriteLine(result.GetProperty("dialog").GetProperty("prompts")[0].GetProperty("displayOrder").ToString());
Console.WriteLine(result.GetProperty("dialog").GetProperty("prompts")[0].GetProperty("qnaId").ToString());
Console.WriteLine(result.GetProperty("dialog").GetProperty("prompts")[0].GetProperty("qna").GetProperty("id").ToString());
Console.WriteLine(result.GetProperty("dialog").GetProperty("prompts")[0].GetProperty("qna").GetProperty("answer").ToString());
Console.WriteLine(result.GetProperty("dialog").GetProperty("prompts")[0].GetProperty("qna").GetProperty("source").ToString());
Console.WriteLine(result.GetProperty("dialog").GetProperty("prompts")[0].GetProperty("qna").GetProperty("questions")[0].ToString());
Console.WriteLine(result.GetProperty("dialog").GetProperty("prompts")[0].GetProperty("qna").GetProperty("metadata").GetProperty("<test>").ToString());
Console.WriteLine(result.GetProperty("dialog").GetProperty("prompts")[0].GetProperty("qna").GetProperty("activeLearningSuggestions")[0].GetProperty("clusterHead").ToString());
Console.WriteLine(result.GetProperty("dialog").GetProperty("prompts")[0].GetProperty("qna").GetProperty("activeLearningSuggestions")[0].GetProperty("suggestedQuestions")[0].GetProperty("question").ToString());
Console.WriteLine(result.GetProperty("dialog").GetProperty("prompts")[0].GetProperty("qna").GetProperty("activeLearningSuggestions")[0].GetProperty("suggestedQuestions")[0].GetProperty("userSuggestedCount").ToString());
Console.WriteLine(result.GetProperty("dialog").GetProperty("prompts")[0].GetProperty("qna").GetProperty("activeLearningSuggestions")[0].GetProperty("suggestedQuestions")[0].GetProperty("autoSuggestedCount").ToString());
Console.WriteLine(result.GetProperty("dialog").GetProperty("prompts")[0].GetProperty("displayText").ToString());
Console.WriteLine(result.GetProperty("activeLearningSuggestions")[0].GetProperty("clusterHead").ToString());
Console.WriteLine(result.GetProperty("activeLearningSuggestions")[0].GetProperty("suggestedQuestions")[0].GetProperty("question").ToString());
Console.WriteLine(result.GetProperty("activeLearningSuggestions")[0].GetProperty("suggestedQuestions")[0].GetProperty("userSuggestedCount").ToString());
Console.WriteLine(result.GetProperty("activeLearningSuggestions")[0].GetProperty("suggestedQuestions")[0].GetProperty("autoSuggestedCount").ToString());
}
]]></code></example>
</Docs>
</Member>
<Member MemberName="GetSources">
<MemberSignature Language="C#" Value="public virtual Azure.Pageable<BinaryData> GetSources (string projectName, Azure.RequestContext context = default);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class Azure.Pageable`1<class System.BinaryData> GetSources(string projectName, class Azure.RequestContext context) cil managed" />
<MemberSignature Language="DocId" Value="M:Azure.AI.Language.QuestionAnswering.Authoring.QuestionAnsweringAuthoringClient.GetSources(System.String,Azure.RequestContext)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function GetSources (projectName As String, Optional context As RequestContext = Nothing) As Pageable(Of BinaryData)" />
<MemberSignature Language="F#" Value="abstract member GetSources : string * Azure.RequestContext -> Azure.Pageable<BinaryData>
override this.GetSources : string * Azure.RequestContext -> Azure.Pageable<BinaryData>" Usage="questionAnsweringAuthoringClient.GetSources (projectName, context)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Azure.AI.Language.QuestionAnswering</AssemblyName>
<AssemblyVersion>1.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Azure.Pageable<System.BinaryData></ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="projectName" Type="System.String" />
<Parameter Name="context" Type="Azure.RequestContext" />
</Parameters>
<Docs>
<param name="projectName"> The name of the project to use. </param>
<param name="context"> The request context, which can override default behaviors of the client pipeline on a per-call basis. </param>
<summary> Gets all the sources of a project. </summary>
<returns> The <see cref="T:Azure.Pageable`1" /> from the service containing a list of <see cref="T:System.BinaryData" /> objects. Details of the body schema for each item in the collection are in the Remarks section below. </returns>
<remarks>
Below is the JSON schema for one item in the pageable response.
Additional information can be found in the service REST API documentation:
https://learn.microsoft.com/rest/api/cognitiveservices/questionanswering/question-answering-projects/get-sources
Response Body:
Schema for <c>QnaSourcesMetadata</c>:
<code>{
displayName: string, # Optional. Friendly name of the Source.
source: string, # Optional. Unique source identifier. Name of the file if it's a 'file' source; otherwise, the complete URL if it's a 'url' source.
sourceUri: string, # Required. URI location for the file or url.
sourceKind: "file" | "url", # Required. Supported source types.
contentStructureKind: "unstructured", # Optional. Content structure type for sources.
}
</code></remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="projectName" /> is null. </exception>
<exception cref="T:System.ArgumentException">
<paramref name="projectName" /> is an empty string, and was expected to be non-empty. </exception>
<exception cref="T:Azure.RequestFailedException"> Service returned a non-success status code. </exception>
<example>
This sample shows how to call GetSources with required parameters and parse the result.
<code><![CDATA[
var credential = new AzureKeyCredential("<key>");
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new QuestionAnsweringAuthoringClient(endpoint, credential);
foreach (var data in client.GetSources("<projectName>"))
{
JsonElement result = JsonDocument.Parse(data.ToStream()).RootElement;
Console.WriteLine(result.GetProperty("displayName").ToString());
Console.WriteLine(result.GetProperty("source").ToString());
Console.WriteLine(result.GetProperty("sourceUri").ToString());
Console.WriteLine(result.GetProperty("sourceKind").ToString());
Console.WriteLine(result.GetProperty("contentStructureKind").ToString());
}
]]></code></example>
</Docs>
</Member>
<Member MemberName="GetSourcesAsync">
<MemberSignature Language="C#" Value="public virtual Azure.AsyncPageable<BinaryData> GetSourcesAsync (string projectName, Azure.RequestContext context = default);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class Azure.AsyncPageable`1<class System.BinaryData> GetSourcesAsync(string projectName, class Azure.RequestContext context) cil managed" />
<MemberSignature Language="DocId" Value="M:Azure.AI.Language.QuestionAnswering.Authoring.QuestionAnsweringAuthoringClient.GetSourcesAsync(System.String,Azure.RequestContext)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function GetSourcesAsync (projectName As String, Optional context As RequestContext = Nothing) As AsyncPageable(Of BinaryData)" />
<MemberSignature Language="F#" Value="abstract member GetSourcesAsync : string * Azure.RequestContext -> Azure.AsyncPageable<BinaryData>
override this.GetSourcesAsync : string * Azure.RequestContext -> Azure.AsyncPageable<BinaryData>" Usage="questionAnsweringAuthoringClient.GetSourcesAsync (projectName, context)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Azure.AI.Language.QuestionAnswering</AssemblyName>
<AssemblyVersion>1.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Azure.AsyncPageable<System.BinaryData></ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="projectName" Type="System.String" />
<Parameter Name="context" Type="Azure.RequestContext" />
</Parameters>
<Docs>
<param name="projectName"> The name of the project to use. </param>
<param name="context"> The request context, which can override default behaviors of the client pipeline on a per-call basis. </param>
<summary> Gets all the sources of a project. </summary>
<returns> The <see cref="T:Azure.AsyncPageable`1" /> from the service containing a list of <see cref="T:System.BinaryData" /> objects. Details of the body schema for each item in the collection are in the Remarks section below. </returns>
<remarks>
Below is the JSON schema for one item in the pageable response.
Additional information can be found in the service REST API documentation:
https://learn.microsoft.com/rest/api/cognitiveservices/questionanswering/question-answering-projects/get-sources
Response Body:
Schema for <c>QnaSourcesMetadata</c>:
<code>{
displayName: string, # Optional. Friendly name of the Source.
source: string, # Optional. Unique source identifier. Name of the file if it's a 'file' source; otherwise, the complete URL if it's a 'url' source.
sourceUri: string, # Required. URI location for the file or url.
sourceKind: "file" | "url", # Required. Supported source types.
contentStructureKind: "unstructured", # Optional. Content structure type for sources.
}
</code></remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="projectName" /> is null. </exception>
<exception cref="T:System.ArgumentException">
<paramref name="projectName" /> is an empty string, and was expected to be non-empty. </exception>
<exception cref="T:Azure.RequestFailedException"> Service returned a non-success status code. </exception>
<example>
This sample shows how to call GetSourcesAsync with required parameters and parse the result.
<code><![CDATA[
var credential = new AzureKeyCredential("<key>");
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new QuestionAnsweringAuthoringClient(endpoint, credential);
await foreach (var data in client.GetSourcesAsync("<projectName>"))
{
JsonElement result = JsonDocument.Parse(data.ToStream()).RootElement;
Console.WriteLine(result.GetProperty("displayName").ToString());
Console.WriteLine(result.GetProperty("source").ToString());
Console.WriteLine(result.GetProperty("sourceUri").ToString());
Console.WriteLine(result.GetProperty("sourceKind").ToString());
Console.WriteLine(result.GetProperty("contentStructureKind").ToString());
}
]]></code></example>
</Docs>
</Member>
<Member MemberName="GetSynonyms">
<MemberSignature Language="C#" Value="public virtual Azure.Pageable<BinaryData> GetSynonyms (string projectName, Azure.RequestContext context = default);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class Azure.Pageable`1<class System.BinaryData> GetSynonyms(string projectName, class Azure.RequestContext context) cil managed" />
<MemberSignature Language="DocId" Value="M:Azure.AI.Language.QuestionAnswering.Authoring.QuestionAnsweringAuthoringClient.GetSynonyms(System.String,Azure.RequestContext)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function GetSynonyms (projectName As String, Optional context As RequestContext = Nothing) As Pageable(Of BinaryData)" />
<MemberSignature Language="F#" Value="abstract member GetSynonyms : string * Azure.RequestContext -> Azure.Pageable<BinaryData>
override this.GetSynonyms : string * Azure.RequestContext -> Azure.Pageable<BinaryData>" Usage="questionAnsweringAuthoringClient.GetSynonyms (projectName, context)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Azure.AI.Language.QuestionAnswering</AssemblyName>
<AssemblyVersion>1.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Azure.Pageable<System.BinaryData></ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="projectName" Type="System.String" />
<Parameter Name="context" Type="Azure.RequestContext" />
</Parameters>
<Docs>
<param name="projectName"> The name of the project to use. </param>
<param name="context"> The request context, which can override default behaviors of the client pipeline on a per-call basis. </param>
<summary> Gets all the synonyms of a project. </summary>
<returns> The <see cref="T:Azure.Pageable`1" /> from the service containing a list of <see cref="T:System.BinaryData" /> objects. Details of the body schema for each item in the collection are in the Remarks section below. </returns>
<remarks>
Below is the JSON schema for one item in the pageable response.
Additional information can be found in the service REST API documentation:
https://learn.microsoft.com/rest/api/cognitiveservices/questionanswering/question-answering-projects/get-synonyms
Response Body:
Schema for <c>SynonymAsset</c>:
<code>{
alterations: [string], # Required. Collection of word alterations.
}
</code></remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="projectName" /> is null. </exception>
<exception cref="T:System.ArgumentException">
<paramref name="projectName" /> is an empty string, and was expected to be non-empty. </exception>
<exception cref="T:Azure.RequestFailedException"> Service returned a non-success status code. </exception>
<example>
This sample shows how to call GetSynonyms with required parameters and parse the result.
<code><![CDATA[
var credential = new AzureKeyCredential("<key>");
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new QuestionAnsweringAuthoringClient(endpoint, credential);
foreach (var data in client.GetSynonyms("<projectName>"))
{
JsonElement result = JsonDocument.Parse(data.ToStream()).RootElement;
Console.WriteLine(result.GetProperty("alterations")[0].ToString());
}
]]></code></example>
</Docs>
</Member>
<Member MemberName="GetSynonymsAsync">
<MemberSignature Language="C#" Value="public virtual Azure.AsyncPageable<BinaryData> GetSynonymsAsync (string projectName, Azure.RequestContext context = default);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class Azure.AsyncPageable`1<class System.BinaryData> GetSynonymsAsync(string projectName, class Azure.RequestContext context) cil managed" />
<MemberSignature Language="DocId" Value="M:Azure.AI.Language.QuestionAnswering.Authoring.QuestionAnsweringAuthoringClient.GetSynonymsAsync(System.String,Azure.RequestContext)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function GetSynonymsAsync (projectName As String, Optional context As RequestContext = Nothing) As AsyncPageable(Of BinaryData)" />
<MemberSignature Language="F#" Value="abstract member GetSynonymsAsync : string * Azure.RequestContext -> Azure.AsyncPageable<BinaryData>
override this.GetSynonymsAsync : string * Azure.RequestContext -> Azure.AsyncPageable<BinaryData>" Usage="questionAnsweringAuthoringClient.GetSynonymsAsync (projectName, context)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Azure.AI.Language.QuestionAnswering</AssemblyName>
<AssemblyVersion>1.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Azure.AsyncPageable<System.BinaryData></ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="projectName" Type="System.String" />
<Parameter Name="context" Type="Azure.RequestContext" />
</Parameters>
<Docs>
<param name="projectName"> The name of the project to use. </param>
<param name="context"> The request context, which can override default behaviors of the client pipeline on a per-call basis. </param>
<summary> Gets all the synonyms of a project. </summary>
<returns> The <see cref="T:Azure.AsyncPageable`1" /> from the service containing a list of <see cref="T:System.BinaryData" /> objects. Details of the body schema for each item in the collection are in the Remarks section below. </returns>
<remarks>
Below is the JSON schema for one item in the pageable response.
Additional information can be found in the service REST API documentation:
https://learn.microsoft.com/rest/api/cognitiveservices/questionanswering/question-answering-projects/get-synonyms
Response Body:
Schema for <c>SynonymAsset</c>:
<code>{
alterations: [string], # Required. Collection of word alterations.
}
</code></remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="projectName" /> is null. </exception>
<exception cref="T:System.ArgumentException">
<paramref name="projectName" /> is an empty string, and was expected to be non-empty. </exception>
<exception cref="T:Azure.RequestFailedException"> Service returned a non-success status code. </exception>
<example>
This sample shows how to call GetSynonymsAsync with required parameters and parse the result.
<code><![CDATA[
var credential = new AzureKeyCredential("<key>");
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new QuestionAnsweringAuthoringClient(endpoint, credential);
await foreach (var data in client.GetSynonymsAsync("<projectName>"))
{
JsonElement result = JsonDocument.Parse(data.ToStream()).RootElement;
Console.WriteLine(result.GetProperty("alterations")[0].ToString());
}
]]></code></example>
</Docs>
</Member>
<Member MemberName="GetUpdateQnasStatus">
<MemberSignature Language="C#" Value="public virtual Azure.Response GetUpdateQnasStatus (string projectName, string jobId, Azure.RequestContext context = default);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class Azure.Response GetUpdateQnasStatus(string projectName, string jobId, class Azure.RequestContext context) cil managed" />
<MemberSignature Language="DocId" Value="M:Azure.AI.Language.QuestionAnswering.Authoring.QuestionAnsweringAuthoringClient.GetUpdateQnasStatus(System.String,System.String,Azure.RequestContext)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function GetUpdateQnasStatus (projectName As String, jobId As String, Optional context As RequestContext = Nothing) As Response" />
<MemberSignature Language="F#" Value="abstract member GetUpdateQnasStatus : string * string * Azure.RequestContext -> Azure.Response
override this.GetUpdateQnasStatus : string * string * Azure.RequestContext -> Azure.Response" Usage="questionAnsweringAuthoringClient.GetUpdateQnasStatus (projectName, jobId, context)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Azure.AI.Language.QuestionAnswering</AssemblyName>
<AssemblyVersion>1.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Azure.Response</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="projectName" Type="System.String" />
<Parameter Name="jobId" Type="System.String" />
<Parameter Name="context" Type="Azure.RequestContext" />
</Parameters>
<Docs>
<param name="projectName"> The name of the project to use. </param>
<param name="jobId"> Job ID. </param>
<param name="context"> The request context, which can override default behaviors of the client pipeline on a per-call basis. </param>
<summary> Gets the status of update QnAs job. </summary>
<returns> The response returned from the service. Details of the response body schema are in the Remarks section below. </returns>
<remarks>
Below is the JSON schema for the response payload.
Additional information can be found in the service REST API documentation:
https://learn.microsoft.com/rest/api/cognitiveservices/questionanswering/question-answering-projects/get-update-qnas-status
Response Body:
<details><summary>ExportJobState</summary>Schema for <c>ExportJobState</c>:
<code>{
createdDateTime: string (ISO 8601 Format), # Required.
expirationDateTime: string (ISO 8601 Format), # Optional.
jobId: string, # Required.
lastUpdatedDateTime: string (ISO 8601 Format), # Required.
status: "notStarted" | "running" | "succeeded" | "failed" | "cancelled" | "cancelling" | "partiallyCompleted", # Required. Job Status.
}
</code></details></remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="projectName" /> or <paramref name="jobId" /> is null. </exception>
<exception cref="T:System.ArgumentException">
<paramref name="projectName" /> or <paramref name="jobId" /> is an empty string, and was expected to be non-empty. </exception>
<exception cref="T:Azure.RequestFailedException"> Service returned a non-success status code. </exception>
<example>
This sample shows how to call GetUpdateQnasStatus with required parameters and parse the result.
<code><![CDATA[
var credential = new AzureKeyCredential("<key>");
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new QuestionAnsweringAuthoringClient(endpoint, credential);
Response response = client.GetUpdateQnasStatus("<projectName>", "<jobId>");
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("createdDateTime").ToString());
Console.WriteLine(result.GetProperty("expirationDateTime").ToString());
Console.WriteLine(result.GetProperty("jobId").ToString());
Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
Console.WriteLine(result.GetProperty("status").ToString());
]]></code></example>
</Docs>
</Member>
<Member MemberName="GetUpdateQnasStatusAsync">
<MemberSignature Language="C#" Value="public virtual System.Threading.Tasks.Task<Azure.Response> GetUpdateQnasStatusAsync (string projectName, string jobId, Azure.RequestContext context = default);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class System.Threading.Tasks.Task`1<class Azure.Response> GetUpdateQnasStatusAsync(string projectName, string jobId, class Azure.RequestContext context) cil managed" />
<MemberSignature Language="DocId" Value="M:Azure.AI.Language.QuestionAnswering.Authoring.QuestionAnsweringAuthoringClient.GetUpdateQnasStatusAsync(System.String,System.String,Azure.RequestContext)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function GetUpdateQnasStatusAsync (projectName As String, jobId As String, Optional context As RequestContext = Nothing) As Task(Of Response)" />
<MemberSignature Language="F#" Value="abstract member GetUpdateQnasStatusAsync : string * string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.GetUpdateQnasStatusAsync : string * string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>" Usage="questionAnsweringAuthoringClient.GetUpdateQnasStatusAsync (projectName, jobId, context)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Azure.AI.Language.QuestionAnswering</AssemblyName>
<AssemblyVersion>1.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Threading.Tasks.Task<Azure.Response></ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="projectName" Type="System.String" />
<Parameter Name="jobId" Type="System.String" />
<Parameter Name="context" Type="Azure.RequestContext" />
</Parameters>
<Docs>
<param name="projectName"> The name of the project to use. </param>
<param name="jobId"> Job ID. </param>
<param name="context"> The request context, which can override default behaviors of the client pipeline on a per-call basis. </param>
<summary> Gets the status of update QnAs job. </summary>
<returns> The response returned from the service. Details of the response body schema are in the Remarks section below. </returns>
<remarks>
Below is the JSON schema for the response payload.
Additional information can be found in the service REST API documentation:
https://learn.microsoft.com/rest/api/cognitiveservices/questionanswering/question-answering-projects/get-update-qnas-status
Response Body:
<details><summary>ExportJobState</summary>Schema for <c>ExportJobState</c>:
<code>{
createdDateTime: string (ISO 8601 Format), # Required.
expirationDateTime: string (ISO 8601 Format), # Optional.
jobId: string, # Required.
lastUpdatedDateTime: string (ISO 8601 Format), # Required.
status: "notStarted" | "running" | "succeeded" | "failed" | "cancelled" | "cancelling" | "partiallyCompleted", # Required. Job Status.
}
</code></details></remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="projectName" /> or <paramref name="jobId" /> is null. </exception>
<exception cref="T:System.ArgumentException">
<paramref name="projectName" /> or <paramref name="jobId" /> is an empty string, and was expected to be non-empty. </exception>
<exception cref="T:Azure.RequestFailedException"> Service returned a non-success status code. </exception>
<example>
This sample shows how to call GetUpdateQnasStatusAsync with required parameters and parse the result.
<code><![CDATA[
var credential = new AzureKeyCredential("<key>");
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new QuestionAnsweringAuthoringClient(endpoint, credential);
Response response = await client.GetUpdateQnasStatusAsync("<projectName>", "<jobId>");
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("createdDateTime").ToString());
Console.WriteLine(result.GetProperty("expirationDateTime").ToString());
Console.WriteLine(result.GetProperty("jobId").ToString());
Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
Console.WriteLine(result.GetProperty("status").ToString());
]]></code></example>
</Docs>
</Member>
<Member MemberName="GetUpdateSourcesStatus">
<MemberSignature Language="C#" Value="public virtual Azure.Response GetUpdateSourcesStatus (string projectName, string jobId, Azure.RequestContext context = default);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class Azure.Response GetUpdateSourcesStatus(string projectName, string jobId, class Azure.RequestContext context) cil managed" />
<MemberSignature Language="DocId" Value="M:Azure.AI.Language.QuestionAnswering.Authoring.QuestionAnsweringAuthoringClient.GetUpdateSourcesStatus(System.String,System.String,Azure.RequestContext)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function GetUpdateSourcesStatus (projectName As String, jobId As String, Optional context As RequestContext = Nothing) As Response" />
<MemberSignature Language="F#" Value="abstract member GetUpdateSourcesStatus : string * string * Azure.RequestContext -> Azure.Response
override this.GetUpdateSourcesStatus : string * string * Azure.RequestContext -> Azure.Response" Usage="questionAnsweringAuthoringClient.GetUpdateSourcesStatus (projectName, jobId, context)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Azure.AI.Language.QuestionAnswering</AssemblyName>
<AssemblyVersion>1.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Azure.Response</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="projectName" Type="System.String" />
<Parameter Name="jobId" Type="System.String" />
<Parameter Name="context" Type="Azure.RequestContext" />
</Parameters>
<Docs>
<param name="projectName"> The name of the project to use. </param>
<param name="jobId"> Job ID. </param>
<param name="context"> The request context, which can override default behaviors of the client pipeline on a per-call basis. </param>
<summary> Gets the status of update sources job. </summary>
<returns> The response returned from the service. Details of the response body schema are in the Remarks section below. </returns>
<remarks>
Below is the JSON schema for the response payload.
Additional information can be found in the service REST API documentation:
https://learn.microsoft.com/rest/api/cognitiveservices/questionanswering/question-answering-projects/get-update-sources-status
Response Body:
<details><summary>ExportJobState</summary>Schema for <c>ExportJobState</c>:
<code>{
createdDateTime: string (ISO 8601 Format), # Required.
expirationDateTime: string (ISO 8601 Format), # Optional.
jobId: string, # Required.
lastUpdatedDateTime: string (ISO 8601 Format), # Required.
status: "notStarted" | "running" | "succeeded" | "failed" | "cancelled" | "cancelling" | "partiallyCompleted", # Required. Job Status.
}
</code></details></remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="projectName" /> or <paramref name="jobId" /> is null. </exception>
<exception cref="T:System.ArgumentException">
<paramref name="projectName" /> or <paramref name="jobId" /> is an empty string, and was expected to be non-empty. </exception>
<exception cref="T:Azure.RequestFailedException"> Service returned a non-success status code. </exception>
<example>
This sample shows how to call GetUpdateSourcesStatus with required parameters and parse the result.
<code><![CDATA[
var credential = new AzureKeyCredential("<key>");
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new QuestionAnsweringAuthoringClient(endpoint, credential);
Response response = client.GetUpdateSourcesStatus("<projectName>", "<jobId>");
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("createdDateTime").ToString());
Console.WriteLine(result.GetProperty("expirationDateTime").ToString());
Console.WriteLine(result.GetProperty("jobId").ToString());
Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
Console.WriteLine(result.GetProperty("status").ToString());
]]></code></example>
</Docs>
</Member>
<Member MemberName="GetUpdateSourcesStatusAsync">
<MemberSignature Language="C#" Value="public virtual System.Threading.Tasks.Task<Azure.Response> GetUpdateSourcesStatusAsync (string projectName, string jobId, Azure.RequestContext context = default);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class System.Threading.Tasks.Task`1<class Azure.Response> GetUpdateSourcesStatusAsync(string projectName, string jobId, class Azure.RequestContext context) cil managed" />
<MemberSignature Language="DocId" Value="M:Azure.AI.Language.QuestionAnswering.Authoring.QuestionAnsweringAuthoringClient.GetUpdateSourcesStatusAsync(System.String,System.String,Azure.RequestContext)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function GetUpdateSourcesStatusAsync (projectName As String, jobId As String, Optional context As RequestContext = Nothing) As Task(Of Response)" />
<MemberSignature Language="F#" Value="abstract member GetUpdateSourcesStatusAsync : string * string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.GetUpdateSourcesStatusAsync : string * string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>" Usage="questionAnsweringAuthoringClient.GetUpdateSourcesStatusAsync (projectName, jobId, context)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Azure.AI.Language.QuestionAnswering</AssemblyName>
<AssemblyVersion>1.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Threading.Tasks.Task<Azure.Response></ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="projectName" Type="System.String" />
<Parameter Name="jobId" Type="System.String" />
<Parameter Name="context" Type="Azure.RequestContext" />
</Parameters>
<Docs>
<param name="projectName"> The name of the project to use. </param>
<param name="jobId"> Job ID. </param>
<param name="context"> The request context, which can override default behaviors of the client pipeline on a per-call basis. </param>
<summary> Gets the status of update sources job. </summary>
<returns> The response returned from the service. Details of the response body schema are in the Remarks section below. </returns>
<remarks>
Below is the JSON schema for the response payload.
Additional information can be found in the service REST API documentation:
https://learn.microsoft.com/rest/api/cognitiveservices/questionanswering/question-answering-projects/get-update-sources-status
Response Body:
<details><summary>ExportJobState</summary>Schema for <c>ExportJobState</c>:
<code>{
createdDateTime: string (ISO 8601 Format), # Required.
expirationDateTime: string (ISO 8601 Format), # Optional.
jobId: string, # Required.
lastUpdatedDateTime: string (ISO 8601 Format), # Required.
status: "notStarted" | "running" | "succeeded" | "failed" | "cancelled" | "cancelling" | "partiallyCompleted", # Required. Job Status.
}
</code></details></remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="projectName" /> or <paramref name="jobId" /> is null. </exception>
<exception cref="T:System.ArgumentException">
<paramref name="projectName" /> or <paramref name="jobId" /> is an empty string, and was expected to be non-empty. </exception>
<exception cref="T:Azure.RequestFailedException"> Service returned a non-success status code. </exception>
<example>
This sample shows how to call GetUpdateSourcesStatusAsync with required parameters and parse the result.
<code><![CDATA[
var credential = new AzureKeyCredential("<key>");
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new QuestionAnsweringAuthoringClient(endpoint, credential);
Response response = await client.GetUpdateSourcesStatusAsync("<projectName>", "<jobId>");
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("createdDateTime").ToString());
Console.WriteLine(result.GetProperty("expirationDateTime").ToString());
Console.WriteLine(result.GetProperty("jobId").ToString());
Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
Console.WriteLine(result.GetProperty("status").ToString());
]]></code></example>
</Docs>
</Member>
<Member MemberName="Import">
<MemberSignature Language="C#" Value="public virtual Azure.Operation<BinaryData> Import (Azure.WaitUntil waitUntil, string projectName, Azure.Core.RequestContent content, string format = default, string assetKind = default, Azure.RequestContext context = default);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class Azure.Operation`1<class System.BinaryData> Import(valuetype Azure.WaitUntil waitUntil, string projectName, class Azure.Core.RequestContent content, string format, string assetKind, class Azure.RequestContext context) cil managed" />
<MemberSignature Language="DocId" Value="M:Azure.AI.Language.QuestionAnswering.Authoring.QuestionAnsweringAuthoringClient.Import(Azure.WaitUntil,System.String,Azure.Core.RequestContent,System.String,System.String,Azure.RequestContext)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function Import (waitUntil As WaitUntil, projectName As String, content As RequestContent, Optional format As String = Nothing, Optional assetKind As String = Nothing, Optional context As RequestContext = Nothing) As Operation(Of BinaryData)" />
<MemberSignature Language="F#" Value="abstract member Import : Azure.WaitUntil * string * Azure.Core.RequestContent * string * string * Azure.RequestContext -> Azure.Operation<BinaryData>
override this.Import : Azure.WaitUntil * string * Azure.Core.RequestContent * string * string * Azure.RequestContext -> Azure.Operation<BinaryData>" Usage="questionAnsweringAuthoringClient.Import (waitUntil, projectName, content, format, assetKind, context)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Azure.AI.Language.QuestionAnswering</AssemblyName>
<AssemblyVersion>1.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Azure.Operation<System.BinaryData></ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="waitUntil" Type="Azure.WaitUntil" />
<Parameter Name="projectName" Type="System.String" />
<Parameter Name="content" Type="Azure.Core.RequestContent" />
<Parameter Name="format" Type="System.String" />
<Parameter Name="assetKind" Type="System.String" />
<Parameter Name="context" Type="Azure.RequestContext" />
</Parameters>
<Docs>
<param name="waitUntil">
<see cref="F:Azure.WaitUntil.Completed" /> if the method should wait to return until the long-running operation has completed on the service; <see cref="F:Azure.WaitUntil.Started" /> if it should return after starting the operation. For more information on long-running operations, please see <see href="https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/LongRunningOperations.md"> Azure.Core Long-Running Operation samples</see>. </param>
<param name="projectName"> The name of the project to use. </param>
<param name="content"> The content to send as the body of the request. Details of the request body schema are in the Remarks section below. </param>
<param name="format"> Knowledge base Import or Export format. Allowed values: "json" | "tsv" | "excel". </param>
<param name="assetKind"> Kind of the asset of the project. Allowed values: "qnas" | "synonyms". </param>
<param name="context"> The request context, which can override default behaviors of the client pipeline on a per-call basis. </param>
<summary> Import project assets. </summary>
<returns> The <see cref="T:Azure.Operation`1" /> from the service that will contain a <see cref="T:System.BinaryData" /> object once the asynchronous operation on the service has completed. Details of the body schema for the operation's final value are in the Remarks section below. </returns>
<remarks>
Below is the JSON schema for the request and response payloads.
Additional information can be found in the service REST API documentation:
https://learn.microsoft.com/rest/api/cognitiveservices/questionanswering/question-answering-projects/import
Request Body:
Schema for <c>ImportJobOptions</c>:
<code>{
metadata: {
description: string, # Optional. Description of the project.
language: string, # Required. Language of the text records. This is BCP-47 representation of a language. For example, use "en" for English; "es" for Spanish etc. If not set, use "en" for English as default.
multilingualResource: boolean, # Optional. Set to true to enable creating knowledgebases in different languages for the same resource.
settings: {
defaultAnswer: string, # Optional. Default Answer response when no good match is found in the knowledge base.
}, # Optional. Configurable settings of the Project.
}, # Optional. Parameters needed to create the project.
assets: {
synonyms: [
{
alterations: [string], # Required. Collection of word alterations.
}
], # Optional. Collection of synonyms.
qnas: [
{
id: number, # Optional. Unique ID for the QnA.
answer: string, # Optional. Answer text.
source: string, # Optional. Source from which QnA was indexed e.g. https://docs.microsoft.com/en-us/azure/cognitive-services/QnAMaker/FAQs .
questions: [string], # Optional. List of questions associated with the answer.
metadata: Dictionary<string, string>, # Optional. Metadata associated with the answer, useful to categorize or filter question answers.
dialog: {
isContextOnly: boolean, # Optional. To mark if a prompt is relevant only with a previous question or not. If true, do not include this QnA as answer for queries without context; otherwise, ignores context and includes this QnA in answers.
prompts: [
{
displayOrder: number, # Optional. Index of the prompt. It is used for ordering of the prompts.
qnaId: number, # Optional. ID of the QnA corresponding to the prompt.
qna: {
id: number, # Optional. Unique ID for the QnA.
answer: string, # Optional. Answer text.
source: string, # Optional. Source from which QnA was indexed e.g. https://docs.microsoft.com/en-us/azure/cognitive-services/QnAMaker/FAQs .
questions: [string], # Optional. List of questions associated with the answer.
metadata: Dictionary<string, string>, # Optional. Metadata associated with the answer, useful to categorize or filter question answers.
dialog: QnaDialog, # Optional. Context of a QnA.
activeLearningSuggestions: [
{
clusterHead: string, # Optional. Question chosen as the head of suggested questions cluster by Active Learning clustering algorithm.
suggestedQuestions: [
{
question: string, # Optional. Question suggested by the Active Learning feature.
userSuggestedCount: number, # Optional. The number of times the question was suggested explicitly by the user.
autoSuggestedCount: number, # Optional. The number of times the question was suggested automatically by the Active Learning algorithm.
}
], # Optional. List of all suggested questions for the QnA.
}
], # Optional. List of Active Learning suggestions for the QnA.
}, # Optional. QnA record. Either QnAId or QnA record needs to be present in a Prompt.
displayText: string, # Optional. Text displayed to represent a follow up question prompt.
}
], # Optional. List of prompts associated with the answer.
}, # Optional. Context of a QnA.
activeLearningSuggestions: [SuggestedQuestionsCluster], # Optional. List of Active Learning suggestions for the QnA.
}
], # Optional. List of QnA records to import.
}, # Optional. All assets for this project.
fileUri: string, # Optional. Import data File URI.
}
</code>
Response Body:
<details><summary>ExportJobState</summary>Schema for <c>ExportJobState</c>:
<code>{
createdDateTime: string (ISO 8601 Format), # Required.
expirationDateTime: string (ISO 8601 Format), # Optional.
jobId: string, # Required.
lastUpdatedDateTime: string (ISO 8601 Format), # Required.
status: "notStarted" | "running" | "succeeded" | "failed" | "cancelled" | "cancelling" | "partiallyCompleted", # Required. Job Status.
}
</code></details></remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="projectName" /> is null. </exception>
<exception cref="T:System.ArgumentException">
<paramref name="projectName" /> is an empty string, and was expected to be non-empty. </exception>
<exception cref="T:Azure.RequestFailedException"> Service returned a non-success status code. </exception>
<example>
This sample shows how to call Import with required parameters and parse the result.
<code><![CDATA[
var credential = new AzureKeyCredential("<key>");
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new QuestionAnsweringAuthoringClient(endpoint, credential);
var data = new {};
var operation = client.Import(WaitUntil.Completed, "<projectName>", RequestContent.Create(data));
BinaryData data = operation.WaitForCompletion();
JsonElement result = JsonDocument.Parse(data.ToStream()).RootElement;
Console.WriteLine(result.GetProperty("createdDateTime").ToString());
Console.WriteLine(result.GetProperty("jobId").ToString());
Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
Console.WriteLine(result.GetProperty("status").ToString());
]]></code>
This sample shows how to call Import with all parameters and request content, and how to parse the result.
<code><![CDATA[
var credential = new AzureKeyCredential("<key>");
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new QuestionAnsweringAuthoringClient(endpoint, credential);
var data = new {
metadata = new {
description = "<description>",
language = "<language>",
multilingualResource = true,
settings = new {
defaultAnswer = "<defaultAnswer>",
},
},
assets = new {
synonyms = new[] {
new {
alterations = new[] {
"<String>"
},
}
},
qnas = new[] {
new {
id = 1234,
answer = "<answer>",
source = "<source>",
questions = new[] {
"<String>"
},
metadata = new {
key = "<String>",
},
dialog = new {
isContextOnly = true,
prompts = new[] {
new {
displayOrder = 1234,
qnaId = 1234,
qna = new {
id = 1234,
answer = "<answer>",
source = "<source>",
questions = new[] {
"<String>"
},
metadata = new {
key = "<String>",
},
activeLearningSuggestions = new[] {
new {
clusterHead = "<clusterHead>",
suggestedQuestions = new[] {
new {
question = "<question>",
userSuggestedCount = 1234,
autoSuggestedCount = 1234,
}
},
}
},
},
displayText = "<displayText>",
}
},
},
activeLearningSuggestions = new[] {
new {
clusterHead = "<clusterHead>",
suggestedQuestions = new[] {
new {
question = "<question>",
userSuggestedCount = 1234,
autoSuggestedCount = 1234,
}
},
}
},
}
},
},
fileUri = "<fileUri>",
};
var operation = client.Import(WaitUntil.Completed, "<projectName>", RequestContent.Create(data), "<format>", "<assetKind>");
BinaryData data = operation.WaitForCompletion();
JsonElement result = JsonDocument.Parse(data.ToStream()).RootElement;
Console.WriteLine(result.GetProperty("createdDateTime").ToString());
Console.WriteLine(result.GetProperty("expirationDateTime").ToString());
Console.WriteLine(result.GetProperty("jobId").ToString());
Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
Console.WriteLine(result.GetProperty("status").ToString());
]]></code></example>
</Docs>
</Member>
<Member MemberName="ImportAsync">
<MemberSignature Language="C#" Value="public virtual System.Threading.Tasks.Task<Azure.Operation<BinaryData>> ImportAsync (Azure.WaitUntil waitUntil, string projectName, Azure.Core.RequestContent content, string format = default, string assetKind = default, Azure.RequestContext context = default);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class System.Threading.Tasks.Task`1<class Azure.Operation`1<class System.BinaryData>> ImportAsync(valuetype Azure.WaitUntil waitUntil, string projectName, class Azure.Core.RequestContent content, string format, string assetKind, class Azure.RequestContext context) cil managed" />
<MemberSignature Language="DocId" Value="M:Azure.AI.Language.QuestionAnswering.Authoring.QuestionAnsweringAuthoringClient.ImportAsync(Azure.WaitUntil,System.String,Azure.Core.RequestContent,System.String,System.String,Azure.RequestContext)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function ImportAsync (waitUntil As WaitUntil, projectName As String, content As RequestContent, Optional format As String = Nothing, Optional assetKind As String = Nothing, Optional context As RequestContext = Nothing) As Task(Of Operation(Of BinaryData))" />
<MemberSignature Language="F#" Value="abstract member ImportAsync : Azure.WaitUntil * string * Azure.Core.RequestContent * string * string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Operation<BinaryData>>
override this.ImportAsync : Azure.WaitUntil * string * Azure.Core.RequestContent * string * string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Operation<BinaryData>>" Usage="questionAnsweringAuthoringClient.ImportAsync (waitUntil, projectName, content, format, assetKind, context)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Azure.AI.Language.QuestionAnswering</AssemblyName>
<AssemblyVersion>1.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Threading.Tasks.Task<Azure.Operation<System.BinaryData>></ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="waitUntil" Type="Azure.WaitUntil" />
<Parameter Name="projectName" Type="System.String" />
<Parameter Name="content" Type="Azure.Core.RequestContent" />
<Parameter Name="format" Type="System.String" />
<Parameter Name="assetKind" Type="System.String" />
<Parameter Name="context" Type="Azure.RequestContext" />
</Parameters>
<Docs>
<param name="waitUntil">
<see cref="F:Azure.WaitUntil.Completed" /> if the method should wait to return until the long-running operation has completed on the service; <see cref="F:Azure.WaitUntil.Started" /> if it should return after starting the operation. For more information on long-running operations, please see <see href="https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/LongRunningOperations.md"> Azure.Core Long-Running Operation samples</see>. </param>
<param name="projectName"> The name of the project to use. </param>
<param name="content"> The content to send as the body of the request. Details of the request body schema are in the Remarks section below. </param>
<param name="format"> Knowledge base Import or Export format. Allowed values: "json" | "tsv" | "excel". </param>
<param name="assetKind"> Kind of the asset of the project. Allowed values: "qnas" | "synonyms". </param>
<param name="context"> The request context, which can override default behaviors of the client pipeline on a per-call basis. </param>
<summary> Import project assets. </summary>
<returns> The <see cref="T:Azure.Operation`1" /> from the service that will contain a <see cref="T:System.BinaryData" /> object once the asynchronous operation on the service has completed. Details of the body schema for the operation's final value are in the Remarks section below. </returns>
<remarks>
Below is the JSON schema for the request and response payloads.
Additional information can be found in the service REST API documentation:
https://learn.microsoft.com/rest/api/cognitiveservices/questionanswering/question-answering-projects/import
Request Body:
Schema for <c>ImportJobOptions</c>:
<code>{
metadata: {
description: string, # Optional. Description of the project.
language: string, # Required. Language of the text records. This is BCP-47 representation of a language. For example, use "en" for English; "es" for Spanish etc. If not set, use "en" for English as default.
multilingualResource: boolean, # Optional. Set to true to enable creating knowledgebases in different languages for the same resource.
settings: {
defaultAnswer: string, # Optional. Default Answer response when no good match is found in the knowledge base.
}, # Optional. Configurable settings of the Project.
}, # Optional. Parameters needed to create the project.
assets: {
synonyms: [
{
alterations: [string], # Required. Collection of word alterations.
}
], # Optional. Collection of synonyms.
qnas: [
{
id: number, # Optional. Unique ID for the QnA.
answer: string, # Optional. Answer text.
source: string, # Optional. Source from which QnA was indexed e.g. https://docs.microsoft.com/en-us/azure/cognitive-services/QnAMaker/FAQs .
questions: [string], # Optional. List of questions associated with the answer.
metadata: Dictionary<string, string>, # Optional. Metadata associated with the answer, useful to categorize or filter question answers.
dialog: {
isContextOnly: boolean, # Optional. To mark if a prompt is relevant only with a previous question or not. If true, do not include this QnA as answer for queries without context; otherwise, ignores context and includes this QnA in answers.
prompts: [
{
displayOrder: number, # Optional. Index of the prompt. It is used for ordering of the prompts.
qnaId: number, # Optional. ID of the QnA corresponding to the prompt.
qna: {
id: number, # Optional. Unique ID for the QnA.
answer: string, # Optional. Answer text.
source: string, # Optional. Source from which QnA was indexed e.g. https://docs.microsoft.com/en-us/azure/cognitive-services/QnAMaker/FAQs .
questions: [string], # Optional. List of questions associated with the answer.
metadata: Dictionary<string, string>, # Optional. Metadata associated with the answer, useful to categorize or filter question answers.
dialog: QnaDialog, # Optional. Context of a QnA.
activeLearningSuggestions: [
{
clusterHead: string, # Optional. Question chosen as the head of suggested questions cluster by Active Learning clustering algorithm.
suggestedQuestions: [
{
question: string, # Optional. Question suggested by the Active Learning feature.
userSuggestedCount: number, # Optional. The number of times the question was suggested explicitly by the user.
autoSuggestedCount: number, # Optional. The number of times the question was suggested automatically by the Active Learning algorithm.
}
], # Optional. List of all suggested questions for the QnA.
}
], # Optional. List of Active Learning suggestions for the QnA.
}, # Optional. QnA record. Either QnAId or QnA record needs to be present in a Prompt.
displayText: string, # Optional. Text displayed to represent a follow up question prompt.
}
], # Optional. List of prompts associated with the answer.
}, # Optional. Context of a QnA.
activeLearningSuggestions: [SuggestedQuestionsCluster], # Optional. List of Active Learning suggestions for the QnA.
}
], # Optional. List of QnA records to import.
}, # Optional. All assets for this project.
fileUri: string, # Optional. Import data File URI.
}
</code>
Response Body:
<details><summary>ExportJobState</summary>Schema for <c>ExportJobState</c>:
<code>{
createdDateTime: string (ISO 8601 Format), # Required.
expirationDateTime: string (ISO 8601 Format), # Optional.
jobId: string, # Required.
lastUpdatedDateTime: string (ISO 8601 Format), # Required.
status: "notStarted" | "running" | "succeeded" | "failed" | "cancelled" | "cancelling" | "partiallyCompleted", # Required. Job Status.
}
</code></details></remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="projectName" /> is null. </exception>
<exception cref="T:System.ArgumentException">
<paramref name="projectName" /> is an empty string, and was expected to be non-empty. </exception>
<exception cref="T:Azure.RequestFailedException"> Service returned a non-success status code. </exception>
<example>
This sample shows how to call ImportAsync with required parameters and parse the result.
<code><![CDATA[
var credential = new AzureKeyCredential("<key>");
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new QuestionAnsweringAuthoringClient(endpoint, credential);
var data = new {};
var operation = await client.ImportAsync(WaitUntil.Completed, "<projectName>", RequestContent.Create(data));
BinaryData data = await operation.WaitForCompletionAsync();
JsonElement result = JsonDocument.Parse(data.ToStream()).RootElement;
Console.WriteLine(result.GetProperty("createdDateTime").ToString());
Console.WriteLine(result.GetProperty("jobId").ToString());
Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
Console.WriteLine(result.GetProperty("status").ToString());
]]></code>
This sample shows how to call ImportAsync with all parameters and request content, and how to parse the result.
<code><![CDATA[
var credential = new AzureKeyCredential("<key>");
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new QuestionAnsweringAuthoringClient(endpoint, credential);
var data = new {
metadata = new {
description = "<description>",
language = "<language>",
multilingualResource = true,
settings = new {
defaultAnswer = "<defaultAnswer>",
},
},
assets = new {
synonyms = new[] {
new {
alterations = new[] {
"<String>"
},
}
},
qnas = new[] {
new {
id = 1234,
answer = "<answer>",
source = "<source>",
questions = new[] {
"<String>"
},
metadata = new {
key = "<String>",
},
dialog = new {
isContextOnly = true,
prompts = new[] {
new {
displayOrder = 1234,
qnaId = 1234,
qna = new {
id = 1234,
answer = "<answer>",
source = "<source>",
questions = new[] {
"<String>"
},
metadata = new {
key = "<String>",
},
activeLearningSuggestions = new[] {
new {
clusterHead = "<clusterHead>",
suggestedQuestions = new[] {
new {
question = "<question>",
userSuggestedCount = 1234,
autoSuggestedCount = 1234,
}
},
}
},
},
displayText = "<displayText>",
}
},
},
activeLearningSuggestions = new[] {
new {
clusterHead = "<clusterHead>",
suggestedQuestions = new[] {
new {
question = "<question>",
userSuggestedCount = 1234,
autoSuggestedCount = 1234,
}
},
}
},
}
},
},
fileUri = "<fileUri>",
};
var operation = await client.ImportAsync(WaitUntil.Completed, "<projectName>", RequestContent.Create(data), "<format>", "<assetKind>");
BinaryData data = await operation.WaitForCompletionAsync();
JsonElement result = JsonDocument.Parse(data.ToStream()).RootElement;
Console.WriteLine(result.GetProperty("createdDateTime").ToString());
Console.WriteLine(result.GetProperty("expirationDateTime").ToString());
Console.WriteLine(result.GetProperty("jobId").ToString());
Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
Console.WriteLine(result.GetProperty("status").ToString());
]]></code></example>
</Docs>
</Member>
<Member MemberName="Pipeline">
<MemberSignature Language="C#" Value="public virtual Azure.Core.Pipeline.HttpPipeline Pipeline { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class Azure.Core.Pipeline.HttpPipeline Pipeline" />
<MemberSignature Language="DocId" Value="P:Azure.AI.Language.QuestionAnswering.Authoring.QuestionAnsweringAuthoringClient.Pipeline" />
<MemberSignature Language="VB.NET" Value="Public Overridable ReadOnly Property Pipeline As HttpPipeline" />
<MemberSignature Language="F#" Value="member this.Pipeline : Azure.Core.Pipeline.HttpPipeline" Usage="Azure.AI.Language.QuestionAnswering.Authoring.QuestionAnsweringAuthoringClient.Pipeline" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>Azure.AI.Language.QuestionAnswering</AssemblyName>
<AssemblyVersion>1.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Azure.Core.Pipeline.HttpPipeline</ReturnType>
</ReturnValue>
<Docs>
<summary> The HTTP pipeline for sending and receiving REST requests and responses. </summary>
<value>To be added.</value>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="UpdateQnas">
<MemberSignature Language="C#" Value="public virtual Azure.Operation<Azure.Pageable<BinaryData>> UpdateQnas (Azure.WaitUntil waitUntil, string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = default);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class Azure.Operation`1<class Azure.Pageable`1<class System.BinaryData>> UpdateQnas(valuetype Azure.WaitUntil waitUntil, string projectName, class Azure.Core.RequestContent content, class Azure.RequestContext context) cil managed" />
<MemberSignature Language="DocId" Value="M:Azure.AI.Language.QuestionAnswering.Authoring.QuestionAnsweringAuthoringClient.UpdateQnas(Azure.WaitUntil,System.String,Azure.Core.RequestContent,Azure.RequestContext)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function UpdateQnas (waitUntil As WaitUntil, projectName As String, content As RequestContent, Optional context As RequestContext = Nothing) As Operation(Of Pageable(Of BinaryData))" />
<MemberSignature Language="F#" Value="abstract member UpdateQnas : Azure.WaitUntil * string * Azure.Core.RequestContent * Azure.RequestContext -> Azure.Operation<Azure.Pageable<BinaryData>>
override this.UpdateQnas : Azure.WaitUntil * string * Azure.Core.RequestContent * Azure.RequestContext -> Azure.Operation<Azure.Pageable<BinaryData>>" Usage="questionAnsweringAuthoringClient.UpdateQnas (waitUntil, projectName, content, context)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Azure.AI.Language.QuestionAnswering</AssemblyName>
<AssemblyVersion>1.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Azure.Operation<Azure.Pageable<System.BinaryData>></ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="waitUntil" Type="Azure.WaitUntil" />
<Parameter Name="projectName" Type="System.String" />
<Parameter Name="content" Type="Azure.Core.RequestContent" />
<Parameter Name="context" Type="Azure.RequestContext" />
</Parameters>
<Docs>
<param name="waitUntil">
<see cref="F:Azure.WaitUntil.Completed" /> if the method should wait to return until the long-running operation has completed on the service; <see cref="F:Azure.WaitUntil.Started" /> if it should return after starting the operation. For more information on long-running operations, please see <see href="https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/LongRunningOperations.md"> Azure.Core Long-Running Operation samples</see>. </param>
<param name="projectName"> The name of the project to use. </param>
<param name="content"> The content to send as the body of the request. Details of the request body schema are in the Remarks section below. </param>
<param name="context"> The request context, which can override default behaviors of the client pipeline on a per-call basis. </param>
<summary> Updates the QnAs of a project. </summary>
<returns> The <see cref="T:Azure.Operation`1" /> from the service that will contain a <see cref="T:Azure.Pageable`1" /> containing a list of <see cref="T:System.BinaryData" /> objects once the asynchronous operation on the service has completed. Details of the body schema for the operation's final value are in the Remarks section below. </returns>
<remarks>
Below is the JSON schema for the request payload and one item in the pageable response.
Additional information can be found in the service REST API documentation:
https://learn.microsoft.com/rest/api/cognitiveservices/questionanswering/question-answering-projects/update-qnas
Request Body:
Schema for <c>UpdateQnaRecord</c>:
<code>{
op: "add" | "delete" | "replace", # Required. Update operation type for assets.
value: {
id: number, # Optional. Unique ID for the QnA.
answer: string, # Optional. Answer text.
source: string, # Optional. Source from which QnA was indexed e.g. https://docs.microsoft.com/en-us/azure/cognitive-services/QnAMaker/FAQs .
questions: [string], # Optional. List of questions associated with the answer.
metadata: Dictionary<string, string>, # Optional. Metadata associated with the answer, useful to categorize or filter question answers.
dialog: {
isContextOnly: boolean, # Optional. To mark if a prompt is relevant only with a previous question or not. If true, do not include this QnA as answer for queries without context; otherwise, ignores context and includes this QnA in answers.
prompts: [
{
displayOrder: number, # Optional. Index of the prompt. It is used for ordering of the prompts.
qnaId: number, # Optional. ID of the QnA corresponding to the prompt.
qna: QnaRecord, # Optional. QnA record. Either QnAId or QnA record needs to be present in a Prompt.
displayText: string, # Optional. Text displayed to represent a follow up question prompt.
}
], # Optional. List of prompts associated with the answer.
}, # Optional. Context of a QnA.
activeLearningSuggestions: [
{
clusterHead: string, # Optional. Question chosen as the head of suggested questions cluster by Active Learning clustering algorithm.
suggestedQuestions: [
{
question: string, # Optional. Question suggested by the Active Learning feature.
userSuggestedCount: number, # Optional. The number of times the question was suggested explicitly by the user.
autoSuggestedCount: number, # Optional. The number of times the question was suggested automatically by the Active Learning algorithm.
}
], # Optional. List of all suggested questions for the QnA.
}
], # Optional. List of Active Learning suggestions for the QnA.
}, # Required. QnA record.
}
</code>
Response Body:
Schema for <c>QnaAsset</c>:
<code>{
id: number, # Optional. Unique ID for the QnA.
answer: string, # Optional. Answer text.
source: string, # Optional. Source from which QnA was indexed e.g. https://docs.microsoft.com/en-us/azure/cognitive-services/QnAMaker/FAQs .
questions: [string], # Optional. List of questions associated with the answer.
metadata: Dictionary<string, string>, # Optional. Metadata associated with the answer, useful to categorize or filter question answers.
dialog: {
isContextOnly: boolean, # Optional. To mark if a prompt is relevant only with a previous question or not. If true, do not include this QnA as answer for queries without context; otherwise, ignores context and includes this QnA in answers.
prompts: [
{
displayOrder: number, # Optional. Index of the prompt. It is used for ordering of the prompts.
qnaId: number, # Optional. ID of the QnA corresponding to the prompt.
qna: {
id: number, # Optional. Unique ID for the QnA.
answer: string, # Optional. Answer text.
source: string, # Optional. Source from which QnA was indexed e.g. https://docs.microsoft.com/en-us/azure/cognitive-services/QnAMaker/FAQs .
questions: [string], # Optional. List of questions associated with the answer.
metadata: Dictionary<string, string>, # Optional. Metadata associated with the answer, useful to categorize or filter question answers.
dialog: QnaDialog, # Optional. Context of a QnA.
activeLearningSuggestions: [
{
clusterHead: string, # Optional. Question chosen as the head of suggested questions cluster by Active Learning clustering algorithm.
suggestedQuestions: [
{
question: string, # Optional. Question suggested by the Active Learning feature.
userSuggestedCount: number, # Optional. The number of times the question was suggested explicitly by the user.
autoSuggestedCount: number, # Optional. The number of times the question was suggested automatically by the Active Learning algorithm.
}
], # Optional. List of all suggested questions for the QnA.
}
], # Optional. List of Active Learning suggestions for the QnA.
}, # Optional. QnA record. Either QnAId or QnA record needs to be present in a Prompt.
displayText: string, # Optional. Text displayed to represent a follow up question prompt.
}
], # Optional. List of prompts associated with the answer.
}, # Optional. Context of a QnA.
activeLearningSuggestions: [SuggestedQuestionsCluster], # Optional. List of Active Learning suggestions for the QnA.
}
</code></remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="projectName" /> or <paramref name="content" /> is null. </exception>
<exception cref="T:System.ArgumentException">
<paramref name="projectName" /> is an empty string, and was expected to be non-empty. </exception>
<exception cref="T:Azure.RequestFailedException"> Service returned a non-success status code. </exception>
<example>
This sample shows how to call UpdateQnas with required parameters and request content and parse the result.
<code><![CDATA[
var credential = new AzureKeyCredential("<key>");
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new QuestionAnsweringAuthoringClient(endpoint, credential);
var data = new[] {
new {
op = "add",
value = new {
id = 1234,
answer = "<answer>",
source = "<source>",
questions = new[] {
"<String>"
},
metadata = new {
key = "<String>",
},
dialog = new {
isContextOnly = true,
prompts = new[] {
new {
displayOrder = 1234,
qnaId = 1234,
displayText = "<displayText>",
}
},
},
activeLearningSuggestions = new[] {
new {
clusterHead = "<clusterHead>",
suggestedQuestions = new[] {
new {
question = "<question>",
userSuggestedCount = 1234,
autoSuggestedCount = 1234,
}
},
}
},
},
}
};
var operation = client.UpdateQnas(WaitUntil.Completed, "<projectName>", RequestContent.Create(data));
var response = operation.WaitForCompletion();
foreach (var data in response.Value)
{
JsonElement result = JsonDocument.Parse(data.ToStream()).RootElement;
Console.WriteLine(result.GetProperty("id").ToString());
Console.WriteLine(result.GetProperty("answer").ToString());
Console.WriteLine(result.GetProperty("source").ToString());
Console.WriteLine(result.GetProperty("questions")[0].ToString());
Console.WriteLine(result.GetProperty("metadata").GetProperty("<test>").ToString());
Console.WriteLine(result.GetProperty("dialog").GetProperty("isContextOnly").ToString());
Console.WriteLine(result.GetProperty("dialog").GetProperty("prompts")[0].GetProperty("displayOrder").ToString());
Console.WriteLine(result.GetProperty("dialog").GetProperty("prompts")[0].GetProperty("qnaId").ToString());
Console.WriteLine(result.GetProperty("dialog").GetProperty("prompts")[0].GetProperty("qna").GetProperty("id").ToString());
Console.WriteLine(result.GetProperty("dialog").GetProperty("prompts")[0].GetProperty("qna").GetProperty("answer").ToString());
Console.WriteLine(result.GetProperty("dialog").GetProperty("prompts")[0].GetProperty("qna").GetProperty("source").ToString());
Console.WriteLine(result.GetProperty("dialog").GetProperty("prompts")[0].GetProperty("qna").GetProperty("questions")[0].ToString());
Console.WriteLine(result.GetProperty("dialog").GetProperty("prompts")[0].GetProperty("qna").GetProperty("metadata").GetProperty("<test>").ToString());
Console.WriteLine(result.GetProperty("dialog").GetProperty("prompts")[0].GetProperty("qna").GetProperty("activeLearningSuggestions")[0].GetProperty("clusterHead").ToString());
Console.WriteLine(result.GetProperty("dialog").GetProperty("prompts")[0].GetProperty("qna").GetProperty("activeLearningSuggestions")[0].GetProperty("suggestedQuestions")[0].GetProperty("question").ToString());
Console.WriteLine(result.GetProperty("dialog").GetProperty("prompts")[0].GetProperty("qna").GetProperty("activeLearningSuggestions")[0].GetProperty("suggestedQuestions")[0].GetProperty("userSuggestedCount").ToString());
Console.WriteLine(result.GetProperty("dialog").GetProperty("prompts")[0].GetProperty("qna").GetProperty("activeLearningSuggestions")[0].GetProperty("suggestedQuestions")[0].GetProperty("autoSuggestedCount").ToString());
Console.WriteLine(result.GetProperty("dialog").GetProperty("prompts")[0].GetProperty("displayText").ToString());
Console.WriteLine(result.GetProperty("activeLearningSuggestions")[0].GetProperty("clusterHead").ToString());
Console.WriteLine(result.GetProperty("activeLearningSuggestions")[0].GetProperty("suggestedQuestions")[0].GetProperty("question").ToString());
Console.WriteLine(result.GetProperty("activeLearningSuggestions")[0].GetProperty("suggestedQuestions")[0].GetProperty("userSuggestedCount").ToString());
Console.WriteLine(result.GetProperty("activeLearningSuggestions")[0].GetProperty("suggestedQuestions")[0].GetProperty("autoSuggestedCount").ToString());
}
]]></code></example>
</Docs>
</Member>
<Member MemberName="UpdateQnasAsync">
<MemberSignature Language="C#" Value="public virtual System.Threading.Tasks.Task<Azure.Operation<Azure.AsyncPageable<BinaryData>>> UpdateQnasAsync (Azure.WaitUntil waitUntil, string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = default);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class System.Threading.Tasks.Task`1<class Azure.Operation`1<class Azure.AsyncPageable`1<class System.BinaryData>>> UpdateQnasAsync(valuetype Azure.WaitUntil waitUntil, string projectName, class Azure.Core.RequestContent content, class Azure.RequestContext context) cil managed" />
<MemberSignature Language="DocId" Value="M:Azure.AI.Language.QuestionAnswering.Authoring.QuestionAnsweringAuthoringClient.UpdateQnasAsync(Azure.WaitUntil,System.String,Azure.Core.RequestContent,Azure.RequestContext)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function UpdateQnasAsync (waitUntil As WaitUntil, projectName As String, content As RequestContent, Optional context As RequestContext = Nothing) As Task(Of Operation(Of AsyncPageable(Of BinaryData)))" />
<MemberSignature Language="F#" Value="abstract member UpdateQnasAsync : Azure.WaitUntil * string * Azure.Core.RequestContent * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Operation<Azure.AsyncPageable<BinaryData>>>
override this.UpdateQnasAsync : Azure.WaitUntil * string * Azure.Core.RequestContent * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Operation<Azure.AsyncPageable<BinaryData>>>" Usage="questionAnsweringAuthoringClient.UpdateQnasAsync (waitUntil, projectName, content, context)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Azure.AI.Language.QuestionAnswering</AssemblyName>
<AssemblyVersion>1.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Threading.Tasks.Task<Azure.Operation<Azure.AsyncPageable<System.BinaryData>>></ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="waitUntil" Type="Azure.WaitUntil" />
<Parameter Name="projectName" Type="System.String" />
<Parameter Name="content" Type="Azure.Core.RequestContent" />
<Parameter Name="context" Type="Azure.RequestContext" />
</Parameters>
<Docs>
<param name="waitUntil">
<see cref="F:Azure.WaitUntil.Completed" /> if the method should wait to return until the long-running operation has completed on the service; <see cref="F:Azure.WaitUntil.Started" /> if it should return after starting the operation. For more information on long-running operations, please see <see href="https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/LongRunningOperations.md"> Azure.Core Long-Running Operation samples</see>. </param>
<param name="projectName"> The name of the project to use. </param>
<param name="content"> The content to send as the body of the request. Details of the request body schema are in the Remarks section below. </param>
<param name="context"> The request context, which can override default behaviors of the client pipeline on a per-call basis. </param>
<summary> Updates the QnAs of a project. </summary>
<returns> The <see cref="T:Azure.Operation`1" /> from the service that will contain a <see cref="T:Azure.AsyncPageable`1" /> containing a list of <see cref="T:System.BinaryData" /> objects once the asynchronous operation on the service has completed. Details of the body schema for the operation's final value are in the Remarks section below. </returns>
<remarks>
Below is the JSON schema for the request payload and one item in the pageable response.
Additional information can be found in the service REST API documentation:
https://learn.microsoft.com/rest/api/cognitiveservices/questionanswering/question-answering-projects/update-qnas
Request Body:
Schema for <c>UpdateQnaRecord</c>:
<code>{
op: "add" | "delete" | "replace", # Required. Update operation type for assets.
value: {
id: number, # Optional. Unique ID for the QnA.
answer: string, # Optional. Answer text.
source: string, # Optional. Source from which QnA was indexed e.g. https://docs.microsoft.com/en-us/azure/cognitive-services/QnAMaker/FAQs .
questions: [string], # Optional. List of questions associated with the answer.
metadata: Dictionary<string, string>, # Optional. Metadata associated with the answer, useful to categorize or filter question answers.
dialog: {
isContextOnly: boolean, # Optional. To mark if a prompt is relevant only with a previous question or not. If true, do not include this QnA as answer for queries without context; otherwise, ignores context and includes this QnA in answers.
prompts: [
{
displayOrder: number, # Optional. Index of the prompt. It is used for ordering of the prompts.
qnaId: number, # Optional. ID of the QnA corresponding to the prompt.
qna: QnaRecord, # Optional. QnA record. Either QnAId or QnA record needs to be present in a Prompt.
displayText: string, # Optional. Text displayed to represent a follow up question prompt.
}
], # Optional. List of prompts associated with the answer.
}, # Optional. Context of a QnA.
activeLearningSuggestions: [
{
clusterHead: string, # Optional. Question chosen as the head of suggested questions cluster by Active Learning clustering algorithm.
suggestedQuestions: [
{
question: string, # Optional. Question suggested by the Active Learning feature.
userSuggestedCount: number, # Optional. The number of times the question was suggested explicitly by the user.
autoSuggestedCount: number, # Optional. The number of times the question was suggested automatically by the Active Learning algorithm.
}
], # Optional. List of all suggested questions for the QnA.
}
], # Optional. List of Active Learning suggestions for the QnA.
}, # Required. QnA record.
}
</code>
Response Body:
Schema for <c>QnaAsset</c>:
<code>{
id: number, # Optional. Unique ID for the QnA.
answer: string, # Optional. Answer text.
source: string, # Optional. Source from which QnA was indexed e.g. https://docs.microsoft.com/en-us/azure/cognitive-services/QnAMaker/FAQs .
questions: [string], # Optional. List of questions associated with the answer.
metadata: Dictionary<string, string>, # Optional. Metadata associated with the answer, useful to categorize or filter question answers.
dialog: {
isContextOnly: boolean, # Optional. To mark if a prompt is relevant only with a previous question or not. If true, do not include this QnA as answer for queries without context; otherwise, ignores context and includes this QnA in answers.
prompts: [
{
displayOrder: number, # Optional. Index of the prompt. It is used for ordering of the prompts.
qnaId: number, # Optional. ID of the QnA corresponding to the prompt.
qna: {
id: number, # Optional. Unique ID for the QnA.
answer: string, # Optional. Answer text.
source: string, # Optional. Source from which QnA was indexed e.g. https://docs.microsoft.com/en-us/azure/cognitive-services/QnAMaker/FAQs .
questions: [string], # Optional. List of questions associated with the answer.
metadata: Dictionary<string, string>, # Optional. Metadata associated with the answer, useful to categorize or filter question answers.
dialog: QnaDialog, # Optional. Context of a QnA.
activeLearningSuggestions: [
{
clusterHead: string, # Optional. Question chosen as the head of suggested questions cluster by Active Learning clustering algorithm.
suggestedQuestions: [
{
question: string, # Optional. Question suggested by the Active Learning feature.
userSuggestedCount: number, # Optional. The number of times the question was suggested explicitly by the user.
autoSuggestedCount: number, # Optional. The number of times the question was suggested automatically by the Active Learning algorithm.
}
], # Optional. List of all suggested questions for the QnA.
}
], # Optional. List of Active Learning suggestions for the QnA.
}, # Optional. QnA record. Either QnAId or QnA record needs to be present in a Prompt.
displayText: string, # Optional. Text displayed to represent a follow up question prompt.
}
], # Optional. List of prompts associated with the answer.
}, # Optional. Context of a QnA.
activeLearningSuggestions: [SuggestedQuestionsCluster], # Optional. List of Active Learning suggestions for the QnA.
}
</code></remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="projectName" /> or <paramref name="content" /> is null. </exception>
<exception cref="T:System.ArgumentException">
<paramref name="projectName" /> is an empty string, and was expected to be non-empty. </exception>
<exception cref="T:Azure.RequestFailedException"> Service returned a non-success status code. </exception>
<example>
This sample shows how to call UpdateQnasAsync with required parameters and request content and parse the result.
<code><![CDATA[
var credential = new AzureKeyCredential("<key>");
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new QuestionAnsweringAuthoringClient(endpoint, credential);
var data = new[] {
new {
op = "add",
value = new {
id = 1234,
answer = "<answer>",
source = "<source>",
questions = new[] {
"<String>"
},
metadata = new {
key = "<String>",
},
dialog = new {
isContextOnly = true,
prompts = new[] {
new {
displayOrder = 1234,
qnaId = 1234,
displayText = "<displayText>",
}
},
},
activeLearningSuggestions = new[] {
new {
clusterHead = "<clusterHead>",
suggestedQuestions = new[] {
new {
question = "<question>",
userSuggestedCount = 1234,
autoSuggestedCount = 1234,
}
},
}
},
},
}
};
var operation = await client.UpdateQnasAsync(WaitUntil.Completed, "<projectName>", RequestContent.Create(data));
var response = await operation.WaitForCompletionAsync();
await foreach (var data in response.Value)
{
JsonElement result = JsonDocument.Parse(data.ToStream()).RootElement;
Console.WriteLine(result.GetProperty("id").ToString());
Console.WriteLine(result.GetProperty("answer").ToString());
Console.WriteLine(result.GetProperty("source").ToString());
Console.WriteLine(result.GetProperty("questions")[0].ToString());
Console.WriteLine(result.GetProperty("metadata").GetProperty("<test>").ToString());
Console.WriteLine(result.GetProperty("dialog").GetProperty("isContextOnly").ToString());
Console.WriteLine(result.GetProperty("dialog").GetProperty("prompts")[0].GetProperty("displayOrder").ToString());
Console.WriteLine(result.GetProperty("dialog").GetProperty("prompts")[0].GetProperty("qnaId").ToString());
Console.WriteLine(result.GetProperty("dialog").GetProperty("prompts")[0].GetProperty("qna").GetProperty("id").ToString());
Console.WriteLine(result.GetProperty("dialog").GetProperty("prompts")[0].GetProperty("qna").GetProperty("answer").ToString());
Console.WriteLine(result.GetProperty("dialog").GetProperty("prompts")[0].GetProperty("qna").GetProperty("source").ToString());
Console.WriteLine(result.GetProperty("dialog").GetProperty("prompts")[0].GetProperty("qna").GetProperty("questions")[0].ToString());
Console.WriteLine(result.GetProperty("dialog").GetProperty("prompts")[0].GetProperty("qna").GetProperty("metadata").GetProperty("<test>").ToString());
Console.WriteLine(result.GetProperty("dialog").GetProperty("prompts")[0].GetProperty("qna").GetProperty("activeLearningSuggestions")[0].GetProperty("clusterHead").ToString());
Console.WriteLine(result.GetProperty("dialog").GetProperty("prompts")[0].GetProperty("qna").GetProperty("activeLearningSuggestions")[0].GetProperty("suggestedQuestions")[0].GetProperty("question").ToString());
Console.WriteLine(result.GetProperty("dialog").GetProperty("prompts")[0].GetProperty("qna").GetProperty("activeLearningSuggestions")[0].GetProperty("suggestedQuestions")[0].GetProperty("userSuggestedCount").ToString());
Console.WriteLine(result.GetProperty("dialog").GetProperty("prompts")[0].GetProperty("qna").GetProperty("activeLearningSuggestions")[0].GetProperty("suggestedQuestions")[0].GetProperty("autoSuggestedCount").ToString());
Console.WriteLine(result.GetProperty("dialog").GetProperty("prompts")[0].GetProperty("displayText").ToString());
Console.WriteLine(result.GetProperty("activeLearningSuggestions")[0].GetProperty("clusterHead").ToString());
Console.WriteLine(result.GetProperty("activeLearningSuggestions")[0].GetProperty("suggestedQuestions")[0].GetProperty("question").ToString());
Console.WriteLine(result.GetProperty("activeLearningSuggestions")[0].GetProperty("suggestedQuestions")[0].GetProperty("userSuggestedCount").ToString());
Console.WriteLine(result.GetProperty("activeLearningSuggestions")[0].GetProperty("suggestedQuestions")[0].GetProperty("autoSuggestedCount").ToString());
}
]]></code></example>
</Docs>
</Member>
<Member MemberName="UpdateSources">
<MemberSignature Language="C#" Value="public virtual Azure.Operation<Azure.Pageable<BinaryData>> UpdateSources (Azure.WaitUntil waitUntil, string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = default);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class Azure.Operation`1<class Azure.Pageable`1<class System.BinaryData>> UpdateSources(valuetype Azure.WaitUntil waitUntil, string projectName, class Azure.Core.RequestContent content, class Azure.RequestContext context) cil managed" />
<MemberSignature Language="DocId" Value="M:Azure.AI.Language.QuestionAnswering.Authoring.QuestionAnsweringAuthoringClient.UpdateSources(Azure.WaitUntil,System.String,Azure.Core.RequestContent,Azure.RequestContext)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function UpdateSources (waitUntil As WaitUntil, projectName As String, content As RequestContent, Optional context As RequestContext = Nothing) As Operation(Of Pageable(Of BinaryData))" />
<MemberSignature Language="F#" Value="abstract member UpdateSources : Azure.WaitUntil * string * Azure.Core.RequestContent * Azure.RequestContext -> Azure.Operation<Azure.Pageable<BinaryData>>
override this.UpdateSources : Azure.WaitUntil * string * Azure.Core.RequestContent * Azure.RequestContext -> Azure.Operation<Azure.Pageable<BinaryData>>" Usage="questionAnsweringAuthoringClient.UpdateSources (waitUntil, projectName, content, context)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Azure.AI.Language.QuestionAnswering</AssemblyName>
<AssemblyVersion>1.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Azure.Operation<Azure.Pageable<System.BinaryData>></ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="waitUntil" Type="Azure.WaitUntil" />
<Parameter Name="projectName" Type="System.String" />
<Parameter Name="content" Type="Azure.Core.RequestContent" />
<Parameter Name="context" Type="Azure.RequestContext" />
</Parameters>
<Docs>
<param name="waitUntil">
<see cref="F:Azure.WaitUntil.Completed" /> if the method should wait to return until the long-running operation has completed on the service; <see cref="F:Azure.WaitUntil.Started" /> if it should return after starting the operation. For more information on long-running operations, please see <see href="https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/LongRunningOperations.md"> Azure.Core Long-Running Operation samples</see>. </param>
<param name="projectName"> The name of the project to use. </param>
<param name="content"> The content to send as the body of the request. Details of the request body schema are in the Remarks section below. </param>
<param name="context"> The request context, which can override default behaviors of the client pipeline on a per-call basis. </param>
<summary> Updates the sources of a project. </summary>
<returns> The <see cref="T:Azure.Operation`1" /> from the service that will contain a <see cref="T:Azure.Pageable`1" /> containing a list of <see cref="T:System.BinaryData" /> objects once the asynchronous operation on the service has completed. Details of the body schema for the operation's final value are in the Remarks section below. </returns>
<remarks>
Below is the JSON schema for the request payload and one item in the pageable response.
Additional information can be found in the service REST API documentation:
https://learn.microsoft.com/rest/api/cognitiveservices/questionanswering/question-answering-projects/update-sources
Request Body:
Schema for <c>UpdateSourceRecord</c>:
<code>{
op: "add" | "delete" | "replace", # Required. Update operation type for assets.
value: {
displayName: string, # Optional. Friendly name of the Source.
source: string, # Optional. Unique source identifier. Name of the file if it's a 'file' source; otherwise, the complete URL if it's a 'url' source.
sourceUri: string, # Required. URI location for the file or url.
sourceKind: "file" | "url", # Required. Supported source types.
contentStructureKind: "unstructured", # Optional. Content structure type for sources.
}, # Required. Update source record.
}
</code>
Response Body:
Schema for <c>QnaSourcesMetadata</c>:
<code>{
displayName: string, # Optional. Friendly name of the Source.
source: string, # Optional. Unique source identifier. Name of the file if it's a 'file' source; otherwise, the complete URL if it's a 'url' source.
sourceUri: string, # Required. URI location for the file or url.
sourceKind: "file" | "url", # Required. Supported source types.
contentStructureKind: "unstructured", # Optional. Content structure type for sources.
}
</code></remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="projectName" /> or <paramref name="content" /> is null. </exception>
<exception cref="T:System.ArgumentException">
<paramref name="projectName" /> is an empty string, and was expected to be non-empty. </exception>
<exception cref="T:Azure.RequestFailedException"> Service returned a non-success status code. </exception>
<example>
This sample shows how to call UpdateSources with required parameters and request content and parse the result.
<code><![CDATA[
var credential = new AzureKeyCredential("<key>");
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new QuestionAnsweringAuthoringClient(endpoint, credential);
var data = new[] {
new {
op = "add",
value = new {
displayName = "<displayName>",
source = "<source>",
sourceUri = "<sourceUri>",
sourceKind = "file",
contentStructureKind = "unstructured",
},
}
};
var operation = client.UpdateSources(WaitUntil.Completed, "<projectName>", RequestContent.Create(data));
var response = operation.WaitForCompletion();
foreach (var data in response.Value)
{
JsonElement result = JsonDocument.Parse(data.ToStream()).RootElement;
Console.WriteLine(result.GetProperty("displayName").ToString());
Console.WriteLine(result.GetProperty("source").ToString());
Console.WriteLine(result.GetProperty("sourceUri").ToString());
Console.WriteLine(result.GetProperty("sourceKind").ToString());
Console.WriteLine(result.GetProperty("contentStructureKind").ToString());
}
]]></code></example>
</Docs>
</Member>
<Member MemberName="UpdateSourcesAsync">
<MemberSignature Language="C#" Value="public virtual System.Threading.Tasks.Task<Azure.Operation<Azure.AsyncPageable<BinaryData>>> UpdateSourcesAsync (Azure.WaitUntil waitUntil, string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = default);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class System.Threading.Tasks.Task`1<class Azure.Operation`1<class Azure.AsyncPageable`1<class System.BinaryData>>> UpdateSourcesAsync(valuetype Azure.WaitUntil waitUntil, string projectName, class Azure.Core.RequestContent content, class Azure.RequestContext context) cil managed" />
<MemberSignature Language="DocId" Value="M:Azure.AI.Language.QuestionAnswering.Authoring.QuestionAnsweringAuthoringClient.UpdateSourcesAsync(Azure.WaitUntil,System.String,Azure.Core.RequestContent,Azure.RequestContext)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function UpdateSourcesAsync (waitUntil As WaitUntil, projectName As String, content As RequestContent, Optional context As RequestContext = Nothing) As Task(Of Operation(Of AsyncPageable(Of BinaryData)))" />
<MemberSignature Language="F#" Value="abstract member UpdateSourcesAsync : Azure.WaitUntil * string * Azure.Core.RequestContent * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Operation<Azure.AsyncPageable<BinaryData>>>
override this.UpdateSourcesAsync : Azure.WaitUntil * string * Azure.Core.RequestContent * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Operation<Azure.AsyncPageable<BinaryData>>>" Usage="questionAnsweringAuthoringClient.UpdateSourcesAsync (waitUntil, projectName, content, context)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Azure.AI.Language.QuestionAnswering</AssemblyName>
<AssemblyVersion>1.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Threading.Tasks.Task<Azure.Operation<Azure.AsyncPageable<System.BinaryData>>></ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="waitUntil" Type="Azure.WaitUntil" />
<Parameter Name="projectName" Type="System.String" />
<Parameter Name="content" Type="Azure.Core.RequestContent" />
<Parameter Name="context" Type="Azure.RequestContext" />
</Parameters>
<Docs>
<param name="waitUntil">
<see cref="F:Azure.WaitUntil.Completed" /> if the method should wait to return until the long-running operation has completed on the service; <see cref="F:Azure.WaitUntil.Started" /> if it should return after starting the operation. For more information on long-running operations, please see <see href="https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/LongRunningOperations.md"> Azure.Core Long-Running Operation samples</see>. </param>
<param name="projectName"> The name of the project to use. </param>
<param name="content"> The content to send as the body of the request. Details of the request body schema are in the Remarks section below. </param>
<param name="context"> The request context, which can override default behaviors of the client pipeline on a per-call basis. </param>
<summary> Updates the sources of a project. </summary>
<returns> The <see cref="T:Azure.Operation`1" /> from the service that will contain a <see cref="T:Azure.AsyncPageable`1" /> containing a list of <see cref="T:System.BinaryData" /> objects once the asynchronous operation on the service has completed. Details of the body schema for the operation's final value are in the Remarks section below. </returns>
<remarks>
Below is the JSON schema for the request payload and one item in the pageable response.
Additional information can be found in the service REST API documentation:
https://learn.microsoft.com/rest/api/cognitiveservices/questionanswering/question-answering-projects/update-sources
Request Body:
Schema for <c>UpdateSourceRecord</c>:
<code>{
op: "add" | "delete" | "replace", # Required. Update operation type for assets.
value: {
displayName: string, # Optional. Friendly name of the Source.
source: string, # Optional. Unique source identifier. Name of the file if it's a 'file' source; otherwise, the complete URL if it's a 'url' source.
sourceUri: string, # Required. URI location for the file or url.
sourceKind: "file" | "url", # Required. Supported source types.
contentStructureKind: "unstructured", # Optional. Content structure type for sources.
}, # Required. Update source record.
}
</code>
Response Body:
Schema for <c>QnaSourcesMetadata</c>:
<code>{
displayName: string, # Optional. Friendly name of the Source.
source: string, # Optional. Unique source identifier. Name of the file if it's a 'file' source; otherwise, the complete URL if it's a 'url' source.
sourceUri: string, # Required. URI location for the file or url.
sourceKind: "file" | "url", # Required. Supported source types.
contentStructureKind: "unstructured", # Optional. Content structure type for sources.
}
</code></remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="projectName" /> or <paramref name="content" /> is null. </exception>
<exception cref="T:System.ArgumentException">
<paramref name="projectName" /> is an empty string, and was expected to be non-empty. </exception>
<exception cref="T:Azure.RequestFailedException"> Service returned a non-success status code. </exception>
<example>
This sample shows how to call UpdateSourcesAsync with required parameters and request content and parse the result.
<code><![CDATA[
var credential = new AzureKeyCredential("<key>");
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new QuestionAnsweringAuthoringClient(endpoint, credential);
var data = new[] {
new {
op = "add",
value = new {
displayName = "<displayName>",
source = "<source>",
sourceUri = "<sourceUri>",
sourceKind = "file",
contentStructureKind = "unstructured",
},
}
};
var operation = await client.UpdateSourcesAsync(WaitUntil.Completed, "<projectName>", RequestContent.Create(data));
var response = await operation.WaitForCompletionAsync();
await foreach (var data in response.Value)
{
JsonElement result = JsonDocument.Parse(data.ToStream()).RootElement;
Console.WriteLine(result.GetProperty("displayName").ToString());
Console.WriteLine(result.GetProperty("source").ToString());
Console.WriteLine(result.GetProperty("sourceUri").ToString());
Console.WriteLine(result.GetProperty("sourceKind").ToString());
Console.WriteLine(result.GetProperty("contentStructureKind").ToString());
}
]]></code></example>
</Docs>
</Member>
<Member MemberName="UpdateSynonyms">
<MemberSignature Language="C#" Value="public virtual Azure.Response UpdateSynonyms (string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = default);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class Azure.Response UpdateSynonyms(string projectName, class Azure.Core.RequestContent content, class Azure.RequestContext context) cil managed" />
<MemberSignature Language="DocId" Value="M:Azure.AI.Language.QuestionAnswering.Authoring.QuestionAnsweringAuthoringClient.UpdateSynonyms(System.String,Azure.Core.RequestContent,Azure.RequestContext)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function UpdateSynonyms (projectName As String, content As RequestContent, Optional context As RequestContext = Nothing) As Response" />
<MemberSignature Language="F#" Value="abstract member UpdateSynonyms : string * Azure.Core.RequestContent * Azure.RequestContext -> Azure.Response
override this.UpdateSynonyms : string * Azure.Core.RequestContent * Azure.RequestContext -> Azure.Response" Usage="questionAnsweringAuthoringClient.UpdateSynonyms (projectName, content, context)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Azure.AI.Language.QuestionAnswering</AssemblyName>
<AssemblyVersion>1.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Azure.Response</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="projectName" Type="System.String" />
<Parameter Name="content" Type="Azure.Core.RequestContent" />
<Parameter Name="context" Type="Azure.RequestContext" />
</Parameters>
<Docs>
<param name="projectName"> The name of the project to use. </param>
<param name="content"> The content to send as the body of the request. Details of the request body schema are in the Remarks section below. </param>
<param name="context"> The request context, which can override default behaviors of the client pipeline on a per-call basis. </param>
<summary> Updates all the synonyms of a project. </summary>
<returns> The response returned from the service. </returns>
<remarks>
Below is the JSON schema for the request payload.
Additional information can be found in the service REST API documentation:
https://learn.microsoft.com/rest/api/cognitiveservices/questionanswering/question-answering-projects/update-synonyms
Request Body:
Schema for <c>SynonymAssets</c>:
<code>{
value: [
{
alterations: [string], # Required. Collection of word alterations.
}
], # Optional. Collection of synonyms.
nextLink: string, # Optional.
}
</code></remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="projectName" /> or <paramref name="content" /> is null. </exception>
<exception cref="T:System.ArgumentException">
<paramref name="projectName" /> is an empty string, and was expected to be non-empty. </exception>
<exception cref="T:Azure.RequestFailedException"> Service returned a non-success status code. </exception>
<example>
This sample shows how to call UpdateSynonyms with required parameters.
<code><![CDATA[
var credential = new AzureKeyCredential("<key>");
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new QuestionAnsweringAuthoringClient(endpoint, credential);
var data = new {};
Response response = client.UpdateSynonyms("<projectName>", RequestContent.Create(data));
Console.WriteLine(response.Status);
]]></code>
This sample shows how to call UpdateSynonyms with all parameters and request content.
<code><![CDATA[
var credential = new AzureKeyCredential("<key>");
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new QuestionAnsweringAuthoringClient(endpoint, credential);
var data = new {
value = new[] {
new {
alterations = new[] {
"<String>"
},
}
},
nextLink = "<nextLink>",
};
Response response = client.UpdateSynonyms("<projectName>", RequestContent.Create(data));
Console.WriteLine(response.Status);
]]></code></example>
</Docs>
</Member>
<Member MemberName="UpdateSynonymsAsync">
<MemberSignature Language="C#" Value="public virtual System.Threading.Tasks.Task<Azure.Response> UpdateSynonymsAsync (string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = default);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class System.Threading.Tasks.Task`1<class Azure.Response> UpdateSynonymsAsync(string projectName, class Azure.Core.RequestContent content, class Azure.RequestContext context) cil managed" />
<MemberSignature Language="DocId" Value="M:Azure.AI.Language.QuestionAnswering.Authoring.QuestionAnsweringAuthoringClient.UpdateSynonymsAsync(System.String,Azure.Core.RequestContent,Azure.RequestContext)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function UpdateSynonymsAsync (projectName As String, content As RequestContent, Optional context As RequestContext = Nothing) As Task(Of Response)" />
<MemberSignature Language="F#" Value="abstract member UpdateSynonymsAsync : string * Azure.Core.RequestContent * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.UpdateSynonymsAsync : string * Azure.Core.RequestContent * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>" Usage="questionAnsweringAuthoringClient.UpdateSynonymsAsync (projectName, content, context)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Azure.AI.Language.QuestionAnswering</AssemblyName>
<AssemblyVersion>1.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Threading.Tasks.Task<Azure.Response></ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="projectName" Type="System.String" />
<Parameter Name="content" Type="Azure.Core.RequestContent" />
<Parameter Name="context" Type="Azure.RequestContext" />
</Parameters>
<Docs>
<param name="projectName"> The name of the project to use. </param>
<param name="content"> The content to send as the body of the request. Details of the request body schema are in the Remarks section below. </param>
<param name="context"> The request context, which can override default behaviors of the client pipeline on a per-call basis. </param>
<summary> Updates all the synonyms of a project. </summary>
<returns> The response returned from the service. </returns>
<remarks>
Below is the JSON schema for the request payload.
Additional information can be found in the service REST API documentation:
https://learn.microsoft.com/rest/api/cognitiveservices/questionanswering/question-answering-projects/update-synonyms
Request Body:
Schema for <c>SynonymAssets</c>:
<code>{
value: [
{
alterations: [string], # Required. Collection of word alterations.
}
], # Optional. Collection of synonyms.
nextLink: string, # Optional.
}
</code></remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="projectName" /> or <paramref name="content" /> is null. </exception>
<exception cref="T:System.ArgumentException">
<paramref name="projectName" /> is an empty string, and was expected to be non-empty. </exception>
<exception cref="T:Azure.RequestFailedException"> Service returned a non-success status code. </exception>
<example>
This sample shows how to call UpdateSynonymsAsync with required parameters.
<code><![CDATA[
var credential = new AzureKeyCredential("<key>");
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new QuestionAnsweringAuthoringClient(endpoint, credential);
var data = new {};
Response response = await client.UpdateSynonymsAsync("<projectName>", RequestContent.Create(data));
Console.WriteLine(response.Status);
]]></code>
This sample shows how to call UpdateSynonymsAsync with all parameters and request content.
<code><![CDATA[
var credential = new AzureKeyCredential("<key>");
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new QuestionAnsweringAuthoringClient(endpoint, credential);
var data = new {
value = new[] {
new {
alterations = new[] {
"<String>"
},
}
},
nextLink = "<nextLink>",
};
Response response = await client.UpdateSynonymsAsync("<projectName>", RequestContent.Create(data));
Console.WriteLine(response.Status);
]]></code></example>
</Docs>
</Member>
</Members>
</Type>