From 330e4ef04601fd09fd75896a8fe5c0da26b2fe09 Mon Sep 17 00:00:00 2001 From: FARHAD SHAKERIN Date: Wed, 9 Mar 2022 12:53:33 -0800 Subject: [PATCH] Release/cognitiveservices/clu 2021 11 01 preview (#17507) * Adds base for updating Language from version preview/2021-07-15-preview to version 2021-11-01-preview * Updates readme * Updates API version in new specs and examples * Add CLU Public Preview API (#16450) * Add CLU Public Preview API * remove azure-sdk-for-net-track2 * Nit: remove extra space Co-authored-by: Heath Stewart Co-authored-by: Chong Tang Co-authored-by: Heath Stewart * added x-ms-client-name "confidence" (#16646) * Add SDK owners for CLU (#16718) * add a clu entry to readme * making enums compatible * making TA point to common.json for error * fixing spaces * adding questionanswering to custom-words * Update analyzeconversations.json adding "non_linked" * add an owner * addressing comments Co-authored-by: Chong Tang Co-authored-by: Chong Tang Co-authored-by: Heath Stewart Co-authored-by: Ahmed Leithy Co-authored-by: Heath Stewart Co-authored-by: Farhad Shakerin --- CODEOWNERS | 1 + custom-words.txt | 2 + .../analyzeconversations.json | 560 ++++++++++++++++++ .../preview/2021-11-01-preview/common.json | 248 ++++++++ .../conversations/Conversation_project.json | 78 +++ .../Orchestrator_arbitration.json | 91 +++ .../Orchestrator_direct_target.json | 96 +++ .../Language/preview/2021-11-01-preview/oav | 0 .../2021-11-01-preview/textanalytics.json | 46 +- .../data-plane/Language/readme.md | 4 +- 10 files changed, 1080 insertions(+), 46 deletions(-) create mode 100644 specification/cognitiveservices/data-plane/Language/preview/2021-11-01-preview/analyzeconversations.json create mode 100644 specification/cognitiveservices/data-plane/Language/preview/2021-11-01-preview/common.json create mode 100644 specification/cognitiveservices/data-plane/Language/preview/2021-11-01-preview/examples/conversations/Conversation_project.json create mode 100644 specification/cognitiveservices/data-plane/Language/preview/2021-11-01-preview/examples/conversations/Orchestrator_arbitration.json create mode 100644 specification/cognitiveservices/data-plane/Language/preview/2021-11-01-preview/examples/conversations/Orchestrator_direct_target.json create mode 100644 specification/cognitiveservices/data-plane/Language/preview/2021-11-01-preview/oav diff --git a/CODEOWNERS b/CODEOWNERS index 4c5d01e466be..0fcee181aaa1 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -13,6 +13,7 @@ /specification/billing/ @wilcobmsft @asarkar84 /specification/cdn/ @jorinmejia @yunhemsft @jessicl-ms @sinadell @rrahulms @t-bzhan /specification/cognitiveservices/ @felixwa @yangyuan +/specification/cognitiveservices/data-plane/Language/ @rokulka @ChongTang @annatisch @heaths @Azure/api-stewardship-board /specification/compute/ @bilaakpan-ms @sandido @dkulkarni-ms @haagha @madewithsmiles @MS-syh2qs @grizzlytheodore @hyonholee @mabhard @danielli90 @smotwani @ppatwa @vikramd-ms @savyasachisamal @yunusm @ZhidongPeng @nkuchta @maheshnemichand @najams @changov /specification/consumption/ @kjeur @panda-wang /specification/containerinstance/ @novinc diff --git a/custom-words.txt b/custom-words.txt index c0431c69aa79..d4d9214da202 100644 --- a/custom-words.txt +++ b/custom-words.txt @@ -2484,6 +2484,8 @@ loadtest xvalue yvalue servermetrics +IAASVM +questionanswering napt Napt NAPT diff --git a/specification/cognitiveservices/data-plane/Language/preview/2021-11-01-preview/analyzeconversations.json b/specification/cognitiveservices/data-plane/Language/preview/2021-11-01-preview/analyzeconversations.json new file mode 100644 index 000000000000..7a20d69bad7a --- /dev/null +++ b/specification/cognitiveservices/data-plane/Language/preview/2021-11-01-preview/analyzeconversations.json @@ -0,0 +1,560 @@ +{ + "swagger": "2.0", + "info": { + "title": "Microsoft Cognitive Language Service - Analyze Conversations", + "description": "This API accepts a request and mediates among multiple language projects, such as LUIS Generally Available, Question Answering, Conversation, and then calls the best candidate service to handle the request. At last, it returns a response with the candidate service's response as a payload.\n\n In some cases, this API needs to forward requests and responses between the caller and an upstream service.", + "version": "2021-11-01-preview" + }, + "securityDefinitions": { + "apim_key": { + "type": "apiKey", + "description": "An APIM subscription key.", + "name": "Ocp-Apim-Subscription-Key", + "in": "header" + } + }, + "security": [ + { + "apim_key": [] + } + ], + "x-ms-parameterized-host": { + "hostTemplate": "{Endpoint}/language", + "useSchemePrefix": false, + "parameters": [ + { + "$ref": "common.json#/parameters/Endpoint" + } + ] + }, + "paths": { + "/:analyze-conversations": { + "post": { + "operationId": "ConversationAnalysis_AnalyzeConversation", + "description": "Analyzes the input conversation utterance.", + "parameters": [ + { + "$ref": "common.json#/parameters/ProjectNameQueryParameter" + }, + { + "$ref": "common.json#/parameters/DeploymentNameQueryParameter" + }, + { + "$ref": "#/parameters/ConversationAnalysisOptions" + }, + { + "$ref": "common.json#/parameters/ApiVersionParameter" + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "The conversation analysis response.", + "schema": { + "$ref": "#/definitions/AnalyzeConversationResult" + } + }, + "default": { + "description": "Error response.", + "schema": { + "$ref": "common.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Arbitration result": { + "$ref": "./examples/conversations/Orchestrator_arbitration.json" + }, + "Conversation project result": { + "$ref": "./examples/conversations/Conversation_project.json" + }, + "Orchestrator direct target result": { + "$ref": "./examples/conversations/Orchestrator_direct_target.json" + } + } + } + } + }, + "definitions": { + "ConversationAnalysisOptions": { + "type": "object", + "description": "The request body.", + "required": [ + "query" + ], + "properties": { + "query": { + "description": "The conversation utterance to be analyzed.", + "type": "string" + }, + "directTarget": { + "type": "string", + "description": "The name of the target project this request is sending to directly." + }, + "language": { + "type": "string", + "description": "The language to use in this request. This will be the language setting when communicating with all other target projects." + }, + "verbose": { + "type": "boolean", + "description": "If true, the service will return more detailed information in the response." + }, + "isLoggingEnabled": { + "description": "If true, the query will be kept by the service for customers to further review, to improve the model quality.", + "type": "boolean" + }, + "parameters": { + "type": "object", + "description": "A dictionary representing the input for each target project.", + "additionalProperties": { + "$ref": "#/definitions/AnalysisParameters" + } + } + } + }, + "AnalysisParameters": { + "type": "object", + "description": "This is the parameter set of either the Orchestration project itself or one of the target services.", + "required": [ + "targetKind" + ], + "discriminator": "targetKind", + "properties": { + "targetKind": { + "type": "string", + "description": "The type of a target service.", + "enum": [ + "luis", + "conversation", + "question_answering", + "non_linked" + ], + "x-ms-enum": { + "name": "targetKind", + "modelAsString": true + } + }, + "apiVersion": { + "type": "string", + "description": "The API version to use when call a specific target service." + } + } + }, + "NoneLinkedTargetIntentResult": { + "type": "object", + "description": "A wrap up of non-linked intent response.", + "x-ms-discriminator-value": "non_linked", + "allOf": [ + { + "$ref": "#/definitions/TargetIntentResult" + } + ], + "properties": { + "result": { + "type": "object", + "$ref": "#/definitions/ConversationResult", + "description": "The actual response from a Conversation project.", + "x-nullable": true + } + } + }, + "LUISParameters": { + "description": "This is a set of request parameters for LUIS Generally Available projects.", + "x-ms-discriminator-value": "luis", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/AnalysisParameters" + } + ], + "properties": { + "query": { + "type": "string", + "maxLength": 500, + "description": "The utterance to predict." + }, + "callingOptions": { + "type": "object", + "description": "This customizes how the service calls LUIS Generally Available projects.", + "$ref": "#/definitions/LUISCallingOptions" + } + }, + "additionalProperties": true + }, + "LUISCallingOptions": { + "description": "This customizes how the service calls LUIS Generally Available projects.", + "type": "object", + "properties": { + "verbose": { + "description": "Enable verbose response.", + "type": "boolean" + }, + "log": { + "description": "Save log to add in training utterances later.", + "type": "boolean" + }, + "show-all-intents": { + "description": "Set true to show all intents.", + "type": "boolean" + }, + "timezoneOffset": { + "type": "number", + "description": "The timezone offset for the location of the request." + }, + "spellCheck": { + "type": "boolean", + "description": "Enable spell checking." + }, + "bing-spell-check-subscription-key": { + "description": "The subscription key to use when enabling Bing spell check", + "type": "string" + } + } + }, + "ConversationParameters": { + "type": "object", + "description": "This is a set of request parameters for Customized Conversation projects.", + "x-ms-discriminator-value": "conversation", + "allOf": [ + { + "$ref": "#/definitions/AnalysisParameters" + } + ], + "properties": { + "callingOptions": { + "type": "object", + "$ref": "#/definitions/ConversationCallingOptions" + } + } + }, + "ConversationCallingOptions": { + "type": "object", + "description": "The option to set to call a Conversation project.", + "properties": { + "language": { + "description": "The language of the query.", + "type": "string" + }, + "verbose": { + "description": "If true, the service will return more detailed information.", + "type": "boolean" + }, + "isLoggingEnabled": { + "description": "If true, the query will be saved for customers to further review in authoring, to improve the model quality.", + "type": "boolean" + } + } + }, + "QuestionAnsweringParameters": { + "type": "object", + "description": "This is a set of request parameters for Question Answering knowledge bases.", + "x-ms-discriminator-value": "question_answering", + "allOf": [ + { + "$ref": "#/definitions/AnalysisParameters" + } + ], + "properties": { + "callingOptions": { + "type": "object", + "description": "The options sent to a Question Answering KB." + } + } + }, + "AnalyzeConversationResult": { + "type": "object", + "description": "Represents a conversation analysis response.", + "required": [ + "query", + "prediction" + ], + "properties": { + "query": { + "type": "string", + "description": "The conversation utterance given by the caller." + }, + "detectedLanguage": { + "type": "string", + "description": "The system detected language for the query." + }, + "prediction": { + "description": "The prediction result of a conversation project.", + "$ref": "#/definitions/BasePrediction" + } + } + }, + "BasePrediction": { + "type": "object", + "description": "This is the base class of prediction", + "required": [ + "projectKind" + ], + "discriminator": "projectKind", + "properties": { + "projectKind": { + "type": "string", + "description": "The type of the project.", + "enum": [ + "conversation", + "workflow" + ], + "x-ms-enum": { + "name": "projectKind", + "modelAsString": true + } + }, + "topIntent": { + "type": "string", + "description": "The intent with the highest score." + } + } + }, + "OrchestratorPrediction": { + "type": "object", + "description": "This represents the prediction result of an Orchestrator project.", + "x-ms-discriminator-value": "workflow", + "required": [ + "intents" + ], + "allOf": [ + { + "$ref": "#/definitions/BasePrediction" + } + ], + "properties": { + "intents": { + "description": "A dictionary that contains all intents. A key is an intent name and a value is its confidence score and target type. The top intent's value also contains the actual response from the target project.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/TargetIntentResult" + } + } + } + }, + "TargetIntentResult": { + "type": "object", + "description": "This is the base class of an intent prediction", + "discriminator": "targetKind", + "required": [ + "confidenceScore", + "targetKind" + ], + "properties": { + "targetKind": { + "type": "string", + "description": "This discriminator property specifies the type of the target project that returns the response.", + "enum": [ + "luis", + "conversation", + "question_answering", + "non_linked" + ], + "x-ms-enum": { + "name": "targetKind", + "modelAsString": true + } + }, + "apiVersion": { + "type": "string", + "description": "The API version used to call a target service." + }, + "confidenceScore": { + "type": "number", + "format": "float", + "x-ms-client-name": "confidence", + "description": "The prediction score and it ranges from 0.0 to 1.0.", + "minimum": 0, + "maximum": 1 + } + } + }, + "ConversationTargetIntentResult": { + "type": "object", + "description": "A wrap up of Conversation project response.", + "x-ms-discriminator-value": "conversation", + "allOf": [ + { + "$ref": "#/definitions/TargetIntentResult" + } + ], + "properties": { + "result": { + "type": "object", + "$ref": "#/definitions/ConversationResult", + "description": "The actual response from a Conversation project.", + "x-nullable": true + } + } + }, + "ConversationResult": { + "type": "object", + "description": "The response returned by a Conversation project.", + "required": [ + "query", + "prediction" + ], + "properties": { + "query": { + "description": "The same query given in request.", + "type": "string" + }, + "detectedLanguage": { + "description": "The detected language from the query.", + "type": "string" + }, + "prediction": { + "description": "The predicted result for the query.", + "$ref": "#/definitions/ConversationPrediction" + } + } + }, + "ConversationPrediction": { + "type": "object", + "description": "Represents the prediction section of a Conversation project.", + "x-ms-discriminator-value": "conversation", + "required": [ + "intents", + "entities" + ], + "allOf": [ + { + "$ref": "#/definitions/BasePrediction" + } + ], + "properties": { + "intents": { + "description": "The intent classification results.", + "type": "array", + "items": { + "$ref": "#/definitions/ConversationIntent" + } + }, + "entities": { + "description": "The entity extraction results.", + "type": "array", + "items": { + "$ref": "#/definitions/ConversationEntity" + } + } + } + }, + "ConversationIntent": { + "type": "object", + "description": "The intent classification result of a Conversation project.", + "required": [ + "category", + "confidenceScore" + ], + "properties": { + "category": { + "description": "A predicted class.", + "type": "string" + }, + "confidenceScore": { + "format": "float", + "x-ms-client-name": "confidence", + "description": "The confidence score of the class from 0.0 to 1.0.", + "type": "number", + "minimum": 0, + "maximum": 1 + } + } + }, + "ConversationEntity": { + "type": "object", + "description": "The entity extraction result of a Conversation project.", + "required": [ + "category", + "text", + "offset", + "length", + "confidenceScore" + ], + "properties": { + "category": { + "description": "The entity category.", + "type": "string" + }, + "text": { + "description": "The predicted entity text.", + "type": "string" + }, + "offset": { + "format": "int32", + "description": "The starting index of this entity in the query.", + "type": "integer" + }, + "length": { + "format": "int32", + "description": "The length of the text.", + "type": "integer" + }, + "confidenceScore": { + "format": "float", + "x-ms-client-name": "confidence", + "description": "The entity confidence score.", + "type": "number" + }, + "listKeys": { + "type": "array", + "description": "List of keys.", + "items": { + "type": "string" + } + } + } + }, + "LUISTargetIntentResult": { + "type": "object", + "description": "It is a wrap up of LUIS Generally Available response.", + "x-ms-discriminator-value": "luis", + "allOf": [ + { + "$ref": "#/definitions/TargetIntentResult" + } + ], + "properties": { + "result": { + "type": "object", + "description": "The actual response from a LUIS Generally Available application.", + "x-nullable": true + } + } + }, + "QuestionAnsweringTargetIntentResult": { + "type": "object", + "description": "It is a wrap up a Question Answering KB response.", + "x-ms-discriminator-value": "question_answering", + "allOf": [ + { + "$ref": "#/definitions/TargetIntentResult" + } + ], + "properties": { + "result": { + "type": "object", + "$ref": "../2021-07-15-preview/questionanswering.json#/definitions/KnowledgeBaseAnswers", + "description": "The generated answer by a Question Answering KB.", + "x-nullable": true + } + } + } + }, + "parameters": { + "ConversationAnalysisOptions": { + "name": "ConversationAnalysisOptions", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ConversationAnalysisOptions" + }, + "description": "Post body of the request.", + "x-ms-parameter-location": "method" + } + } +} diff --git a/specification/cognitiveservices/data-plane/Language/preview/2021-11-01-preview/common.json b/specification/cognitiveservices/data-plane/Language/preview/2021-11-01-preview/common.json new file mode 100644 index 000000000000..31edd52e3056 --- /dev/null +++ b/specification/cognitiveservices/data-plane/Language/preview/2021-11-01-preview/common.json @@ -0,0 +1,248 @@ +{ + "swagger": "2.0", + "info": { + "title": "Microsoft Cognitive Language Service", + "description": "The language service API is a suite of natural language processing (NLP) skills built with best-in-class Microsoft machine learning algorithms. The API can be used to analyze unstructured text for tasks such as sentiment analysis, key phrase extraction, language detection and question answering. Further documentation can be found in https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/overview.", + "version": "2021-11-01-preview" + }, + "paths": {}, + "definitions": { + "ErrorResponse": { + "type": "object", + "description": "Error response.", + "additionalProperties": false, + "properties": { + "error": { + "description": "The error object.", + "$ref": "#/definitions/Error" + } + }, + "required": [ + "error" + ] + }, + "Error": { + "type": "object", + "description": "The error object.", + "additionalProperties": false, + "required": [ + "code", + "message" + ], + "properties": { + "code": { + "description": "One of a server-defined set of error codes.", + "$ref": "#/definitions/ErrorCode" + }, + "message": { + "type": "string", + "description": "A human-readable representation of the error." + }, + "target": { + "type": "string", + "description": "The target of the error." + }, + "details": { + "type": "array", + "description": "An array of details about specific errors that led to this reported error.", + "items": { + "$ref": "#/definitions/Error" + } + }, + "innererror": { + "description": "An object containing more specific information than the current object about the error.", + "$ref": "#/definitions/InnerErrorModel" + } + } + }, + "InnerErrorModel": { + "type": "object", + "description": "An object containing more specific information about the error. As per Microsoft One API guidelines - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses.", + "additionalProperties": false, + "required": [ + "code", + "message" + ], + "properties": { + "code": { + "description": "One of a server-defined set of error codes.", + "$ref": "#/definitions/InnerErrorCode" + }, + "message": { + "type": "string", + "description": "Error message." + }, + "details": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Error details." + }, + "target": { + "type": "string", + "description": "Error target." + }, + "innererror": { + "description": "An object containing more specific information than the current object about the error.", + "$ref": "#/definitions/InnerErrorModel" + } + } + }, + "ErrorCode": { + "type": "string", + "description": "Human-readable error code.", + "x-ms-enum": { + "name": "ErrorCode", + "modelAsString": true + }, + "enum": [ + "InvalidRequest", + "InvalidArgument", + "Unauthorized", + "Forbidden", + "NotFound", + "TooManyRequests", + "InternalServerError", + "ServiceUnavailable", + "ProjectNotFound", + "OperationNotFound", + "AzureCognitiveSearchNotFound", + "AzureCognitiveSearchIndexNotFound", + "AzureCognitiveSearchThrottling", + "AzureCognitiveSearchIndexLimitReached" + ] + }, + "InnerErrorCode": { + "type": "string", + "description": "Human-readable error code.", + "x-ms-enum": { + "name": "InnerErrorCode", + "modelAsString": true + }, + "enum": [ + "InvalidRequest", + "InvalidParameterValue", + "KnowledgeBaseNotFound", + "AzureCognitiveSearchNotFound", + "AzureCognitiveSearchThrottling", + "ExtractionFailure", + "InvalidRequestBodyFormat", + "EmptyRequest", + "MissingInputDocuments", + "InvalidDocument", + "ModelVersionIncorrect", + "InvalidDocumentBatch", + "UnsupportedLanguageCode", + "InvalidCountryHint" + ] + }, + "Language": { + "type": "string", + "description": "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." + }, + "StringIndexType": { + "type": "string", + "description": "Specifies the method used to interpret string offsets. Defaults to Text Elements (Graphemes) according to Unicode v8.0.0. For additional information see https://aka.ms/text-analytics-offsets.", + "default": "TextElements_v8", + "enum": [ + "TextElements_v8", + "UnicodeCodePoint", + "Utf16CodeUnit" + ], + "x-ms-enum": { + "name": "StringIndexType", + "modelAsString": true, + "values": [ + { + "value": "TextElements_v8", + "description": "Returned offset and length values will correspond to TextElements (Graphemes and Grapheme clusters) confirming to the Unicode 8.0.0 standard. Use this option if your application is written in .Net Framework or .Net Core and you will be using StringInfo." + }, + { + "value": "UnicodeCodePoint", + "description": "Returned offset and length values will correspond to Unicode code points. Use this option if your application is written in a language that support Unicode, for example Python." + }, + { + "value": "Utf16CodeUnit", + "description": "Returned offset and length values will correspond to UTF-16 code units. Use this option if your application is written in a language that support Unicode, for example Java, JavaScript." + } + ] + } + } + }, + "parameters": { + "Endpoint": { + "name": "Endpoint", + "description": "Supported Cognitive Services endpoint (e.g., https://.api.cognitiveservices.azure.com).", + "x-ms-parameter-location": "client", + "required": true, + "type": "string", + "in": "path", + "x-ms-skip-url-encoding": true + }, + "ProjectNameQueryParameter": { + "name": "projectName", + "in": "query", + "required": true, + "type": "string", + "description": "The name of the project to use.", + "x-ms-parameter-location": "method" + }, + "ProjectNamePathParameter": { + "name": "projectName", + "in": "path", + "required": true, + "type": "string", + "maxLength": 100, + "description": "The name of the project to use.", + "x-ms-parameter-location": "method" + }, + "DeploymentNameQueryParameter": { + "name": "deploymentName", + "in": "query", + "required": true, + "type": "string", + "description": "The name of the specific deployment of the project to use.", + "x-ms-parameter-location": "method" + }, + "DeploymentNamePathParameter": { + "name": "deploymentName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the specific deployment of the project to use.", + "x-ms-parameter-location": "method" + }, + "ApiVersionParameter": { + "name": "api-version", + "in": "query", + "required": true, + "type": "string", + "description": "Client API version." + }, + "TopParameter": { + "name": "top", + "in": "query", + "description": "The maximum number of resources to return from the collection.", + "type": "integer", + "format": "int32", + "x-ms-parameter-location": "method" + }, + "SkipParameter": { + "name": "skip", + "in": "query", + "description": "An offset into the collection of the first resource to be returned.", + "type": "integer", + "format": "int32", + "x-ms-parameter-location": "method" + }, + "MaxPageSizeParameter": { + "name": "maxpagesize", + "in": "query", + "description": "The maximum number of resources to include in a single response.", + "type": "integer", + "format": "int32", + "x-ms-parameter-location": "method" + } + } +} diff --git a/specification/cognitiveservices/data-plane/Language/preview/2021-11-01-preview/examples/conversations/Conversation_project.json b/specification/cognitiveservices/data-plane/Language/preview/2021-11-01-preview/examples/conversations/Conversation_project.json new file mode 100644 index 000000000000..e0844baf3a1f --- /dev/null +++ b/specification/cognitiveservices/data-plane/Language/preview/2021-11-01-preview/examples/conversations/Conversation_project.json @@ -0,0 +1,78 @@ +{ + "parameters": { + "Endpoint": "{Endpoint}", + "Ocp-Apim-Subscription-Key": "{API key}", + "Content-Type": "application/json", + "api-version": "2021-11-01-preview", + "projectName": "{project-name}", + "deploymentName": "{deployment-name}", + "ConversationAnalysisOptions": { + "query": "play a song", + "language": "en-us", + "verbose": true, + "isLoggingEnabled": false + } + }, + "responses": { + "200": { + "headers": {}, + "body": { + "query": "play a song from Joe Doe", + "detectedLanguage": "en-Us", + "prediction": { + "topIntent": "PlayMusic", + "projectKind": "conversation", + "intents": [ + { + "category": "PlayMusic", + "confidenceScore": 0.99998415 + }, + { + "category": "SearchCreativeWork", + "confidenceScore": 0.000008943313 + }, + { + "category": "BookRestaurant", + "confidenceScore": 0.0000041524872 + }, + { + "category": "GetWeather", + "confidenceScore": 0.0000011409703 + }, + { + "category": "AddToPlaylist", + "confidenceScore": 0.0000010632801 + }, + { + "category": "SearchScreeningEvent", + "confidenceScore": 3.2717122e-7 + }, + { + "category": "RateBook", + "confidenceScore": 1.926987e-7 + } + ], + "entities": [ + { + "category": "music_item", + "text": "song", + "offset": 7, + "length": 4, + "confidenceScore": 0.9959329 + }, + { + "category": "artist", + "text": "Joe", + "offset": 17, + "length": 7, + "confidenceScore": 0.99691725, + "listKeys": [ + "Joe D." + ] + } + ] + } + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/Language/preview/2021-11-01-preview/examples/conversations/Orchestrator_arbitration.json b/specification/cognitiveservices/data-plane/Language/preview/2021-11-01-preview/examples/conversations/Orchestrator_arbitration.json new file mode 100644 index 000000000000..258e906824fa --- /dev/null +++ b/specification/cognitiveservices/data-plane/Language/preview/2021-11-01-preview/examples/conversations/Orchestrator_arbitration.json @@ -0,0 +1,91 @@ +{ + "parameters": { + "Endpoint": "{Endpoint}", + "Ocp-Apim-Subscription-Key": "{API key}", + "Content-Type": "application/json", + "api-version": "2021-11-01-preview", + "projectName": "{project-name}", + "deploymentName": "{deployment-name}", + "ConversationAnalysisOptions": { + "query": "How do I integrate QnA Maker and LUIS?" + } + }, + "responses": { + "200": { + "headers": {}, + "body": { + "query": "How do I integrate QnA Maker and LUIS?", + "prediction": { + "projectKind": "workflow", + "topIntent": "qnaTargetApp", + "intents": { + "qnaTargetApp": { + "targetKind": "question_answering", + "apiVersion": "2021-05-01-preview", + "confidenceScore": 0.913329, + "result": { + "answers": [ + { + "questions": [ + "Power and charging" + ], + "answer": "Power and charging**\n\nIt takes two to four hours to charge the Surface Pro 4 battery fully from an empty state. It can take longer if you are using your Surface for power-intensive activities like gaming or video streaming while you’re charging it.\n\nYou can use the USB port on your Surface Pro 4 power supply to charge other devices, like a phone, while your Surface charges. The USB port on the power supply is only for charging, not for data transfer. If you want to use a USB device, plug it into the USB port on your Surface.", + "confidenceScore": 0.65, + "id": 20, + "source": "surface-pro-4-user-guide-EN.pdf", + "metadata": { + "category": "api", + "editorial": "chitchat" + }, + "dialog": { + "isContextOnly": false, + "prompts": [ + { + "displayOrder": 1, + "qnaId": 23, + "displayText": "prompt1" + }, + { + "displayOrder": 2, + "qnaId": 36, + "displayText": "prompt2" + } + ] + }, + "answerSpan": { + "text": "two to four hours", + "confidenceScore": 0.3, + "offset": 33, + "length": 50 + } + }, + { + "questions": [ + "Charge your Surface Pro 4" + ], + "answer": "**Charge your Surface Pro 4**\n\n1. Connect the two parts of the power cord.\n\n2. Connect the power cord securely to the charging port.\n\n3. Plug the power supply into an electrical outlet.", + "confidenceScore": 0.32, + "id": 13, + "source": "surface-pro-4-user-guide-EN.pdf" + } + ] + } + }, + "mcluApp": { + "targetKind": "conversation", + "confidenceScore": 0.082329 + }, + "luisApp": { + "targetKind": "luis", + "confidenceScore": 0.001 + }, + "nonlinkedIntent1": { + "targetKind": "non_linked", + "confidenceScore": 0.00021 + } + } + } + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/Language/preview/2021-11-01-preview/examples/conversations/Orchestrator_direct_target.json b/specification/cognitiveservices/data-plane/Language/preview/2021-11-01-preview/examples/conversations/Orchestrator_direct_target.json new file mode 100644 index 000000000000..770562719047 --- /dev/null +++ b/specification/cognitiveservices/data-plane/Language/preview/2021-11-01-preview/examples/conversations/Orchestrator_direct_target.json @@ -0,0 +1,96 @@ +{ + "parameters": { + "Endpoint": "{Endpoint}", + "Ocp-Apim-Subscription-Key": "{API key}", + "Content-Type": "application/json", + "api-version": "2021-11-01-preview", + "projectName": "{project-name}", + "deploymentName": "{deployment-name}", + "ConversationAnalysisOptions": { + "query": "", + "directTarget": "qnaTargetApp", + "parameters": { + "qnaTargetApp": { + "targetKind": "question_answering", + "apiVersion": "v5.1", + "callingOptions": { + "question": "Ports and connectors", + "top": 3, + "userId": "Default", + "isTest": true, + "context": { + "previousQuery": "Meet Surface Pro 4", + "previousQnAId": 4 + } + } + } + } + } + }, + "responses": { + "200": { + "headers": {}, + "body": { + "query": "Ports and connectors", + "prediction": { + "projectKind": "workflow", + "topIntent": "qnaTargetApp", + "intents": { + "qnaTargetApp": { + "targetKind": "question_answering", + "apiVersion": "v5.1", + "confidenceScore": 0.913329, + "result": { + "answers": [ + { + "questions": [ + "Power and charging" + ], + "answer": "Power and charging**\n\nIt takes two to four hours to charge the Surface Pro 4 battery fully from an empty state. It can take longer if you are using your Surface for power-intensive activities like gaming or video streaming while you’re charging it.\n\nYou can use the USB port on your Surface Pro 4 power supply to charge other devices, like a phone, while your Surface charges. The USB port on the power supply is only for charging, not for data transfer. If you want to use a USB device, plug it into the USB port on your Surface.", + "confidenceScore": 0.65, + "id": 20, + "source": "surface-pro-4-user-guide-EN.pdf", + "metadata": { + "category": "api", + "editorial": "chitchat" + }, + "dialog": { + "isContextOnly": false, + "prompts": [ + { + "displayOrder": 1, + "qnaId": 23, + "displayText": "prompt1" + }, + { + "displayOrder": 2, + "qnaId": 36, + "displayText": "prompt2" + } + ] + }, + "answerSpan": { + "text": "two to four hours", + "confidenceScore": 0.3, + "offset": 33, + "length": 50 + } + }, + { + "questions": [ + "Charge your Surface Pro 4" + ], + "answer": "**Charge your Surface Pro 4**\n\n1. Connect the two parts of the power cord.\n\n2. Connect the power cord securely to the charging port.\n\n3. Plug the power supply into an electrical outlet.", + "confidenceScore": 0.32, + "id": 13, + "source": "surface-pro-4-user-guide-EN.pdf" + } + ] + } + } + } + } + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/Language/preview/2021-11-01-preview/oav b/specification/cognitiveservices/data-plane/Language/preview/2021-11-01-preview/oav new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/specification/cognitiveservices/data-plane/Language/preview/2021-11-01-preview/textanalytics.json b/specification/cognitiveservices/data-plane/Language/preview/2021-11-01-preview/textanalytics.json index ea8017cc1605..42d66799d546 100644 --- a/specification/cognitiveservices/data-plane/Language/preview/2021-11-01-preview/textanalytics.json +++ b/specification/cognitiveservices/data-plane/Language/preview/2021-11-01-preview/textanalytics.json @@ -2109,7 +2109,7 @@ "properties": { "code": { "description": "One of a server-defined set of error codes.", - "$ref": "#/definitions/ErrorCode" + "$ref": "common.json#/definitions/ErrorCode" }, "message": { "type": "string", @@ -2143,7 +2143,7 @@ "properties": { "code": { "description": "One of a server-defined set of error codes.", - "$ref": "#/definitions/InnerErrorCode" + "$ref": "common.json#/definitions/InnerErrorCode" }, "message": { "type": "string", @@ -2165,48 +2165,6 @@ "$ref": "#/definitions/InnerErrorModel" } } - }, - "ErrorCode": { - "type": "string", - "description": "Human-readable error code.", - "x-ms-enum": { - "name": "ErrorCode", - "modelAsString": true - }, - "enum": [ - "InvalidRequest", - "InvalidArgument", - "Unauthorized", - "Forbidden", - "NotFound", - "TooManyRequests", - "InternalServerError", - "ServiceUnavailable" - ] - }, - "InnerErrorCode": { - "type": "string", - "description": "Human-readable error code.", - "x-ms-enum": { - "name": "InnerErrorCode", - "modelAsString": true - }, - "enum": [ - "InvalidRequest", - "InvalidParameterValue", - "KnowledgeBaseNotFound", - "AzureCognitiveSearchNotFound", - "AzureCognitiveSearchThrottling", - "ExtractionFailure", - "InvalidRequestBodyFormat", - "EmptyRequest", - "MissingInputDocuments", - "InvalidDocument", - "ModelVersionIncorrect", - "InvalidDocumentBatch", - "UnsupportedLanguageCode", - "InvalidCountryHint" - ] } }, "parameters": { diff --git a/specification/cognitiveservices/data-plane/Language/readme.md b/specification/cognitiveservices/data-plane/Language/readme.md index 09d48dead6dc..09842769ce00 100644 --- a/specification/cognitiveservices/data-plane/Language/readme.md +++ b/specification/cognitiveservices/data-plane/Language/readme.md @@ -7,8 +7,7 @@ This is the AutoRest configuration file the Cognitive Services Language SDK. ## Releases The current preview release is 2022-02-01-preview - -The current stable release of QuestionAnswering is 2021-10-01 and preview release of Luis Deepstack is 2021-07-15-preview +The current stable release of QuestionAnswering is 2021-10-01 and preview release of Conversational Language Understanding (CLU) service is 2021-11-01-preview ```yaml tag: release_2022_02_01_preview @@ -65,6 +64,7 @@ These settings apply only when `--tag=release_2021_11_01_preview` is specified o ``` yaml $(tag) == 'release_2021_11_01_preview' input-file: - preview/2021-11-01-preview/textanalytics.json +- preview/2021-11-01-preview/analyzeconversations.json title: Microsoft Cognitive Language Service modelerfour: