@videosdk.live/react-sdk 0.1.101 → 0.1.102
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +21 -4
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +21 -4
- package/dist/index.modern.js.map +1 -1
- package/dist/types/character.d.ts +17 -8
- package/dist/types/index.d.ts +30 -6
- package/package.json +2 -2
|
@@ -2,10 +2,10 @@ import { Participant } from './participant';
|
|
|
2
2
|
import { Stream } from './stream';
|
|
3
3
|
|
|
4
4
|
export enum CharacterMode {
|
|
5
|
-
TEXT =
|
|
6
|
-
CO_PILOT =
|
|
7
|
-
AUTO_PILOT =
|
|
8
|
-
VISION_PILOT =
|
|
5
|
+
TEXT = 'text',
|
|
6
|
+
CO_PILOT = 'co_pilot',
|
|
7
|
+
AUTO_PILOT = 'auto_pilot',
|
|
8
|
+
VISION_PILOT = 'vision_pilot'
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
export enum CharacterState {
|
|
@@ -35,6 +35,11 @@ export class Character extends Participant {
|
|
|
35
35
|
*/
|
|
36
36
|
knowledgeBases: string[];
|
|
37
37
|
|
|
38
|
+
/**
|
|
39
|
+
* @description This represents language of interaction
|
|
40
|
+
*/
|
|
41
|
+
language: string;
|
|
42
|
+
|
|
38
43
|
/**
|
|
39
44
|
* @description This represents communication mode of character participant
|
|
40
45
|
*/
|
|
@@ -61,8 +66,8 @@ export class Character extends Participant {
|
|
|
61
66
|
sendMessage(text: string): Promise<void>;
|
|
62
67
|
|
|
63
68
|
/**
|
|
64
|
-
|
|
65
|
-
|
|
69
|
+
* @description This method can be used to interrupt a character participant
|
|
70
|
+
*/
|
|
66
71
|
interrupt(): Promise<void>;
|
|
67
72
|
|
|
68
73
|
/**
|
|
@@ -79,7 +84,9 @@ export class Character extends Participant {
|
|
|
79
84
|
| 'character-state-changed'
|
|
80
85
|
| 'character-message'
|
|
81
86
|
| 'character-joined'
|
|
82
|
-
| 'character-left'
|
|
87
|
+
| 'character-left'
|
|
88
|
+
| 'user-message'
|
|
89
|
+
| 'data',
|
|
83
90
|
listener: (data: any) => void
|
|
84
91
|
): void;
|
|
85
92
|
/**
|
|
@@ -96,7 +103,9 @@ export class Character extends Participant {
|
|
|
96
103
|
| 'character-state-changed'
|
|
97
104
|
| 'character-message'
|
|
98
105
|
| 'character-joined'
|
|
99
|
-
| 'character-left'
|
|
106
|
+
| 'character-left'
|
|
107
|
+
| 'user-message'
|
|
108
|
+
| 'data',
|
|
100
109
|
listener: (data: any) => void
|
|
101
110
|
): void;
|
|
102
111
|
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1010,7 +1010,6 @@ export function useFile(): {
|
|
|
1010
1010
|
}) => Promise<string | null>;
|
|
1011
1011
|
};
|
|
1012
1012
|
|
|
1013
|
-
|
|
1014
1013
|
/**
|
|
1015
1014
|
* @returns - This will return `startWhiteboard()`, `stopWhiteboard()` and `whiteboardUrl`.
|
|
1016
1015
|
* ---
|
|
@@ -1027,8 +1026,7 @@ export function useFile(): {
|
|
|
1027
1026
|
* }
|
|
1028
1027
|
* ```
|
|
1029
1028
|
*/
|
|
1030
|
-
export function useWhiteboard():
|
|
1031
|
-
{
|
|
1029
|
+
export function useWhiteboard(): {
|
|
1032
1030
|
/**
|
|
1033
1031
|
* @description Starts the whiteboard for the meeting.
|
|
1034
1032
|
*/
|
|
@@ -1117,6 +1115,10 @@ export function useTranscription({
|
|
|
1117
1115
|
* ---
|
|
1118
1116
|
* @param onCharacterMessage - This will triggered when a character response/message is published.
|
|
1119
1117
|
* ---
|
|
1118
|
+
* @param onUserMessage - This will triggered when a user/participant message is published.
|
|
1119
|
+
* ---
|
|
1120
|
+
* @param onData - This will triggered when a character worker notify payload.
|
|
1121
|
+
* ---
|
|
1120
1122
|
* @param onStreamEnabled - It's a callback which gets triggered whenever a character's video, audio or screen share stream is enabled.
|
|
1121
1123
|
* ---
|
|
1122
1124
|
* @param onStreamEnabled - It's a callback which gets triggered whenever a character's video, audio or screen share stream is disabled.
|
|
@@ -1140,6 +1142,14 @@ export function useTranscription({
|
|
|
1140
1142
|
* console.log('character message Payload:', data);
|
|
1141
1143
|
* }
|
|
1142
1144
|
*
|
|
1145
|
+
* function onUserMessage(data) {
|
|
1146
|
+
* console.log('user message Payload:', data);
|
|
1147
|
+
* }
|
|
1148
|
+
*
|
|
1149
|
+
* function onData(topic, data) {
|
|
1150
|
+
* console.log('character data available:', topic, data);
|
|
1151
|
+
* }
|
|
1152
|
+
*
|
|
1143
1153
|
* const { join, leave, sendMessage, interrupt } = useCharacter({
|
|
1144
1154
|
* interactionId,
|
|
1145
1155
|
* // OR
|
|
@@ -1148,10 +1158,13 @@ export function useTranscription({
|
|
|
1148
1158
|
* characterRole,
|
|
1149
1159
|
* characterMode,
|
|
1150
1160
|
* knowledgeBases,
|
|
1161
|
+
* language,
|
|
1151
1162
|
* },
|
|
1152
1163
|
* {
|
|
1153
1164
|
* onCharacterStateChanged,
|
|
1154
1165
|
* onCharacterMessage,
|
|
1166
|
+
* onUserMessage,
|
|
1167
|
+
* onData,
|
|
1155
1168
|
* onCharacterJoined,
|
|
1156
1169
|
* onCharacterLeft,
|
|
1157
1170
|
*
|
|
@@ -1178,7 +1191,8 @@ export function useCharacter(
|
|
|
1178
1191
|
displayName,
|
|
1179
1192
|
characterRole,
|
|
1180
1193
|
characterMode,
|
|
1181
|
-
knowledgeBases
|
|
1194
|
+
knowledgeBases,
|
|
1195
|
+
language
|
|
1182
1196
|
}: {
|
|
1183
1197
|
interactionId: string;
|
|
1184
1198
|
// OR
|
|
@@ -1187,11 +1201,13 @@ export function useCharacter(
|
|
|
1187
1201
|
characterRole: string;
|
|
1188
1202
|
characterMode: 'text' | 'co_pilot' | 'auto_pilot' | 'vision_pilot';
|
|
1189
1203
|
knowledgeBases: string[];
|
|
1204
|
+
language: string;
|
|
1190
1205
|
},
|
|
1191
1206
|
{
|
|
1192
1207
|
onCharacterStateChanged,
|
|
1193
1208
|
onCharacterMessage,
|
|
1194
|
-
|
|
1209
|
+
onUserMessage,
|
|
1210
|
+
onData,
|
|
1195
1211
|
onStreamEnabled,
|
|
1196
1212
|
onStreamDisabled,
|
|
1197
1213
|
onMediaStatusChanged,
|
|
@@ -1201,12 +1217,20 @@ export function useCharacter(
|
|
|
1201
1217
|
id: string;
|
|
1202
1218
|
status: CharacterState;
|
|
1203
1219
|
}) => void;
|
|
1204
|
-
|
|
1220
|
+
onUserMessage?: (data: {
|
|
1205
1221
|
participantId: string;
|
|
1206
1222
|
participantName: string;
|
|
1207
1223
|
text: string;
|
|
1208
1224
|
timestamp: number;
|
|
1209
1225
|
}) => void;
|
|
1226
|
+
onCharacterMessage?: (data: {
|
|
1227
|
+
characterId: string;
|
|
1228
|
+
characterName: string;
|
|
1229
|
+
text: string;
|
|
1230
|
+
timestamp: number;
|
|
1231
|
+
}) => void;
|
|
1232
|
+
|
|
1233
|
+
onData?: (topic: string, data: any) => void;
|
|
1210
1234
|
onCharacterJoined?: () => void;
|
|
1211
1235
|
onCharacterLeft?: () => void;
|
|
1212
1236
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@videosdk.live/react-sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.102",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.modern.js",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
}
|
|
75
75
|
},
|
|
76
76
|
"dependencies": {
|
|
77
|
-
"@videosdk.live/js-sdk": "0.0.
|
|
77
|
+
"@videosdk.live/js-sdk": "0.0.98",
|
|
78
78
|
"events": "^3.3.0"
|
|
79
79
|
}
|
|
80
80
|
}
|