File tree 3 files changed +28
-2
lines changed
api/resources/empathicVoice/client
wrapper/empathicVoice/chat
3 files changed +28
-2
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " hume" ,
3
- "version" : " 0.6.1 " ,
3
+ "version" : " 0.6.2 " ,
4
4
"private" : false ,
5
5
"repository" : " https://github.com/HumeAI/hume-typescript-sdk" ,
6
6
"main" : " ./index.js" ,
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ export class StreamSocket {
35
35
}
36
36
37
37
/**
38
- * Send session settings
38
+ * Send assistant input
39
39
*/
40
40
public async sendAssistantInput ( message : Omit < Hume . empathicVoice . AssistantInput , "type" > ) : Promise < void > {
41
41
await this . sendJson ( {
@@ -44,6 +44,26 @@ export class StreamSocket {
44
44
} ) ;
45
45
}
46
46
47
+ /**
48
+ * Send pause assistant message
49
+ */
50
+ public async pauseAssistant ( message : Omit < Hume . empathicVoice . PauseAssistantMessage , "type" > ) : Promise < void > {
51
+ await this . sendJson ( {
52
+ type : "pause_assistant_message" ,
53
+ ...message ,
54
+ } ) ;
55
+ }
56
+
57
+ /**
58
+ * Send resume assistant message
59
+ */
60
+ public async resumeAssistant ( message : Omit < Hume . empathicVoice . ResumeAssistantMessage , "type" > ) : Promise < void > {
61
+ await this . sendJson ( {
62
+ type : "resume_assistant_message" ,
63
+ ...message ,
64
+ } ) ;
65
+ }
66
+
47
67
/**
48
68
* Send text input
49
69
*/
Original file line number Diff line number Diff line change @@ -18,6 +18,9 @@ export declare namespace ChatClient {
18
18
/** The version of the configuration. */
19
19
configVersion ?: string ;
20
20
21
+ /** The ID of a chat group, used to resume a previous chat. */
22
+ resumedChatGroupId ?: string ;
23
+
21
24
onOpen ?: ( ) => void ;
22
25
onMessage ?: ( message : Hume . empathicVoice . SubscribeEvent ) => void ;
23
26
onError ?: ( error : Hume . empathicVoice . WebSocketError ) => void ;
@@ -39,6 +42,9 @@ export class ChatClient {
39
42
if ( args . configVersion != null ) {
40
43
queryParams [ "config_version" ] = args . configVersion ;
41
44
}
45
+ if ( args . resumedChatGroupId != null ) {
46
+ queryParams [ "resumed_chat_group_id" ] = args . resumedChatGroupId ;
47
+ }
42
48
43
49
const websocket = await core . connect ( `wss://api.hume.ai/v0/evi/chat?${ qs . stringify ( queryParams ) } ` ) ;
44
50
You can’t perform that action at this time.
0 commit comments