@azure/ai-text-analytics 5.2.0-beta.2 → 6.0.0-alpha.20220518.3

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.
Files changed (103) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +375 -133
  3. package/dist/index.js +2797 -4176
  4. package/dist/index.js.map +1 -1
  5. package/dist-esm/src/azureKeyCredentialPolicy.js +2 -2
  6. package/dist-esm/src/azureKeyCredentialPolicy.js.map +1 -1
  7. package/dist-esm/src/constants.js +16 -0
  8. package/dist-esm/src/constants.js.map +1 -0
  9. package/dist-esm/src/generated/generatedClient.js +80 -334
  10. package/dist-esm/src/generated/generatedClient.js.map +1 -1
  11. package/dist-esm/src/generated/index.js +1 -1
  12. package/dist-esm/src/generated/index.js.map +1 -1
  13. package/dist-esm/src/generated/models/index.js +106 -35
  14. package/dist-esm/src/generated/models/index.js.map +1 -1
  15. package/dist-esm/src/generated/models/mappers.js +1625 -2101
  16. package/dist-esm/src/generated/models/mappers.js.map +1 -1
  17. package/dist-esm/src/generated/models/parameters.js +18 -105
  18. package/dist-esm/src/generated/models/parameters.js.map +1 -1
  19. package/dist-esm/src/generated/operations/analyzeText.js +105 -0
  20. package/dist-esm/src/generated/operations/analyzeText.js.map +1 -0
  21. package/dist-esm/src/generated/operations/index.js +9 -0
  22. package/dist-esm/src/generated/operations/index.js.map +1 -0
  23. package/dist-esm/src/generated/operationsInterfaces/analyzeText.js +9 -0
  24. package/dist-esm/src/generated/operationsInterfaces/analyzeText.js.map +1 -0
  25. package/dist-esm/src/generated/operationsInterfaces/index.js +9 -0
  26. package/dist-esm/src/generated/operationsInterfaces/index.js.map +1 -0
  27. package/dist-esm/src/index.js +14 -5
  28. package/dist-esm/src/index.js.map +1 -1
  29. package/dist-esm/src/lro.js +195 -0
  30. package/dist-esm/src/lro.js.map +1 -0
  31. package/dist-esm/src/models.js +42 -0
  32. package/dist-esm/src/models.js.map +1 -0
  33. package/dist-esm/src/textAnalysisClient.js +197 -0
  34. package/dist-esm/src/textAnalysisClient.js.map +1 -0
  35. package/dist-esm/src/transforms.js +279 -0
  36. package/dist-esm/src/transforms.js.map +1 -0
  37. package/dist-esm/src/util.js +35 -141
  38. package/dist-esm/src/util.js.map +1 -1
  39. package/package.json +25 -33
  40. package/types/ai-text-analytics.d.ts +1402 -1421
  41. package/CHANGELOG.md +0 -162
  42. package/dist-esm/src/analyzeActionsResult.js +0 -205
  43. package/dist-esm/src/analyzeActionsResult.js.map +0 -1
  44. package/dist-esm/src/analyzeHealthcareEntitiesResult.js +0 -53
  45. package/dist-esm/src/analyzeHealthcareEntitiesResult.js.map +0 -1
  46. package/dist-esm/src/analyzeLro.js +0 -132
  47. package/dist-esm/src/analyzeLro.js.map +0 -1
  48. package/dist-esm/src/analyzeSentimentResult.js +0 -74
  49. package/dist-esm/src/analyzeSentimentResult.js.map +0 -1
  50. package/dist-esm/src/analyzeSentimentResultArray.js +0 -11
  51. package/dist-esm/src/analyzeSentimentResultArray.js.map +0 -1
  52. package/dist-esm/src/detectLanguageResult.js +0 -17
  53. package/dist-esm/src/detectLanguageResult.js.map +0 -1
  54. package/dist-esm/src/detectLanguageResultArray.js +0 -11
  55. package/dist-esm/src/detectLanguageResultArray.js.map +0 -1
  56. package/dist-esm/src/extractKeyPhrasesResult.js +0 -17
  57. package/dist-esm/src/extractKeyPhrasesResult.js.map +0 -1
  58. package/dist-esm/src/extractKeyPhrasesResultArray.js +0 -11
  59. package/dist-esm/src/extractKeyPhrasesResultArray.js.map +0 -1
  60. package/dist-esm/src/extractSummaryResult.js +0 -17
  61. package/dist-esm/src/extractSummaryResult.js.map +0 -1
  62. package/dist-esm/src/extractSummaryResultArray.js +0 -11
  63. package/dist-esm/src/extractSummaryResultArray.js.map +0 -1
  64. package/dist-esm/src/generated/generatedClientContext.js +0 -42
  65. package/dist-esm/src/generated/generatedClientContext.js.map +0 -1
  66. package/dist-esm/src/healthLro.js +0 -139
  67. package/dist-esm/src/healthLro.js.map +0 -1
  68. package/dist-esm/src/multiCategoryClassifyResult.js +0 -17
  69. package/dist-esm/src/multiCategoryClassifyResult.js.map +0 -1
  70. package/dist-esm/src/multiCategoryClassifyResultArray.js +0 -11
  71. package/dist-esm/src/multiCategoryClassifyResultArray.js.map +0 -1
  72. package/dist-esm/src/pollerModels.js +0 -4
  73. package/dist-esm/src/pollerModels.js.map +0 -1
  74. package/dist-esm/src/recognizeCategorizedEntitiesResult.js +0 -17
  75. package/dist-esm/src/recognizeCategorizedEntitiesResult.js.map +0 -1
  76. package/dist-esm/src/recognizeCategorizedEntitiesResultArray.js +0 -11
  77. package/dist-esm/src/recognizeCategorizedEntitiesResultArray.js.map +0 -1
  78. package/dist-esm/src/recognizeCustomEntitiesResult.js +0 -17
  79. package/dist-esm/src/recognizeCustomEntitiesResult.js.map +0 -1
  80. package/dist-esm/src/recognizeCustomEntitiesResultArray.js +0 -11
  81. package/dist-esm/src/recognizeCustomEntitiesResultArray.js.map +0 -1
  82. package/dist-esm/src/recognizeLinkedEntitiesResult.js +0 -17
  83. package/dist-esm/src/recognizeLinkedEntitiesResult.js.map +0 -1
  84. package/dist-esm/src/recognizeLinkedEntitiesResultArray.js +0 -11
  85. package/dist-esm/src/recognizeLinkedEntitiesResultArray.js.map +0 -1
  86. package/dist-esm/src/recognizePiiEntitiesResult.js +0 -18
  87. package/dist-esm/src/recognizePiiEntitiesResult.js.map +0 -1
  88. package/dist-esm/src/recognizePiiEntitiesResultArray.js +0 -11
  89. package/dist-esm/src/recognizePiiEntitiesResultArray.js.map +0 -1
  90. package/dist-esm/src/singleCategoryClassifyResult.js +0 -17
  91. package/dist-esm/src/singleCategoryClassifyResult.js.map +0 -1
  92. package/dist-esm/src/singleCategoryClassifyResultArray.js +0 -11
  93. package/dist-esm/src/singleCategoryClassifyResultArray.js.map +0 -1
  94. package/dist-esm/src/textAnalyticsAction.js +0 -4
  95. package/dist-esm/src/textAnalyticsAction.js.map +0 -1
  96. package/dist-esm/src/textAnalyticsClient.js +0 -511
  97. package/dist-esm/src/textAnalyticsClient.js.map +0 -1
  98. package/dist-esm/src/textAnalyticsOperationOptions.js +0 -4
  99. package/dist-esm/src/textAnalyticsOperationOptions.js.map +0 -1
  100. package/dist-esm/src/textAnalyticsResult.js +0 -94
  101. package/dist-esm/src/textAnalyticsResult.js.map +0 -1
  102. package/dist-esm/src/tracing.js +0 -12
  103. package/dist-esm/src/tracing.js.map +0 -1
@@ -1,511 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
3
- import { __rest } from "tslib";
4
- import { bearerTokenAuthenticationPolicy } from "@azure/core-rest-pipeline";
5
- import { isTokenCredential } from "@azure/core-auth";
6
- import { GeneratedClient } from "./generated/generatedClient";
7
- import { logger } from "./logger";
8
- import { makeDetectLanguageResultArray } from "./detectLanguageResultArray";
9
- import { makeRecognizeCategorizedEntitiesResultArray } from "./recognizeCategorizedEntitiesResultArray";
10
- import { makeAnalyzeSentimentResultArray } from "./analyzeSentimentResultArray";
11
- import { makeExtractKeyPhrasesResultArray } from "./extractKeyPhrasesResultArray";
12
- import { makeRecognizePiiEntitiesResultArray } from "./recognizePiiEntitiesResultArray";
13
- import { makeRecognizeLinkedEntitiesResultArray } from "./recognizeLinkedEntitiesResultArray";
14
- import { createSpan } from "./tracing";
15
- import { SpanStatusCode } from "@azure/core-tracing";
16
- import { textAnalyticsAzureKeyCredentialPolicy } from "./azureKeyCredentialPolicy";
17
- import { addParamsToTask, compose, compileError, setCategoriesFilter, setOpinionMining, setOrderBy, setSentenceCount, setStrEncodingParam, setStrEncodingParamValue } from "./util";
18
- import { HealthLro, isHealthDone, processHealthResult, updateHealthState } from "./healthLro";
19
- import { LroEngine } from "@azure/core-lro";
20
- import { AnalyzeLro, isAnalyzeDone, processAnalyzeResult, updateAnalyzeState } from "./analyzeLro";
21
- const DEFAULT_COGNITIVE_SCOPE = "https://cognitiveservices.azure.com/.default";
22
- /**
23
- * The types of PII domains the user can choose from.
24
- */
25
- export var PiiEntityDomain;
26
- (function (PiiEntityDomain) {
27
- /**
28
- * @see {@link https://aka.ms/tanerpii} for more information.
29
- */
30
- PiiEntityDomain["PROTECTED_HEALTH_INFORMATION"] = "PHI";
31
- })(PiiEntityDomain || (PiiEntityDomain = {}));
32
- /**
33
- * Client class for interacting with Azure Text Analytics.
34
- */
35
- export class TextAnalyticsClient {
36
- /**
37
- * Creates an instance of TextAnalyticsClient.
38
- *
39
- * Example usage:
40
- * ```ts
41
- * import { TextAnalyticsClient, AzureKeyCredential } from "@azure/ai-text-analytics";
42
- *
43
- * const client = new TextAnalyticsClient(
44
- * "<service endpoint>",
45
- * new AzureKeyCredential("<api key>")
46
- * );
47
- * ```
48
- * @param endpointUrl - The URL to the TextAnalytics endpoint
49
- * @param credential - Used to authenticate requests to the service.
50
- * @param options - Used to configure the TextAnalytics client.
51
- */
52
- constructor(endpointUrl, credential, options = {}) {
53
- this.endpointUrl = endpointUrl;
54
- const { defaultCountryHint = "us", defaultLanguage = "en" } = options, pipelineOptions = __rest(options, ["defaultCountryHint", "defaultLanguage"]);
55
- this.defaultCountryHint = defaultCountryHint;
56
- this.defaultLanguage = defaultLanguage;
57
- const internalPipelineOptions = Object.assign(Object.assign({}, pipelineOptions), {
58
- loggingOptions: {
59
- logger: logger.info,
60
- additionalAllowedHeaderNames: ["x-ms-correlation-request-id", "x-ms-request-id"]
61
- }
62
- });
63
- this.client = new GeneratedClient(this.endpointUrl, internalPipelineOptions);
64
- const authPolicy = isTokenCredential(credential)
65
- ? bearerTokenAuthenticationPolicy({ credential, scopes: DEFAULT_COGNITIVE_SCOPE })
66
- : textAnalyticsAzureKeyCredentialPolicy(credential);
67
- this.client.pipeline.addPolicy(authPolicy);
68
- }
69
- async detectLanguage(documents, countryHintOrOptions, options) {
70
- let realOptions;
71
- let realInputs;
72
- if (!Array.isArray(documents) || documents.length === 0) {
73
- throw new Error("'documents' must be a non-empty array");
74
- }
75
- if (isStringArray(documents)) {
76
- const countryHint = countryHintOrOptions || this.defaultCountryHint;
77
- realInputs = convertToDetectLanguageInput(documents, countryHint);
78
- realOptions = options || {};
79
- }
80
- else {
81
- // Replace "none" hints with ""
82
- realInputs = documents.map((input) => (Object.assign(Object.assign({}, input), { countryHint: input.countryHint === "none" ? "" : input.countryHint })));
83
- realOptions = countryHintOrOptions || {};
84
- }
85
- const { span, updatedOptions: finalOptions } = createSpan("TextAnalyticsClient-detectLanguages", makeGeneratedDetectLanguageOptions(realOptions));
86
- try {
87
- const result = await this.client.languages({
88
- documents: realInputs
89
- }, finalOptions);
90
- return makeDetectLanguageResultArray(realInputs, result);
91
- }
92
- catch (e) {
93
- span.setStatus({
94
- code: SpanStatusCode.ERROR,
95
- message: e.message
96
- });
97
- throw e;
98
- }
99
- finally {
100
- span.end();
101
- }
102
- }
103
- async recognizeEntities(documents, languageOrOptions,
104
- // eslint-disable-next-line @azure/azure-sdk/ts-naming-options
105
- options) {
106
- let realOptions;
107
- let realInputs;
108
- if (!Array.isArray(documents) || documents.length === 0) {
109
- throw new Error("'documents' must be a non-empty array");
110
- }
111
- if (isStringArray(documents)) {
112
- const language = languageOrOptions || this.defaultLanguage;
113
- realInputs = convertToTextDocumentInput(documents, language);
114
- realOptions = options || {};
115
- }
116
- else {
117
- realInputs = documents;
118
- realOptions = languageOrOptions || {};
119
- }
120
- const { span, updatedOptions: finalOptions } = createSpan("TextAnalyticsClient-recognizeEntities", makeGeneratedRecognizeCategorizedEntitiesOptions(realOptions));
121
- try {
122
- const result = await this.client.entitiesRecognitionGeneral({
123
- documents: realInputs
124
- }, finalOptions);
125
- return makeRecognizeCategorizedEntitiesResultArray(realInputs, result);
126
- }
127
- catch (e) {
128
- /**
129
- * This special logic handles REST exception with code
130
- * InvalidDocumentBatch and is needed to maintain backward compatability
131
- * with sdk v5.0.0 and earlier. In general, REST exceptions are thrown as
132
- * is and include both outer and inner exception codes. However, the
133
- * earlier versions were throwing an exception that included the inner
134
- * code only.
135
- */
136
- const backwardCompatibleException = compileError(e);
137
- span.setStatus({
138
- code: SpanStatusCode.ERROR,
139
- message: backwardCompatibleException.message
140
- });
141
- throw backwardCompatibleException;
142
- }
143
- finally {
144
- span.end();
145
- }
146
- }
147
- async analyzeSentiment(documents, languageOrOptions, options) {
148
- let realOptions;
149
- let realInputs;
150
- if (!Array.isArray(documents) || documents.length === 0) {
151
- throw new Error("'documents' must be a non-empty array");
152
- }
153
- if (isStringArray(documents)) {
154
- const language = languageOrOptions || this.defaultLanguage;
155
- realInputs = convertToTextDocumentInput(documents, language);
156
- realOptions = options || {};
157
- }
158
- else {
159
- realInputs = documents;
160
- realOptions = languageOrOptions || {};
161
- }
162
- const { span, updatedOptions: finalOptions } = createSpan("TextAnalyticsClient-analyzeSentiment", makeGeneratedAnalyzeSentimentOptions(realOptions));
163
- try {
164
- const result = await this.client.sentiment({
165
- documents: realInputs
166
- }, finalOptions);
167
- return makeAnalyzeSentimentResultArray(realInputs, result);
168
- }
169
- catch (e) {
170
- span.setStatus({
171
- code: SpanStatusCode.ERROR,
172
- message: e.message
173
- });
174
- throw e;
175
- }
176
- finally {
177
- span.end();
178
- }
179
- }
180
- async extractKeyPhrases(documents, languageOrOptions, options) {
181
- let realOptions;
182
- let realInputs;
183
- if (!Array.isArray(documents) || documents.length === 0) {
184
- throw new Error("'documents' must be a non-empty array");
185
- }
186
- if (isStringArray(documents)) {
187
- const language = languageOrOptions || this.defaultLanguage;
188
- realInputs = convertToTextDocumentInput(documents, language);
189
- realOptions = options || {};
190
- }
191
- else {
192
- realInputs = documents;
193
- realOptions = languageOrOptions || {};
194
- }
195
- const { span, updatedOptions: finalOptions } = createSpan("TextAnalyticsClient-extractKeyPhrases", makeGeneratedExtractKeyPhrasesOptions(realOptions));
196
- try {
197
- const result = await this.client.keyPhrases({
198
- documents: realInputs
199
- }, finalOptions);
200
- return makeExtractKeyPhrasesResultArray(realInputs, result);
201
- }
202
- catch (e) {
203
- span.setStatus({
204
- code: SpanStatusCode.ERROR,
205
- message: e.message
206
- });
207
- throw e;
208
- }
209
- finally {
210
- span.end();
211
- }
212
- }
213
- async recognizePiiEntities(inputs, languageOrOptions, options) {
214
- let realOptions;
215
- let realInputs;
216
- if (isStringArray(inputs)) {
217
- const language = languageOrOptions || this.defaultLanguage;
218
- realInputs = convertToTextDocumentInput(inputs, language);
219
- realOptions = options || {};
220
- }
221
- else {
222
- realInputs = inputs;
223
- realOptions = languageOrOptions || {};
224
- }
225
- const { span, updatedOptions: finalOptions } = createSpan("TextAnalyticsClient-recognizePiiEntities", makeGeneratedRecognizePiiEntitiesOptions(realOptions));
226
- try {
227
- const result = await this.client.entitiesRecognitionPii({
228
- documents: realInputs
229
- }, finalOptions);
230
- return makeRecognizePiiEntitiesResultArray(realInputs, result);
231
- }
232
- catch (e) {
233
- span.setStatus({
234
- code: SpanStatusCode.ERROR,
235
- message: e.message
236
- });
237
- throw e;
238
- }
239
- finally {
240
- span.end();
241
- }
242
- }
243
- async recognizeLinkedEntities(documents, languageOrOptions, options) {
244
- let realOptions;
245
- let realInputs;
246
- if (!Array.isArray(documents) || documents.length === 0) {
247
- throw new Error("'documents' must be a non-empty array");
248
- }
249
- if (isStringArray(documents)) {
250
- const language = languageOrOptions || this.defaultLanguage;
251
- realInputs = convertToTextDocumentInput(documents, language);
252
- realOptions = options || {};
253
- }
254
- else {
255
- realInputs = documents;
256
- realOptions = languageOrOptions || {};
257
- }
258
- const { span, updatedOptions: finalOptions } = createSpan("TextAnalyticsClient-recognizeLinkedEntities", makeGeneratedRecognizeLinkingEntitiesOptions(realOptions));
259
- try {
260
- const result = await this.client.entitiesLinking({
261
- documents: realInputs
262
- }, finalOptions);
263
- return makeRecognizeLinkedEntitiesResultArray(realInputs, result);
264
- }
265
- catch (e) {
266
- span.setStatus({
267
- code: SpanStatusCode.ERROR,
268
- message: e.message
269
- });
270
- throw e;
271
- }
272
- finally {
273
- span.end();
274
- }
275
- }
276
- async beginAnalyzeHealthcareEntities(documents, languageOrOptions, options) {
277
- let realOptions;
278
- let realInputs;
279
- if (isStringArray(documents)) {
280
- const language = languageOrOptions || this.defaultLanguage;
281
- realInputs = convertToTextDocumentInput(documents, language);
282
- realOptions = options || {};
283
- }
284
- else {
285
- realInputs = documents;
286
- realOptions = languageOrOptions || {};
287
- }
288
- const { updateIntervalInMs, resumeFrom, onResponse, disableServiceLogs, modelVersion, requestOptions, serializerOptions, abortSignal, stringIndexType, includeStatistics, tracingOptions } = realOptions;
289
- const lro = new HealthLro(this.client, {
290
- onResponse,
291
- requestOptions,
292
- serializerOptions,
293
- abortSignal,
294
- tracingOptions
295
- }, { loggingOptOut: disableServiceLogs, stringIndexType, modelVersion }, { includeStatistics }, realInputs);
296
- const poller = new LroEngine(lro, {
297
- intervalInMs: updateIntervalInMs,
298
- resumeFrom: resumeFrom,
299
- processResult: processHealthResult(this.client, realInputs, {
300
- onResponse,
301
- requestOptions,
302
- serializerOptions,
303
- abortSignal,
304
- tracingOptions,
305
- includeStatistics
306
- }),
307
- isDone: isHealthDone,
308
- updateState: updateHealthState
309
- });
310
- await poller.poll();
311
- return poller;
312
- }
313
- async beginAnalyzeActions(documents, actions, languageOrOptions, options) {
314
- let realOptions;
315
- let realInputs;
316
- if (!Array.isArray(documents) || documents.length === 0) {
317
- throw new Error("'documents' must be a non-empty array");
318
- }
319
- if (isStringArray(documents)) {
320
- const language = languageOrOptions || this.defaultLanguage;
321
- realInputs = convertToTextDocumentInput(documents, language);
322
- realOptions = options || {};
323
- }
324
- else {
325
- realInputs = documents;
326
- realOptions = languageOrOptions || {};
327
- }
328
- const compiledActions = compileAnalyzeInput(actions);
329
- const { updateIntervalInMs, resumeFrom, displayName, includeStatistics, onResponse, requestOptions, serializerOptions, abortSignal, tracingOptions } = realOptions;
330
- const lro = new AnalyzeLro(this.client, {
331
- onResponse,
332
- requestOptions,
333
- serializerOptions,
334
- abortSignal,
335
- tracingOptions
336
- }, { displayName }, { includeStatistics }, realInputs, compiledActions);
337
- const poller = new LroEngine(lro, {
338
- intervalInMs: updateIntervalInMs,
339
- resumeFrom: resumeFrom,
340
- processResult: processAnalyzeResult(this.client, realInputs, {
341
- onResponse,
342
- requestOptions,
343
- serializerOptions,
344
- abortSignal,
345
- tracingOptions,
346
- includeStatistics
347
- }),
348
- isDone: isAnalyzeDone,
349
- updateState: updateAnalyzeState
350
- });
351
- await poller.poll();
352
- return poller;
353
- }
354
- }
355
- /**
356
- * @internal
357
- */
358
- function compileAnalyzeInput(actions) {
359
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
360
- return {
361
- entityRecognitionPiiTasks: (_a = actions.recognizePiiEntitiesActions) === null || _a === void 0 ? void 0 : _a.map(compose(setStrEncodingParam, compose(setCategoriesFilter, addParamsToTask))),
362
- entityRecognitionTasks: (_b = actions.recognizeEntitiesActions) === null || _b === void 0 ? void 0 : _b.map(compose(setStrEncodingParam, addParamsToTask)),
363
- keyPhraseExtractionTasks: (_c = actions.extractKeyPhrasesActions) === null || _c === void 0 ? void 0 : _c.map(addParamsToTask),
364
- entityLinkingTasks: (_d = actions.recognizeLinkedEntitiesActions) === null || _d === void 0 ? void 0 : _d.map(compose(setStrEncodingParam, addParamsToTask)),
365
- sentimentAnalysisTasks: (_e = actions.analyzeSentimentActions) === null || _e === void 0 ? void 0 : _e.map(compose(setStrEncodingParam, compose(setOpinionMining, addParamsToTask))),
366
- extractiveSummarizationTasks: (_f = actions.extractSummaryActions) === null || _f === void 0 ? void 0 : _f.map(compose(setStrEncodingParam, compose(setSentenceCount, compose(setOrderBy, addParamsToTask)))),
367
- customEntityRecognitionTasks: (_g = actions.recognizeCustomEntitiesActions) === null || _g === void 0 ? void 0 : _g.map(compose(setStrEncodingParam, addParamsToTask)),
368
- customSingleClassificationTasks: (_h = actions.singleCategoryClassifyActions) === null || _h === void 0 ? void 0 : _h.map(addParamsToTask),
369
- customMultiClassificationTasks: (_j = actions.multiCategoryClassifyActions) === null || _j === void 0 ? void 0 : _j.map(addParamsToTask)
370
- };
371
- }
372
- function isStringArray(documents) {
373
- return typeof documents[0] === "string";
374
- }
375
- /**
376
- * @internal
377
- */
378
- function convertToDetectLanguageInput(inputs, countryHint) {
379
- if (countryHint === "none") {
380
- countryHint = "";
381
- }
382
- return inputs.map((text, index) => {
383
- return {
384
- id: String(index),
385
- countryHint,
386
- text
387
- };
388
- });
389
- }
390
- /**
391
- * @internal
392
- */
393
- function convertToTextDocumentInput(inputs, language) {
394
- return inputs.map((text, index) => {
395
- return {
396
- id: String(index),
397
- language,
398
- text
399
- };
400
- });
401
- }
402
- /**
403
- * Creates the options the service expects for the analyze sentiment API from the user friendly ones.
404
- * @param params - the user friendly parameters
405
- * @internal
406
- */
407
- function makeGeneratedAnalyzeSentimentOptions(params) {
408
- return {
409
- abortSignal: params.abortSignal,
410
- opinionMining: params.includeOpinionMining,
411
- includeStatistics: params.includeStatistics,
412
- modelVersion: params.modelVersion,
413
- requestOptions: params.requestOptions,
414
- stringIndexType: setStrEncodingParamValue(params.stringIndexType),
415
- tracingOptions: params.tracingOptions,
416
- onResponse: params.onResponse,
417
- serializerOptions: params.serializerOptions,
418
- loggingOptOut: params.disableServiceLogs
419
- };
420
- }
421
- /**
422
- * Creates the options the service expects for the recognize pii entities API from the user friendly ones.
423
- * @param params - the user friendly parameters
424
- * @internal
425
- */
426
- function makeGeneratedRecognizePiiEntitiesOptions(params) {
427
- return {
428
- abortSignal: params.abortSignal,
429
- domain: params.domainFilter,
430
- includeStatistics: params.includeStatistics,
431
- modelVersion: params.modelVersion,
432
- requestOptions: params.requestOptions,
433
- stringIndexType: setStrEncodingParamValue(params.stringIndexType),
434
- tracingOptions: params.tracingOptions,
435
- piiCategories: params.categoriesFilter,
436
- onResponse: params.onResponse,
437
- serializerOptions: params.serializerOptions,
438
- loggingOptOut: params.disableServiceLogs
439
- };
440
- }
441
- /**
442
- * Creates the options the service expects for the recognize entities API from the user friendly ones.
443
- * @param params - the user friendly parameters
444
- * @internal
445
- */
446
- function makeGeneratedRecognizeCategorizedEntitiesOptions(params) {
447
- return {
448
- abortSignal: params.abortSignal,
449
- includeStatistics: params.includeStatistics,
450
- modelVersion: params.modelVersion,
451
- requestOptions: params.requestOptions,
452
- stringIndexType: setStrEncodingParamValue(params.stringIndexType),
453
- tracingOptions: params.tracingOptions,
454
- onResponse: params.onResponse,
455
- serializerOptions: params.serializerOptions,
456
- loggingOptOut: params.disableServiceLogs
457
- };
458
- }
459
- /**
460
- * Creates the options the service expects for the detect language API from the user friendly ones.
461
- * @param params - the user friendly parameters
462
- * @internal
463
- */
464
- function makeGeneratedDetectLanguageOptions(params) {
465
- return {
466
- abortSignal: params.abortSignal,
467
- includeStatistics: params.includeStatistics,
468
- modelVersion: params.modelVersion,
469
- requestOptions: params.requestOptions,
470
- tracingOptions: params.tracingOptions,
471
- onResponse: params.onResponse,
472
- serializerOptions: params.serializerOptions,
473
- loggingOptOut: params.disableServiceLogs
474
- };
475
- }
476
- /**
477
- * Creates the options the service expects for the extract key phrases API from the user friendly ones.
478
- * @param params - the user friendly parameters
479
- * @internal
480
- */
481
- function makeGeneratedExtractKeyPhrasesOptions(params) {
482
- return {
483
- abortSignal: params.abortSignal,
484
- includeStatistics: params.includeStatistics,
485
- modelVersion: params.modelVersion,
486
- requestOptions: params.requestOptions,
487
- tracingOptions: params.tracingOptions,
488
- onResponse: params.onResponse,
489
- serializerOptions: params.serializerOptions,
490
- loggingOptOut: params.disableServiceLogs
491
- };
492
- }
493
- /**
494
- * Creates the options the service expects for the recognize linked entities API from the user friendly ones.
495
- * @param params - the user friendly parameters
496
- * @internal
497
- */
498
- function makeGeneratedRecognizeLinkingEntitiesOptions(params) {
499
- return {
500
- abortSignal: params.abortSignal,
501
- includeStatistics: params.includeStatistics,
502
- modelVersion: params.modelVersion,
503
- requestOptions: params.requestOptions,
504
- tracingOptions: params.tracingOptions,
505
- onResponse: params.onResponse,
506
- serializerOptions: params.serializerOptions,
507
- loggingOptOut: params.disableServiceLogs,
508
- stringIndexType: setStrEncodingParamValue(params.stringIndexType)
509
- };
510
- }
511
- //# sourceMappingURL=textAnalyticsClient.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"textAnalyticsClient.js","sourceRoot":"","sources":["../../src/textAnalyticsClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;AAGlC,OAAO,EAEL,+BAA+B,EAChC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAkC,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrF,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAalC,OAAO,EAEL,6BAA6B,EAC9B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAEL,2CAA2C,EAC5C,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAEL,+BAA+B,EAChC,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,gCAAgC,EAEjC,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAEL,mCAAmC,EACpC,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAEL,sCAAsC,EACvC,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,qCAAqC,EAAE,MAAM,4BAA4B,CAAC;AACnF,OAAO,EACL,eAAe,EACf,OAAO,EACP,YAAY,EACZ,mBAAmB,EACnB,gBAAgB,EAChB,UAAU,EACV,gBAAgB,EAChB,mBAAmB,EACnB,wBAAwB,EAEzB,MAAM,QAAQ,CAAC;AAIhB,OAAO,EAIL,SAAS,EACT,YAAY,EACZ,mBAAmB,EACnB,iBAAiB,EAClB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAIL,UAAU,EAEV,aAAa,EACb,oBAAoB,EACpB,kBAAkB,EACnB,MAAM,cAAc,CAAC;AAgBtB,MAAM,uBAAuB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AE,MAAM,CAAC,WAAW;QAC/B,iBAAiB,EAAE,MAAM,CAAC,iBAAiB;QAC3C,YAAY,EAAE,MAAM,CAAC,YAAY;QACjC,cAAc,EAAE,MAAM,CAAC,cAAc;QACrC,cAAc,EAAE,MAAM,CAAC,cAAc;QACrC,UAAU,EAAE,MAAM,CAAC,UAAU;QAC7B,iBAAiB,EAAE,MAAM,CAAC,iBAAiB;QAC3C,aAAa,EAAE,MAAM,CAAC,kBAAkB;QACxC,eAAe,EAAE,wBAAwB,CAAC,MAAM,CAAC,eAAe,CAAC;KAClE,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { CommonClientOptions } from \"@azure/core-client\";\nimport {\n InternalPipelineOptions,\n bearerTokenAuthenticationPolicy\n} from \"@azure/core-rest-pipeline\";\nimport { TokenCredential, KeyCredential, isTokenCredential } from \"@azure/core-auth\";\nimport { GeneratedClient } from \"./generated/generatedClient\";\nimport { logger } from \"./logger\";\nimport {\n JobManifestTasks as GeneratedActions,\n DetectLanguageInput,\n GeneratedClientEntitiesRecognitionPiiOptionalParams as GeneratedRecognizePiiEntitiesOptions,\n GeneratedClientSentimentOptionalParams as GeneratedAnalyzeSentimentOptions,\n GeneratedClientEntitiesRecognitionGeneralOptionalParams as GeneratedRecognizeCategorizedEntitiesOptions,\n GeneratedClientEntitiesLinkingOptionalParams as GeneratedRecognizeLinkedEntitiesOptions,\n GeneratedClientKeyPhrasesOptionalParams as GeneratedExtractKeyPhrasesOptions,\n GeneratedClientLanguagesOptionalParams as GeneratedDetectLanguageOptions,\n TextDocumentInput,\n PiiCategory\n} from \"./generated/models\";\nimport {\n DetectLanguageResultArray,\n makeDetectLanguageResultArray\n} from \"./detectLanguageResultArray\";\nimport {\n RecognizeCategorizedEntitiesResultArray,\n makeRecognizeCategorizedEntitiesResultArray\n} from \"./recognizeCategorizedEntitiesResultArray\";\nimport {\n AnalyzeSentimentResultArray,\n makeAnalyzeSentimentResultArray\n} from \"./analyzeSentimentResultArray\";\nimport {\n makeExtractKeyPhrasesResultArray,\n ExtractKeyPhrasesResultArray\n} from \"./extractKeyPhrasesResultArray\";\nimport {\n RecognizePiiEntitiesResultArray,\n makeRecognizePiiEntitiesResultArray\n} from \"./recognizePiiEntitiesResultArray\";\nimport {\n RecognizeLinkedEntitiesResultArray,\n makeRecognizeLinkedEntitiesResultArray\n} from \"./recognizeLinkedEntitiesResultArray\";\nimport { createSpan } from \"./tracing\";\nimport { SpanStatusCode } from \"@azure/core-tracing\";\nimport { textAnalyticsAzureKeyCredentialPolicy } from \"./azureKeyCredentialPolicy\";\nimport {\n addParamsToTask,\n compose,\n compileError,\n setCategoriesFilter,\n setOpinionMining,\n setOrderBy,\n setSentenceCount,\n setStrEncodingParam,\n setStrEncodingParamValue,\n StringIndexType\n} from \"./util\";\nimport { TextAnalyticsOperationOptions } from \"./textAnalyticsOperationOptions\";\nimport { AnalysisPollOperationState, OperationMetadata } from \"./pollerModels\";\nimport { CustomTextAnalyticsAction, TextAnalyticsAction } from \"./textAnalyticsAction\";\nimport {\n AnalyzeHealthcareEntitiesPollerLike,\n AnalyzeHealthcareOperationState,\n BeginAnalyzeHealthcareEntitiesOptions,\n HealthLro,\n isHealthDone,\n processHealthResult,\n updateHealthState\n} from \"./healthLro\";\nimport { LroEngine } from \"@azure/core-lro\";\nimport { PagedAnalyzeHealthcareEntitiesResult } from \"./analyzeHealthcareEntitiesResult\";\nimport {\n AnalyzeActionsOperationMetadata,\n AnalyzeActionsOperationState,\n AnalyzeActionsPollerLike,\n AnalyzeLro,\n BeginAnalyzeActionsOptions,\n isAnalyzeDone,\n processAnalyzeResult,\n updateAnalyzeState\n} from \"./analyzeLro\";\nimport { PagedAnalyzeActionsResult } from \"./analyzeActionsResult\";\n\nexport {\n BeginAnalyzeActionsOptions,\n AnalyzeActionsPollerLike,\n AnalyzeActionsOperationState,\n BeginAnalyzeHealthcareEntitiesOptions,\n AnalyzeHealthcareEntitiesPollerLike,\n AnalyzeHealthcareOperationState,\n AnalysisPollOperationState,\n OperationMetadata,\n AnalyzeActionsOperationMetadata,\n StringIndexType\n};\n\nconst DEFAULT_COGNITIVE_SCOPE = \"https://cognitiveservices.azure.com/.default\";\n\n/**\n * Client options used to configure TextAnalytics API requests.\n */\nexport interface TextAnalyticsClientOptions extends CommonClientOptions {\n /**\n * The default country hint to use. Defaults to \"us\".\n */\n defaultCountryHint?: string;\n\n /**\n * The default language to use. Defaults to \"en\".\n */\n defaultLanguage?: string;\n}\n\n/**\n * Options for the detect languages operation.\n */\nexport interface DetectLanguageOptions extends TextAnalyticsOperationOptions {}\n\n/**\n * Options for the recognize entities operation.\n */\nexport interface RecognizeCategorizedEntitiesOptions extends TextAnalyticsOperationOptions {\n /**\n * Specifies the measurement unit used to calculate the offset and length properties.\n * Possible units are \"TextElements_v8\", \"UnicodeCodePoint\", and \"Utf16CodeUnit\".\n * The default is the JavaScript's default which is \"Utf16CodeUnit\".\n */\n stringIndexType?: StringIndexType;\n}\n\n/**\n * Options for the analyze sentiment operation.\n */\nexport interface AnalyzeSentimentOptions extends TextAnalyticsOperationOptions {\n /**\n * Whether to mine the opinions of a sentence and conduct more granular\n * analysis around the aspects of a product or service (also known as\n * aspect-based sentiment analysis). If set to true, the returned\n * `SentenceSentiment` objects will have property `opinions` containing\n * the result of this analysis.\n * More information about the feature can be found here: {@link https://docs.microsoft.com/azure/cognitive-services/text-analytics/how-tos/text-analytics-how-to-sentiment-analysis?tabs=version-3-1#opinion-mining}\n */\n includeOpinionMining?: boolean;\n /**\n * Specifies the measurement unit used to calculate the offset and length properties.\n * Possible units are \"TextElements_v8\", \"UnicodeCodePoint\", and \"Utf16CodeUnit\".\n * The default is the JavaScript's default which is \"Utf16CodeUnit\".\n */\n stringIndexType?: StringIndexType;\n}\n\n/**\n * The types of PII domains the user can choose from.\n */\nexport enum PiiEntityDomain {\n /**\n * @see {@link https://aka.ms/tanerpii} for more information.\n */\n PROTECTED_HEALTH_INFORMATION = \"PHI\"\n}\n\n/**\n * Options for the recognize PII entities operation.\n */\nexport interface RecognizePiiEntitiesOptions extends TextAnalyticsOperationOptions {\n /**\n * Filters entities to ones only included in the specified domain (e.g., if\n * set to 'PHI', entities in the Protected Healthcare Information domain will\n * only be returned). @see {@link https://aka.ms/tanerpii} for more information.\n */\n domainFilter?: PiiEntityDomain;\n /**\n * Specifies the measurement unit used to calculate the offset and length properties.\n * Possible units are \"TextElements_v8\", \"UnicodeCodePoint\", and \"Utf16CodeUnit\".\n * The default is the JavaScript's default which is \"Utf16CodeUnit\".\n */\n stringIndexType?: StringIndexType;\n /**\n * Filters entities to ones only included in the specified array of categories\n */\n categoriesFilter?: PiiCategory[];\n}\n\n/**\n * Options for the extract key phrases operation.\n */\nexport interface ExtractKeyPhrasesOptions extends TextAnalyticsOperationOptions {}\n\n/**\n * Options for the recognize linked entities operation.\n */\nexport interface RecognizeLinkedEntitiesOptions extends TextAnalyticsOperationOptions {\n /**\n * Specifies the measurement unit used to calculate the offset and length properties.\n * Possible units are \"TextElements_v8\", \"UnicodeCodePoint\", and \"Utf16CodeUnit\".\n * The default is the JavaScript's default which is \"Utf16CodeUnit\".\n */\n stringIndexType?: StringIndexType;\n}\n\n/**\n * Options for an entities recognition action.\n */\nexport interface RecognizeCategorizedEntitiesAction extends TextAnalyticsAction {\n /**\n * Specifies the measurement unit used to calculate the offset and length properties.\n * Possible units are \"TextElements_v8\", \"UnicodeCodePoint\", and \"Utf16CodeUnit\".\n * The default is the JavaScript's default which is \"Utf16CodeUnit\".\n */\n stringIndexType?: StringIndexType;\n /**\n * If set to true, you opt-out of having your text input logged for troubleshooting. By default, Text Analytics\n * logs your input text for 48 hours, solely to allow for troubleshooting issues. Setting this parameter to true,\n * disables input logging and may limit our ability to remediate issues that occur.\n */\n disableServiceLogs?: boolean;\n}\n\n/**\n * Options for a Pii entities recognition action.\n */\nexport interface RecognizePiiEntitiesAction extends TextAnalyticsAction {\n /**\n * Filters entities to ones only included in the specified domain (e.g., if\n * set to 'PHI', entities in the Protected Healthcare Information domain will\n * only be returned). @see {@link https://aka.ms/tanerpii} for more information.\n */\n domainFilter?: PiiEntityDomain;\n /**\n * Filters entities to ones only included in the specified array of categories\n */\n categoriesFilter?: PiiCategory[];\n /**\n * Specifies the measurement unit used to calculate the offset and length properties.\n * Possible units are \"TextElements_v8\", \"UnicodeCodePoint\", and \"Utf16CodeUnit\".\n * The default is the JavaScript's default which is \"Utf16CodeUnit\".\n */\n stringIndexType?: StringIndexType;\n /**\n * If set to false, you opt-in to have your text input logged for troubleshooting. By default, Text Analytics\n * will not log your input text for pii entities recognition. Setting this parameter to false,\n * enables input logging.\n */\n disableServiceLogs?: boolean;\n}\n\n/**\n * Options for a key phrases recognition action.\n */\nexport interface ExtractKeyPhrasesAction extends TextAnalyticsAction {\n /**\n * If set to false, you opt-in to have your text input logged for troubleshooting. By default, Text Analytics\n * will not log your input text for pii entities recognition. Setting this parameter to false,\n * enables input logging.\n */\n disableServiceLogs?: boolean;\n}\n\n/**\n * Options for an entities linking action.\n */\nexport interface RecognizeLinkedEntitiesAction extends TextAnalyticsAction {\n /**\n * Specifies the measurement unit used to calculate the offset and length properties.\n * Possible units are \"TextElements_v8\", \"UnicodeCodePoint\", and \"Utf16CodeUnit\".\n * The default is the JavaScript's default which is \"Utf16CodeUnit\".\n */\n stringIndexType?: StringIndexType;\n /**\n * If set to true, you opt-out of having your text input logged for troubleshooting. By default, Text Analytics\n * logs your input text for 48 hours, solely to allow for troubleshooting issues. Setting this parameter to true,\n * disables input logging and may limit our ability to remediate issues that occur.\n */\n disableServiceLogs?: boolean;\n}\n\n/**\n * Options for an analyze sentiment action.\n */\nexport interface AnalyzeSentimentAction extends TextAnalyticsAction {\n /**\n * Specifies the measurement unit used to calculate the offset and length properties.\n * Possible units are \"TextElements_v8\", \"UnicodeCodePoint\", and \"Utf16CodeUnit\".\n * The default is the JavaScript's default which is \"Utf16CodeUnit\".\n */\n stringIndexType?: StringIndexType;\n /**\n * If set to true, you opt-out of having your text input logged for troubleshooting. By default, Text Analytics\n * logs your input text for 48 hours, solely to allow for troubleshooting issues. Setting this parameter to true,\n * disables input logging and may limit our ability to remediate issues that occur.\n */\n disableServiceLogs?: boolean;\n /**\n * Whether to mine the opinions of a sentence and conduct more granular\n * analysis around the aspects of a product or service (also known as\n * aspect-based sentiment analysis). If set to true, the returned\n * `SentenceSentiment` objects will have property `opinions` containing\n * the result of this analysis.\n * More information about the feature can be found here: {@link https://docs.microsoft.com/azure/cognitive-services/text-analytics/how-tos/text-analytics-how-to-sentiment-analysis?tabs=version-3-1#opinion-mining}\n */\n includeOpinionMining?: boolean;\n}\n\n/**\n * A type representing how to sort sentences for the summarization extraction action.\n */\nexport type KnownSummarySentencesSortBy = \"Offset\" | \"Rank\";\n\n/**\n * Options for an extract summary action.\n */\nexport interface ExtractSummaryAction extends TextAnalyticsAction {\n /**\n * Specifies the measurement unit used to calculate the offset and length properties.\n * Possible units are \"TextElements_v8\", \"UnicodeCodePoint\", and \"Utf16CodeUnit\".\n * The default is the JavaScript's default which is \"Utf16CodeUnit\".\n */\n stringIndexType?: StringIndexType;\n /**\n * If set to true, you opt-out of having your text input logged for troubleshooting. By default, Text Analytics\n * logs your input text for 48 hours, solely to allow for troubleshooting issues. Setting this parameter to true,\n * disables input logging and may limit our ability to remediate issues that occur.\n */\n disableServiceLogs?: boolean;\n /**\n * Specifies the number of summary sentences to return. The default number of sentences is 3.\n */\n maxSentenceCount?: number;\n /**\n * Specifies how to sort the returned sentences. Please refer to {@link KnownSummarySentencesOrderBy} for possible values.\n */\n orderBy?: string;\n}\n\n/**\n * Options for a custom recognize entities action. For more information, please refer\n * to the service documentation: {@link https://aka.ms/azsdk/textanalytics/customentityrecognition}\n */\nexport interface RecognizeCustomEntitiesAction extends CustomTextAnalyticsAction {\n /**\n * Specifies the measurement unit used to calculate the offset and length properties.\n * Possible units are \"TextElements_v8\", \"UnicodeCodePoint\", and \"Utf16CodeUnit\".\n * The default is the JavaScript's default which is \"Utf16CodeUnit\".\n */\n stringIndexType?: StringIndexType;\n /**\n * If set to true, you opt-out of having your text input logged for troubleshooting. By default, Text Analytics\n * logs your input text for 48 hours, solely to allow for troubleshooting issues. Setting this parameter to true,\n * disables input logging and may limit our ability to remediate issues that occur.\n */\n disableServiceLogs?: boolean;\n}\n\n/**\n * Options for an custom classify document single category action. For more information, please refer\n * to the service documentation: {@link https://aka.ms/azsdk/textanalytics/customfunctionalities}\n */\nexport interface SingleCategoryClassifyAction extends CustomTextAnalyticsAction {\n /**\n * If set to true, you opt-out of having your text input logged for troubleshooting. By default, Text Analytics\n * logs your input text for 48 hours, solely to allow for troubleshooting issues. Setting this parameter to true,\n * disables input logging and may limit our ability to remediate issues that occur.\n */\n disableServiceLogs?: boolean;\n}\n\n/**\n * Options for a custom classify document multi categories action. For more information, please refer\n * to the service documentation: {@link https://aka.ms/azsdk/textanalytics/customfunctionalities}\n */\nexport interface MultiCategoryClassifyAction extends CustomTextAnalyticsAction {\n /**\n * If set to true, you opt-out of having your text input logged for troubleshooting. By default, Text Analytics\n * logs your input text for 48 hours, solely to allow for troubleshooting issues. Setting this parameter to true,\n * disables input logging and may limit our ability to remediate issues that occur.\n */\n disableServiceLogs?: boolean;\n}\n\n/**\n * Description of collection of actions for the analyze API to perform on input documents.\n */\nexport interface TextAnalyticsActions {\n /**\n * A collection of descriptions of entities recognition actions.\n */\n recognizeEntitiesActions?: RecognizeCategorizedEntitiesAction[];\n /**\n * A collection of descriptions of Pii entities recognition actions.\n */\n recognizePiiEntitiesActions?: RecognizePiiEntitiesAction[];\n /**\n * A collection of descriptions of key phrases recognition actions.\n */\n extractKeyPhrasesActions?: ExtractKeyPhrasesAction[];\n /**\n * A collection of descriptions of entities linking actions.\n */\n recognizeLinkedEntitiesActions?: RecognizeLinkedEntitiesAction[];\n /**\n * A collection of descriptions of sentiment analysis actions.\n */\n analyzeSentimentActions?: AnalyzeSentimentAction[];\n /**\n * A collection of descriptions of summarization extraction actions.\n */\n extractSummaryActions?: ExtractSummaryAction[];\n /**\n * A collection of descriptions of custom entity recognition actions. For more information, please refer\n * to the service documentation: {@link https://aka.ms/azsdk/textanalytics/customentityrecognition}\n */\n recognizeCustomEntitiesActions?: RecognizeCustomEntitiesAction[];\n /**\n * A collection of descriptions of custom single classification actions. For more information, please refer\n * to the service documentation: {@link https://aka.ms/azsdk/textanalytics/customfunctionalities}\n */\n singleCategoryClassifyActions?: SingleCategoryClassifyAction[];\n /**\n * A collection of descriptions of custom multi classification actions. For more information, please refer\n * to the service documentation: {@link https://aka.ms/azsdk/textanalytics/customfunctionalities}\n */\n multiCategoryClassifyActions?: MultiCategoryClassifyAction[];\n}\n/**\n * Client class for interacting with Azure Text Analytics.\n */\nexport class TextAnalyticsClient {\n /**\n * The URL to the TextAnalytics endpoint\n */\n public readonly endpointUrl: string;\n\n /**\n * The default country hint to use. Defaults to \"us\".\n */\n public defaultCountryHint: string;\n\n /**\n * The default language to use. Defaults to \"en\".\n */\n public defaultLanguage: string;\n\n /**\n * @internal\n * A reference to the auto-generated TextAnalytics HTTP client.\n */\n private readonly client: GeneratedClient;\n\n /**\n * Creates an instance of TextAnalyticsClient.\n *\n * Example usage:\n * ```ts\n * import { TextAnalyticsClient, AzureKeyCredential } from \"@azure/ai-text-analytics\";\n *\n * const client = new TextAnalyticsClient(\n * \"<service endpoint>\",\n * new AzureKeyCredential(\"<api key>\")\n * );\n * ```\n * @param endpointUrl - The URL to the TextAnalytics endpoint\n * @param credential - Used to authenticate requests to the service.\n * @param options - Used to configure the TextAnalytics client.\n */\n constructor(\n endpointUrl: string,\n credential: TokenCredential | KeyCredential,\n options: TextAnalyticsClientOptions = {}\n ) {\n this.endpointUrl = endpointUrl;\n const { defaultCountryHint = \"us\", defaultLanguage = \"en\", ...pipelineOptions } = options;\n this.defaultCountryHint = defaultCountryHint;\n this.defaultLanguage = defaultLanguage;\n\n const internalPipelineOptions: InternalPipelineOptions = {\n ...pipelineOptions,\n ...{\n loggingOptions: {\n logger: logger.info,\n additionalAllowedHeaderNames: [\"x-ms-correlation-request-id\", \"x-ms-request-id\"]\n }\n }\n };\n\n this.client = new GeneratedClient(this.endpointUrl, internalPipelineOptions);\n\n const authPolicy = isTokenCredential(credential)\n ? bearerTokenAuthenticationPolicy({ credential, scopes: DEFAULT_COGNITIVE_SCOPE })\n : textAnalyticsAzureKeyCredentialPolicy(credential);\n\n this.client.pipeline.addPolicy(authPolicy);\n }\n\n /**\n * Runs a predictive model to determine the language that the passed-in\n * input strings are written in, and returns, for each one, the detected\n * language as well as a score indicating the model's confidence that the\n * inferred language is correct. Scores close to 1 indicate high certainty in\n * the result. 120 languages are supported.\n * @param documents - A collection of input strings to analyze.\n * @param countryHint - Indicates the country of origin for all of\n * the input strings to assist the text analytics model in predicting\n * the language they are written in. If unspecified, this value will be\n * set to the default country hint in `TextAnalyticsClientOptions`.\n * If set to an empty string, or the string \"none\", the service will apply a\n * model where the country is explicitly unset.\n * The same country hint is applied to all strings in the input collection.\n * @param options - Optional parameters for the operation.\n */\n public async detectLanguage(\n documents: string[],\n countryHint?: string,\n options?: DetectLanguageOptions\n ): Promise<DetectLanguageResultArray>;\n /**\n * Runs a predictive model to determine the language that the passed-in\n * input document are written in, and returns, for each one, the detected\n * language as well as a score indicating the model's confidence that the\n * inferred language is correct. Scores close to 1 indicate high certainty in\n * the result. 120 languages are supported.\n * @param documents - A collection of input documents to analyze.\n * @param options - Optional parameters for the operation.\n */\n public async detectLanguage(\n documents: DetectLanguageInput[],\n options?: DetectLanguageOptions\n ): Promise<DetectLanguageResultArray>;\n public async detectLanguage(\n documents: string[] | DetectLanguageInput[],\n countryHintOrOptions?: string | DetectLanguageOptions,\n options?: DetectLanguageOptions\n ): Promise<DetectLanguageResultArray> {\n let realOptions: DetectLanguageOptions;\n let realInputs: DetectLanguageInput[];\n\n if (!Array.isArray(documents) || documents.length === 0) {\n throw new Error(\"'documents' must be a non-empty array\");\n }\n\n if (isStringArray(documents)) {\n const countryHint = (countryHintOrOptions as string) || this.defaultCountryHint;\n realInputs = convertToDetectLanguageInput(documents, countryHint);\n realOptions = options || {};\n } else {\n // Replace \"none\" hints with \"\"\n realInputs = documents.map((input) => ({\n ...input,\n countryHint: input.countryHint === \"none\" ? \"\" : input.countryHint\n }));\n realOptions = (countryHintOrOptions as DetectLanguageOptions) || {};\n }\n\n const { span, updatedOptions: finalOptions } = createSpan(\n \"TextAnalyticsClient-detectLanguages\",\n makeGeneratedDetectLanguageOptions(realOptions)\n );\n\n try {\n const result = await this.client.languages(\n {\n documents: realInputs\n },\n finalOptions\n );\n\n return makeDetectLanguageResultArray(realInputs, result);\n } catch (e) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: e.message\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Runs a predictive model to identify a collection of named entities\n * in the passed-in input strings, and categorize those entities into types\n * such as person, location, or organization. For more information on \n * available categories, @see\n * {@link https://docs.microsoft.com/azure/cognitive-services/Text-Analytics/named-entity-types}.\n * For a list of languages supported by this operation, @see\n * {@link https://docs.microsoft.com/azure/cognitive-services/text-analytics/language-support}.\n * @param documents - The input strings to analyze.\n * @param language - The language that all the input strings are\n written in. If unspecified, this value will be set to the default\n language in `TextAnalyticsClientOptions`. \n If set to an empty string, the service will apply a model\n where the language is explicitly set to \"None\".\n * @param options - Optional parameters for the operation.\n */\n public async recognizeEntities(\n documents: string[],\n language?: string,\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n options?: RecognizeCategorizedEntitiesOptions\n ): Promise<RecognizeCategorizedEntitiesResultArray>;\n /**\n * Runs a predictive model to identify a collection of named entities\n * in the passed-in input documents, and categorize those entities into types\n * such as person, location, or organization. For more information on\n * available categories, @see\n * {@link https://docs.microsoft.com/azure/cognitive-services/Text-Analytics/named-entity-types}.\n * For a list of languages supported by this operation, @see\n * {@link https://docs.microsoft.com/azure/cognitive-services/text-analytics/language-support}.\n * @param documents - The input documents to analyze.\n * @param options - Optional parameters for the operation.\n */\n public async recognizeEntities(\n documents: TextDocumentInput[],\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n options?: RecognizeCategorizedEntitiesOptions\n ): Promise<RecognizeCategorizedEntitiesResultArray>;\n public async recognizeEntities(\n documents: string[] | TextDocumentInput[],\n languageOrOptions?: string | RecognizeCategorizedEntitiesOptions,\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n options?: RecognizeCategorizedEntitiesOptions\n ): Promise<RecognizeCategorizedEntitiesResultArray> {\n let realOptions: RecognizeCategorizedEntitiesOptions;\n let realInputs: TextDocumentInput[];\n\n if (!Array.isArray(documents) || documents.length === 0) {\n throw new Error(\"'documents' must be a non-empty array\");\n }\n\n if (isStringArray(documents)) {\n const language = (languageOrOptions as string) || this.defaultLanguage;\n realInputs = convertToTextDocumentInput(documents, language);\n realOptions = options || {};\n } else {\n realInputs = documents;\n realOptions = (languageOrOptions as RecognizeCategorizedEntitiesOptions) || {};\n }\n\n const { span, updatedOptions: finalOptions } = createSpan(\n \"TextAnalyticsClient-recognizeEntities\",\n makeGeneratedRecognizeCategorizedEntitiesOptions(realOptions)\n );\n\n try {\n const result = await this.client.entitiesRecognitionGeneral(\n {\n documents: realInputs\n },\n finalOptions\n );\n\n return makeRecognizeCategorizedEntitiesResultArray(realInputs, result);\n } catch (e) {\n /**\n * This special logic handles REST exception with code\n * InvalidDocumentBatch and is needed to maintain backward compatability\n * with sdk v5.0.0 and earlier. In general, REST exceptions are thrown as\n * is and include both outer and inner exception codes. However, the\n * earlier versions were throwing an exception that included the inner\n * code only.\n */\n const backwardCompatibleException = compileError(e);\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: backwardCompatibleException.message\n });\n throw backwardCompatibleException;\n } finally {\n span.end();\n }\n }\n\n /**\n * Runs a predictive model to identify the positive, negative, neutral, or mixed\n * sentiment contained in the input strings, as well as scores indicating\n * the model's confidence in each of the predicted sentiments. Optionally it\n * can also identify targets in the text and assessments about it through\n * opinion mining. For a list of languages supported by this operation, @see\n * {@link https://docs.microsoft.com/azure/cognitive-services/text-analytics/language-support}.\n * @param documents - The input strings to analyze.\n * @param language - The language that all the input strings are\n written in. If unspecified, this value will be set to the default\n language in `TextAnalyticsClientOptions`. \n If set to an empty string, the service will apply a model\n where the lanuage is explicitly set to \"None\".\n * @param options - Optional parameters that includes enabling opinion mining.\n */\n public async analyzeSentiment(\n documents: string[],\n language?: string,\n options?: AnalyzeSentimentOptions\n ): Promise<AnalyzeSentimentResultArray>;\n /**\n * Runs a predictive model to identify the positive, negative or neutral, or mixed\n * sentiment contained in the input documents, as well as scores indicating\n * the model's confidence in each of the predicted sentiments.Optionally it\n * can also identify targets in the text and assessments about it through\n * opinion mining. For a list of languages supported by this operation, @see\n * {@link https://docs.microsoft.com/azure/cognitive-services/text-analytics/language-support}.\n * @param documents - The input documents to analyze.\n * @param options - Optional parameters that includes enabling opinion mining.\n */\n public async analyzeSentiment(\n documents: TextDocumentInput[],\n options?: AnalyzeSentimentOptions\n ): Promise<AnalyzeSentimentResultArray>;\n public async analyzeSentiment(\n documents: string[] | TextDocumentInput[],\n languageOrOptions?: string | AnalyzeSentimentOptions,\n options?: AnalyzeSentimentOptions\n ): Promise<AnalyzeSentimentResultArray> {\n let realOptions: AnalyzeSentimentOptions;\n let realInputs: TextDocumentInput[];\n\n if (!Array.isArray(documents) || documents.length === 0) {\n throw new Error(\"'documents' must be a non-empty array\");\n }\n\n if (isStringArray(documents)) {\n const language = (languageOrOptions as string) || this.defaultLanguage;\n realInputs = convertToTextDocumentInput(documents, language);\n realOptions = options || {};\n } else {\n realInputs = documents;\n realOptions = (languageOrOptions as AnalyzeSentimentOptions) || {};\n }\n\n const { span, updatedOptions: finalOptions } = createSpan(\n \"TextAnalyticsClient-analyzeSentiment\",\n makeGeneratedAnalyzeSentimentOptions(realOptions)\n );\n\n try {\n const result = await this.client.sentiment(\n {\n documents: realInputs\n },\n finalOptions\n );\n\n return makeAnalyzeSentimentResultArray(realInputs, result);\n } catch (e) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: e.message\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Runs a model to identify a collection of significant phrases\n * found in the passed-in input strings.\n * For a list of languages supported by this operation, @see\n * {@link https://docs.microsoft.com/azure/cognitive-services/text-analytics/language-support}.\n * @param documents - The input strings to analyze.\n * @param language - The language that all the input strings are\n written in. If unspecified, this value will be set to the default\n language in `TextAnalyticsClientOptions`. \n If set to an empty string, the service will apply a model\n where the language is explicitly set to \"None\".\n * @param options - Options for the operation.\n */\n public async extractKeyPhrases(\n documents: string[],\n language?: string,\n options?: ExtractKeyPhrasesOptions\n ): Promise<ExtractKeyPhrasesResultArray>;\n /**\n * Runs a model to identify a collection of significant phrases\n * found in the passed-in input documents.\n * For a list of languages supported by this operation, @see\n * {@link https://docs.microsoft.com/azure/cognitive-services/text-analytics/language-support}.\n * @param documents - The input documents to analyze.\n * @param options - Options for the operation.\n */\n public async extractKeyPhrases(\n documents: TextDocumentInput[],\n options?: ExtractKeyPhrasesOptions\n ): Promise<ExtractKeyPhrasesResultArray>;\n public async extractKeyPhrases(\n documents: string[] | TextDocumentInput[],\n languageOrOptions?: string | ExtractKeyPhrasesOptions,\n options?: ExtractKeyPhrasesOptions\n ): Promise<ExtractKeyPhrasesResultArray> {\n let realOptions: ExtractKeyPhrasesOptions;\n let realInputs: TextDocumentInput[];\n\n if (!Array.isArray(documents) || documents.length === 0) {\n throw new Error(\"'documents' must be a non-empty array\");\n }\n\n if (isStringArray(documents)) {\n const language = (languageOrOptions as string) || this.defaultLanguage;\n realInputs = convertToTextDocumentInput(documents, language);\n realOptions = options || {};\n } else {\n realInputs = documents;\n realOptions = (languageOrOptions as ExtractKeyPhrasesOptions) || {};\n }\n\n const { span, updatedOptions: finalOptions } = createSpan(\n \"TextAnalyticsClient-extractKeyPhrases\",\n makeGeneratedExtractKeyPhrasesOptions(realOptions)\n );\n\n try {\n const result = await this.client.keyPhrases(\n {\n documents: realInputs\n },\n finalOptions\n );\n\n return makeExtractKeyPhrasesResultArray(realInputs, result);\n } catch (e) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: e.message\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Runs a predictive model to identify a collection of entities containing\n * personally identifiable information found in the passed-in input strings,\n * and categorize those entities into types such as US social security\n * number, drivers license number, or credit card number.\n * For a list of languages supported by this operation, @see\n * {@link https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/language-support}.\n * @param inputs - The input strings to analyze.\n * @param language - The language that all the input strings are\n written in. If unspecified, this value will be set to the default\n language in `TextAnalyticsClientOptions`. \n If set to an empty string, the service will apply a model\n where the language is explicitly set to \"None\".\n * @param options - Options for the operation.\n */\n public async recognizePiiEntities(\n inputs: string[],\n language?: string,\n options?: RecognizePiiEntitiesOptions\n ): Promise<RecognizePiiEntitiesResultArray>;\n /**\n * Runs a predictive model to identify a collection of entities containing\n * personally identifiable information found in the passed-in input documents,\n * and categorize those entities into types such as US social security\n * number, drivers license number, or credit card number.\n * For a list of languages supported by this operation, @see\n * {@link https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/language-support}.\n * @param inputs - The input documents to analyze.\n * @param options - Optional parameters for the operation.\n */\n public async recognizePiiEntities(\n inputs: TextDocumentInput[],\n options?: RecognizePiiEntitiesOptions\n ): Promise<RecognizePiiEntitiesResultArray>;\n public async recognizePiiEntities(\n inputs: string[] | TextDocumentInput[],\n languageOrOptions?: string | RecognizePiiEntitiesOptions,\n options?: RecognizePiiEntitiesOptions\n ): Promise<RecognizePiiEntitiesResultArray> {\n let realOptions: RecognizePiiEntitiesOptions;\n let realInputs: TextDocumentInput[];\n\n if (isStringArray(inputs)) {\n const language = (languageOrOptions as string) || this.defaultLanguage;\n realInputs = convertToTextDocumentInput(inputs, language);\n realOptions = options || {};\n } else {\n realInputs = inputs;\n realOptions = (languageOrOptions as RecognizePiiEntitiesOptions) || {};\n }\n\n const { span, updatedOptions: finalOptions } = createSpan(\n \"TextAnalyticsClient-recognizePiiEntities\",\n makeGeneratedRecognizePiiEntitiesOptions(realOptions)\n );\n\n try {\n const result = await this.client.entitiesRecognitionPii(\n {\n documents: realInputs\n },\n finalOptions\n );\n\n return makeRecognizePiiEntitiesResultArray(realInputs, result);\n } catch (e) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: e.message\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Runs a predictive model to identify a collection of entities\n * found in the passed-in input strings, and include information linking the\n * entities to their corresponding entries in a well-known knowledge base.\n * For a list of languages supported by this operation, @see\n * {@link https://docs.microsoft.com/azure/cognitive-services/text-analytics/language-support}.\n * @param documents - The input strings to analyze.\n * @param language - The language that all the input strings are\n written in. If unspecified, this value will be set to the default\n language in `TextAnalyticsClientOptions`. \n If set to an empty string, the service will apply a model\n where the language is explicitly set to \"None\".\n * @param options - Options for the operation.\n */\n public async recognizeLinkedEntities(\n documents: string[],\n language?: string,\n options?: RecognizeLinkedEntitiesOptions\n ): Promise<RecognizeLinkedEntitiesResultArray>;\n /**\n * Runs a predictive model to identify a collection of entities\n * found in the passed-in input documents, and include information linking the\n * entities to their corresponding entries in a well-known knowledge base.\n * For a list of languages supported by this operation, @see\n * {@link https://docs.microsoft.com/azure/cognitive-services/text-analytics/language-support}.\n * @param documents - The input documents to analyze.\n * @param options - Options for the operation.\n */\n public async recognizeLinkedEntities(\n documents: TextDocumentInput[],\n options?: RecognizeLinkedEntitiesOptions\n ): Promise<RecognizeLinkedEntitiesResultArray>;\n public async recognizeLinkedEntities(\n documents: string[] | TextDocumentInput[],\n languageOrOptions?: string | RecognizeLinkedEntitiesOptions,\n options?: RecognizeLinkedEntitiesOptions\n ): Promise<RecognizeLinkedEntitiesResultArray> {\n let realOptions: RecognizeLinkedEntitiesOptions;\n let realInputs: TextDocumentInput[];\n\n if (!Array.isArray(documents) || documents.length === 0) {\n throw new Error(\"'documents' must be a non-empty array\");\n }\n\n if (isStringArray(documents)) {\n const language = (languageOrOptions as string) || this.defaultLanguage;\n realInputs = convertToTextDocumentInput(documents, language);\n realOptions = options || {};\n } else {\n realInputs = documents;\n realOptions = (languageOrOptions as RecognizeLinkedEntitiesOptions) || {};\n }\n\n const { span, updatedOptions: finalOptions } = createSpan(\n \"TextAnalyticsClient-recognizeLinkedEntities\",\n makeGeneratedRecognizeLinkingEntitiesOptions(realOptions)\n );\n\n try {\n const result = await this.client.entitiesLinking(\n {\n documents: realInputs\n },\n finalOptions\n );\n\n return makeRecognizeLinkedEntitiesResultArray(realInputs, result);\n } catch (e) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: e.message\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Start a healthcare analysis operation to recognize healthcare related entities (drugs, conditions,\n * symptoms, etc) and their relations.\n * @param documents - Collection of documents to analyze.\n * @param language - The language that all the input strings are\n written in. If unspecified, this value will be set to the default\n language in `TextAnalyticsClientOptions`.\n If set to an empty string, the service will apply a model\n where the language is explicitly set to \"None\".\n * @param options - Options for the operation.\n */\n async beginAnalyzeHealthcareEntities(\n documents: string[],\n language?: string,\n options?: BeginAnalyzeHealthcareEntitiesOptions\n ): Promise<AnalyzeHealthcareEntitiesPollerLike>;\n /**\n * Start a healthcare analysis operation to recognize healthcare related entities (drugs, conditions,\n * symptoms, etc) and their relations.\n * @param documents - Collection of documents to analyze.\n * @param options - Options for the operation.\n */\n async beginAnalyzeHealthcareEntities(\n documents: TextDocumentInput[],\n options?: BeginAnalyzeHealthcareEntitiesOptions\n ): Promise<AnalyzeHealthcareEntitiesPollerLike>;\n\n async beginAnalyzeHealthcareEntities(\n documents: string[] | TextDocumentInput[],\n languageOrOptions?: string | BeginAnalyzeHealthcareEntitiesOptions,\n options?: BeginAnalyzeHealthcareEntitiesOptions\n ): Promise<AnalyzeHealthcareEntitiesPollerLike> {\n let realOptions: BeginAnalyzeHealthcareEntitiesOptions;\n let realInputs: TextDocumentInput[];\n if (isStringArray(documents)) {\n const language = (languageOrOptions as string) || this.defaultLanguage;\n realInputs = convertToTextDocumentInput(documents, language);\n realOptions = options || {};\n } else {\n realInputs = documents;\n realOptions = (languageOrOptions as BeginAnalyzeHealthcareEntitiesOptions) || {};\n }\n\n const {\n updateIntervalInMs,\n resumeFrom,\n onResponse,\n disableServiceLogs,\n modelVersion,\n requestOptions,\n serializerOptions,\n abortSignal,\n stringIndexType,\n includeStatistics,\n tracingOptions\n } = realOptions;\n const lro = new HealthLro(\n this.client,\n {\n onResponse,\n requestOptions,\n serializerOptions,\n abortSignal,\n tracingOptions\n },\n { loggingOptOut: disableServiceLogs, stringIndexType, modelVersion },\n { includeStatistics },\n realInputs\n );\n\n const poller = new LroEngine<\n PagedAnalyzeHealthcareEntitiesResult,\n AnalyzeHealthcareOperationState\n >(lro, {\n intervalInMs: updateIntervalInMs,\n resumeFrom: resumeFrom,\n processResult: processHealthResult(this.client, realInputs, {\n onResponse,\n requestOptions,\n serializerOptions,\n abortSignal,\n tracingOptions,\n includeStatistics\n }),\n isDone: isHealthDone,\n updateState: updateHealthState\n });\n\n await poller.poll();\n return poller;\n }\n\n /**\n * Submit a collection of text documents for analysis. Specify one or more unique actions to be executed.\n * @param documents - Collection of documents to analyze\n * @param actions - TextAnalyticsActions to execute.\n * @param language - The language that all the input strings are\n written in. If unspecified, this value will be set to the default\n language in `TextAnalyticsClientOptions`.\n If set to an empty string, the service will apply a model\n where the language is explicitly set to \"None\".\n * @param options - Options for the operation.\n */\n public async beginAnalyzeActions(\n documents: string[],\n actions: TextAnalyticsActions,\n language?: string,\n options?: BeginAnalyzeActionsOptions\n ): Promise<AnalyzeActionsPollerLike>;\n /**\n * Submit a collection of text documents for analysis. Specify one or more unique actions to be executed.\n * @param documents - Collection of documents to analyze\n * @param actions - TextAnalyticsActions to execute.\n * @param options - Options for the operation.\n */\n public async beginAnalyzeActions(\n documents: TextDocumentInput[],\n actions: TextAnalyticsActions,\n options?: BeginAnalyzeActionsOptions\n ): Promise<AnalyzeActionsPollerLike>;\n public async beginAnalyzeActions(\n documents: string[] | TextDocumentInput[],\n actions: TextAnalyticsActions,\n languageOrOptions?: string | BeginAnalyzeActionsOptions,\n options?: BeginAnalyzeActionsOptions\n ): Promise<AnalyzeActionsPollerLike> {\n let realOptions: BeginAnalyzeActionsOptions;\n let realInputs: TextDocumentInput[];\n\n if (!Array.isArray(documents) || documents.length === 0) {\n throw new Error(\"'documents' must be a non-empty array\");\n }\n\n if (isStringArray(documents)) {\n const language = (languageOrOptions as string) || this.defaultLanguage;\n realInputs = convertToTextDocumentInput(documents, language);\n realOptions = options || {};\n } else {\n realInputs = documents;\n realOptions = (languageOrOptions as BeginAnalyzeActionsOptions) || {};\n }\n const compiledActions = compileAnalyzeInput(actions);\n const {\n updateIntervalInMs,\n resumeFrom,\n displayName,\n includeStatistics,\n onResponse,\n requestOptions,\n serializerOptions,\n abortSignal,\n tracingOptions\n } = realOptions;\n const lro = new AnalyzeLro(\n this.client,\n {\n onResponse,\n requestOptions,\n serializerOptions,\n abortSignal,\n tracingOptions\n },\n { displayName },\n { includeStatistics },\n realInputs,\n compiledActions\n );\n\n const poller = new LroEngine<PagedAnalyzeActionsResult, AnalyzeActionsOperationState>(lro, {\n intervalInMs: updateIntervalInMs,\n resumeFrom: resumeFrom,\n processResult: processAnalyzeResult(this.client, realInputs, {\n onResponse,\n requestOptions,\n serializerOptions,\n abortSignal,\n tracingOptions,\n includeStatistics\n }),\n isDone: isAnalyzeDone,\n updateState: updateAnalyzeState\n });\n\n await poller.poll();\n return poller;\n }\n}\n\n/**\n * @internal\n */\nfunction compileAnalyzeInput(actions: TextAnalyticsActions): GeneratedActions {\n return {\n entityRecognitionPiiTasks: actions.recognizePiiEntitiesActions?.map(\n compose(setStrEncodingParam, compose(setCategoriesFilter, addParamsToTask))\n ),\n entityRecognitionTasks: actions.recognizeEntitiesActions?.map(\n compose(setStrEncodingParam, addParamsToTask)\n ),\n keyPhraseExtractionTasks: actions.extractKeyPhrasesActions?.map(addParamsToTask),\n entityLinkingTasks: actions.recognizeLinkedEntitiesActions?.map(\n compose(setStrEncodingParam, addParamsToTask)\n ),\n sentimentAnalysisTasks: actions.analyzeSentimentActions?.map(\n compose(setStrEncodingParam, compose(setOpinionMining, addParamsToTask))\n ),\n extractiveSummarizationTasks: actions.extractSummaryActions?.map(\n compose(setStrEncodingParam, compose(setSentenceCount, compose(setOrderBy, addParamsToTask)))\n ),\n customEntityRecognitionTasks: actions.recognizeCustomEntitiesActions?.map(\n compose(setStrEncodingParam, addParamsToTask)\n ),\n customSingleClassificationTasks: actions.singleCategoryClassifyActions?.map(addParamsToTask),\n customMultiClassificationTasks: actions.multiCategoryClassifyActions?.map(addParamsToTask)\n };\n}\n\nfunction isStringArray(documents: any[]): documents is string[] {\n return typeof documents[0] === \"string\";\n}\n\n/**\n * @internal\n */\nfunction convertToDetectLanguageInput(\n inputs: string[],\n countryHint: string\n): DetectLanguageInput[] {\n if (countryHint === \"none\") {\n countryHint = \"\";\n }\n return inputs.map(\n (text: string, index): DetectLanguageInput => {\n return {\n id: String(index),\n countryHint,\n text\n };\n }\n );\n}\n\n/**\n * @internal\n */\nfunction convertToTextDocumentInput(inputs: string[], language: string): TextDocumentInput[] {\n return inputs.map(\n (text: string, index): TextDocumentInput => {\n return {\n id: String(index),\n language,\n text\n };\n }\n );\n}\n\n/**\n * Creates the options the service expects for the analyze sentiment API from the user friendly ones.\n * @param params - the user friendly parameters\n * @internal\n */\nfunction makeGeneratedAnalyzeSentimentOptions(\n params: AnalyzeSentimentOptions\n): GeneratedAnalyzeSentimentOptions {\n return {\n abortSignal: params.abortSignal,\n opinionMining: params.includeOpinionMining,\n includeStatistics: params.includeStatistics,\n modelVersion: params.modelVersion,\n requestOptions: params.requestOptions,\n stringIndexType: setStrEncodingParamValue(params.stringIndexType),\n tracingOptions: params.tracingOptions,\n onResponse: params.onResponse,\n serializerOptions: params.serializerOptions,\n loggingOptOut: params.disableServiceLogs\n };\n}\n\n/**\n * Creates the options the service expects for the recognize pii entities API from the user friendly ones.\n * @param params - the user friendly parameters\n * @internal\n */\nfunction makeGeneratedRecognizePiiEntitiesOptions(\n params: RecognizePiiEntitiesOptions\n): GeneratedRecognizePiiEntitiesOptions {\n return {\n abortSignal: params.abortSignal,\n domain: params.domainFilter,\n includeStatistics: params.includeStatistics,\n modelVersion: params.modelVersion,\n requestOptions: params.requestOptions,\n stringIndexType: setStrEncodingParamValue(params.stringIndexType),\n tracingOptions: params.tracingOptions,\n piiCategories: params.categoriesFilter,\n onResponse: params.onResponse,\n serializerOptions: params.serializerOptions,\n loggingOptOut: params.disableServiceLogs\n };\n}\n\n/**\n * Creates the options the service expects for the recognize entities API from the user friendly ones.\n * @param params - the user friendly parameters\n * @internal\n */\nfunction makeGeneratedRecognizeCategorizedEntitiesOptions(\n params: RecognizeCategorizedEntitiesOptions\n): GeneratedRecognizeCategorizedEntitiesOptions {\n return {\n abortSignal: params.abortSignal,\n includeStatistics: params.includeStatistics,\n modelVersion: params.modelVersion,\n requestOptions: params.requestOptions,\n stringIndexType: setStrEncodingParamValue(params.stringIndexType),\n tracingOptions: params.tracingOptions,\n onResponse: params.onResponse,\n serializerOptions: params.serializerOptions,\n loggingOptOut: params.disableServiceLogs\n };\n}\n\n/**\n * Creates the options the service expects for the detect language API from the user friendly ones.\n * @param params - the user friendly parameters\n * @internal\n */\nfunction makeGeneratedDetectLanguageOptions(\n params: DetectLanguageOptions\n): GeneratedDetectLanguageOptions {\n return {\n abortSignal: params.abortSignal,\n includeStatistics: params.includeStatistics,\n modelVersion: params.modelVersion,\n requestOptions: params.requestOptions,\n tracingOptions: params.tracingOptions,\n onResponse: params.onResponse,\n serializerOptions: params.serializerOptions,\n loggingOptOut: params.disableServiceLogs\n };\n}\n\n/**\n * Creates the options the service expects for the extract key phrases API from the user friendly ones.\n * @param params - the user friendly parameters\n * @internal\n */\nfunction makeGeneratedExtractKeyPhrasesOptions(\n params: ExtractKeyPhrasesOptions\n): GeneratedExtractKeyPhrasesOptions {\n return {\n abortSignal: params.abortSignal,\n includeStatistics: params.includeStatistics,\n modelVersion: params.modelVersion,\n requestOptions: params.requestOptions,\n tracingOptions: params.tracingOptions,\n onResponse: params.onResponse,\n serializerOptions: params.serializerOptions,\n loggingOptOut: params.disableServiceLogs\n };\n}\n\n/**\n * Creates the options the service expects for the recognize linked entities API from the user friendly ones.\n * @param params - the user friendly parameters\n * @internal\n */\nfunction makeGeneratedRecognizeLinkingEntitiesOptions(\n params: RecognizeLinkedEntitiesOptions\n): GeneratedRecognizeLinkedEntitiesOptions {\n return {\n abortSignal: params.abortSignal,\n includeStatistics: params.includeStatistics,\n modelVersion: params.modelVersion,\n requestOptions: params.requestOptions,\n tracingOptions: params.tracingOptions,\n onResponse: params.onResponse,\n serializerOptions: params.serializerOptions,\n loggingOptOut: params.disableServiceLogs,\n stringIndexType: setStrEncodingParamValue(params.stringIndexType)\n };\n}\n"]}