@aiqa/sdk 1.0.0-develop.4 → 1.0.0-develop.5
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/README.md +46 -0
- package/dist/browser/browser.d.ts +14 -2
- package/dist/browser/browser.js +15 -1
- package/dist/browser/browser.js.map +1 -1
- package/dist/node/node.d.ts +14 -2
- package/dist/node/node.js +15 -1
- package/dist/node/node.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -89,6 +89,42 @@ If authentication hasn't completed yet, this throws. Use the `authenticated` eve
|
|
|
89
89
|
const application = await sdk.getApplication();
|
|
90
90
|
```
|
|
91
91
|
|
|
92
|
+
#### `setConversationProduct(product)`
|
|
93
|
+
|
|
94
|
+
Sets the conversation product using a valid product code.
|
|
95
|
+
|
|
96
|
+
**Parameters:**
|
|
97
|
+
|
|
98
|
+
- `product: string` - product code (from the `service.code` catalog)
|
|
99
|
+
|
|
100
|
+
**Returns:**
|
|
101
|
+
|
|
102
|
+
- `Promise<{ success: boolean; product: string }>`
|
|
103
|
+
|
|
104
|
+
```typescript
|
|
105
|
+
const result = await sdk.setConversationProduct("life_insurance");
|
|
106
|
+
console.log(result.success, result.product);
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
#### `setConversationLanguage(language)`
|
|
110
|
+
|
|
111
|
+
Sets the conversation language.
|
|
112
|
+
|
|
113
|
+
**Parameters:**
|
|
114
|
+
|
|
115
|
+
- `language: ConversationLanguage` - only valid enum values are accepted
|
|
116
|
+
|
|
117
|
+
**Returns:**
|
|
118
|
+
|
|
119
|
+
- `Promise<{ success: boolean; language: string }>`
|
|
120
|
+
|
|
121
|
+
```typescript
|
|
122
|
+
import { ConversationLanguage } from "@aiqa/sdk";
|
|
123
|
+
|
|
124
|
+
const result = await sdk.setConversationLanguage(ConversationLanguage.EN);
|
|
125
|
+
console.log(result.success, result.language);
|
|
126
|
+
```
|
|
127
|
+
|
|
92
128
|
### Fact Management
|
|
93
129
|
|
|
94
130
|
#### `addFact(fact)`
|
|
@@ -242,6 +278,16 @@ type ApplicationFactInput = {
|
|
|
242
278
|
};
|
|
243
279
|
```
|
|
244
280
|
|
|
281
|
+
### ConversationLanguage
|
|
282
|
+
|
|
283
|
+
```typescript
|
|
284
|
+
enum ConversationLanguage {
|
|
285
|
+
EN = "en",
|
|
286
|
+
ES = "es",
|
|
287
|
+
FR = "fr",
|
|
288
|
+
}
|
|
289
|
+
```
|
|
290
|
+
|
|
245
291
|
### FactUpdateEvent
|
|
246
292
|
|
|
247
293
|
```typescript
|
|
@@ -15,12 +15,22 @@ declare enum Methods {
|
|
|
15
15
|
STOP_RECORDING = "STOP_RECORDING",
|
|
16
16
|
IS_RECORDING = "IS_RECORDING",
|
|
17
17
|
ADD_FACT = "ADD_FACT",
|
|
18
|
-
SET_CONVERSATION_PRODUCT = "SET_CONVERSATION_PRODUCT"
|
|
18
|
+
SET_CONVERSATION_PRODUCT = "SET_CONVERSATION_PRODUCT",
|
|
19
|
+
SET_CONVERSATION_LANGUAGE = "SET_CONVERSATION_LANGUAGE"
|
|
19
20
|
}
|
|
20
21
|
type SetConversationProductResult = {
|
|
21
22
|
success: boolean;
|
|
22
23
|
product: string;
|
|
23
24
|
};
|
|
25
|
+
type SetConversationLanguageResult = {
|
|
26
|
+
success: boolean;
|
|
27
|
+
language: string;
|
|
28
|
+
};
|
|
29
|
+
declare enum ConversationLanguage {
|
|
30
|
+
EN = "en",
|
|
31
|
+
ES = "es",
|
|
32
|
+
FR = "fr"
|
|
33
|
+
}
|
|
24
34
|
type SdkEvent = Methods | "connect" | "disconnect" | "close" | "error" | "reconnect_attempt" | "reconnect_error" | "reconnect_failed" | "authenticated" | "app_version";
|
|
25
35
|
declare enum FactAnswerFormatType {
|
|
26
36
|
string = "STRING",
|
|
@@ -79,6 +89,7 @@ declare abstract class IAiqaSdk {
|
|
|
79
89
|
abstract addFact(fact: ApplicationFactInput): Promise<AddFactResult>;
|
|
80
90
|
abstract getFacts(): Promise<ApplicationFact[]>;
|
|
81
91
|
abstract setConversationProduct(product: string): Promise<SetConversationProductResult>;
|
|
92
|
+
abstract setConversationLanguage(language: ConversationLanguage): Promise<SetConversationLanguageResult>;
|
|
82
93
|
}
|
|
83
94
|
|
|
84
95
|
declare class AiQaSdk implements IAiqaSdk {
|
|
@@ -99,6 +110,7 @@ declare class AiQaSdk implements IAiqaSdk {
|
|
|
99
110
|
getFacts(): Promise<ApplicationFact[]>;
|
|
100
111
|
addFact(fact: ApplicationFactInput): Promise<AddFactResult>;
|
|
101
112
|
setConversationProduct(product: string): Promise<SetConversationProductResult>;
|
|
113
|
+
setConversationLanguage(language: ConversationLanguage): Promise<SetConversationLanguageResult>;
|
|
102
114
|
authenticate(): Promise<void>;
|
|
103
115
|
startRecording(): Promise<boolean>;
|
|
104
116
|
stopRecording(): Promise<boolean>;
|
|
@@ -108,4 +120,4 @@ declare class AiQaSdk implements IAiqaSdk {
|
|
|
108
120
|
private isManagerEvent;
|
|
109
121
|
}
|
|
110
122
|
|
|
111
|
-
export { type AddFactResult, AiQaSdk, type Application, type ApplicationFact, type ApplicationFactAnswerChoice, type ApplicationFactAnswerFormat, type ApplicationFactInput, FactAnswerFormatType, IAiqaSdk, Methods, type QuestionStatus, type SdkError, type SdkEvent, type SetConversationProductResult, type VerificationStatus };
|
|
123
|
+
export { type AddFactResult, AiQaSdk, type Application, type ApplicationFact, type ApplicationFactAnswerChoice, type ApplicationFactAnswerFormat, type ApplicationFactInput, ConversationLanguage, FactAnswerFormatType, IAiqaSdk, Methods, type QuestionStatus, type SdkError, type SdkEvent, type SetConversationLanguageResult, type SetConversationProductResult, type VerificationStatus };
|
package/dist/browser/browser.js
CHANGED
|
@@ -3346,8 +3346,15 @@ var Methods = /* @__PURE__ */ ((Methods2) => {
|
|
|
3346
3346
|
Methods2["IS_RECORDING"] = "IS_RECORDING";
|
|
3347
3347
|
Methods2["ADD_FACT"] = "ADD_FACT";
|
|
3348
3348
|
Methods2["SET_CONVERSATION_PRODUCT"] = "SET_CONVERSATION_PRODUCT";
|
|
3349
|
+
Methods2["SET_CONVERSATION_LANGUAGE"] = "SET_CONVERSATION_LANGUAGE";
|
|
3349
3350
|
return Methods2;
|
|
3350
3351
|
})(Methods || {});
|
|
3352
|
+
var ConversationLanguage = /* @__PURE__ */ ((ConversationLanguage3) => {
|
|
3353
|
+
ConversationLanguage3["EN"] = "en";
|
|
3354
|
+
ConversationLanguage3["ES"] = "es";
|
|
3355
|
+
ConversationLanguage3["FR"] = "fr";
|
|
3356
|
+
return ConversationLanguage3;
|
|
3357
|
+
})(ConversationLanguage || {});
|
|
3351
3358
|
var FactAnswerFormatType = /* @__PURE__ */ ((FactAnswerFormatType2) => {
|
|
3352
3359
|
FactAnswerFormatType2["string"] = "STRING";
|
|
3353
3360
|
FactAnswerFormatType2["number"] = "NUMBER";
|
|
@@ -3388,7 +3395,7 @@ var compareVersions = (left, right) => {
|
|
|
3388
3395
|
// package.json
|
|
3389
3396
|
var package_default = {
|
|
3390
3397
|
name: "@aiqa/sdk",
|
|
3391
|
-
version: "1.0.0-develop.
|
|
3398
|
+
version: "1.0.0-develop.4",
|
|
3392
3399
|
main: "dist/node/node.js",
|
|
3393
3400
|
module: "dist/node/node.js",
|
|
3394
3401
|
types: "dist/node/node.d.ts",
|
|
@@ -3623,6 +3630,12 @@ var AiQaSdk = class {
|
|
|
3623
3630
|
});
|
|
3624
3631
|
return result && result.data !== void 0 ? result.data : result;
|
|
3625
3632
|
}
|
|
3633
|
+
async setConversationLanguage(language) {
|
|
3634
|
+
const result = await this.sendMessage("SET_CONVERSATION_LANGUAGE" /* SET_CONVERSATION_LANGUAGE */, {
|
|
3635
|
+
language
|
|
3636
|
+
});
|
|
3637
|
+
return result && result.data !== void 0 ? result.data : result;
|
|
3638
|
+
}
|
|
3626
3639
|
async authenticate() {
|
|
3627
3640
|
try {
|
|
3628
3641
|
const result = await this.sendMessage("AUTHENTICATE" /* AUTHENTICATE */, {
|
|
@@ -3665,6 +3678,7 @@ var AiQaSdk = class {
|
|
|
3665
3678
|
var shared_default = AiQaSdk;
|
|
3666
3679
|
export {
|
|
3667
3680
|
shared_default as AiQaSdk,
|
|
3681
|
+
ConversationLanguage,
|
|
3668
3682
|
FactAnswerFormatType,
|
|
3669
3683
|
IAiqaSdk,
|
|
3670
3684
|
Methods
|