Merged PR 22929: Allow user embed standalone qna part
Allow user embed standalone qna part in two supported modes: interactive and answer/result view.
This commit is contained in:
Родитель
899d87bee3
Коммит
3936fd1f94
|
@ -11,6 +11,9 @@ export const settingsSchema = require('./schemas/settings.json');
|
|||
export const basicFilterSchema = require('./schemas/basicFilter.json');
|
||||
export const createReportSchema = require('./schemas/reportCreateConfiguration.json');
|
||||
export const saveAsParametersSchema = require('./schemas/saveAsParameters.json');
|
||||
export const loadQnaConfigurationSchema = require('./schemas/loadQnaConfiguration.json');
|
||||
export const qnaSettingsSchema = require('./schemas/qnaSettings.json');
|
||||
export const qnaInterpretInputDataSchema = require('./schemas/qnaInterpretInputData.json');
|
||||
/* tslint:enable:no-var-requires */
|
||||
|
||||
import * as jsen from 'jsen';
|
||||
|
@ -473,3 +476,39 @@ export interface ISaveAsParameters {
|
|||
}
|
||||
|
||||
export const validateSaveAsParameters = validate(saveAsParametersSchema);
|
||||
|
||||
export interface IQnaSettings {
|
||||
filterPaneEnabled?: boolean;
|
||||
}
|
||||
|
||||
export interface ILoadQnaConfiguration {
|
||||
accessToken: string;
|
||||
datasetIds: string[];
|
||||
utterance?: string;
|
||||
viewMode?: QnAMode;
|
||||
settings?: IQnaSettings;
|
||||
tokenType?: TokenType;
|
||||
}
|
||||
|
||||
export const validateLoadQnaConfiguration = validate(loadQnaConfigurationSchema, {
|
||||
schemas: {
|
||||
qnaSettings: qnaSettingsSchema,
|
||||
}
|
||||
});
|
||||
|
||||
export enum QnAMode {
|
||||
Interactive,
|
||||
NonInteractive,
|
||||
}
|
||||
|
||||
export interface IQnaInterpretInputData {
|
||||
utterance: string;
|
||||
datasetIds?: string[];
|
||||
}
|
||||
|
||||
export const validateQnaInterpretInputData = validate(qnaInterpretInputDataSchema);
|
||||
|
||||
export interface IQnaVisualRenderedEvent {
|
||||
utterance: string;
|
||||
normalizedUtterance?: string;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,48 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"accessToken": {
|
||||
"type": "string",
|
||||
"messages": {
|
||||
"type": "accessToken must be a string",
|
||||
"required": "accessToken is required"
|
||||
}
|
||||
},
|
||||
"datasetIds": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"messages": {
|
||||
"type": "datasetIds must be an array of strings",
|
||||
"required": "datasetIds is required"
|
||||
}
|
||||
},
|
||||
"utterance": {
|
||||
"type": "string",
|
||||
"messages": {
|
||||
"type": "utterance must be a string"
|
||||
}
|
||||
},
|
||||
"viewMode": {
|
||||
"type": "number",
|
||||
"enum": [ 0, 1 ],
|
||||
"default": 0,
|
||||
"invalidMessage": "viewMode property is invalid"
|
||||
},
|
||||
"settings": {
|
||||
"$ref": "#qnaSettings"
|
||||
},
|
||||
"tokenType": {
|
||||
"type": "number",
|
||||
"enum": [ 0, 1 ],
|
||||
"default": 0,
|
||||
"invalidMessage": "tokenType property is invalid"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"accessToken",
|
||||
"datasetIds"
|
||||
]
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"datasetIds": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"messages": {
|
||||
"type": "datasetIds must be an array of strings"
|
||||
}
|
||||
},
|
||||
"utterance": {
|
||||
"type": "string",
|
||||
"messages": {
|
||||
"type": "utterance must be a string",
|
||||
"required": "utterance is required"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"utterance"
|
||||
]
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"filterPaneEnabled": {
|
||||
"type": "boolean",
|
||||
"messages": {
|
||||
"type": "filterPaneEnabled must be a boolean"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Загрузка…
Ссылка в новой задаче