@azure/ai-text-analytics 5.2.0-alpha.20211215.1 → 5.2.0-alpha.20211221.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +75 -75
- package/dist/index.js.map +1 -1
- package/dist-esm/src/analyzeActionsResult.js +15 -15
- package/dist-esm/src/analyzeActionsResult.js.map +1 -1
- package/dist-esm/src/analyzeHealthcareEntitiesResult.js +4 -4
- package/dist-esm/src/analyzeHealthcareEntitiesResult.js.map +1 -1
- package/dist-esm/src/analyzeLro.js +11 -11
- package/dist-esm/src/analyzeLro.js.map +1 -1
- package/dist-esm/src/analyzeSentimentResult.js +5 -5
- package/dist-esm/src/analyzeSentimentResult.js.map +1 -1
- package/dist-esm/src/analyzeSentimentResultArray.js +1 -1
- package/dist-esm/src/analyzeSentimentResultArray.js.map +1 -1
- package/dist-esm/src/azureKeyCredentialPolicy.js +1 -1
- package/dist-esm/src/azureKeyCredentialPolicy.js.map +1 -1
- package/dist-esm/src/detectLanguageResult.js +1 -1
- package/dist-esm/src/detectLanguageResult.js.map +1 -1
- package/dist-esm/src/detectLanguageResultArray.js +1 -1
- package/dist-esm/src/detectLanguageResultArray.js.map +1 -1
- package/dist-esm/src/extractKeyPhrasesResult.js +1 -1
- package/dist-esm/src/extractKeyPhrasesResult.js.map +1 -1
- package/dist-esm/src/extractKeyPhrasesResultArray.js +1 -1
- package/dist-esm/src/extractKeyPhrasesResultArray.js.map +1 -1
- package/dist-esm/src/extractSummaryResult.js +1 -1
- package/dist-esm/src/extractSummaryResult.js.map +1 -1
- package/dist-esm/src/extractSummaryResultArray.js +1 -1
- package/dist-esm/src/extractSummaryResultArray.js.map +1 -1
- package/dist-esm/src/healthLro.js +12 -12
- package/dist-esm/src/healthLro.js.map +1 -1
- package/dist-esm/src/index.js +2 -2
- package/dist-esm/src/index.js.map +1 -1
- package/dist-esm/src/multiCategoryClassifyResult.js +1 -1
- package/dist-esm/src/multiCategoryClassifyResult.js.map +1 -1
- package/dist-esm/src/multiCategoryClassifyResultArray.js +1 -1
- package/dist-esm/src/multiCategoryClassifyResultArray.js.map +1 -1
- package/dist-esm/src/recognizeCategorizedEntitiesResult.js +1 -1
- package/dist-esm/src/recognizeCategorizedEntitiesResult.js.map +1 -1
- package/dist-esm/src/recognizeCategorizedEntitiesResultArray.js +1 -1
- package/dist-esm/src/recognizeCategorizedEntitiesResultArray.js.map +1 -1
- package/dist-esm/src/recognizeCustomEntitiesResult.js +1 -1
- package/dist-esm/src/recognizeCustomEntitiesResult.js.map +1 -1
- package/dist-esm/src/recognizeCustomEntitiesResultArray.js +1 -1
- package/dist-esm/src/recognizeCustomEntitiesResultArray.js.map +1 -1
- package/dist-esm/src/recognizeLinkedEntitiesResult.js +1 -1
- package/dist-esm/src/recognizeLinkedEntitiesResult.js.map +1 -1
- package/dist-esm/src/recognizeLinkedEntitiesResultArray.js +1 -1
- package/dist-esm/src/recognizeLinkedEntitiesResultArray.js.map +1 -1
- package/dist-esm/src/recognizePiiEntitiesResult.js +1 -1
- package/dist-esm/src/recognizePiiEntitiesResult.js.map +1 -1
- package/dist-esm/src/recognizePiiEntitiesResultArray.js +1 -1
- package/dist-esm/src/recognizePiiEntitiesResultArray.js.map +1 -1
- package/dist-esm/src/singleCategoryClassifyResult.js +1 -1
- package/dist-esm/src/singleCategoryClassifyResult.js.map +1 -1
- package/dist-esm/src/singleCategoryClassifyResultArray.js +1 -1
- package/dist-esm/src/singleCategoryClassifyResultArray.js.map +1 -1
- package/dist-esm/src/textAnalyticsClient.js +41 -41
- package/dist-esm/src/textAnalyticsClient.js.map +1 -1
- package/dist-esm/src/textAnalyticsResult.js +5 -5
- package/dist-esm/src/textAnalyticsResult.js.map +1 -1
- package/dist-esm/src/tracing.js +1 -1
- package/dist-esm/src/tracing.js.map +1 -1
- package/dist-esm/src/util.js +6 -6
- package/dist-esm/src/util.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -4016,7 +4016,7 @@ const logger = logger$1.createClientLogger("ai-text-analytics");
|
|
|
4016
4016
|
*/
|
|
4017
4017
|
const createSpan = coreTracing.createSpanFunction({
|
|
4018
4018
|
packagePrefix: "Azure.CognitiveServices.TextAnalytics",
|
|
4019
|
-
namespace: "Microsoft.CognitiveServices"
|
|
4019
|
+
namespace: "Microsoft.CognitiveServices",
|
|
4020
4020
|
});
|
|
4021
4021
|
|
|
4022
4022
|
// Copyright (c) Microsoft Corporation.
|
|
@@ -4056,7 +4056,7 @@ function parseAssessmentIndex(pointer) {
|
|
|
4056
4056
|
const assessmentIndex = {
|
|
4057
4057
|
document: parseInt(res[1]),
|
|
4058
4058
|
sentence: parseInt(res[2]),
|
|
4059
|
-
assessment: parseInt(res[3])
|
|
4059
|
+
assessment: parseInt(res[3]),
|
|
4060
4060
|
};
|
|
4061
4061
|
return assessmentIndex;
|
|
4062
4062
|
}
|
|
@@ -4161,7 +4161,7 @@ function compileError(errorResponse) {
|
|
|
4161
4161
|
unwrap(topLevelError);
|
|
4162
4162
|
return new coreRestPipeline.RestError(errorMessage, {
|
|
4163
4163
|
code: invalidDocumentBatchCode ? "InvalidDocumentBatch" : topLevelError.code,
|
|
4164
|
-
statusCode: castErrorResponse.statusCode
|
|
4164
|
+
statusCode: castErrorResponse.statusCode,
|
|
4165
4165
|
});
|
|
4166
4166
|
}
|
|
4167
4167
|
/**
|
|
@@ -4185,8 +4185,8 @@ async function getRawResponse(f, options) {
|
|
|
4185
4185
|
rawResponse: {
|
|
4186
4186
|
statusCode: rawResponse.status,
|
|
4187
4187
|
headers: rawResponse.headers.toJSON(),
|
|
4188
|
-
body: rawResponse.parsedBody
|
|
4189
|
-
}
|
|
4188
|
+
body: rawResponse.parsedBody,
|
|
4189
|
+
},
|
|
4190
4190
|
};
|
|
4191
4191
|
}
|
|
4192
4192
|
/**
|
|
@@ -4200,13 +4200,13 @@ client, spec, spanStr, options, path) {
|
|
|
4200
4200
|
const { flatResponse, rawResponse } = await getRawResponse((paramOptions) => client.sendOperationRequest({ options: paramOptions }, Object.assign(Object.assign({}, spec), { path, httpMethod: "GET" })), finalOptions);
|
|
4201
4201
|
return {
|
|
4202
4202
|
flatResponse: flatResponse,
|
|
4203
|
-
rawResponse
|
|
4203
|
+
rawResponse,
|
|
4204
4204
|
};
|
|
4205
4205
|
}
|
|
4206
4206
|
catch (e) {
|
|
4207
4207
|
span.setStatus({
|
|
4208
4208
|
code: coreTracing.SpanStatusCode.ERROR,
|
|
4209
|
-
message: e.message
|
|
4209
|
+
message: e.message,
|
|
4210
4210
|
});
|
|
4211
4211
|
throw e;
|
|
4212
4212
|
}
|
|
@@ -4230,7 +4230,7 @@ function intoTextAnalyticsError(errorModel) {
|
|
|
4230
4230
|
return {
|
|
4231
4231
|
code: errorModel.code,
|
|
4232
4232
|
message: errorModel.message,
|
|
4233
|
-
target: errorModel.target
|
|
4233
|
+
target: errorModel.target,
|
|
4234
4234
|
};
|
|
4235
4235
|
}
|
|
4236
4236
|
/**
|
|
@@ -4240,7 +4240,7 @@ function makeTextAnalyticsSuccessResult(id, warnings, statistics) {
|
|
|
4240
4240
|
return {
|
|
4241
4241
|
id,
|
|
4242
4242
|
statistics,
|
|
4243
|
-
warnings
|
|
4243
|
+
warnings,
|
|
4244
4244
|
};
|
|
4245
4245
|
}
|
|
4246
4246
|
/**
|
|
@@ -4249,7 +4249,7 @@ function makeTextAnalyticsSuccessResult(id, warnings, statistics) {
|
|
|
4249
4249
|
function makeTextAnalyticsErrorResult(id, error) {
|
|
4250
4250
|
return {
|
|
4251
4251
|
id,
|
|
4252
|
-
error: intoTextAnalyticsError(error)
|
|
4252
|
+
error: intoTextAnalyticsError(error),
|
|
4253
4253
|
};
|
|
4254
4254
|
}
|
|
4255
4255
|
/**
|
|
@@ -4277,7 +4277,7 @@ function combineSuccessfulAndErroneousDocumentsWithStatisticsAndModelVersion(inp
|
|
|
4277
4277
|
const sorted = processAndCombineSuccessfulAndErroneousDocuments(input, response, processSuccess, processError);
|
|
4278
4278
|
return Object.assign(sorted, {
|
|
4279
4279
|
statistics: response.statistics,
|
|
4280
|
-
modelVersion: response.modelVersion
|
|
4280
|
+
modelVersion: response.modelVersion,
|
|
4281
4281
|
});
|
|
4282
4282
|
}
|
|
4283
4283
|
/**
|
|
@@ -4293,7 +4293,7 @@ function combineSuccessfulAndErroneousDocumentsWithStatisticsAndCustomProjectInf
|
|
|
4293
4293
|
return Object.assign(sorted, {
|
|
4294
4294
|
statistics: response.statistics,
|
|
4295
4295
|
projectName: response.projectName,
|
|
4296
|
-
deploymentName: response.deploymentName
|
|
4296
|
+
deploymentName: response.deploymentName,
|
|
4297
4297
|
});
|
|
4298
4298
|
}
|
|
4299
4299
|
|
|
@@ -4349,7 +4349,7 @@ function makeRecognizeCategorizedEntitiesResultArray(input, response) {
|
|
|
4349
4349
|
* @internal
|
|
4350
4350
|
*/
|
|
4351
4351
|
function makeAnalyzeSentimentResult(result) {
|
|
4352
|
-
const { id, sentiment, confidenceScores, sentenceSentiments: sentences, warnings, statistics } = result;
|
|
4352
|
+
const { id, sentiment, confidenceScores, sentenceSentiments: sentences, warnings, statistics, } = result;
|
|
4353
4353
|
return Object.assign(Object.assign({}, makeTextAnalyticsSuccessResult(id, warnings, statistics)), { sentiment,
|
|
4354
4354
|
confidenceScores, sentences: sentences.map((sentence) => convertGeneratedSentenceSentiment(sentence, result)) });
|
|
4355
4355
|
}
|
|
@@ -4382,13 +4382,13 @@ function convertGeneratedSentenceSentiment(sentence, result) {
|
|
|
4382
4382
|
sentiment: target.sentiment,
|
|
4383
4383
|
text: target.text,
|
|
4384
4384
|
offset: target.offset,
|
|
4385
|
-
length: target.length
|
|
4385
|
+
length: target.length,
|
|
4386
4386
|
},
|
|
4387
4387
|
assessments: target.relations
|
|
4388
4388
|
.filter((relation) => relation.relationType === "assessment")
|
|
4389
|
-
.map((relation) => convertTargetRelationToAssessmentSentiment(relation, result))
|
|
4389
|
+
.map((relation) => convertTargetRelationToAssessmentSentiment(relation, result)),
|
|
4390
4390
|
}))
|
|
4391
|
-
: []
|
|
4391
|
+
: [],
|
|
4392
4392
|
};
|
|
4393
4393
|
}
|
|
4394
4394
|
/**
|
|
@@ -4510,7 +4510,7 @@ function textAnalyticsAzureKeyCredentialPolicy(credential) {
|
|
|
4510
4510
|
sendRequest(request, next) {
|
|
4511
4511
|
request.headers.set(API_KEY_HEADER_NAME, credential.key);
|
|
4512
4512
|
return next(request);
|
|
4513
|
-
}
|
|
4513
|
+
},
|
|
4514
4514
|
};
|
|
4515
4515
|
}
|
|
4516
4516
|
|
|
@@ -4532,7 +4532,7 @@ function makeHealthcareEntitiesWithoutNeighbors(entity) {
|
|
|
4532
4532
|
text,
|
|
4533
4533
|
normalizedText: name,
|
|
4534
4534
|
subCategory: subcategory,
|
|
4535
|
-
dataSources: (_a = links === null || links === void 0 ? void 0 : links.map(({ dataSource, id }) => ({ name: dataSource, entityId: id }))) !== null && _a !== void 0 ? _a : []
|
|
4535
|
+
dataSources: (_a = links === null || links === void 0 ? void 0 : links.map(({ dataSource, id }) => ({ name: dataSource, entityId: id }))) !== null && _a !== void 0 ? _a : [],
|
|
4536
4536
|
};
|
|
4537
4537
|
}
|
|
4538
4538
|
/**
|
|
@@ -4543,8 +4543,8 @@ function makeHealthcareRelations(entities, relations) {
|
|
|
4543
4543
|
relationType: relation.relationType,
|
|
4544
4544
|
roles: relation.entities.map((role) => ({
|
|
4545
4545
|
entity: entities[parseHealthcareEntityIndex(role.ref)],
|
|
4546
|
-
name: role.role
|
|
4547
|
-
}))
|
|
4546
|
+
name: role.role,
|
|
4547
|
+
})),
|
|
4548
4548
|
}));
|
|
4549
4549
|
}
|
|
4550
4550
|
/**
|
|
@@ -4572,16 +4572,16 @@ const healthStatusOperationSpec$1 = {
|
|
|
4572
4572
|
httpMethod: "GET",
|
|
4573
4573
|
responses: {
|
|
4574
4574
|
200: {
|
|
4575
|
-
bodyMapper: HealthcareJobState
|
|
4575
|
+
bodyMapper: HealthcareJobState,
|
|
4576
4576
|
},
|
|
4577
4577
|
default: {
|
|
4578
|
-
bodyMapper: ErrorResponse
|
|
4579
|
-
}
|
|
4578
|
+
bodyMapper: ErrorResponse,
|
|
4579
|
+
},
|
|
4580
4580
|
},
|
|
4581
4581
|
queryParameters: [includeStatistics, top, skip],
|
|
4582
4582
|
urlParameters: [endpoint, apiVersion],
|
|
4583
4583
|
headerParameters: [accept],
|
|
4584
|
-
serializer: serializer$1
|
|
4584
|
+
serializer: serializer$1,
|
|
4585
4585
|
};
|
|
4586
4586
|
/**
|
|
4587
4587
|
* @internal
|
|
@@ -4604,14 +4604,14 @@ class HealthLro {
|
|
|
4604
4604
|
const { flatResponse, rawResponse } = await getRawResponse((paramOptions) => this.client.health({ documents: this.documents }, paramOptions), finalOptions);
|
|
4605
4605
|
return {
|
|
4606
4606
|
flatResponse: flatResponse,
|
|
4607
|
-
rawResponse
|
|
4607
|
+
rawResponse,
|
|
4608
4608
|
};
|
|
4609
4609
|
}
|
|
4610
4610
|
catch (e) {
|
|
4611
4611
|
const exception = compileError(e);
|
|
4612
4612
|
span.setStatus({
|
|
4613
4613
|
code: coreTracing.SpanStatusCode.ERROR,
|
|
4614
|
-
message: exception.message
|
|
4614
|
+
message: exception.message,
|
|
4615
4615
|
});
|
|
4616
4616
|
throw exception;
|
|
4617
4617
|
}
|
|
@@ -4667,18 +4667,18 @@ client, documents, options) {
|
|
|
4667
4667
|
if (flatResponse.results) {
|
|
4668
4668
|
return {
|
|
4669
4669
|
page: processAndCombineSuccessfulAndErroneousDocuments(documents, flatResponse.results, makeHealthcareEntitiesResult, makeHealthcareEntitiesErrorResult),
|
|
4670
|
-
nextPageLink: flatResponse.nextLink
|
|
4670
|
+
nextPageLink: flatResponse.nextLink,
|
|
4671
4671
|
};
|
|
4672
4672
|
}
|
|
4673
4673
|
else {
|
|
4674
4674
|
throw new Error("Healthcare action has succeeded but there are no results!");
|
|
4675
4675
|
}
|
|
4676
|
-
}
|
|
4676
|
+
},
|
|
4677
4677
|
};
|
|
4678
4678
|
const pagedIterator = corePaging.getPagedAsyncIterator(pagedResult);
|
|
4679
4679
|
return Object.assign(pagedIterator, {
|
|
4680
4680
|
statistics: result.results.statistics,
|
|
4681
|
-
modelVersion: result.results.modelVersion
|
|
4681
|
+
modelVersion: result.results.modelVersion,
|
|
4682
4682
|
});
|
|
4683
4683
|
};
|
|
4684
4684
|
}
|
|
@@ -4841,7 +4841,7 @@ function parseActionError(erredActions) {
|
|
|
4841
4841
|
code: erredActions.code,
|
|
4842
4842
|
message: erredActions.message,
|
|
4843
4843
|
index: parseInt(result[2]),
|
|
4844
|
-
type: convertTaskTypeToActionType(result[1])
|
|
4844
|
+
type: convertTaskTypeToActionType(result[1]),
|
|
4845
4845
|
};
|
|
4846
4846
|
}
|
|
4847
4847
|
else {
|
|
@@ -4912,7 +4912,7 @@ function createErredAction(error, lastUpdateDateTime, taskName) {
|
|
|
4912
4912
|
return {
|
|
4913
4913
|
error: intoTextAnalyticsError(error),
|
|
4914
4914
|
failedOn: lastUpdateDateTime,
|
|
4915
|
-
actionName: taskName
|
|
4915
|
+
actionName: taskName,
|
|
4916
4916
|
};
|
|
4917
4917
|
}
|
|
4918
4918
|
/**
|
|
@@ -4934,14 +4934,14 @@ function makeActionResult(documents, makeResultsArray, succeededTasks, erredActi
|
|
|
4934
4934
|
{
|
|
4935
4935
|
results: recognizeEntitiesResults,
|
|
4936
4936
|
completedOn: lastUpdateDateTime,
|
|
4937
|
-
actionName: taskName
|
|
4938
|
-
}
|
|
4937
|
+
actionName: taskName,
|
|
4938
|
+
},
|
|
4939
4939
|
];
|
|
4940
4940
|
}
|
|
4941
4941
|
else {
|
|
4942
4942
|
return [
|
|
4943
4943
|
...actions,
|
|
4944
|
-
createErredAction(erredActions[errorIndex++], lastUpdateDateTime, taskName)
|
|
4944
|
+
createErredAction(erredActions[errorIndex++], lastUpdateDateTime, taskName),
|
|
4945
4945
|
];
|
|
4946
4946
|
}
|
|
4947
4947
|
}
|
|
@@ -4975,7 +4975,7 @@ function createAnalyzeActionsResult(response, documents) {
|
|
|
4975
4975
|
extractSummaryResults: makeActionResult(documents, makeExtractSummaryResultArray, (_g = response.tasks.extractiveSummarizationTasks) !== null && _g !== void 0 ? _g : [], extractSummarySentencesActionErrors),
|
|
4976
4976
|
recognizeCustomEntitiesResults: makeActionResult(documents, makeRecognizeCustomEntitiesResultArray, (_h = response.tasks.customEntityRecognitionTasks) !== null && _h !== void 0 ? _h : [], recognizeCustomEntitiesActionErrors),
|
|
4977
4977
|
singleCategoryClassifyResults: makeActionResult(documents, makeSingleCategoryClassifyResultArray, (_j = response.tasks.customSingleClassificationTasks) !== null && _j !== void 0 ? _j : [], singleCategoryClassifyActionErrors),
|
|
4978
|
-
multiCategoryClassifyResults: makeActionResult(documents, makeMultiCategoryClassifyResultArray, (_k = response.tasks.customMultiClassificationTasks) !== null && _k !== void 0 ? _k : [], multiCategoryClassifyActionErrors)
|
|
4978
|
+
multiCategoryClassifyResults: makeActionResult(documents, makeMultiCategoryClassifyResultArray, (_k = response.tasks.customMultiClassificationTasks) !== null && _k !== void 0 ? _k : [], multiCategoryClassifyActionErrors),
|
|
4979
4979
|
};
|
|
4980
4980
|
}
|
|
4981
4981
|
|
|
@@ -4986,16 +4986,16 @@ const analyzeStatusOperationSpec$1 = {
|
|
|
4986
4986
|
httpMethod: "GET",
|
|
4987
4987
|
responses: {
|
|
4988
4988
|
200: {
|
|
4989
|
-
bodyMapper: AnalyzeJobState
|
|
4989
|
+
bodyMapper: AnalyzeJobState,
|
|
4990
4990
|
},
|
|
4991
4991
|
default: {
|
|
4992
|
-
bodyMapper: ErrorResponse
|
|
4993
|
-
}
|
|
4992
|
+
bodyMapper: ErrorResponse,
|
|
4993
|
+
},
|
|
4994
4994
|
},
|
|
4995
4995
|
queryParameters: [includeStatistics, top, skip],
|
|
4996
4996
|
urlParameters: [endpoint, apiVersion],
|
|
4997
4997
|
headerParameters: [accept],
|
|
4998
|
-
serializer: serializer$2
|
|
4998
|
+
serializer: serializer$2,
|
|
4999
4999
|
};
|
|
5000
5000
|
/**
|
|
5001
5001
|
* @internal
|
|
@@ -5019,18 +5019,18 @@ class AnalyzeLro {
|
|
|
5019
5019
|
const { flatResponse, rawResponse } = await getRawResponse((paramOptions) => this.client.analyze(Object.assign({ body: {
|
|
5020
5020
|
analysisInput: { documents: this.documents },
|
|
5021
5021
|
tasks: this.tasks,
|
|
5022
|
-
displayName: this.initOptions.displayName
|
|
5022
|
+
displayName: this.initOptions.displayName,
|
|
5023
5023
|
} }, paramOptions)), finalOptions);
|
|
5024
5024
|
return {
|
|
5025
5025
|
flatResponse: flatResponse,
|
|
5026
|
-
rawResponse
|
|
5026
|
+
rawResponse,
|
|
5027
5027
|
};
|
|
5028
5028
|
}
|
|
5029
5029
|
catch (e) {
|
|
5030
5030
|
const exception = compileError(e);
|
|
5031
5031
|
span.setStatus({
|
|
5032
5032
|
code: coreTracing.SpanStatusCode.ERROR,
|
|
5033
|
-
message: exception.message
|
|
5033
|
+
message: exception.message,
|
|
5034
5034
|
});
|
|
5035
5035
|
throw exception;
|
|
5036
5036
|
}
|
|
@@ -5074,9 +5074,9 @@ client, documents, options) {
|
|
|
5074
5074
|
const flatResponse = response.flatResponse;
|
|
5075
5075
|
return {
|
|
5076
5076
|
page: createAnalyzeActionsResult(flatResponse, documents),
|
|
5077
|
-
nextPageLink: flatResponse.nextLink
|
|
5077
|
+
nextPageLink: flatResponse.nextLink,
|
|
5078
5078
|
};
|
|
5079
|
-
}
|
|
5079
|
+
},
|
|
5080
5080
|
};
|
|
5081
5081
|
const pagedIterator = corePaging.getPagedAsyncIterator(pagedResult);
|
|
5082
5082
|
// Attach stats if the service starts to return them
|
|
@@ -5138,8 +5138,8 @@ class TextAnalyticsClient {
|
|
|
5138
5138
|
const internalPipelineOptions = Object.assign(Object.assign({}, pipelineOptions), {
|
|
5139
5139
|
loggingOptions: {
|
|
5140
5140
|
logger: logger.info,
|
|
5141
|
-
additionalAllowedHeaderNames: ["x-ms-correlation-request-id", "x-ms-request-id"]
|
|
5142
|
-
}
|
|
5141
|
+
additionalAllowedHeaderNames: ["x-ms-correlation-request-id", "x-ms-request-id"],
|
|
5142
|
+
},
|
|
5143
5143
|
});
|
|
5144
5144
|
this.client = new GeneratedClient(this.endpointUrl, internalPipelineOptions);
|
|
5145
5145
|
const authPolicy = coreAuth.isTokenCredential(credential)
|
|
@@ -5166,14 +5166,14 @@ class TextAnalyticsClient {
|
|
|
5166
5166
|
const { span, updatedOptions: finalOptions } = createSpan("TextAnalyticsClient-detectLanguages", makeGeneratedDetectLanguageOptions(realOptions));
|
|
5167
5167
|
try {
|
|
5168
5168
|
const result = await this.client.languages({
|
|
5169
|
-
documents: realInputs
|
|
5169
|
+
documents: realInputs,
|
|
5170
5170
|
}, finalOptions);
|
|
5171
5171
|
return makeDetectLanguageResultArray(realInputs, result);
|
|
5172
5172
|
}
|
|
5173
5173
|
catch (e) {
|
|
5174
5174
|
span.setStatus({
|
|
5175
5175
|
code: coreTracing.SpanStatusCode.ERROR,
|
|
5176
|
-
message: e.message
|
|
5176
|
+
message: e.message,
|
|
5177
5177
|
});
|
|
5178
5178
|
throw e;
|
|
5179
5179
|
}
|
|
@@ -5201,7 +5201,7 @@ class TextAnalyticsClient {
|
|
|
5201
5201
|
const { span, updatedOptions: finalOptions } = createSpan("TextAnalyticsClient-recognizeEntities", makeGeneratedRecognizeCategorizedEntitiesOptions(realOptions));
|
|
5202
5202
|
try {
|
|
5203
5203
|
const result = await this.client.entitiesRecognitionGeneral({
|
|
5204
|
-
documents: realInputs
|
|
5204
|
+
documents: realInputs,
|
|
5205
5205
|
}, finalOptions);
|
|
5206
5206
|
return makeRecognizeCategorizedEntitiesResultArray(realInputs, result);
|
|
5207
5207
|
}
|
|
@@ -5217,7 +5217,7 @@ class TextAnalyticsClient {
|
|
|
5217
5217
|
const backwardCompatibleException = compileError(e);
|
|
5218
5218
|
span.setStatus({
|
|
5219
5219
|
code: coreTracing.SpanStatusCode.ERROR,
|
|
5220
|
-
message: backwardCompatibleException.message
|
|
5220
|
+
message: backwardCompatibleException.message,
|
|
5221
5221
|
});
|
|
5222
5222
|
throw backwardCompatibleException;
|
|
5223
5223
|
}
|
|
@@ -5243,14 +5243,14 @@ class TextAnalyticsClient {
|
|
|
5243
5243
|
const { span, updatedOptions: finalOptions } = createSpan("TextAnalyticsClient-analyzeSentiment", makeGeneratedAnalyzeSentimentOptions(realOptions));
|
|
5244
5244
|
try {
|
|
5245
5245
|
const result = await this.client.sentiment({
|
|
5246
|
-
documents: realInputs
|
|
5246
|
+
documents: realInputs,
|
|
5247
5247
|
}, finalOptions);
|
|
5248
5248
|
return makeAnalyzeSentimentResultArray(realInputs, result);
|
|
5249
5249
|
}
|
|
5250
5250
|
catch (e) {
|
|
5251
5251
|
span.setStatus({
|
|
5252
5252
|
code: coreTracing.SpanStatusCode.ERROR,
|
|
5253
|
-
message: e.message
|
|
5253
|
+
message: e.message,
|
|
5254
5254
|
});
|
|
5255
5255
|
throw e;
|
|
5256
5256
|
}
|
|
@@ -5276,14 +5276,14 @@ class TextAnalyticsClient {
|
|
|
5276
5276
|
const { span, updatedOptions: finalOptions } = createSpan("TextAnalyticsClient-extractKeyPhrases", makeGeneratedExtractKeyPhrasesOptions(realOptions));
|
|
5277
5277
|
try {
|
|
5278
5278
|
const result = await this.client.keyPhrases({
|
|
5279
|
-
documents: realInputs
|
|
5279
|
+
documents: realInputs,
|
|
5280
5280
|
}, finalOptions);
|
|
5281
5281
|
return makeExtractKeyPhrasesResultArray(realInputs, result);
|
|
5282
5282
|
}
|
|
5283
5283
|
catch (e) {
|
|
5284
5284
|
span.setStatus({
|
|
5285
5285
|
code: coreTracing.SpanStatusCode.ERROR,
|
|
5286
|
-
message: e.message
|
|
5286
|
+
message: e.message,
|
|
5287
5287
|
});
|
|
5288
5288
|
throw e;
|
|
5289
5289
|
}
|
|
@@ -5306,14 +5306,14 @@ class TextAnalyticsClient {
|
|
|
5306
5306
|
const { span, updatedOptions: finalOptions } = createSpan("TextAnalyticsClient-recognizePiiEntities", makeGeneratedRecognizePiiEntitiesOptions(realOptions));
|
|
5307
5307
|
try {
|
|
5308
5308
|
const result = await this.client.entitiesRecognitionPii({
|
|
5309
|
-
documents: realInputs
|
|
5309
|
+
documents: realInputs,
|
|
5310
5310
|
}, finalOptions);
|
|
5311
5311
|
return makeRecognizePiiEntitiesResultArray(realInputs, result);
|
|
5312
5312
|
}
|
|
5313
5313
|
catch (e) {
|
|
5314
5314
|
span.setStatus({
|
|
5315
5315
|
code: coreTracing.SpanStatusCode.ERROR,
|
|
5316
|
-
message: e.message
|
|
5316
|
+
message: e.message,
|
|
5317
5317
|
});
|
|
5318
5318
|
throw e;
|
|
5319
5319
|
}
|
|
@@ -5339,14 +5339,14 @@ class TextAnalyticsClient {
|
|
|
5339
5339
|
const { span, updatedOptions: finalOptions } = createSpan("TextAnalyticsClient-recognizeLinkedEntities", makeGeneratedRecognizeLinkingEntitiesOptions(realOptions));
|
|
5340
5340
|
try {
|
|
5341
5341
|
const result = await this.client.entitiesLinking({
|
|
5342
|
-
documents: realInputs
|
|
5342
|
+
documents: realInputs,
|
|
5343
5343
|
}, finalOptions);
|
|
5344
5344
|
return makeRecognizeLinkedEntitiesResultArray(realInputs, result);
|
|
5345
5345
|
}
|
|
5346
5346
|
catch (e) {
|
|
5347
5347
|
span.setStatus({
|
|
5348
5348
|
code: coreTracing.SpanStatusCode.ERROR,
|
|
5349
|
-
message: e.message
|
|
5349
|
+
message: e.message,
|
|
5350
5350
|
});
|
|
5351
5351
|
throw e;
|
|
5352
5352
|
}
|
|
@@ -5366,13 +5366,13 @@ class TextAnalyticsClient {
|
|
|
5366
5366
|
realInputs = documents;
|
|
5367
5367
|
realOptions = languageOrOptions || {};
|
|
5368
5368
|
}
|
|
5369
|
-
const { updateIntervalInMs, resumeFrom, onResponse, disableServiceLogs, modelVersion, requestOptions, serializerOptions, abortSignal, stringIndexType, includeStatistics, tracingOptions } = realOptions;
|
|
5369
|
+
const { updateIntervalInMs, resumeFrom, onResponse, disableServiceLogs, modelVersion, requestOptions, serializerOptions, abortSignal, stringIndexType, includeStatistics, tracingOptions, } = realOptions;
|
|
5370
5370
|
const lro = new HealthLro(this.client, {
|
|
5371
5371
|
onResponse,
|
|
5372
5372
|
requestOptions,
|
|
5373
5373
|
serializerOptions,
|
|
5374
5374
|
abortSignal,
|
|
5375
|
-
tracingOptions
|
|
5375
|
+
tracingOptions,
|
|
5376
5376
|
}, { loggingOptOut: disableServiceLogs, stringIndexType, modelVersion }, { includeStatistics }, realInputs);
|
|
5377
5377
|
const poller = new coreLro.LroEngine(lro, {
|
|
5378
5378
|
intervalInMs: updateIntervalInMs,
|
|
@@ -5383,10 +5383,10 @@ class TextAnalyticsClient {
|
|
|
5383
5383
|
serializerOptions,
|
|
5384
5384
|
abortSignal,
|
|
5385
5385
|
tracingOptions,
|
|
5386
|
-
includeStatistics
|
|
5386
|
+
includeStatistics,
|
|
5387
5387
|
}),
|
|
5388
5388
|
isDone: isHealthDone,
|
|
5389
|
-
updateState: updateHealthState
|
|
5389
|
+
updateState: updateHealthState,
|
|
5390
5390
|
});
|
|
5391
5391
|
await poller.poll();
|
|
5392
5392
|
return poller;
|
|
@@ -5407,13 +5407,13 @@ class TextAnalyticsClient {
|
|
|
5407
5407
|
realOptions = languageOrOptions || {};
|
|
5408
5408
|
}
|
|
5409
5409
|
const compiledActions = compileAnalyzeInput(actions);
|
|
5410
|
-
const { updateIntervalInMs, resumeFrom, displayName, includeStatistics, onResponse, requestOptions, serializerOptions, abortSignal, tracingOptions } = realOptions;
|
|
5410
|
+
const { updateIntervalInMs, resumeFrom, displayName, includeStatistics, onResponse, requestOptions, serializerOptions, abortSignal, tracingOptions, } = realOptions;
|
|
5411
5411
|
const lro = new AnalyzeLro(this.client, {
|
|
5412
5412
|
onResponse,
|
|
5413
5413
|
requestOptions,
|
|
5414
5414
|
serializerOptions,
|
|
5415
5415
|
abortSignal,
|
|
5416
|
-
tracingOptions
|
|
5416
|
+
tracingOptions,
|
|
5417
5417
|
}, { displayName }, { includeStatistics }, realInputs, compiledActions);
|
|
5418
5418
|
const poller = new coreLro.LroEngine(lro, {
|
|
5419
5419
|
intervalInMs: updateIntervalInMs,
|
|
@@ -5424,10 +5424,10 @@ class TextAnalyticsClient {
|
|
|
5424
5424
|
serializerOptions,
|
|
5425
5425
|
abortSignal,
|
|
5426
5426
|
tracingOptions,
|
|
5427
|
-
includeStatistics
|
|
5427
|
+
includeStatistics,
|
|
5428
5428
|
}),
|
|
5429
5429
|
isDone: isAnalyzeDone,
|
|
5430
|
-
updateState: updateAnalyzeState
|
|
5430
|
+
updateState: updateAnalyzeState,
|
|
5431
5431
|
});
|
|
5432
5432
|
await poller.poll();
|
|
5433
5433
|
return poller;
|
|
@@ -5447,7 +5447,7 @@ function compileAnalyzeInput(actions) {
|
|
|
5447
5447
|
extractiveSummarizationTasks: (_f = actions.extractSummaryActions) === null || _f === void 0 ? void 0 : _f.map(compose(setStrEncodingParam, compose(setSentenceCount, compose(setOrderBy, addParamsToTask)))),
|
|
5448
5448
|
customEntityRecognitionTasks: (_g = actions.recognizeCustomEntitiesActions) === null || _g === void 0 ? void 0 : _g.map(compose(setStrEncodingParam, addParamsToTask)),
|
|
5449
5449
|
customSingleClassificationTasks: (_h = actions.singleCategoryClassifyActions) === null || _h === void 0 ? void 0 : _h.map(addParamsToTask),
|
|
5450
|
-
customMultiClassificationTasks: (_j = actions.multiCategoryClassifyActions) === null || _j === void 0 ? void 0 : _j.map(addParamsToTask)
|
|
5450
|
+
customMultiClassificationTasks: (_j = actions.multiCategoryClassifyActions) === null || _j === void 0 ? void 0 : _j.map(addParamsToTask),
|
|
5451
5451
|
};
|
|
5452
5452
|
}
|
|
5453
5453
|
function isStringArray(documents) {
|
|
@@ -5464,7 +5464,7 @@ function convertToDetectLanguageInput(inputs, countryHint) {
|
|
|
5464
5464
|
return {
|
|
5465
5465
|
id: String(index),
|
|
5466
5466
|
countryHint,
|
|
5467
|
-
text
|
|
5467
|
+
text,
|
|
5468
5468
|
};
|
|
5469
5469
|
});
|
|
5470
5470
|
}
|
|
@@ -5476,7 +5476,7 @@ function convertToTextDocumentInput(inputs, language) {
|
|
|
5476
5476
|
return {
|
|
5477
5477
|
id: String(index),
|
|
5478
5478
|
language,
|
|
5479
|
-
text
|
|
5479
|
+
text,
|
|
5480
5480
|
};
|
|
5481
5481
|
});
|
|
5482
5482
|
}
|
|
@@ -5496,7 +5496,7 @@ function makeGeneratedAnalyzeSentimentOptions(params) {
|
|
|
5496
5496
|
tracingOptions: params.tracingOptions,
|
|
5497
5497
|
onResponse: params.onResponse,
|
|
5498
5498
|
serializerOptions: params.serializerOptions,
|
|
5499
|
-
loggingOptOut: params.disableServiceLogs
|
|
5499
|
+
loggingOptOut: params.disableServiceLogs,
|
|
5500
5500
|
};
|
|
5501
5501
|
}
|
|
5502
5502
|
/**
|
|
@@ -5516,7 +5516,7 @@ function makeGeneratedRecognizePiiEntitiesOptions(params) {
|
|
|
5516
5516
|
piiCategories: params.categoriesFilter,
|
|
5517
5517
|
onResponse: params.onResponse,
|
|
5518
5518
|
serializerOptions: params.serializerOptions,
|
|
5519
|
-
loggingOptOut: params.disableServiceLogs
|
|
5519
|
+
loggingOptOut: params.disableServiceLogs,
|
|
5520
5520
|
};
|
|
5521
5521
|
}
|
|
5522
5522
|
/**
|
|
@@ -5534,7 +5534,7 @@ function makeGeneratedRecognizeCategorizedEntitiesOptions(params) {
|
|
|
5534
5534
|
tracingOptions: params.tracingOptions,
|
|
5535
5535
|
onResponse: params.onResponse,
|
|
5536
5536
|
serializerOptions: params.serializerOptions,
|
|
5537
|
-
loggingOptOut: params.disableServiceLogs
|
|
5537
|
+
loggingOptOut: params.disableServiceLogs,
|
|
5538
5538
|
};
|
|
5539
5539
|
}
|
|
5540
5540
|
/**
|
|
@@ -5551,7 +5551,7 @@ function makeGeneratedDetectLanguageOptions(params) {
|
|
|
5551
5551
|
tracingOptions: params.tracingOptions,
|
|
5552
5552
|
onResponse: params.onResponse,
|
|
5553
5553
|
serializerOptions: params.serializerOptions,
|
|
5554
|
-
loggingOptOut: params.disableServiceLogs
|
|
5554
|
+
loggingOptOut: params.disableServiceLogs,
|
|
5555
5555
|
};
|
|
5556
5556
|
}
|
|
5557
5557
|
/**
|
|
@@ -5568,7 +5568,7 @@ function makeGeneratedExtractKeyPhrasesOptions(params) {
|
|
|
5568
5568
|
tracingOptions: params.tracingOptions,
|
|
5569
5569
|
onResponse: params.onResponse,
|
|
5570
5570
|
serializerOptions: params.serializerOptions,
|
|
5571
|
-
loggingOptOut: params.disableServiceLogs
|
|
5571
|
+
loggingOptOut: params.disableServiceLogs,
|
|
5572
5572
|
};
|
|
5573
5573
|
}
|
|
5574
5574
|
/**
|
|
@@ -5586,7 +5586,7 @@ function makeGeneratedRecognizeLinkingEntitiesOptions(params) {
|
|
|
5586
5586
|
onResponse: params.onResponse,
|
|
5587
5587
|
serializerOptions: params.serializerOptions,
|
|
5588
5588
|
loggingOptOut: params.disableServiceLogs,
|
|
5589
|
-
stringIndexType: setStrEncodingParamValue(params.stringIndexType)
|
|
5589
|
+
stringIndexType: setStrEncodingParamValue(params.stringIndexType),
|
|
5590
5590
|
};
|
|
5591
5591
|
}
|
|
5592
5592
|
|