retell-sdk 2.3.1 → 2.3.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.
- package/example.js +25 -17
- package/lib/config.d.ts +1 -1
- package/lib/config.d.ts.map +1 -1
- package/lib/config.js +1 -1
- package/lib/config.js.map +1 -1
- package/models/components/agent.d.ts +31 -1
- package/models/components/agent.d.ts.map +1 -1
- package/models/components/agent.js +22 -2
- package/models/components/agent.js.map +1 -1
- package/models/components/calldetail.d.ts +6 -0
- package/models/components/calldetail.d.ts.map +1 -1
- package/models/components/calldetail.js +4 -0
- package/models/components/calldetail.js.map +1 -1
- package/models/operations/createagent.d.ts +31 -1
- package/models/operations/createagent.d.ts.map +1 -1
- package/models/operations/createagent.js +22 -2
- package/models/operations/createagent.js.map +1 -1
- package/models/operations/registercall.d.ts +6 -0
- package/models/operations/registercall.d.ts.map +1 -1
- package/models/operations/registercall.js +4 -0
- package/models/operations/registercall.js.map +1 -1
- package/models/operations/updateagent.d.ts +30 -0
- package/models/operations/updateagent.d.ts.map +1 -1
- package/models/operations/updateagent.js +23 -2
- package/models/operations/updateagent.js.map +1 -1
- package/package.json +1 -1
- package/sdk/index.d.ts +0 -1
- package/sdk/index.d.ts.map +1 -1
- package/sdk/index.js +0 -1
- package/sdk/index.js.map +1 -1
- package/src/example.ts +3 -3
- package/src/lib/config.ts +1 -1
- package/src/models/components/agent.ts +54 -3
- package/src/models/components/calldetail.ts +10 -0
- package/src/models/operations/createagent.ts +53 -3
- package/src/models/operations/registercall.ts +10 -0
- package/src/models/operations/updateagent.ts +53 -2
- package/src/sdk/index.ts +0 -1
- package/src/sdk/audioWsClient.ts +0 -76
|
@@ -38,7 +38,12 @@ var UpdateAgentRequestBody$;
|
|
|
38
38
|
llm_websocket_url: zod_1.z.string(),
|
|
39
39
|
voice_id: zod_1.z.string(),
|
|
40
40
|
enable_backchannel: zod_1.z.boolean().optional(),
|
|
41
|
-
voice_temperature: zod_1.z.number().optional()
|
|
41
|
+
voice_temperature: zod_1.z.number().optional(),
|
|
42
|
+
voice_speed: zod_1.z.number().optional(),
|
|
43
|
+
responsiveness: zod_1.z.number().optional(),
|
|
44
|
+
ambient_sound: zod_1.z.enum(['coffee-shop', 'convention-hall', 'summer-outdoor', 'mountain-outdoor', 'null']).optional(),
|
|
45
|
+
webhook_url: zod_1.z.string().optional(),
|
|
46
|
+
boosted_keywords: zod_1.z.array(zod_1.z.string()).optional(),
|
|
42
47
|
})
|
|
43
48
|
.transform((v) => {
|
|
44
49
|
return {
|
|
@@ -49,6 +54,12 @@ var UpdateAgentRequestBody$;
|
|
|
49
54
|
...(v.voice_id === undefined ? null : { voiceId: v.voice_id }),
|
|
50
55
|
...(v.enable_backchannel === undefined ? null : { enableBackchannel: v.enable_backchannel }),
|
|
51
56
|
...(v.voice_temperature === undefined ? null : { voiceTemperature: v.voice_temperature }),
|
|
57
|
+
...(v.voice_temperature === undefined ? null : { voiceTemperature: v.voice_temperature }),
|
|
58
|
+
...(v.voice_speed === undefined ? null : { voiceSpeed: v.voice_speed }),
|
|
59
|
+
...(v.responsiveness === undefined ? null : { responsiveness: v.responsiveness }),
|
|
60
|
+
...(v.ambient_sound === undefined ? null : { ambientSound: v.ambient_sound }),
|
|
61
|
+
...(v.webhook_url === undefined ? null : { webhookUrl: v.webhook_url }),
|
|
62
|
+
...(v.boosted_keywords === undefined ? null : { boostedKeywords: v.boosted_keywords }),
|
|
52
63
|
};
|
|
53
64
|
});
|
|
54
65
|
UpdateAgentRequestBody$.outboundSchema = zod_1.z
|
|
@@ -57,7 +68,12 @@ var UpdateAgentRequestBody$;
|
|
|
57
68
|
llmWebsocketUrl: zod_1.z.string().optional(),
|
|
58
69
|
voiceId: zod_1.z.string().optional(),
|
|
59
70
|
enableBackchannel: zod_1.z.boolean().optional(),
|
|
60
|
-
voiceTemperature: zod_1.z.number().optional()
|
|
71
|
+
voiceTemperature: zod_1.z.number().optional(),
|
|
72
|
+
voiceSpeed: zod_1.z.number().optional(),
|
|
73
|
+
responsiveness: zod_1.z.number().optional(),
|
|
74
|
+
ambientSound: zod_1.z.enum(['coffee-shop', 'convention-hall', 'summer-outdoor', 'mountain-outdoor', 'null']).optional(),
|
|
75
|
+
webhookUrl: zod_1.z.string().optional(),
|
|
76
|
+
boostedKeywords: zod_1.z.array(zod_1.z.string()).optional(),
|
|
61
77
|
})
|
|
62
78
|
.transform((v) => {
|
|
63
79
|
return {
|
|
@@ -68,6 +84,11 @@ var UpdateAgentRequestBody$;
|
|
|
68
84
|
...(v.voiceId === undefined ? null : { voice_id: v.voiceId }),
|
|
69
85
|
...(v.enableBackchannel === undefined ? null : { enable_backchannel: v.enableBackchannel }),
|
|
70
86
|
...(v.voiceTemperature === undefined ? null : { voice_temperature: v.voiceTemperature }),
|
|
87
|
+
...(v.voiceSpeed === undefined ? null : { voice_speed: v.voiceSpeed }),
|
|
88
|
+
...(v.responsiveness === undefined ? null : { responsiveness: v.responsiveness }),
|
|
89
|
+
...(v.ambientSound === undefined ? null : { ambient_sound: v.ambientSound }),
|
|
90
|
+
...(v.webhookUrl === undefined ? null : { webhook_url: v.webhookUrl }),
|
|
91
|
+
...(v.boostedKeywords === undefined ? null : { boosted_keywords: v.boostedKeywords }),
|
|
71
92
|
};
|
|
72
93
|
});
|
|
73
94
|
})(UpdateAgentRequestBody$ || (exports.UpdateAgentRequestBody$ = UpdateAgentRequestBody$ = {}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updateagent.js","sourceRoot":"","sources":["../../src/models/operations/updateagent.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,oEAAsD;AACtD,6BAAwB;
|
|
1
|
+
{"version":3,"file":"updateagent.js","sourceRoot":"","sources":["../../src/models/operations/updateagent.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,oEAAsD;AACtD,6BAAwB;AA6CxB,gBAAgB;AAChB,I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AAC,CAAC,CAAC;IASQ,mCAAc,GAIvB,OAAC;SACF,MAAM,CAAC;QACN,KAAK,EAAE,UAAU,CAAC,MAAM,CAAC,cAAc,CAAC,QAAQ,EAAE;QAClD,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE;QACvB,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE;QAC5B,WAAW,EAAE,OAAC,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,GAAG,EAAE;YACjD,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;QACnD,CAAC,CAAC;KACH,CAAC;SACD,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE;QACf,OAAO;YACL,GAAG,CAAC,CAAC,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC;YACtD,WAAW,EAAE,CAAC,CAAC,WAAW;YAC1B,UAAU,EAAE,CAAC,CAAC,UAAU;YACxB,WAAW,EAAE,CAAC,CAAC,WAAW;SAC3B,CAAC;IACJ,CAAC,CAAC,CAAC;AACP,CAAC,EAxDgB,oBAAoB,oCAApB,oBAAoB,QAwDpC"}
|
package/package.json
CHANGED
package/sdk/index.d.ts
CHANGED
package/sdk/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/sdk/index.ts"],"names":[],"mappings":"AAIA,cAAc,OAAO,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/sdk/index.ts"],"names":[],"mappings":"AAIA,cAAc,OAAO,CAAC"}
|
package/sdk/index.js
CHANGED
|
@@ -18,5 +18,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
18
18
|
};
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
20
|
__exportStar(require("./sdk"), exports);
|
|
21
|
-
__exportStar(require("./audioWsClient"), exports);
|
|
22
21
|
//# sourceMappingURL=index.js.map
|
package/sdk/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/sdk/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;AAEH,wCAAsB
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/sdk/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;AAEH,wCAAsB"}
|
package/src/example.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { RetellClient } from "./sdk";
|
|
|
4
4
|
|
|
5
5
|
const retell = new RetellClient({
|
|
6
6
|
// Find the key in dashboard
|
|
7
|
-
apiKey: "
|
|
7
|
+
apiKey: "1a698b4f-5b06-4c71-8f69-7c506a67696e",
|
|
8
8
|
serverURL: "http://localhost:3002"
|
|
9
9
|
});
|
|
10
10
|
|
|
@@ -27,7 +27,7 @@ async function main() {
|
|
|
27
27
|
|
|
28
28
|
// console.log(res);
|
|
29
29
|
|
|
30
|
-
const res2 = await retell.getAgent("
|
|
30
|
+
const res2 = await retell.getAgent("68ebe15b1c323aa536bedfc275e02b53");
|
|
31
31
|
// const res = await retell.listAgents();
|
|
32
32
|
console.log(res2);
|
|
33
33
|
|
|
@@ -35,7 +35,7 @@ console.log(res2);
|
|
|
35
35
|
agentName: "new name",
|
|
36
36
|
voiceTemperature: 0,
|
|
37
37
|
enableBackchannel: true
|
|
38
|
-
}, '
|
|
38
|
+
}, '68ebe15b1c323aa536bedfc275e02b53');
|
|
39
39
|
console.log(agent.agent);
|
|
40
40
|
// const res = await retell.deleteAgent('5790c196cd6b7728de819c3de444d3b5');
|
|
41
41
|
// console.log(res.statusCode)
|
package/src/lib/config.ts
CHANGED
|
@@ -30,9 +30,29 @@ export type Agent = {
|
|
|
30
30
|
*/
|
|
31
31
|
enableBackchannel?: boolean | undefined;
|
|
32
32
|
/**
|
|
33
|
-
* Controls how stable the voice is.
|
|
33
|
+
* Controls how stable the voice is. Value ranging from [0,2]. Lower value means more stable, and higher value means more variant speech generation. Currently this setting only applies to 11labs voices. If unset, default value 1 will apply.
|
|
34
34
|
*/
|
|
35
35
|
voiceTemperature?: number | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* Controls speed of voice. Value ranging from [0.5,2]. Lower value means slower speech, while higher value means faster speech rate. If unset, default value 1 will apply.
|
|
38
|
+
*/
|
|
39
|
+
voiceSpeed?: number | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* Controls how responsive is the agent. Value ranging from [0,1]. Lower value means less responsive agent (wait more, respond slower), while higher value means faster exchanges (respond when it can). If unset, default value 1 will apply.
|
|
42
|
+
*/
|
|
43
|
+
responsiveness?: number | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* If set, will add ambient environment sound to the call to make experience more realistic.
|
|
46
|
+
*/
|
|
47
|
+
ambientSound?: 'coffee-shop' | 'convention-hall' | 'summer-outdoor' | 'mountain-outdoor' | 'null' | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* The webhook for agent to listen to call events. See what events it would get at webhook doc. If set, will binds webhook events for this agent to the specified url, and will ignore the account level webhook for this agent. Set to string null to remove webhook url from this agent.
|
|
50
|
+
*/
|
|
51
|
+
webhookUrl?: string | undefined;
|
|
52
|
+
/**
|
|
53
|
+
* Provide a customized list of keywords to expand our models' vocabulary, aimed at improving performance and understanding within your specific context.
|
|
54
|
+
*/
|
|
55
|
+
boostedKeywords?: string[] | undefined;
|
|
36
56
|
};
|
|
37
57
|
|
|
38
58
|
/** @internal */
|
|
@@ -45,6 +65,11 @@ export namespace Agent$ {
|
|
|
45
65
|
last_modification_timestamp: number;
|
|
46
66
|
enable_backchannel?: boolean | undefined;
|
|
47
67
|
voice_temperature?: number | undefined;
|
|
68
|
+
voice_speed?: number | undefined;
|
|
69
|
+
responsiveness?: number | undefined;
|
|
70
|
+
ambient_sound?: 'coffee-shop' | 'convention-hall' | 'summer-outdoor' | 'mountain-outdoor' | 'null' | undefined;
|
|
71
|
+
webhook_url?: string | undefined;
|
|
72
|
+
boosted_keywords?: string[] | undefined;
|
|
48
73
|
};
|
|
49
74
|
|
|
50
75
|
export const inboundSchema: z.ZodType<Agent, z.ZodTypeDef, Inbound> = z
|
|
@@ -55,7 +80,12 @@ export namespace Agent$ {
|
|
|
55
80
|
voice_id: z.string(),
|
|
56
81
|
last_modification_timestamp: z.number().int(),
|
|
57
82
|
enable_backchannel: z.boolean().optional(),
|
|
58
|
-
voice_temperature: z.number().optional()
|
|
83
|
+
voice_temperature: z.number().optional(),
|
|
84
|
+
voice_speed: z.number().optional(),
|
|
85
|
+
responsiveness: z.number().optional(),
|
|
86
|
+
ambient_sound: z.enum(['coffee-shop', 'convention-hall', 'summer-outdoor', 'mountain-outdoor', 'null']).optional(),
|
|
87
|
+
webhook_url: z.string().optional(),
|
|
88
|
+
boosted_keywords: z.array(z.string()).optional(),
|
|
59
89
|
})
|
|
60
90
|
.transform((v) => {
|
|
61
91
|
return {
|
|
@@ -66,6 +96,11 @@ export namespace Agent$ {
|
|
|
66
96
|
lastModificationTimestamp: v.last_modification_timestamp,
|
|
67
97
|
...(v.enable_backchannel === undefined ? null : { enableBackchannel: v.enable_backchannel }),
|
|
68
98
|
...(v.voice_temperature === undefined ? null : { voiceTemperature: v.voice_temperature }),
|
|
99
|
+
...(v.voice_speed === undefined ? null : { voiceSpeed: v.voice_speed }),
|
|
100
|
+
...(v.responsiveness === undefined ? null : { responsiveness: v.responsiveness }),
|
|
101
|
+
...(v.ambient_sound === undefined ? null : { ambientSound: v.ambient_sound }),
|
|
102
|
+
...(v.webhook_url === undefined ? null : { webhookUrl: v.webhook_url }),
|
|
103
|
+
...(v.boosted_keywords === undefined ? null : { boostedKeywords: v.boosted_keywords }),
|
|
69
104
|
};
|
|
70
105
|
});
|
|
71
106
|
|
|
@@ -77,6 +112,12 @@ export namespace Agent$ {
|
|
|
77
112
|
last_modification_timestamp: number;
|
|
78
113
|
enable_backchannel?: boolean | undefined;
|
|
79
114
|
voice_temperature?: number | undefined;
|
|
115
|
+
voice_speed?: number | undefined;
|
|
116
|
+
responsiveness?: number | undefined;
|
|
117
|
+
ambient_sound?: 'coffee-shop' | 'convention-hall' | 'summer-outdoor' | 'mountain-outdoor' | 'null' | undefined;
|
|
118
|
+
webhook_url?: string | undefined;
|
|
119
|
+
boosted_keywords?: string[] | undefined;
|
|
120
|
+
|
|
80
121
|
};
|
|
81
122
|
|
|
82
123
|
export const outboundSchema: z.ZodType<Outbound, z.ZodTypeDef, Agent> = z
|
|
@@ -87,7 +128,12 @@ export namespace Agent$ {
|
|
|
87
128
|
voiceId: z.string(),
|
|
88
129
|
lastModificationTimestamp: z.number().int(),
|
|
89
130
|
enableBackchannel: z.boolean().optional(),
|
|
90
|
-
voiceTemperature: z.number().optional()
|
|
131
|
+
voiceTemperature: z.number().optional(),
|
|
132
|
+
voiceSpeed: z.number().optional(),
|
|
133
|
+
responsiveness: z.number().optional(),
|
|
134
|
+
ambientSound: z.enum(['coffee-shop', 'convention-hall', 'summer-outdoor', 'mountain-outdoor', 'null']).optional(),
|
|
135
|
+
webhookUrl: z.string().optional(),
|
|
136
|
+
boostedKeywords: z.array(z.string()).optional(),
|
|
91
137
|
})
|
|
92
138
|
.transform((v) => {
|
|
93
139
|
return {
|
|
@@ -98,6 +144,11 @@ export namespace Agent$ {
|
|
|
98
144
|
last_modification_timestamp: v.lastModificationTimestamp,
|
|
99
145
|
...(v.enableBackchannel === undefined ? null : { enable_backchannel: v.enableBackchannel }),
|
|
100
146
|
...(v.voiceTemperature === undefined ? null : { voice_temperature: v.voiceTemperature }),
|
|
147
|
+
...(v.voiceSpeed === undefined ? null : { voice_speed: v.voiceSpeed }),
|
|
148
|
+
...(v.responsiveness === undefined ? null : { responsiveness: v.responsiveness }),
|
|
149
|
+
...(v.ambientSound === undefined ? null : { ambient_sound: v.ambientSound }),
|
|
150
|
+
...(v.webhookUrl === undefined ? null : { webhook_url: v.webhookUrl }),
|
|
151
|
+
...(v.boostedKeywords === undefined ? null : { boosted_keywords: v.boostedKeywords }), // Correctly transformed
|
|
101
152
|
};
|
|
102
153
|
});
|
|
103
154
|
}
|
|
@@ -72,6 +72,10 @@ export type CallDetail = {
|
|
|
72
72
|
* Transcription of the call. Available after call ends.
|
|
73
73
|
*/
|
|
74
74
|
transcript?: string | undefined;
|
|
75
|
+
/**
|
|
76
|
+
* If users stay silent for a period, end the call. By default, it is set to 600,000 ms (10 min). The minimum value allowed is 10,000 ms (10 s).
|
|
77
|
+
*/
|
|
78
|
+
endCallAfterSilenceMs?: number | undefined;
|
|
75
79
|
};
|
|
76
80
|
|
|
77
81
|
/** @internal */
|
|
@@ -96,6 +100,7 @@ export namespace CallDetail$ {
|
|
|
96
100
|
recording_url?: string | undefined;
|
|
97
101
|
start_timestamp: number;
|
|
98
102
|
transcript?: string | undefined;
|
|
103
|
+
end_call_after_silence_ms?: number | undefined;
|
|
99
104
|
};
|
|
100
105
|
|
|
101
106
|
export const inboundSchema: z.ZodType<CallDetail, z.ZodTypeDef, Inbound> = z
|
|
@@ -110,6 +115,7 @@ export namespace CallDetail$ {
|
|
|
110
115
|
recording_url: z.string().optional(),
|
|
111
116
|
start_timestamp: z.number().int(),
|
|
112
117
|
transcript: z.string().optional(),
|
|
118
|
+
end_call_after_silence_ms: z.number().int().optional(),
|
|
113
119
|
})
|
|
114
120
|
.transform((v) => {
|
|
115
121
|
return {
|
|
@@ -127,6 +133,7 @@ export namespace CallDetail$ {
|
|
|
127
133
|
: { recordingUrl: v.recording_url }),
|
|
128
134
|
startTimestamp: v.start_timestamp,
|
|
129
135
|
...(v.transcript === undefined ? null : { transcript: v.transcript }),
|
|
136
|
+
...(v.end_call_after_silence_ms === undefined ? null : { endCallAfterSilenceMs: v.end_call_after_silence_ms }),
|
|
130
137
|
};
|
|
131
138
|
});
|
|
132
139
|
|
|
@@ -141,6 +148,7 @@ export namespace CallDetail$ {
|
|
|
141
148
|
recording_url?: string | undefined;
|
|
142
149
|
start_timestamp: number;
|
|
143
150
|
transcript?: string | undefined;
|
|
151
|
+
end_call_after_silence_ms?: number | undefined;
|
|
144
152
|
};
|
|
145
153
|
|
|
146
154
|
export const outboundSchema: z.ZodType<Outbound, z.ZodTypeDef, CallDetail> = z
|
|
@@ -155,6 +163,7 @@ export namespace CallDetail$ {
|
|
|
155
163
|
recordingUrl: z.string().optional(),
|
|
156
164
|
startTimestamp: z.number().int(),
|
|
157
165
|
transcript: z.string().optional(),
|
|
166
|
+
endCallAfterSilenceMs: z.number().int().optional(),
|
|
158
167
|
})
|
|
159
168
|
.transform((v) => {
|
|
160
169
|
return {
|
|
@@ -172,6 +181,7 @@ export namespace CallDetail$ {
|
|
|
172
181
|
: { recording_url: v.recordingUrl }),
|
|
173
182
|
start_timestamp: v.startTimestamp,
|
|
174
183
|
...(v.transcript === undefined ? null : { transcript: v.transcript }),
|
|
184
|
+
...(v.endCallAfterSilenceMs === undefined ? null : { end_call_after_silence_ms: v.endCallAfterSilenceMs }),
|
|
175
185
|
};
|
|
176
186
|
});
|
|
177
187
|
}
|
|
@@ -23,9 +23,29 @@ export type CreateAgentRequestBody = {
|
|
|
23
23
|
*/
|
|
24
24
|
enableBackchannel?: boolean | undefined;
|
|
25
25
|
/**
|
|
26
|
-
* Controls how stable the voice is.
|
|
26
|
+
* Controls how stable the voice is. Value ranging from [0,2]. Lower value means more stable, and higher value means more variant speech generation. Currently this setting only applies to 11labs voices. If unset, default value 1 will apply.
|
|
27
27
|
*/
|
|
28
28
|
voiceTemperature?: number | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* Controls speed of voice. Value ranging from [0.5,2]. Lower value means slower speech, while higher value means faster speech rate. If unset, default value 1 will apply.
|
|
31
|
+
*/
|
|
32
|
+
voiceSpeed?: number | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* Controls how responsive is the agent. Value ranging from [0,1]. Lower value means less responsive agent (wait more, respond slower), while higher value means faster exchanges (respond when it can). If unset, default value 1 will apply.
|
|
35
|
+
*/
|
|
36
|
+
responsiveness?: number | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* If set, will add ambient environment sound to the call to make experience more realistic.
|
|
39
|
+
*/
|
|
40
|
+
ambientSound?: 'coffee-shop' | 'convention-hall' | 'summer-outdoor' | 'mountain-outdoor' | 'null' | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* The webhook for agent to listen to call events. See what events it would get at webhook doc. If set, will binds webhook events for this agent to the specified url, and will ignore the account level webhook for this agent. Set to string null to remove webhook url from this agent.
|
|
43
|
+
*/
|
|
44
|
+
webhookUrl?: string | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* Provide a customized list of keywords to expand our models' vocabulary, aimed at improving performance and understanding within your specific context.
|
|
47
|
+
*/
|
|
48
|
+
boostedKeywords?: string[] | undefined;
|
|
29
49
|
};
|
|
30
50
|
|
|
31
51
|
export type CreateAgentResponse = {
|
|
@@ -55,6 +75,11 @@ export namespace CreateAgentRequestBody$ {
|
|
|
55
75
|
voice_id: string;
|
|
56
76
|
enable_backchannel?: boolean | undefined;
|
|
57
77
|
voice_temperature?: number | undefined;
|
|
78
|
+
voice_speed?: number | undefined;
|
|
79
|
+
responsiveness?: number | undefined;
|
|
80
|
+
ambient_sound?: 'coffee-shop' | 'convention-hall' | 'summer-outdoor' | 'mountain-outdoor' | 'null' | undefined;
|
|
81
|
+
webhook_url?: string | undefined;
|
|
82
|
+
boosted_keywords?: string[] | undefined;
|
|
58
83
|
};
|
|
59
84
|
|
|
60
85
|
export const inboundSchema: z.ZodType<
|
|
@@ -67,7 +92,12 @@ export namespace CreateAgentRequestBody$ {
|
|
|
67
92
|
llm_websocket_url: z.string(),
|
|
68
93
|
voice_id: z.string(),
|
|
69
94
|
enable_backchannel: z.boolean().optional(),
|
|
70
|
-
voice_temperature: z.number().optional()
|
|
95
|
+
voice_temperature: z.number().optional(),
|
|
96
|
+
voice_speed: z.number().optional(),
|
|
97
|
+
responsiveness: z.number().optional(),
|
|
98
|
+
ambient_sound: z.enum(['coffee-shop', 'convention-hall', 'summer-outdoor', 'mountain-outdoor', 'null']).optional(),
|
|
99
|
+
webhook_url: z.string().optional(),
|
|
100
|
+
boosted_keywords: z.array(z.string()).optional(),
|
|
71
101
|
})
|
|
72
102
|
.transform((v) => {
|
|
73
103
|
return {
|
|
@@ -76,6 +106,11 @@ export namespace CreateAgentRequestBody$ {
|
|
|
76
106
|
voiceId: v.voice_id,
|
|
77
107
|
...(v.enable_backchannel === undefined ? null : { enableBackchannel: v.enable_backchannel }),
|
|
78
108
|
...(v.voice_temperature === undefined ? null : { voiceTemperature: v.voice_temperature }),
|
|
109
|
+
...(v.voice_speed === undefined ? null : { voiceSpeed: v.voice_speed }),
|
|
110
|
+
...(v.responsiveness === undefined ? null : { responsiveness: v.responsiveness }),
|
|
111
|
+
...(v.ambient_sound === undefined ? null : { ambientSound: v.ambient_sound }),
|
|
112
|
+
...(v.webhook_url === undefined ? null : { webhookUrl: v.webhook_url }),
|
|
113
|
+
...(v.boosted_keywords === undefined ? null : { boostedKeywords: v.boosted_keywords }),
|
|
79
114
|
};
|
|
80
115
|
});
|
|
81
116
|
|
|
@@ -85,6 +120,11 @@ export namespace CreateAgentRequestBody$ {
|
|
|
85
120
|
voice_id: string;
|
|
86
121
|
enable_backchannel?: boolean | undefined;
|
|
87
122
|
voice_temperature?: number | undefined;
|
|
123
|
+
voice_speed?: number | undefined;
|
|
124
|
+
responsiveness?: number | undefined;
|
|
125
|
+
ambient_sound?: 'coffee-shop' | 'convention-hall' | 'summer-outdoor' | 'mountain-outdoor' | 'null' | undefined;
|
|
126
|
+
webhook_url?: string | undefined;
|
|
127
|
+
boosted_keywords?: string[] | undefined;
|
|
88
128
|
};
|
|
89
129
|
|
|
90
130
|
export const outboundSchema: z.ZodType<
|
|
@@ -97,7 +137,12 @@ export namespace CreateAgentRequestBody$ {
|
|
|
97
137
|
llmWebsocketUrl: z.string(),
|
|
98
138
|
voiceId: z.string(),
|
|
99
139
|
enableBackchannel: z.boolean().optional(),
|
|
100
|
-
voiceTemperature: z.number().optional()
|
|
140
|
+
voiceTemperature: z.number().optional(),
|
|
141
|
+
voiceSpeed: z.number().optional(),
|
|
142
|
+
responsiveness: z.number().optional(),
|
|
143
|
+
ambientSound: z.enum(['coffee-shop', 'convention-hall', 'summer-outdoor', 'mountain-outdoor', 'null']).optional(),
|
|
144
|
+
webhookUrl: z.string().optional(),
|
|
145
|
+
boostedKeywords: z.array(z.string()).optional(),
|
|
101
146
|
})
|
|
102
147
|
.transform((v) => {
|
|
103
148
|
return {
|
|
@@ -106,6 +151,11 @@ export namespace CreateAgentRequestBody$ {
|
|
|
106
151
|
voice_id: v.voiceId,
|
|
107
152
|
...(v.enableBackchannel === undefined ? null : { enable_backchannel: v.enableBackchannel }),
|
|
108
153
|
...(v.voiceTemperature === undefined ? null : { voice_temperature: v.voiceTemperature }),
|
|
154
|
+
...(v.voiceSpeed === undefined ? null : { voice_speed: v.voiceSpeed }),
|
|
155
|
+
...(v.responsiveness === undefined ? null : { responsiveness: v.responsiveness }),
|
|
156
|
+
...(v.ambientSound === undefined ? null : { ambient_sound: v.ambientSound }),
|
|
157
|
+
...(v.webhookUrl === undefined ? null : { webhook_url: v.webhookUrl }),
|
|
158
|
+
...(v.boostedKeywords === undefined ? null : { boosted_keywords: v.boostedKeywords }), // Correctly transformed
|
|
109
159
|
};
|
|
110
160
|
});
|
|
111
161
|
}
|
|
@@ -28,6 +28,10 @@ export type RegisterCallRequestBody = {
|
|
|
28
28
|
* The protocol how audio websocket read and send audio bytes.
|
|
29
29
|
*/
|
|
30
30
|
audioWebsocketProtocol: AudioWebsocketProtocol;
|
|
31
|
+
/**
|
|
32
|
+
* If users stay silent for a period, end the call. By default, it is set to 600,000 ms (10 min). The minimum value allowed is 10,000 ms (10 s).
|
|
33
|
+
*/
|
|
34
|
+
endCallAfterSilenceMs?: number | undefined;
|
|
31
35
|
};
|
|
32
36
|
|
|
33
37
|
export type RegisterCallResponse = {
|
|
@@ -56,6 +60,7 @@ export namespace RegisterCallRequestBody$ {
|
|
|
56
60
|
audio_encoding: AudioEncoding;
|
|
57
61
|
sample_rate: number;
|
|
58
62
|
audio_websocket_protocol: AudioWebsocketProtocol;
|
|
63
|
+
end_call_after_silence_ms?: number | undefined;
|
|
59
64
|
};
|
|
60
65
|
|
|
61
66
|
export const inboundSchema: z.ZodType<
|
|
@@ -69,6 +74,7 @@ export namespace RegisterCallRequestBody$ {
|
|
|
69
74
|
audio_encoding: AudioEncoding$,
|
|
70
75
|
sample_rate: z.number().int(),
|
|
71
76
|
audio_websocket_protocol: AudioWebsocketProtocol$,
|
|
77
|
+
end_call_after_silence_ms: z.number().int().optional(),
|
|
72
78
|
})
|
|
73
79
|
.transform((v) => {
|
|
74
80
|
return {
|
|
@@ -76,6 +82,7 @@ export namespace RegisterCallRequestBody$ {
|
|
|
76
82
|
audioEncoding: v.audio_encoding,
|
|
77
83
|
sampleRate: v.sample_rate,
|
|
78
84
|
audioWebsocketProtocol: v.audio_websocket_protocol,
|
|
85
|
+
...(v.end_call_after_silence_ms === undefined ? null : { endCallAfterSilenceMs: v.end_call_after_silence_ms }),
|
|
79
86
|
};
|
|
80
87
|
});
|
|
81
88
|
|
|
@@ -84,6 +91,7 @@ export namespace RegisterCallRequestBody$ {
|
|
|
84
91
|
audio_encoding: components.AudioEncoding;
|
|
85
92
|
sample_rate: number;
|
|
86
93
|
audio_websocket_protocol: components.AudioWebsocketProtocol;
|
|
94
|
+
end_call_after_silence_ms?: number | undefined;
|
|
87
95
|
};
|
|
88
96
|
|
|
89
97
|
export const outboundSchema: z.ZodType<
|
|
@@ -96,6 +104,7 @@ export namespace RegisterCallRequestBody$ {
|
|
|
96
104
|
audioEncoding: AudioEncoding$,
|
|
97
105
|
sampleRate: z.number().int(),
|
|
98
106
|
audioWebsocketProtocol: AudioWebsocketProtocol$,
|
|
107
|
+
endCallAfterSilenceMs: z.number().int().optional(),
|
|
99
108
|
})
|
|
100
109
|
.transform((v) => {
|
|
101
110
|
return {
|
|
@@ -103,6 +112,7 @@ export namespace RegisterCallRequestBody$ {
|
|
|
103
112
|
audio_encoding: v.audioEncoding,
|
|
104
113
|
sample_rate: v.sampleRate,
|
|
105
114
|
audio_websocket_protocol: v.audioWebsocketProtocol,
|
|
115
|
+
...(v.endCallAfterSilenceMs === undefined ? null : { end_call_after_silence_ms: v.endCallAfterSilenceMs }),
|
|
106
116
|
};
|
|
107
117
|
});
|
|
108
118
|
}
|
|
@@ -26,6 +26,26 @@ export type UpdateAgentRequestBody = {
|
|
|
26
26
|
* Controls how stable the voice is.
|
|
27
27
|
*/
|
|
28
28
|
voiceTemperature?: number | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* Controls speed of voice. Value ranging from [0.5,2]. Lower value means slower speech, while higher value means faster speech rate. If unset, default value 1 will apply.
|
|
31
|
+
*/
|
|
32
|
+
voiceSpeed?: number | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* Controls how responsive is the agent. Value ranging from [0,1]. Lower value means less responsive agent (wait more, respond slower), while higher value means faster exchanges (respond when it can). If unset, default value 1 will apply.
|
|
35
|
+
*/
|
|
36
|
+
responsiveness?: number | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* If set, will add ambient environment sound to the call to make experience more realistic.
|
|
39
|
+
*/
|
|
40
|
+
ambientSound?: 'coffee-shop' | 'convention-hall' | 'summer-outdoor' | 'mountain-outdoor' | 'null' | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* The webhook for agent to listen to call events. See what events it would get at webhook doc. If set, will binds webhook events for this agent to the specified url, and will ignore the account level webhook for this agent. Set to string null to remove webhook url from this agent.
|
|
43
|
+
*/
|
|
44
|
+
webhookUrl?: string | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* Provide a customized list of keywords to expand our models' vocabulary, aimed at improving performance and understanding within your specific context.
|
|
47
|
+
*/
|
|
48
|
+
boostedKeywords?: string[] | undefined;
|
|
29
49
|
};
|
|
30
50
|
|
|
31
51
|
/** @internal */
|
|
@@ -36,6 +56,11 @@ export namespace UpdateAgentRequestBody$ {
|
|
|
36
56
|
voice_id?: string | undefined;
|
|
37
57
|
enable_backchannel?: boolean | undefined;
|
|
38
58
|
voice_temperature?: number | undefined;
|
|
59
|
+
voice_speed?: number | undefined;
|
|
60
|
+
responsiveness?: number | undefined;
|
|
61
|
+
ambient_sound?: 'coffee-shop' | 'convention-hall' | 'summer-outdoor' | 'mountain-outdoor' | 'null' | undefined;
|
|
62
|
+
webhook_url?: string | undefined;
|
|
63
|
+
boosted_keywords?: string[] | undefined;
|
|
39
64
|
};
|
|
40
65
|
|
|
41
66
|
export const inboundSchema: z.ZodType<
|
|
@@ -48,7 +73,12 @@ export namespace UpdateAgentRequestBody$ {
|
|
|
48
73
|
llm_websocket_url: z.string(),
|
|
49
74
|
voice_id: z.string(),
|
|
50
75
|
enable_backchannel: z.boolean().optional(),
|
|
51
|
-
voice_temperature: z.number().optional()
|
|
76
|
+
voice_temperature: z.number().optional(),
|
|
77
|
+
voice_speed: z.number().optional(),
|
|
78
|
+
responsiveness: z.number().optional(),
|
|
79
|
+
ambient_sound: z.enum(['coffee-shop', 'convention-hall', 'summer-outdoor', 'mountain-outdoor', 'null']).optional(),
|
|
80
|
+
webhook_url: z.string().optional(),
|
|
81
|
+
boosted_keywords: z.array(z.string()).optional(),
|
|
52
82
|
})
|
|
53
83
|
.transform((v) => {
|
|
54
84
|
return {
|
|
@@ -59,6 +89,12 @@ export namespace UpdateAgentRequestBody$ {
|
|
|
59
89
|
...(v.voice_id === undefined ? null : { voiceId: v.voice_id }),
|
|
60
90
|
...(v.enable_backchannel === undefined ? null : { enableBackchannel: v.enable_backchannel }),
|
|
61
91
|
...(v.voice_temperature === undefined ? null : { voiceTemperature: v.voice_temperature }),
|
|
92
|
+
...(v.voice_temperature === undefined ? null : { voiceTemperature: v.voice_temperature }),
|
|
93
|
+
...(v.voice_speed === undefined ? null : { voiceSpeed: v.voice_speed }),
|
|
94
|
+
...(v.responsiveness === undefined ? null : { responsiveness: v.responsiveness }),
|
|
95
|
+
...(v.ambient_sound === undefined ? null : { ambientSound: v.ambient_sound }),
|
|
96
|
+
...(v.webhook_url === undefined ? null : { webhookUrl: v.webhook_url }),
|
|
97
|
+
...(v.boosted_keywords === undefined ? null : { boostedKeywords: v.boosted_keywords }),
|
|
62
98
|
};
|
|
63
99
|
});
|
|
64
100
|
|
|
@@ -68,6 +104,11 @@ export namespace UpdateAgentRequestBody$ {
|
|
|
68
104
|
voice_id?: string | undefined;
|
|
69
105
|
enable_backchannel?: boolean | undefined;
|
|
70
106
|
voice_temperature?: number | undefined;
|
|
107
|
+
voice_speed?: number | undefined;
|
|
108
|
+
responsiveness?: number | undefined;
|
|
109
|
+
ambient_sound?: 'coffee-shop' | 'convention-hall' | 'summer-outdoor' | 'mountain-outdoor' | 'null' | undefined;
|
|
110
|
+
webhook_url?: string | undefined;
|
|
111
|
+
boosted_keywords?: string[] | undefined;
|
|
71
112
|
};
|
|
72
113
|
|
|
73
114
|
export const outboundSchema: z.ZodType<
|
|
@@ -80,7 +121,12 @@ export namespace UpdateAgentRequestBody$ {
|
|
|
80
121
|
llmWebsocketUrl: z.string().optional(),
|
|
81
122
|
voiceId: z.string().optional(),
|
|
82
123
|
enableBackchannel: z.boolean().optional(),
|
|
83
|
-
voiceTemperature: z.number().optional()
|
|
124
|
+
voiceTemperature: z.number().optional(),
|
|
125
|
+
voiceSpeed: z.number().optional(),
|
|
126
|
+
responsiveness: z.number().optional(),
|
|
127
|
+
ambientSound: z.enum(['coffee-shop', 'convention-hall', 'summer-outdoor', 'mountain-outdoor', 'null']).optional(),
|
|
128
|
+
webhookUrl: z.string().optional(),
|
|
129
|
+
boostedKeywords: z.array(z.string()).optional(),
|
|
84
130
|
})
|
|
85
131
|
.transform((v) => {
|
|
86
132
|
return {
|
|
@@ -91,6 +137,11 @@ export namespace UpdateAgentRequestBody$ {
|
|
|
91
137
|
...(v.voiceId === undefined ? null : { voice_id: v.voiceId }),
|
|
92
138
|
...(v.enableBackchannel === undefined ? null : { enable_backchannel: v.enableBackchannel }),
|
|
93
139
|
...(v.voiceTemperature === undefined ? null : { voice_temperature: v.voiceTemperature }),
|
|
140
|
+
...(v.voiceSpeed === undefined ? null : { voice_speed: v.voiceSpeed }),
|
|
141
|
+
...(v.responsiveness === undefined ? null : { responsiveness: v.responsiveness }),
|
|
142
|
+
...(v.ambientSound === undefined ? null : { ambient_sound: v.ambientSound }),
|
|
143
|
+
...(v.webhookUrl === undefined ? null : { webhook_url: v.webhookUrl }),
|
|
144
|
+
...(v.boostedKeywords === undefined ? null : { boosted_keywords: v.boostedKeywords }),
|
|
94
145
|
};
|
|
95
146
|
});
|
|
96
147
|
}
|
package/src/sdk/index.ts
CHANGED
package/src/sdk/audioWsClient.ts
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { EventEmitter } from "eventemitter3";
|
|
2
|
-
import WebSocket from "isomorphic-ws";
|
|
3
|
-
|
|
4
|
-
let baseEndpoint = "wss://api.re-tell.ai/audio-websocket/";
|
|
5
|
-
|
|
6
|
-
export class AudioWsClient extends EventEmitter {
|
|
7
|
-
private ws: WebSocket;
|
|
8
|
-
|
|
9
|
-
constructor(callId: string, customEndpoint?: string) {
|
|
10
|
-
super();
|
|
11
|
-
|
|
12
|
-
if (customEndpoint) baseEndpoint = customEndpoint;
|
|
13
|
-
const endpoint = baseEndpoint + callId;
|
|
14
|
-
this.ws = new WebSocket(endpoint);
|
|
15
|
-
this.ws.binaryType = "arraybuffer";
|
|
16
|
-
|
|
17
|
-
this.ws.onmessage = (event) => {
|
|
18
|
-
// Check if the data is a string (text data)
|
|
19
|
-
if (typeof event.data === "string") {
|
|
20
|
-
if (event.data === "clear") {
|
|
21
|
-
this.emit("clear");
|
|
22
|
-
} else {
|
|
23
|
-
// Handle other text data if necessary
|
|
24
|
-
}
|
|
25
|
-
} else if (event.data instanceof ArrayBuffer) {
|
|
26
|
-
// Handle binary data (ArrayBuffer)
|
|
27
|
-
const audio = new Uint8Array(event.data);
|
|
28
|
-
this.emit("audio", audio);
|
|
29
|
-
} else {
|
|
30
|
-
this.emit("error", "Got unknown message from server.");
|
|
31
|
-
this.ws.close(1002, "Got unknown message from server.");
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
this.ws.onclose = (event) => {
|
|
35
|
-
this.emit("close", event.code, event.reason);
|
|
36
|
-
};
|
|
37
|
-
this.ws.onerror = (event) => {
|
|
38
|
-
this.emit("error", event.error);
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
send(audio: Uint8Array) {
|
|
43
|
-
if (this.ws.readyState === 1) {
|
|
44
|
-
this.ws.send(audio);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
close() {
|
|
49
|
-
this.ws.close();
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export function convertUint8ToFloat32(array: Uint8Array): Float32Array {
|
|
54
|
-
const targetArray = new Float32Array(array.byteLength / 2);
|
|
55
|
-
|
|
56
|
-
// A DataView is used to read our 16-bit little-endian samples out of the Uint8Array buffer
|
|
57
|
-
const sourceDataView = new DataView(array.buffer);
|
|
58
|
-
|
|
59
|
-
// Loop through, get values, and divide by 32,768
|
|
60
|
-
for (let i = 0; i < targetArray.length; i++) {
|
|
61
|
-
targetArray[i] = sourceDataView.getInt16(i * 2, true) / Math.pow(2, 16 - 1);
|
|
62
|
-
}
|
|
63
|
-
return targetArray;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export function convertFloat32ToUint8(array: Float32Array): Uint8Array {
|
|
67
|
-
const buffer = new ArrayBuffer(array.length * 2);
|
|
68
|
-
const view = new DataView(buffer);
|
|
69
|
-
|
|
70
|
-
for (let i = 0; i < array.length; i++) {
|
|
71
|
-
const value = (array[i] as number) * 32768;
|
|
72
|
-
view.setInt16(i * 2, value, true); // true for little-endian
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
return new Uint8Array(buffer);
|
|
76
|
-
}
|