@azure/ai-language-conversations 1.0.0-beta.1 → 1.0.0-beta.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/LICENSE +4 -4
- package/README.md +15 -11
- package/{types/src → dist/browser}/azureKeyCredentialPolicy.d.ts +2 -2
- package/dist/browser/azureKeyCredentialPolicy.d.ts.map +1 -0
- package/{dist-esm/src → dist/browser}/azureKeyCredentialPolicy.js +1 -1
- package/dist/browser/azureKeyCredentialPolicy.js.map +1 -0
- package/{dist-esm/src → dist/browser}/constants.js +1 -1
- package/{dist-esm/src → dist/browser}/constants.js.map +1 -1
- package/{types/src → dist/browser}/conversationAnalysisClient.d.ts +6 -8
- package/dist/browser/conversationAnalysisClient.d.ts.map +1 -0
- package/{dist-esm/src → dist/browser}/conversationAnalysisClient.js +8 -10
- package/dist/browser/conversationAnalysisClient.js.map +1 -0
- package/{types/src → dist/browser}/generated/conversationAnalysisClient.d.ts +1 -1
- package/dist/browser/generated/conversationAnalysisClient.d.ts.map +1 -0
- package/{dist-esm/src → dist/browser}/generated/conversationAnalysisClient.js +25 -14
- package/{dist-esm/src → dist/browser}/generated/conversationAnalysisClient.js.map +1 -1
- package/dist/browser/generated/index.d.ts +3 -0
- package/{types/src → dist/browser}/generated/index.d.ts.map +1 -1
- package/{dist-esm/src → dist/browser}/generated/index.js +2 -2
- package/dist/browser/generated/index.js.map +1 -0
- package/{dist-esm/src → dist/browser}/generated/lroImpl.js +11 -3
- package/dist/browser/generated/lroImpl.js.map +1 -0
- package/{types/src → dist/browser}/generated/models/index.d.ts +46 -46
- package/dist/browser/generated/models/index.d.ts.map +1 -0
- package/{dist-esm/src → dist/browser}/generated/models/mappers.js +297 -117
- package/dist/browser/generated/models/mappers.js.map +1 -0
- package/{dist-esm/src → dist/browser}/generated/models/parameters.js +1 -1
- package/{dist-esm/src → dist/browser}/generated/models/parameters.js.map +1 -1
- package/{types/src → dist/browser}/index.d.ts +3 -3
- package/{types/src → dist/browser}/index.d.ts.map +1 -1
- package/{dist-esm/src → dist/browser}/index.js +4 -4
- package/dist/browser/index.js.map +1 -0
- package/{types/src → dist/browser}/models.d.ts +47 -47
- package/dist/browser/models.d.ts.map +1 -0
- package/{dist-esm/src → dist/browser}/models.js +0 -2
- package/dist/browser/models.js.map +1 -0
- package/dist/browser/package.json +3 -0
- package/dist/commonjs/azureKeyCredentialPolicy.d.ts +9 -0
- package/dist/commonjs/azureKeyCredentialPolicy.d.ts.map +1 -0
- package/dist/commonjs/azureKeyCredentialPolicy.js +25 -0
- package/dist/commonjs/azureKeyCredentialPolicy.js.map +1 -0
- package/dist/commonjs/constants.d.ts +3 -0
- package/dist/commonjs/constants.d.ts.map +1 -0
- package/dist/commonjs/constants.js +8 -0
- package/dist/commonjs/constants.js.map +1 -0
- package/dist/commonjs/conversationAnalysisClient.d.ts +63 -0
- package/dist/commonjs/conversationAnalysisClient.d.ts.map +1 -0
- package/dist/commonjs/conversationAnalysisClient.js +85 -0
- package/dist/commonjs/conversationAnalysisClient.js.map +1 -0
- package/dist/commonjs/generated/conversationAnalysisClient.d.ts +36 -0
- package/dist/commonjs/generated/conversationAnalysisClient.d.ts.map +1 -0
- package/dist/commonjs/generated/conversationAnalysisClient.js +207 -0
- package/dist/commonjs/generated/conversationAnalysisClient.js.map +1 -0
- package/dist/commonjs/generated/index.d.ts +3 -0
- package/dist/commonjs/generated/index.d.ts.map +1 -0
- package/dist/commonjs/generated/index.js +15 -0
- package/dist/commonjs/generated/index.js.map +1 -0
- package/dist/commonjs/generated/lroImpl.d.ts +16 -0
- package/dist/commonjs/generated/lroImpl.d.ts.map +1 -0
- package/dist/commonjs/generated/lroImpl.js +37 -0
- package/dist/commonjs/generated/lroImpl.js.map +1 -0
- package/dist/commonjs/generated/models/index.d.ts +1951 -0
- package/dist/commonjs/generated/models/index.d.ts.map +1 -0
- package/dist/commonjs/generated/models/index.js +659 -0
- package/dist/commonjs/generated/models/index.js.map +1 -0
- package/dist/commonjs/generated/models/mappers.d.ts +153 -0
- package/dist/commonjs/generated/models/mappers.d.ts.map +1 -0
- package/dist/commonjs/generated/models/mappers.js +2847 -0
- package/dist/commonjs/generated/models/mappers.js.map +1 -0
- package/dist/commonjs/generated/models/parameters.d.ts +8 -0
- package/dist/commonjs/generated/models/parameters.d.ts.map +1 -0
- package/dist/commonjs/generated/models/parameters.js +64 -0
- package/dist/commonjs/generated/models/parameters.js.map +1 -0
- package/dist/commonjs/index.d.ts +13 -0
- package/dist/commonjs/index.d.ts.map +1 -0
- package/dist/commonjs/index.js +21 -0
- package/dist/commonjs/index.js.map +1 -0
- package/{types/ai-language-conversations.d.ts → dist/commonjs/models.d.ts} +1953 -2221
- package/dist/commonjs/models.d.ts.map +1 -0
- package/dist/commonjs/models.js +652 -0
- package/dist/commonjs/models.js.map +1 -0
- package/dist/commonjs/package.json +3 -0
- package/{types → dist/commonjs}/tsdoc-metadata.json +11 -11
- package/dist/esm/azureKeyCredentialPolicy.d.ts +9 -0
- package/dist/esm/azureKeyCredentialPolicy.d.ts.map +1 -0
- package/dist/esm/azureKeyCredentialPolicy.js +22 -0
- package/dist/esm/azureKeyCredentialPolicy.js.map +1 -0
- package/dist/esm/constants.d.ts +3 -0
- package/dist/esm/constants.d.ts.map +1 -0
- package/dist/esm/constants.js +5 -0
- package/dist/esm/constants.js.map +1 -0
- package/dist/esm/conversationAnalysisClient.d.ts +63 -0
- package/dist/esm/conversationAnalysisClient.d.ts.map +1 -0
- package/dist/esm/conversationAnalysisClient.js +81 -0
- package/dist/esm/conversationAnalysisClient.js.map +1 -0
- package/dist/esm/generated/conversationAnalysisClient.d.ts +36 -0
- package/dist/esm/generated/conversationAnalysisClient.d.ts.map +1 -0
- package/dist/esm/generated/conversationAnalysisClient.js +202 -0
- package/dist/esm/generated/conversationAnalysisClient.js.map +1 -0
- package/dist/esm/generated/index.d.ts +3 -0
- package/dist/esm/generated/index.d.ts.map +1 -0
- package/dist/esm/generated/index.js +10 -0
- package/dist/esm/generated/index.js.map +1 -0
- package/dist/esm/generated/lroImpl.d.ts +16 -0
- package/dist/esm/generated/lroImpl.d.ts.map +1 -0
- package/dist/esm/generated/lroImpl.js +33 -0
- package/dist/esm/generated/lroImpl.js.map +1 -0
- package/dist/esm/generated/models/index.d.ts +1951 -0
- package/dist/esm/generated/models/index.d.ts.map +1 -0
- package/dist/esm/generated/models/index.js +656 -0
- package/dist/esm/generated/models/index.js.map +1 -0
- package/dist/esm/generated/models/mappers.d.ts +153 -0
- package/dist/esm/generated/models/mappers.d.ts.map +1 -0
- package/dist/{index.js → esm/generated/models/mappers.js} +404 -1395
- package/dist/esm/generated/models/mappers.js.map +1 -0
- package/dist/esm/generated/models/parameters.d.ts +8 -0
- package/dist/esm/generated/models/parameters.d.ts.map +1 -0
- package/dist/esm/generated/models/parameters.js +61 -0
- package/dist/esm/generated/models/parameters.js.map +1 -0
- package/dist/esm/index.d.ts +13 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +15 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/models.d.ts +1953 -0
- package/dist/esm/models.d.ts.map +1 -0
- package/dist/esm/models.js +649 -0
- package/dist/esm/models.js.map +1 -0
- package/dist/esm/package.json +3 -0
- package/dist/react-native/azureKeyCredentialPolicy.d.ts +9 -0
- package/dist/react-native/azureKeyCredentialPolicy.d.ts.map +1 -0
- package/dist/react-native/azureKeyCredentialPolicy.js +22 -0
- package/dist/react-native/azureKeyCredentialPolicy.js.map +1 -0
- package/dist/react-native/constants.d.ts +3 -0
- package/dist/react-native/constants.d.ts.map +1 -0
- package/dist/react-native/constants.js +5 -0
- package/dist/react-native/constants.js.map +1 -0
- package/dist/react-native/conversationAnalysisClient.d.ts +63 -0
- package/dist/react-native/conversationAnalysisClient.d.ts.map +1 -0
- package/dist/react-native/conversationAnalysisClient.js +81 -0
- package/dist/react-native/conversationAnalysisClient.js.map +1 -0
- package/dist/react-native/generated/conversationAnalysisClient.d.ts +36 -0
- package/dist/react-native/generated/conversationAnalysisClient.d.ts.map +1 -0
- package/dist/react-native/generated/conversationAnalysisClient.js +202 -0
- package/dist/react-native/generated/conversationAnalysisClient.js.map +1 -0
- package/dist/react-native/generated/index.d.ts +3 -0
- package/dist/react-native/generated/index.d.ts.map +1 -0
- package/dist/react-native/generated/index.js +10 -0
- package/dist/react-native/generated/index.js.map +1 -0
- package/dist/react-native/generated/lroImpl.d.ts +16 -0
- package/dist/react-native/generated/lroImpl.d.ts.map +1 -0
- package/dist/react-native/generated/lroImpl.js +33 -0
- package/dist/react-native/generated/lroImpl.js.map +1 -0
- package/dist/react-native/generated/models/index.d.ts +1951 -0
- package/dist/react-native/generated/models/index.d.ts.map +1 -0
- package/dist/react-native/generated/models/index.js +656 -0
- package/dist/react-native/generated/models/index.js.map +1 -0
- package/dist/react-native/generated/models/mappers.d.ts +153 -0
- package/dist/react-native/generated/models/mappers.d.ts.map +1 -0
- package/dist/react-native/generated/models/mappers.js +2842 -0
- package/dist/react-native/generated/models/mappers.js.map +1 -0
- package/dist/react-native/generated/models/parameters.d.ts +8 -0
- package/dist/react-native/generated/models/parameters.d.ts.map +1 -0
- package/dist/react-native/generated/models/parameters.js +61 -0
- package/dist/react-native/generated/models/parameters.js.map +1 -0
- package/dist/react-native/index.d.ts +13 -0
- package/dist/react-native/index.d.ts.map +1 -0
- package/dist/react-native/index.js +15 -0
- package/dist/react-native/index.js.map +1 -0
- package/dist/react-native/models.d.ts +1953 -0
- package/dist/react-native/models.d.ts.map +1 -0
- package/dist/react-native/models.js +649 -0
- package/dist/react-native/models.js.map +1 -0
- package/dist/react-native/package.json +3 -0
- package/package.json +95 -100
- package/CHANGELOG.md +0 -5
- package/dist/index.js.map +0 -1
- package/dist-esm/samples-dev/sample_analyze_conversation_app.js +0 -74
- package/dist-esm/samples-dev/sample_analyze_conversation_app.js.map +0 -1
- package/dist-esm/samples-dev/sample_analyze_orchestration_app_conv_response.js +0 -89
- package/dist-esm/samples-dev/sample_analyze_orchestration_app_conv_response.js.map +0 -1
- package/dist-esm/samples-dev/sample_analyze_orchestration_app_luis_response.js +0 -65
- package/dist-esm/samples-dev/sample_analyze_orchestration_app_luis_response.js.map +0 -1
- package/dist-esm/samples-dev/sample_analyze_orchestration_app_qna_response.js +0 -66
- package/dist-esm/samples-dev/sample_analyze_orchestration_app_qna_response.js.map +0 -1
- package/dist-esm/samples-dev/sample_analyze_orchestration_direct_target.js +0 -76
- package/dist-esm/samples-dev/sample_analyze_orchestration_direct_target.js.map +0 -1
- package/dist-esm/samples-dev/sample_authentication.js +0 -44
- package/dist-esm/samples-dev/sample_authentication.js.map +0 -1
- package/dist-esm/samples-dev/sample_conv_pii_transcript_input.js +0 -112
- package/dist-esm/samples-dev/sample_conv_pii_transcript_input.js.map +0 -1
- package/dist-esm/samples-dev/sample_conv_summarization.js +0 -95
- package/dist-esm/samples-dev/sample_conv_summarization.js.map +0 -1
- package/dist-esm/src/azureKeyCredentialPolicy.js.map +0 -1
- package/dist-esm/src/conversationAnalysisClient.js.map +0 -1
- package/dist-esm/src/generated/index.js.map +0 -1
- package/dist-esm/src/generated/lroImpl.js.map +0 -1
- package/dist-esm/src/generated/models/mappers.js.map +0 -1
- package/dist-esm/src/index.js.map +0 -1
- package/dist-esm/src/models.js.map +0 -1
- package/dist-esm/test/public/analyze.spec.js +0 -159
- package/dist-esm/test/public/analyze.spec.js.map +0 -1
- package/dist-esm/test/public/inputs.js +0 -166
- package/dist-esm/test/public/inputs.js.map +0 -1
- package/dist-esm/test/public/utils/recordedClient.js +0 -50
- package/dist-esm/test/public/utils/recordedClient.js.map +0 -1
- package/review/ai-language-conversations.api.md +0 -1291
- package/rollup.config.js +0 -122
- package/tsconfig.json +0 -11
- package/types/samples-dev/sample_analyze_conversation_app.d.ts +0 -2
- package/types/samples-dev/sample_analyze_conversation_app.d.ts.map +0 -1
- package/types/samples-dev/sample_analyze_orchestration_app_conv_response.d.ts +0 -2
- package/types/samples-dev/sample_analyze_orchestration_app_conv_response.d.ts.map +0 -1
- package/types/samples-dev/sample_analyze_orchestration_app_luis_response.d.ts +0 -2
- package/types/samples-dev/sample_analyze_orchestration_app_luis_response.d.ts.map +0 -1
- package/types/samples-dev/sample_analyze_orchestration_app_qna_response.d.ts +0 -2
- package/types/samples-dev/sample_analyze_orchestration_app_qna_response.d.ts.map +0 -1
- package/types/samples-dev/sample_analyze_orchestration_direct_target.d.ts +0 -2
- package/types/samples-dev/sample_analyze_orchestration_direct_target.d.ts.map +0 -1
- package/types/samples-dev/sample_authentication.d.ts +0 -2
- package/types/samples-dev/sample_authentication.d.ts.map +0 -1
- package/types/samples-dev/sample_conv_pii_transcript_input.d.ts +0 -2
- package/types/samples-dev/sample_conv_pii_transcript_input.d.ts.map +0 -1
- package/types/samples-dev/sample_conv_summarization.d.ts +0 -2
- package/types/samples-dev/sample_conv_summarization.d.ts.map +0 -1
- package/types/src/azureKeyCredentialPolicy.d.ts.map +0 -1
- package/types/src/conversationAnalysisClient.d.ts.map +0 -1
- package/types/src/generated/conversationAnalysisClient.d.ts.map +0 -1
- package/types/src/generated/index.d.ts +0 -3
- package/types/src/generated/models/index.d.ts.map +0 -1
- package/types/src/models.d.ts.map +0 -1
- package/types/test/public/analyze.spec.d.ts +0 -2
- package/types/test/public/analyze.spec.d.ts.map +0 -1
- package/types/test/public/inputs.d.ts +0 -8
- package/types/test/public/inputs.d.ts.map +0 -1
- package/types/test/public/utils/recordedClient.d.ts +0 -16
- package/types/test/public/utils/recordedClient.d.ts.map +0 -1
- /package/{types/src → dist/browser}/constants.d.ts +0 -0
- /package/{types/src → dist/browser}/constants.d.ts.map +0 -0
- /package/{types/src → dist/browser}/generated/lroImpl.d.ts +0 -0
- /package/{types/src → dist/browser}/generated/lroImpl.d.ts.map +0 -0
- /package/{dist-esm/src → dist/browser}/generated/models/index.js +0 -0
- /package/{dist-esm/src → dist/browser}/generated/models/index.js.map +0 -0
- /package/{types/src → dist/browser}/generated/models/mappers.d.ts +0 -0
- /package/{types/src → dist/browser}/generated/models/mappers.d.ts.map +0 -0
- /package/{types/src → dist/browser}/generated/models/parameters.d.ts +0 -0
- /package/{types/src → dist/browser}/generated/models/parameters.d.ts.map +0 -0
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
Copyright (c) Microsoft Corporation.
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
MIT License
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -12,10 +12,10 @@ furnished to do so, subject to the following conditions:
|
|
|
12
12
|
The above copyright notice and this permission notice shall be included in all
|
|
13
13
|
copies or substantial portions of the Software.
|
|
14
14
|
|
|
15
|
-
THE SOFTWARE IS PROVIDED
|
|
15
|
+
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
16
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
17
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
18
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
19
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
20
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -4,21 +4,21 @@ This package contains an isomorphic SDK (runs both in Node.js and in browsers) f
|
|
|
4
4
|
|
|
5
5
|
The language service conversations API is a suite of natural language processing (NLP) skills that can be used to analyze structured conversations (textual or spoken). The synchronous API in this suite accepts a request and mediates among multiple language projects, such as LUIS Generally Available, Question Answering, Conversational Language Understanding, and then calls the best candidate service to handle the request. At last, it returns a response with the candidate service's response as a payload.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
In some cases, this API needs to forward requests and responses between the caller and an upstream service. The asynchronous APIs in this suite enable tasks like Conversation Summarization and Conversational PII detection.
|
|
8
8
|
|
|
9
9
|
Key links:
|
|
10
10
|
|
|
11
11
|
- [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/cognitivelanguage/ai-language-conversations)
|
|
12
12
|
- [Package (NPM)](https://www.npmjs.com/package/@azure/ai-language-conversations)
|
|
13
13
|
- [API reference documentation](https://aka.ms/clujsapidocs)
|
|
14
|
-
- [Product documentation](https://
|
|
14
|
+
- [Product documentation](https://learn.microsoft.com/azure/cognitive-services/language-service/)
|
|
15
15
|
- [Samples](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/cognitivelanguage/ai-language-conversations/samples-dev)
|
|
16
16
|
|
|
17
17
|
## Getting started
|
|
18
18
|
|
|
19
19
|
### Currently supported environments
|
|
20
20
|
|
|
21
|
-
- [LTS versions of Node.js](https://
|
|
21
|
+
- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule)
|
|
22
22
|
- Latest versions of Safari, Chrome, Edge and Firefox.
|
|
23
23
|
|
|
24
24
|
See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUPPORT.md) for more details.
|
|
@@ -64,14 +64,17 @@ az cognitiveservices account keys list --resource-group <your-resource-group-nam
|
|
|
64
64
|
|
|
65
65
|
Once you have an API key and endpoint, you can use the `AzureKeyCredential` class to authenticate the client as follows:
|
|
66
66
|
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
|
|
67
|
+
```ts snippet:ReadmeSampleCreateClient_Key
|
|
68
|
+
import { AzureKeyCredential } from "@azure/core-auth";
|
|
69
|
+
import { ConversationAnalysisClient } from "@azure/ai-language-conversations";
|
|
70
70
|
|
|
71
|
-
const
|
|
71
|
+
const endpoint = "https://<resource name>.cognitiveservices.azure.com";
|
|
72
|
+
const credential = new AzureKeyCredential("<api key>");
|
|
73
|
+
const client = new ConversationAnalysisClient(endpoint, credential);
|
|
72
74
|
```
|
|
73
75
|
|
|
74
76
|
### JavaScript Bundle
|
|
77
|
+
|
|
75
78
|
To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling).
|
|
76
79
|
|
|
77
80
|
## Key concepts
|
|
@@ -86,8 +89,9 @@ To use this client library in the browser, first you need to use a bundler. For
|
|
|
86
89
|
|
|
87
90
|
Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`:
|
|
88
91
|
|
|
89
|
-
```
|
|
90
|
-
|
|
92
|
+
```ts snippet:SetLogLevel
|
|
93
|
+
import { setLogLevel } from "@azure/logger";
|
|
94
|
+
|
|
91
95
|
setLogLevel("info");
|
|
92
96
|
```
|
|
93
97
|
|
|
@@ -105,9 +109,9 @@ If you'd like to contribute to this library, please read the [contributing guide
|
|
|
105
109
|
|
|
106
110
|
- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js)
|
|
107
111
|
|
|
108
|
-

|
|
109
112
|
|
|
110
|
-
|
|
113
|
+
|
|
114
|
+
[azure_cli]: https://learn.microsoft.com/cli/azure
|
|
111
115
|
[azure_sub]: https://azure.microsoft.com/free/
|
|
112
116
|
[azure_portal]: https://portal.azure.com
|
|
113
117
|
[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { PipelinePolicy } from "@azure/core-rest-pipeline";
|
|
2
|
-
import { KeyCredential } from "@azure/core-auth";
|
|
1
|
+
import type { PipelinePolicy } from "@azure/core-rest-pipeline";
|
|
2
|
+
import type { KeyCredential } from "@azure/core-auth";
|
|
3
3
|
/**
|
|
4
4
|
* Create an HTTP pipeline policy to authenticate a request
|
|
5
5
|
* using an `AzureKeyCredential` for Conversation Analysis
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"azureKeyCredentialPolicy.d.ts","sourceRoot":"","sources":["../../src/azureKeyCredentialPolicy.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,cAAc,EAIf,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAUtD;;;;GAIG;AACH,wBAAgB,4CAA4C,CAC1D,UAAU,EAAE,aAAa,GACxB,cAAc,CAQhB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"azureKeyCredentialPolicy.js","sourceRoot":"","sources":["../../src/azureKeyCredentialPolicy.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAUlC,MAAM,mBAAmB,GAAG,2BAA2B,CAAC;AAExD;;GAEG;AACH,MAAM,gDAAgD,GACpD,8CAA8C,CAAC;AAEjD;;;;GAIG;AACH,MAAM,UAAU,4CAA4C,CAC1D,UAAyB;IAEzB,OAAO;QACL,IAAI,EAAE,gDAAgD;QACtD,WAAW,CAAC,OAAwB,EAAE,IAAiB;YACrD,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC;YACzD,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;QACvB,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n PipelinePolicy,\n PipelineRequest,\n PipelineResponse,\n SendRequest,\n} from \"@azure/core-rest-pipeline\";\nimport type { KeyCredential } from \"@azure/core-auth\";\n\nconst API_KEY_HEADER_NAME = \"Ocp-Apim-Subscription-Key\";\n\n/**\n * The programmatic identifier of the conversationAnalysisAzureKeyCredentialPolicy.\n */\nconst conversationAnalysisAzureKeyCredentialPolicyName =\n \"conversationAnalysisAzureKeyCredentialPolicy\";\n\n/**\n * Create an HTTP pipeline policy to authenticate a request\n * using an `AzureKeyCredential` for Conversation Analysis\n * @internal\n */\nexport function conversationAnalysisAzureKeyCredentialPolicy(\n credential: KeyCredential,\n): PipelinePolicy {\n return {\n name: conversationAnalysisAzureKeyCredentialPolicyName,\n sendRequest(request: PipelineRequest, next: SendRequest): Promise<PipelineResponse> {\n request.headers.set(API_KEY_HEADER_NAME, credential.key);\n return next(request);\n },\n };\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
|
-
// Licensed under the MIT
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
3
|
export const DEFAULT_COGNITIVE_SCOPE = "https://cognitiveservices.azure.com/.default";
|
|
4
4
|
export const SDK_VERSION = "1.0.0-beta.1";
|
|
5
5
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,MAAM,CAAC,MAAM,uBAAuB,GAAG,8CAA8C,CAAC;AACtF,MAAM,CAAC,MAAM,WAAW,GAAG,cAAc,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,MAAM,CAAC,MAAM,uBAAuB,GAAG,8CAA8C,CAAC;AACtF,MAAM,CAAC,MAAM,WAAW,GAAG,cAAc,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport const DEFAULT_COGNITIVE_SCOPE = \"https://cognitiveservices.azure.com/.default\";\nexport const SDK_VERSION = \"1.0.0-beta.1\";\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { AnalyzeConversationJobsInput, AnalyzeConversationOptionalParams, AnalyzeConversationResponse, AnalyzeConversationTaskUnion, ConversationAnalysisClientOptionalParams, ConversationAnalysisOptionalParams, ConversationAnalysisResponse } from "./models";
|
|
2
|
-
import { KeyCredential, TokenCredential } from "@azure/core-auth";
|
|
3
|
-
import { PollOperationState, PollerLike } from "@azure/core-lro";
|
|
1
|
+
import type { AnalyzeConversationJobsInput, AnalyzeConversationOptionalParams, AnalyzeConversationResponse, AnalyzeConversationTaskUnion, ConversationAnalysisClientOptionalParams, ConversationAnalysisOptionalParams, ConversationAnalysisResponse } from "./models.js";
|
|
2
|
+
import type { KeyCredential, TokenCredential } from "@azure/core-auth";
|
|
3
|
+
import type { PollOperationState, PollerLike } from "@azure/core-lro";
|
|
4
4
|
/**
|
|
5
5
|
* A client for interacting with the conversational language understanding
|
|
6
6
|
* features in Azure Cognitive Language Service.
|
|
@@ -14,13 +14,12 @@ import { PollOperationState, PollerLike } from "@azure/core-lro";
|
|
|
14
14
|
*
|
|
15
15
|
* #### API Key
|
|
16
16
|
*
|
|
17
|
-
* ```
|
|
17
|
+
* ```ts snippet:ReadmeSampleCreateClient_Key
|
|
18
18
|
* import { AzureKeyCredential } from "@azure/core-auth";
|
|
19
19
|
* import { ConversationAnalysisClient } from "@azure/ai-language-conversations";
|
|
20
20
|
*
|
|
21
21
|
* const endpoint = "https://<resource name>.cognitiveservices.azure.com";
|
|
22
22
|
* const credential = new AzureKeyCredential("<api key>");
|
|
23
|
-
*
|
|
24
23
|
* const client = new ConversationAnalysisClient(endpoint, credential);
|
|
25
24
|
* ```
|
|
26
25
|
*
|
|
@@ -29,13 +28,12 @@ import { PollOperationState, PollerLike } from "@azure/core-lro";
|
|
|
29
28
|
* See the [`@azure/identity`](https://npmjs.com/package/\@azure/identity)
|
|
30
29
|
* package for more information about authenticating with Azure Active Directory.
|
|
31
30
|
*
|
|
32
|
-
* ```
|
|
33
|
-
* import { ConversationAnalysisClient } from "@azure/ai-language-conversations";
|
|
31
|
+
* ```ts snippet:ReadmeSampleCreateClient_ActiveDirectory
|
|
34
32
|
* import { DefaultAzureCredential } from "@azure/identity";
|
|
33
|
+
* import { ConversationAnalysisClient } from "@azure/ai-language-conversations";
|
|
35
34
|
*
|
|
36
35
|
* const endpoint = "https://<resource name>.cognitiveservices.azure.com";
|
|
37
36
|
* const credential = new DefaultAzureCredential();
|
|
38
|
-
*
|
|
39
37
|
* const client = new ConversationAnalysisClient(endpoint, credential);
|
|
40
38
|
* ```
|
|
41
39
|
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversationAnalysisClient.d.ts","sourceRoot":"","sources":["../../src/conversationAnalysisClient.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,4BAA4B,EAC5B,iCAAiC,EACjC,2BAA2B,EAC3B,4BAA4B,EAC5B,wCAAwC,EACxC,kCAAkC,EAClC,4BAA4B,EAC7B,MAAM,aAAa,CAAC;AAErB,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEvE,OAAO,KAAK,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAOtE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,qBAAa,0BAA0B;IACrC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAkB;IAC1C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAgB;IAEzC;;;;;OAKG;gBAED,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,eAAe,GAAG,aAAa,EAC3C,OAAO,GAAE,wCAA6C;IAiBxD;;;;OAIG;IACH,mBAAmB,CACjB,IAAI,EAAE,4BAA4B,EAClC,OAAO,CAAC,EAAE,iCAAiC,GAC1C,OAAO,CAAC,2BAA2B,CAAC;IAYvC;;;;OAIG;IACG,yBAAyB,CAC7B,IAAI,EAAE,4BAA4B,EAClC,OAAO,CAAC,EAAE,kCAAkC,GAC3C,OAAO,CACR,UAAU,CAAC,kBAAkB,CAAC,4BAA4B,CAAC,EAAE,4BAA4B,CAAC,CAC3F;CAUF"}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
// Licensed under the MIT license.
|
|
3
|
-
import { DEFAULT_COGNITIVE_SCOPE, SDK_VERSION } from "./constants";
|
|
1
|
+
import { DEFAULT_COGNITIVE_SCOPE, SDK_VERSION } from "./constants.js";
|
|
4
2
|
import { isTokenCredential } from "@azure/core-auth";
|
|
5
3
|
import { createTracingClient } from "@azure/core-tracing";
|
|
6
|
-
import { ConversationAnalysisClient as GeneratedClient } from "./generated";
|
|
4
|
+
import { ConversationAnalysisClient as GeneratedClient } from "./generated/index.js";
|
|
7
5
|
import { bearerTokenAuthenticationPolicy } from "@azure/core-rest-pipeline";
|
|
8
|
-
import { conversationAnalysisAzureKeyCredentialPolicy } from "./azureKeyCredentialPolicy";
|
|
6
|
+
import { conversationAnalysisAzureKeyCredentialPolicy } from "./azureKeyCredentialPolicy.js";
|
|
9
7
|
/**
|
|
10
8
|
* A client for interacting with the conversational language understanding
|
|
11
9
|
* features in Azure Cognitive Language Service.
|
|
@@ -19,13 +17,12 @@ import { conversationAnalysisAzureKeyCredentialPolicy } from "./azureKeyCredenti
|
|
|
19
17
|
*
|
|
20
18
|
* #### API Key
|
|
21
19
|
*
|
|
22
|
-
* ```
|
|
20
|
+
* ```ts snippet:ReadmeSampleCreateClient_Key
|
|
23
21
|
* import { AzureKeyCredential } from "@azure/core-auth";
|
|
24
22
|
* import { ConversationAnalysisClient } from "@azure/ai-language-conversations";
|
|
25
23
|
*
|
|
26
24
|
* const endpoint = "https://<resource name>.cognitiveservices.azure.com";
|
|
27
25
|
* const credential = new AzureKeyCredential("<api key>");
|
|
28
|
-
*
|
|
29
26
|
* const client = new ConversationAnalysisClient(endpoint, credential);
|
|
30
27
|
* ```
|
|
31
28
|
*
|
|
@@ -34,17 +31,18 @@ import { conversationAnalysisAzureKeyCredentialPolicy } from "./azureKeyCredenti
|
|
|
34
31
|
* See the [`@azure/identity`](https://npmjs.com/package/\@azure/identity)
|
|
35
32
|
* package for more information about authenticating with Azure Active Directory.
|
|
36
33
|
*
|
|
37
|
-
* ```
|
|
38
|
-
* import { ConversationAnalysisClient } from "@azure/ai-language-conversations";
|
|
34
|
+
* ```ts snippet:ReadmeSampleCreateClient_ActiveDirectory
|
|
39
35
|
* import { DefaultAzureCredential } from "@azure/identity";
|
|
36
|
+
* import { ConversationAnalysisClient } from "@azure/ai-language-conversations";
|
|
40
37
|
*
|
|
41
38
|
* const endpoint = "https://<resource name>.cognitiveservices.azure.com";
|
|
42
39
|
* const credential = new DefaultAzureCredential();
|
|
43
|
-
*
|
|
44
40
|
* const client = new ConversationAnalysisClient(endpoint, credential);
|
|
45
41
|
* ```
|
|
46
42
|
*/
|
|
47
43
|
export class ConversationAnalysisClient {
|
|
44
|
+
_client;
|
|
45
|
+
_tracing;
|
|
48
46
|
/**
|
|
49
47
|
* Initializes a new instance of the ConversationAnalysisClient class.
|
|
50
48
|
* @param endpoint - Supported Cognitive Services endpoint (e.g.,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversationAnalysisClient.js","sourceRoot":"","sources":["../../src/conversationAnalysisClient.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,uBAAuB,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAEtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAGrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,0BAA0B,IAAI,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACrF,OAAO,EAAE,+BAA+B,EAAE,MAAM,2BAA2B,CAAC;AAC5E,OAAO,EAAE,4CAA4C,EAAE,MAAM,+BAA+B,CAAC;AAE7F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,MAAM,OAAO,0BAA0B;IACpB,OAAO,CAAkB;IACzB,QAAQ,CAAgB;IAEzC;;;;;OAKG;IACH,YACE,QAAgB,EAChB,UAA2C,EAC3C,UAAoD,EAAE;QAEtD,IAAI,CAAC,OAAO,GAAG,IAAI,eAAe,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QAEtD,IAAI,CAAC,QAAQ,GAAG,mBAAmB,CAAC;YAClC,WAAW,EAAE,kCAAkC;YAC/C,cAAc,EAAE,WAAW;YAC3B,SAAS,EAAE,6BAA6B;SACzC,CAAC,CAAC;QAEH,MAAM,UAAU,GAAG,iBAAiB,CAAC,UAAU,CAAC;YAC9C,CAAC,CAAC,+BAA+B,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,uBAAuB,EAAE,CAAC;YAClF,CAAC,CAAC,4CAA4C,CAAC,UAAU,CAAC,CAAC;QAE7D,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;IAC9C,CAAC;IAED;;;;OAIG;IACH,mBAAmB,CACjB,IAAkC,EAClC,OAA2C;QAE3C,OAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAC3B,gDAAgD,EAChD,OAAO,IAAI,EAAE,EACb,CAAC,cAAc,EAAE,EAAE,CACjB,IAAI,CAAC,OAAO,CAAC,mBAAmB,CAC9B,IAAI,EACJ,cAAc,CACyB,CAC5C,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,yBAAyB,CAC7B,IAAkC,EAClC,OAA4C;QAI5C,OAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAC3B,sDAAsD,EACtD,OAAO,IAAI,EAAE,EACb,CAAC,cAAc,EAAE,EAAE,CACjB,IAAI,CAAC,OAAO,CAAC,yBAAyB,CAAC,IAAI,EAAE,cAAc,CAE1D,CACJ,CAAC;IACJ,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport type {\n AnalyzeConversationJobsInput,\n AnalyzeConversationOptionalParams,\n AnalyzeConversationResponse,\n AnalyzeConversationTaskUnion,\n ConversationAnalysisClientOptionalParams,\n ConversationAnalysisOptionalParams,\n ConversationAnalysisResponse,\n} from \"./models.js\";\nimport { DEFAULT_COGNITIVE_SCOPE, SDK_VERSION } from \"./constants.js\";\nimport type { KeyCredential, TokenCredential } from \"@azure/core-auth\";\nimport { isTokenCredential } from \"@azure/core-auth\";\nimport type { PollOperationState, PollerLike } from \"@azure/core-lro\";\nimport type { TracingClient } from \"@azure/core-tracing\";\nimport { createTracingClient } from \"@azure/core-tracing\";\nimport { ConversationAnalysisClient as GeneratedClient } from \"./generated/index.js\";\nimport { bearerTokenAuthenticationPolicy } from \"@azure/core-rest-pipeline\";\nimport { conversationAnalysisAzureKeyCredentialPolicy } from \"./azureKeyCredentialPolicy.js\";\n\n/**\n * A client for interacting with the conversational language understanding\n * features in Azure Cognitive Language Service.\n *\n * The client needs the endpoint of a Language resource and an authentication\n * method such as an API key or AAD. The API key and endpoint can be found in\n * the Language resource page in the Azure portal. They will be located in the\n * resource's Keys and Endpoint page, under Resource Management.\n *\n * ### Examples for authentication:\n *\n * #### API Key\n *\n * ```ts snippet:ReadmeSampleCreateClient_Key\n * import { AzureKeyCredential } from \"@azure/core-auth\";\n * import { ConversationAnalysisClient } from \"@azure/ai-language-conversations\";\n *\n * const endpoint = \"https://<resource name>.cognitiveservices.azure.com\";\n * const credential = new AzureKeyCredential(\"<api key>\");\n * const client = new ConversationAnalysisClient(endpoint, credential);\n * ```\n *\n * #### Azure Active Directory\n *\n * See the [`@azure/identity`](https://npmjs.com/package/\\@azure/identity)\n * package for more information about authenticating with Azure Active Directory.\n *\n * ```ts snippet:ReadmeSampleCreateClient_ActiveDirectory\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { ConversationAnalysisClient } from \"@azure/ai-language-conversations\";\n *\n * const endpoint = \"https://<resource name>.cognitiveservices.azure.com\";\n * const credential = new DefaultAzureCredential();\n * const client = new ConversationAnalysisClient(endpoint, credential);\n * ```\n */\nexport class ConversationAnalysisClient {\n private readonly _client: GeneratedClient;\n private readonly _tracing: TracingClient;\n\n /**\n * Initializes a new instance of the ConversationAnalysisClient class.\n * @param endpoint - Supported Cognitive Services endpoint (e.g.,\n * https://<resource-name>.api.cognitiveservices.azure.com).\n * @param options - The parameter options\n */\n constructor(\n endpoint: string,\n credential: TokenCredential | KeyCredential,\n options: ConversationAnalysisClientOptionalParams = {},\n ) {\n this._client = new GeneratedClient(endpoint, options);\n\n this._tracing = createTracingClient({\n packageName: \"@azure/ai-language-conversations\",\n packageVersion: SDK_VERSION,\n namespace: \"Microsoft.CognitiveServices\",\n });\n\n const authPolicy = isTokenCredential(credential)\n ? bearerTokenAuthenticationPolicy({ credential, scopes: DEFAULT_COGNITIVE_SCOPE })\n : conversationAnalysisAzureKeyCredentialPolicy(credential);\n\n this._client.pipeline.addPolicy(authPolicy);\n }\n\n /**\n * Analyzes the input conversation utterance.\n * @param task - A single conversational task to execute.\n * @param options - The options parameters.\n */\n analyzeConversation(\n task: AnalyzeConversationTaskUnion,\n options?: AnalyzeConversationOptionalParams,\n ): Promise<AnalyzeConversationResponse> {\n return this._tracing.withSpan(\n \"ConversationAnalysisClient.analyzeConversation\",\n options || {},\n (updatedOptions) =>\n this._client.analyzeConversation(\n task,\n updatedOptions,\n ) as Promise<AnalyzeConversationResponse>,\n );\n }\n\n /**\n * Submit a collection of conversations for analysis. Specify one or more unique tasks to be executed.\n * @param task - The collection of conversations to analyze and one or more tasks to execute.\n * @param options - The options parameters.\n */\n async beginConversationAnalysis(\n task: AnalyzeConversationJobsInput,\n options?: ConversationAnalysisOptionalParams,\n ): Promise<\n PollerLike<PollOperationState<ConversationAnalysisResponse>, ConversationAnalysisResponse>\n > {\n return this._tracing.withSpan(\n \"ConversationAnalysisClient.beginConversationAnalysis\",\n options || {},\n (updatedOptions) =>\n this._client.beginConversationAnalysis(task, updatedOptions) as Promise<\n PollerLike<PollOperationState<ConversationAnalysisResponse>, ConversationAnalysisResponse>\n >,\n );\n }\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as coreClient from "@azure/core-client";
|
|
2
2
|
import { PollerLike, PollOperationState } from "@azure/core-lro";
|
|
3
|
-
import { ConversationAnalysisClientOptionalParams, AnalyzeConversationTaskUnion, AnalyzeConversationOptionalParams, AnalyzeConversationResponse, AnalyzeConversationJobsInput, ConversationAnalysisOptionalParams, ConversationAnalysisResponse } from "./models";
|
|
3
|
+
import { ConversationAnalysisClientOptionalParams, AnalyzeConversationTaskUnion, AnalyzeConversationOptionalParams, AnalyzeConversationResponse, AnalyzeConversationJobsInput, ConversationAnalysisOptionalParams, ConversationAnalysisResponse } from "./models/index.js";
|
|
4
4
|
/** @internal */
|
|
5
5
|
export declare class ConversationAnalysisClient extends coreClient.ServiceClient {
|
|
6
6
|
endpoint: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversationAnalysisClient.d.ts","sourceRoot":"","sources":["../../../src/generated/conversationAnalysisClient.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AAOjD,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAa,MAAM,iBAAiB,CAAC;AAI5E,OAAO,EACL,wCAAwC,EACxC,4BAA4B,EAC5B,iCAAiC,EACjC,2BAA2B,EAC3B,4BAA4B,EAC5B,kCAAkC,EAClC,4BAA4B,EAC7B,MAAM,mBAAmB,CAAC;AAE3B,gBAAgB;AAChB,qBAAa,0BAA2B,SAAQ,UAAU,CAAC,aAAa;IACtE,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IAEnB;;;;;OAKG;gBAED,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,wCAAwC;IA4DpD,8GAA8G;IAC9G,OAAO,CAAC,yBAAyB;IA2BjC;;;;OAIG;IACH,mBAAmB,CACjB,IAAI,EAAE,4BAA4B,EAClC,OAAO,CAAC,EAAE,iCAAiC,GAC1C,OAAO,CAAC,2BAA2B,CAAC;IAOvC;;;;OAIG;IACG,yBAAyB,CAC7B,IAAI,EAAE,4BAA4B,EAClC,OAAO,CAAC,EAAE,kCAAkC,GAC3C,OAAO,CACR,UAAU,CACR,kBAAkB,CAAC,4BAA4B,CAAC,EAChD,4BAA4B,CAC7B,CACF;IAqDD;;;;OAIG;IACG,gCAAgC,CACpC,IAAI,EAAE,4BAA4B,EAClC,OAAO,CAAC,EAAE,kCAAkC,GAC3C,OAAO,CAAC,4BAA4B,CAAC;CAIzC"}
|
|
@@ -8,11 +8,13 @@
|
|
|
8
8
|
import * as coreClient from "@azure/core-client";
|
|
9
9
|
import * as coreRestPipeline from "@azure/core-rest-pipeline";
|
|
10
10
|
import { LroEngine } from "@azure/core-lro";
|
|
11
|
-
import { LroImpl } from "./lroImpl";
|
|
12
|
-
import * as Parameters from "./models/parameters";
|
|
13
|
-
import * as Mappers from "./models/mappers";
|
|
11
|
+
import { LroImpl } from "./lroImpl.js";
|
|
12
|
+
import * as Parameters from "./models/parameters.js";
|
|
13
|
+
import * as Mappers from "./models/mappers.js";
|
|
14
14
|
/** @internal */
|
|
15
15
|
export class ConversationAnalysisClient extends coreClient.ServiceClient {
|
|
16
|
+
endpoint;
|
|
17
|
+
apiVersion;
|
|
16
18
|
/**
|
|
17
19
|
* Initializes a new instance of the ConversationAnalysisClient class.
|
|
18
20
|
* @param endpoint Supported Cognitive Services endpoint (e.g.,
|
|
@@ -20,7 +22,6 @@ export class ConversationAnalysisClient extends coreClient.ServiceClient {
|
|
|
20
22
|
* @param options The parameter options
|
|
21
23
|
*/
|
|
22
24
|
constructor(endpoint, options) {
|
|
23
|
-
var _a, _b;
|
|
24
25
|
if (endpoint === undefined) {
|
|
25
26
|
throw new Error("'endpoint' cannot be null");
|
|
26
27
|
}
|
|
@@ -31,15 +32,20 @@ export class ConversationAnalysisClient extends coreClient.ServiceClient {
|
|
|
31
32
|
const defaults = {
|
|
32
33
|
requestContentType: "application/json; charset=utf-8"
|
|
33
34
|
};
|
|
34
|
-
const packageDetails = `azsdk-js-ai-language-conversations/1.0.0-beta.
|
|
35
|
+
const packageDetails = `azsdk-js-ai-language-conversations/1.0.0-beta.2`;
|
|
35
36
|
const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
|
36
37
|
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
|
|
37
38
|
: `${packageDetails}`;
|
|
38
|
-
const optionsWithDefaults =
|
|
39
|
+
const optionsWithDefaults = {
|
|
40
|
+
...defaults,
|
|
41
|
+
...options,
|
|
42
|
+
userAgentOptions: {
|
|
39
43
|
userAgentPrefix
|
|
40
|
-
},
|
|
44
|
+
},
|
|
45
|
+
baseUri: options.endpoint ?? options.baseUri ?? "{Endpoint}/language"
|
|
46
|
+
};
|
|
41
47
|
super(optionsWithDefaults);
|
|
42
|
-
if (
|
|
48
|
+
if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {
|
|
43
49
|
const pipelinePolicies = options.pipeline.getOrderedPolicies();
|
|
44
50
|
const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some((pipelinePolicy) => pipelinePolicy.name ===
|
|
45
51
|
coreRestPipeline.bearerTokenAuthenticationPolicyName);
|
|
@@ -104,14 +110,19 @@ export class ConversationAnalysisClient extends coreClient.ServiceClient {
|
|
|
104
110
|
return this.sendOperationRequest(args, spec);
|
|
105
111
|
};
|
|
106
112
|
const sendOperation = async (args, spec) => {
|
|
107
|
-
var _a;
|
|
108
113
|
let currentRawResponse = undefined;
|
|
109
|
-
const providedCallback =
|
|
114
|
+
const providedCallback = args.options?.onResponse;
|
|
110
115
|
const callback = (rawResponse, flatResponse) => {
|
|
111
116
|
currentRawResponse = rawResponse;
|
|
112
|
-
providedCallback
|
|
117
|
+
providedCallback?.(rawResponse, flatResponse);
|
|
118
|
+
};
|
|
119
|
+
const updatedArgs = {
|
|
120
|
+
...args,
|
|
121
|
+
options: {
|
|
122
|
+
...args.options,
|
|
123
|
+
onResponse: callback
|
|
124
|
+
}
|
|
113
125
|
};
|
|
114
|
-
const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
|
|
115
126
|
const flatResponse = await directSendOperation(updatedArgs, spec);
|
|
116
127
|
return {
|
|
117
128
|
flatResponse,
|
|
@@ -124,8 +135,8 @@ export class ConversationAnalysisClient extends coreClient.ServiceClient {
|
|
|
124
135
|
};
|
|
125
136
|
const lro = new LroImpl(sendOperation, { task, options }, conversationAnalysisOperationSpec);
|
|
126
137
|
const poller = new LroEngine(lro, {
|
|
127
|
-
resumeFrom: options
|
|
128
|
-
intervalInMs: options
|
|
138
|
+
resumeFrom: options?.resumeFrom,
|
|
139
|
+
intervalInMs: options?.updateIntervalInMs
|
|
129
140
|
});
|
|
130
141
|
await poller.poll();
|
|
131
142
|
return poller;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversationAnalysisClient.js","sourceRoot":"","sources":["../../../src/generated/conversationAnalysisClient.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,gBAAgB,MAAM,2BAA2B,CAAC;AAM9D,OAAO,EAAkC,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5E,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,UAAU,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAW5C,gBAAgB;AAChB,MAAM,OAAO,0BAA2B,SAAQ,UAAU,CAAC,aAAa;IAItE;;;;;OAKG;IACH,YACE,QAAgB,EAChB,OAAkD;;QAElD,IAAI,QAAQ,KAAK,SAAS,EAAE;YAC1B,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;SAC9C;QAED,0CAA0C;QAC1C,IAAI,CAAC,OAAO,EAAE;YACZ,OAAO,GAAG,EAAE,CAAC;SACd;QACD,MAAM,QAAQ,GAA6C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QACD,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,2BAA2B;SAChD;QACD,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,2BAA2B;SAChD;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,aAAa;SAClC;KACF;IACD,WAAW,EAAE,UAAU,CAAC,KAAK;IAC7B,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;IACxC,aAAa,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC;IACpC,gBAAgB,EAAE,CAAC,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC,MAAM,CAAC;IAC7D,SAAS,EAAE,MAAM;IACjB,UAAU;CACX,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport * as coreClient from \"@azure/core-client\";\nimport * as coreRestPipeline from \"@azure/core-rest-pipeline\";\nimport {\n PipelineRequest,\n PipelineResponse,\n SendRequest\n} from \"@azure/core-rest-pipeline\";\nimport { PollerLike, PollOperationState, LroEngine } from \"@azure/core-lro\";\nimport { LroImpl } from \"./lroImpl\";\nimport * as Parameters from \"./models/parameters\";\nimport * as Mappers from \"./models/mappers\";\nimport {\n ConversationAnalysisClientOptionalParams,\n AnalyzeConversationTaskUnion,\n AnalyzeConversationOptionalParams,\n AnalyzeConversationResponse,\n AnalyzeConversationJobsInput,\n ConversationAnalysisOptionalParams,\n ConversationAnalysisResponse\n} from \"./models\";\n\n/** @internal */\nexport class ConversationAnalysisClient extends coreClient.ServiceClient {\n endpoint: string;\n apiVersion: string;\n\n /**\n * Initializes a new instance of the ConversationAnalysisClient class.\n * @param endpoint Supported Cognitive Services endpoint (e.g.,\n * https://<resource-name>.api.cognitiveservices.azure.com).\n * @param options The parameter options\n */\n constructor(\n endpoint: string,\n options?: ConversationAnalysisClientOptionalParams\n ) {\n if (endpoint === undefined) {\n throw new Error(\"'endpoint' cannot be null\");\n }\n\n // Initializing default values for options\n if (!options) {\n options = {};\n }\n const defaults: ConversationAnalysisClientOptionalParams = {\n requestContentType: \"application/json; charset=utf-8\"\n };\n\n const packageDetails = `azsdk-js-ai-language-conversations/1.0.0-beta.1`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`\n : `${packageDetails}`;\n\n const optionsWithDefaults = {\n ...defaults,\n ...options,\n userAgentOptions: {\n userAgentPrefix\n },\n baseUri: options.endpoint ?? options.baseUri ?? \"{Endpoint}/language\"\n };\n super(optionsWithDefaults);\n\n if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {\n const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies();\n const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(\n (pipelinePolicy) =>\n pipelinePolicy.name ===\n coreRestPipeline.bearerTokenAuthenticationPolicyName\n );\n if (!bearerTokenAuthenticationPolicyFound) {\n this.pipeline.removePolicy({\n name: coreRestPipeline.bearerTokenAuthenticationPolicyName\n });\n this.pipeline.addPolicy(\n coreRestPipeline.bearerTokenAuthenticationPolicy({\n scopes: `${optionsWithDefaults.baseUri}/.default`,\n challengeCallbacks: {\n authorizeRequestOnChallenge:\n coreClient.authorizeRequestOnClaimChallenge\n }\n })\n );\n }\n }\n // Parameter assignments\n this.endpoint = endpoint;\n\n // Assigning values to Constant parameters\n this.apiVersion = options.apiVersion || \"2022-05-15-preview\";\n this.addCustomApiVersionPolicy(options.apiVersion);\n }\n\n /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */\n private addCustomApiVersionPolicy(apiVersion?: string) {\n if (!apiVersion) {\n return;\n }\n const apiVersionPolicy = {\n name: \"CustomApiVersionPolicy\",\n async sendRequest(\n request: PipelineRequest,\n next: SendRequest\n ): Promise<PipelineResponse> {\n const param = request.url.split(\"?\");\n if (param.length > 1) {\n const newParams = param[1].split(\"&\").map((item) => {\n if (item.indexOf(\"api-version\") > -1) {\n return \"api-version=\" + apiVersion;\n } else {\n return item;\n }\n });\n request.url = param[0] + \"?\" + newParams.join(\"&\");\n }\n return next(request);\n }\n };\n this.pipeline.addPolicy(apiVersionPolicy);\n }\n\n /**\n * Analyzes the input conversation utterance.\n * @param task A single conversational task to execute.\n * @param options The options parameters.\n */\n analyzeConversation(\n task: AnalyzeConversationTaskUnion,\n options?: AnalyzeConversationOptionalParams\n ): Promise<AnalyzeConversationResponse> {\n return this.sendOperationRequest(\n { task, options },\n analyzeConversationOperationSpec\n );\n }\n\n /**\n * Submit a collection of conversations for analysis. Specify one or more unique tasks to be executed.\n * @param task The collection of conversations to analyze and one or more tasks to execute.\n * @param options The options parameters.\n */\n async beginConversationAnalysis(\n task: AnalyzeConversationJobsInput,\n options?: ConversationAnalysisOptionalParams\n ): Promise<\n PollerLike<\n PollOperationState<ConversationAnalysisResponse>,\n ConversationAnalysisResponse\n >\n > {\n const directSendOperation = async (\n args: coreClient.OperationArguments,\n spec: coreClient.OperationSpec\n ): Promise<ConversationAnalysisResponse> => {\n return this.sendOperationRequest(args, spec);\n };\n const sendOperation = async (\n args: coreClient.OperationArguments,\n spec: coreClient.OperationSpec\n ) => {\n let currentRawResponse:\n | coreClient.FullOperationResponse\n | undefined = undefined;\n const providedCallback = args.options?.onResponse;\n const callback: coreClient.RawResponseCallback = (\n rawResponse: coreClient.FullOperationResponse,\n flatResponse: unknown\n ) => {\n currentRawResponse = rawResponse;\n providedCallback?.(rawResponse, flatResponse);\n };\n const updatedArgs = {\n ...args,\n options: {\n ...args.options,\n onResponse: callback\n }\n };\n const flatResponse = await directSendOperation(updatedArgs, spec);\n return {\n flatResponse,\n rawResponse: {\n statusCode: currentRawResponse!.status,\n body: currentRawResponse!.parsedBody,\n headers: currentRawResponse!.headers.toJSON()\n }\n };\n };\n\n const lro = new LroImpl(\n sendOperation,\n { task, options },\n conversationAnalysisOperationSpec\n );\n const poller = new LroEngine(lro, {\n resumeFrom: options?.resumeFrom,\n intervalInMs: options?.updateIntervalInMs\n });\n await poller.poll();\n return poller;\n }\n\n /**\n * Submit a collection of conversations for analysis. Specify one or more unique tasks to be executed.\n * @param task The collection of conversations to analyze and one or more tasks to execute.\n * @param options The options parameters.\n */\n async beginConversationAnalysisAndWait(\n task: AnalyzeConversationJobsInput,\n options?: ConversationAnalysisOptionalParams\n ): Promise<ConversationAnalysisResponse> {\n const poller = await this.beginConversationAnalysis(task, options);\n return poller.pollUntilDone();\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst analyzeConversationOperationSpec: coreClient.OperationSpec = {\n path: \"/:analyze-conversations\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.AnalyzeConversationTaskResult\n },\n default: {\n bodyMapper: Mappers.ErrorResponse,\n headersMapper:\n Mappers.ConversationAnalysisClientAnalyzeConversationExceptionHeaders\n }\n },\n requestBody: Parameters.task,\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer\n};\nconst conversationAnalysisOperationSpec: coreClient.OperationSpec = {\n path: \"/analyze-conversations/jobs\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.AnalyzeConversationJobState\n },\n 201: {\n bodyMapper: Mappers.AnalyzeConversationJobState\n },\n 202: {\n bodyMapper: Mappers.AnalyzeConversationJobState\n },\n 204: {\n bodyMapper: Mappers.AnalyzeConversationJobState\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n requestBody: Parameters.task1,\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer\n};\n"]}
|
|
1
|
+
{"version":3,"file":"conversationAnalysisClient.js","sourceRoot":"","sources":["../../../src/generated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B;IACjE,IAAI,EAAE,yBAAyB;IAC/B,UAAU,EAAE,MAAM;IAClB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,6BAA6B;SAClD;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,aAAa;YACjC,aAAa,EACX,OAAO,CAAC,6DAA6D;SACxE;KACF;IACD,WAAW,EAAE,UAAU,CAAC,IAAI;IAC5B,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;IACxC,aAAa,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC;IACpC,gBAAgB,EAAE,CAAC,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC,MAAM,CAAC;IAC7D,SAAS,EAAE,MAAM;IACjB,UAAU;CACX,CAAC;AACF,MAAM,iCAAiC,GAA6B;IAClE,IAAI,EAAE,6BAA6B;IACnC,UAAU,EAAE,MAAM;IAClB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,2BAA2B;SAChD;QACD,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,2BAA2B;SAChD;QACD,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,2BAA2B;SAChD;QACD,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,2BAA2B;SAChD;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,aAAa;SAClC;KACF;IACD,WAAW,EAAE,UAAU,CAAC,KAAK;IAC7B,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;IACxC,aAAa,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC;IACpC,gBAAgB,EAAE,CAAC,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC,MAAM,CAAC;IAC7D,SAAS,EAAE,MAAM;IACjB,UAAU;CACX,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport * as coreClient from \"@azure/core-client\";\nimport * as coreRestPipeline from \"@azure/core-rest-pipeline\";\nimport {\n PipelineRequest,\n PipelineResponse,\n SendRequest\n} from \"@azure/core-rest-pipeline\";\nimport { PollerLike, PollOperationState, LroEngine } from \"@azure/core-lro\";\nimport { LroImpl } from \"./lroImpl.js\";\nimport * as Parameters from \"./models/parameters.js\";\nimport * as Mappers from \"./models/mappers.js\";\nimport {\n ConversationAnalysisClientOptionalParams,\n AnalyzeConversationTaskUnion,\n AnalyzeConversationOptionalParams,\n AnalyzeConversationResponse,\n AnalyzeConversationJobsInput,\n ConversationAnalysisOptionalParams,\n ConversationAnalysisResponse\n} from \"./models/index.js\";\n\n/** @internal */\nexport class ConversationAnalysisClient extends coreClient.ServiceClient {\n endpoint: string;\n apiVersion: string;\n\n /**\n * Initializes a new instance of the ConversationAnalysisClient class.\n * @param endpoint Supported Cognitive Services endpoint (e.g.,\n * https://<resource-name>.api.cognitiveservices.azure.com).\n * @param options The parameter options\n */\n constructor(\n endpoint: string,\n options?: ConversationAnalysisClientOptionalParams\n ) {\n if (endpoint === undefined) {\n throw new Error(\"'endpoint' cannot be null\");\n }\n\n // Initializing default values for options\n if (!options) {\n options = {};\n }\n const defaults: ConversationAnalysisClientOptionalParams = {\n requestContentType: \"application/json; charset=utf-8\"\n };\n\n const packageDetails = `azsdk-js-ai-language-conversations/1.0.0-beta.2`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`\n : `${packageDetails}`;\n\n const optionsWithDefaults = {\n ...defaults,\n ...options,\n userAgentOptions: {\n userAgentPrefix\n },\n baseUri: options.endpoint ?? options.baseUri ?? \"{Endpoint}/language\"\n };\n super(optionsWithDefaults);\n\n if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {\n const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies();\n const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(\n (pipelinePolicy) =>\n pipelinePolicy.name ===\n coreRestPipeline.bearerTokenAuthenticationPolicyName\n );\n if (!bearerTokenAuthenticationPolicyFound) {\n this.pipeline.removePolicy({\n name: coreRestPipeline.bearerTokenAuthenticationPolicyName\n });\n this.pipeline.addPolicy(\n coreRestPipeline.bearerTokenAuthenticationPolicy({\n scopes: `${optionsWithDefaults.baseUri}/.default`,\n challengeCallbacks: {\n authorizeRequestOnChallenge:\n coreClient.authorizeRequestOnClaimChallenge\n }\n })\n );\n }\n }\n // Parameter assignments\n this.endpoint = endpoint;\n\n // Assigning values to Constant parameters\n this.apiVersion = options.apiVersion || \"2022-05-15-preview\";\n this.addCustomApiVersionPolicy(options.apiVersion);\n }\n\n /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */\n private addCustomApiVersionPolicy(apiVersion?: string) {\n if (!apiVersion) {\n return;\n }\n const apiVersionPolicy = {\n name: \"CustomApiVersionPolicy\",\n async sendRequest(\n request: PipelineRequest,\n next: SendRequest\n ): Promise<PipelineResponse> {\n const param = request.url.split(\"?\");\n if (param.length > 1) {\n const newParams = param[1].split(\"&\").map((item) => {\n if (item.indexOf(\"api-version\") > -1) {\n return \"api-version=\" + apiVersion;\n } else {\n return item;\n }\n });\n request.url = param[0] + \"?\" + newParams.join(\"&\");\n }\n return next(request);\n }\n };\n this.pipeline.addPolicy(apiVersionPolicy);\n }\n\n /**\n * Analyzes the input conversation utterance.\n * @param task A single conversational task to execute.\n * @param options The options parameters.\n */\n analyzeConversation(\n task: AnalyzeConversationTaskUnion,\n options?: AnalyzeConversationOptionalParams\n ): Promise<AnalyzeConversationResponse> {\n return this.sendOperationRequest(\n { task, options },\n analyzeConversationOperationSpec\n );\n }\n\n /**\n * Submit a collection of conversations for analysis. Specify one or more unique tasks to be executed.\n * @param task The collection of conversations to analyze and one or more tasks to execute.\n * @param options The options parameters.\n */\n async beginConversationAnalysis(\n task: AnalyzeConversationJobsInput,\n options?: ConversationAnalysisOptionalParams\n ): Promise<\n PollerLike<\n PollOperationState<ConversationAnalysisResponse>,\n ConversationAnalysisResponse\n >\n > {\n const directSendOperation = async (\n args: coreClient.OperationArguments,\n spec: coreClient.OperationSpec\n ): Promise<ConversationAnalysisResponse> => {\n return this.sendOperationRequest(args, spec);\n };\n const sendOperation = async (\n args: coreClient.OperationArguments,\n spec: coreClient.OperationSpec\n ) => {\n let currentRawResponse:\n | coreClient.FullOperationResponse\n | undefined = undefined;\n const providedCallback = args.options?.onResponse;\n const callback: coreClient.RawResponseCallback = (\n rawResponse: coreClient.FullOperationResponse,\n flatResponse: unknown\n ) => {\n currentRawResponse = rawResponse;\n providedCallback?.(rawResponse, flatResponse);\n };\n const updatedArgs = {\n ...args,\n options: {\n ...args.options,\n onResponse: callback\n }\n };\n const flatResponse = await directSendOperation(updatedArgs, spec);\n return {\n flatResponse,\n rawResponse: {\n statusCode: currentRawResponse!.status,\n body: currentRawResponse!.parsedBody,\n headers: currentRawResponse!.headers.toJSON()\n }\n };\n };\n\n const lro = new LroImpl(\n sendOperation,\n { task, options },\n conversationAnalysisOperationSpec\n );\n const poller = new LroEngine(lro, {\n resumeFrom: options?.resumeFrom,\n intervalInMs: options?.updateIntervalInMs\n });\n await poller.poll();\n return poller;\n }\n\n /**\n * Submit a collection of conversations for analysis. Specify one or more unique tasks to be executed.\n * @param task The collection of conversations to analyze and one or more tasks to execute.\n * @param options The options parameters.\n */\n async beginConversationAnalysisAndWait(\n task: AnalyzeConversationJobsInput,\n options?: ConversationAnalysisOptionalParams\n ): Promise<ConversationAnalysisResponse> {\n const poller = await this.beginConversationAnalysis(task, options);\n return poller.pollUntilDone();\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst analyzeConversationOperationSpec: coreClient.OperationSpec = {\n path: \"/:analyze-conversations\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.AnalyzeConversationTaskResult\n },\n default: {\n bodyMapper: Mappers.ErrorResponse,\n headersMapper:\n Mappers.ConversationAnalysisClientAnalyzeConversationExceptionHeaders\n }\n },\n requestBody: Parameters.task,\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer\n};\nconst conversationAnalysisOperationSpec: coreClient.OperationSpec = {\n path: \"/analyze-conversations/jobs\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.AnalyzeConversationJobState\n },\n 201: {\n bodyMapper: Mappers.AnalyzeConversationJobState\n },\n 202: {\n bodyMapper: Mappers.AnalyzeConversationJobState\n },\n 204: {\n bodyMapper: Mappers.AnalyzeConversationJobState\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n requestBody: Parameters.task1,\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/generated/index.ts"],"names":[],"mappings":"AAQA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/generated/index.ts"],"names":[],"mappings":"AAQA,cAAc,mBAAmB,CAAC;AAClC,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC"}
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|
6
6
|
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
7
7
|
*/
|
|
8
|
-
export * from "./models";
|
|
9
|
-
export { ConversationAnalysisClient } from "./conversationAnalysisClient";
|
|
8
|
+
export * from "./models/index.js";
|
|
9
|
+
export { ConversationAnalysisClient } from "./conversationAnalysisClient.js";
|
|
10
10
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/generated/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,mBAAmB,CAAC;AAClC,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nexport * from \"./models/index.js\";\nexport { ConversationAnalysisClient } from \"./conversationAnalysisClient.js\";\n"]}
|
|
@@ -5,8 +5,12 @@
|
|
|
5
5
|
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|
6
6
|
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
7
7
|
*/
|
|
8
|
-
import { __rest } from "tslib";
|
|
9
8
|
export class LroImpl {
|
|
9
|
+
sendOperationFn;
|
|
10
|
+
args;
|
|
11
|
+
spec;
|
|
12
|
+
requestPath;
|
|
13
|
+
requestMethod;
|
|
10
14
|
constructor(sendOperationFn, args, spec, requestPath = spec.path, requestMethod = spec.httpMethod) {
|
|
11
15
|
this.sendOperationFn = sendOperationFn;
|
|
12
16
|
this.args = args;
|
|
@@ -18,8 +22,12 @@ export class LroImpl {
|
|
|
18
22
|
return this.sendOperationFn(this.args, this.spec);
|
|
19
23
|
}
|
|
20
24
|
async sendPollRequest(path) {
|
|
21
|
-
const
|
|
22
|
-
return this.sendOperationFn(this.args,
|
|
25
|
+
const { requestBody, ...restSpec } = this.spec;
|
|
26
|
+
return this.sendOperationFn(this.args, {
|
|
27
|
+
...restSpec,
|
|
28
|
+
path,
|
|
29
|
+
httpMethod: "GET"
|
|
30
|
+
});
|
|
23
31
|
}
|
|
24
32
|
}
|
|
25
33
|
//# sourceMappingURL=lroImpl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lroImpl.js","sourceRoot":"","sources":["../../../src/generated/lroImpl.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,MAAM,OAAO,OAAO;IAER;IACA;IACA;IAKD;IACA;IATT,YACU,eAAkE,EAClE,IAA6B,EAC7B,IAIe,EAChB,cAAsB,IAAI,CAAC,IAAK,EAChC,gBAAwB,IAAI,CAAC,UAAU;QARtC,oBAAe,GAAf,eAAe,CAAmD;QAClE,SAAI,GAAJ,IAAI,CAAyB;QAC7B,SAAI,GAAJ,IAAI,CAIW;QAChB,gBAAW,GAAX,WAAW,CAAqB;QAChC,kBAAa,GAAb,aAAa,CAA0B;IAC7C,CAAC;IACG,KAAK,CAAC,kBAAkB;QAC7B,OAAO,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IACpD,CAAC;IACM,KAAK,CAAC,eAAe,CAAC,IAAY;QACvC,MAAM,EAAE,WAAW,EAAE,GAAG,QAAQ,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC;QAC/C,OAAO,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,EAAE;YACrC,GAAG,QAAQ;YACX,IAAI;YACJ,UAAU,EAAE,KAAK;SAClB,CAAC,CAAC;IACL,CAAC;CACF","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport { LongRunningOperation, LroResponse } from \"@azure/core-lro\";\n\nexport class LroImpl<T> implements LongRunningOperation<T> {\n constructor(\n private sendOperationFn: (args: any, spec: any) => Promise<LroResponse<T>>,\n private args: Record<string, unknown>,\n private spec: {\n readonly requestBody?: unknown;\n readonly path?: string;\n readonly httpMethod: string;\n } & Record<string, any>,\n public requestPath: string = spec.path!,\n public requestMethod: string = spec.httpMethod\n ) {}\n public async sendInitialRequest(): Promise<LroResponse<T>> {\n return this.sendOperationFn(this.args, this.spec);\n }\n public async sendPollRequest(path: string): Promise<LroResponse<T>> {\n const { requestBody, ...restSpec } = this.spec;\n return this.sendOperationFn(this.args, {\n ...restSpec,\n path,\n httpMethod: \"GET\"\n });\n }\n}\n"]}
|