Skip to main content

qnas

Creates, updates, deletes, gets or lists a qnas resource.

Overview

Nameqnas
TypeResource
Idazure.ai_language.qnas

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idintegerUnique ID for the QnA. Required.
activeLearningSuggestionsarrayList of Active Learning suggestions for the QnA.
answerstringAnswer text.
dialogobjectContext of a QnA.
lastUpdatedDateTimestring (date-time)Date-time when the QnA was last updated.
metadataobjectMetadata associated with the answer, useful to categorize or filter question answers.
questionsarrayList of questions associated with the answer.
sourcestringSource from which QnA was indexed e.g. https://docs.microsoft.com/en-us/azure/cognitive-services/QnAMaker/FAQs _ .

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_qnasselectproject_name, endpointtop, skip, maxpagesize, sourceGets all the QnAs of a project.
update_qnasupdateproject_name, endpoint, op, valueUpdates the QnAs of a project.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
endpointstringThe service endpoint host (no scheme), e.g. myaccount.table.cosmos.azure.com:443 - value of the client Endpoint parameter. (default: )
project_namestringThe name of the project to use. Required.
maxpagesizeinteger
skipintegerAn offset into the collection of the first resource to be returned. Default value is None.
sourcestringSource of the QnA. Default value is None.
topintegerThe maximum number of resources to return from the collection. Default value is None.

SELECT examples

Gets all the QnAs of a project.

SELECT
id,
activeLearningSuggestions,
answer,
dialog,
lastUpdatedDateTime,
metadata,
questions,
source
FROM azure.ai_language.qnas
WHERE project_name = '{{ project_name }}' -- required
AND endpoint = '{{ endpoint }}' -- required
AND top = '{{ top }}'
AND skip = '{{ skip }}'
AND maxpagesize = '{{ maxpagesize }}'
AND source = '{{ source }}'
;

UPDATE examples

Updates the QnAs of a project.

UPDATE azure.ai_language.qnas
SET
op = '{{ op }}',
value = '{{ value }}'
WHERE
project_name = '{{ project_name }}' --required
AND endpoint = '{{ endpoint }}' --required
AND op = '{{ op }}' --required
AND value = '{{ value }}' --required;