retell-sdk 2.2.8 → 2.2.9
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/package.json +1 -1
- package/example.d.ts +0 -2
- package/example.d.ts.map +0 -1
- package/example.js +0 -143
- package/example.js.map +0 -1
- package/src/example.ts +0 -158
package/package.json
CHANGED
package/example.d.ts
DELETED
package/example.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"example.d.ts","sourceRoot":"","sources":["src/example.ts"],"names":[],"mappings":""}
|
package/example.js
DELETED
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const sdk_1 = require("./sdk");
|
|
4
|
-
// import { AudioEncoding, AudioWebsocketProtocol } from "./models/components";
|
|
5
|
-
// import { CallType, SortOrder } from "./models/operations";
|
|
6
|
-
const retell = new sdk_1.RetellClient({
|
|
7
|
-
// Find the key in dashboard
|
|
8
|
-
apiKey: "557e09e6-f8e6-4c24-bf8c-e7a1754e44e2",
|
|
9
|
-
serverURL: "http://localhost:3002",
|
|
10
|
-
});
|
|
11
|
-
async function main() {
|
|
12
|
-
// const res = await retell.createAgent({
|
|
13
|
-
// agentName: "testfunction",
|
|
14
|
-
// llmSetting: {
|
|
15
|
-
// provider: "retell",
|
|
16
|
-
// prompt: "test prompt",
|
|
17
|
-
// },
|
|
18
|
-
// voiceId: "11labs-Ryan",
|
|
19
|
-
// interactionSetting: {
|
|
20
|
-
// enableBeginMessage: true,
|
|
21
|
-
// beginMessage: "Hello there, how can I help you?",
|
|
22
|
-
// enableEndCall: true,
|
|
23
|
-
// enableEndMessage: false,
|
|
24
|
-
// endMessage: "Hope you have a good day, goodbye.",
|
|
25
|
-
// },
|
|
26
|
-
// functions: [{
|
|
27
|
-
// url: "http://localhost:3002/get-weather",
|
|
28
|
-
// description: "Get the current weather in a given location.",
|
|
29
|
-
// name: "get_current_weather",
|
|
30
|
-
// parameters: {
|
|
31
|
-
// type: "object",
|
|
32
|
-
// properties: {
|
|
33
|
-
// location: {
|
|
34
|
-
// type: "string",
|
|
35
|
-
// description: "The city and state, e.g. San Francisco, CA"
|
|
36
|
-
// },
|
|
37
|
-
// unit: {
|
|
38
|
-
// type: "string",
|
|
39
|
-
// enum: ["celsius", "fahrenheit"]
|
|
40
|
-
// }
|
|
41
|
-
// },
|
|
42
|
-
// required: ["location"]
|
|
43
|
-
// }
|
|
44
|
-
// }]
|
|
45
|
-
// });
|
|
46
|
-
// console.log(res.agent);
|
|
47
|
-
// const res = await retell.getAgent("147d9b8e9b698e275d0aaa353bce8864");
|
|
48
|
-
// console.log(res.agent);
|
|
49
|
-
// const res = await retell.updateAgent(
|
|
50
|
-
// {
|
|
51
|
-
// agentName: "new name",
|
|
52
|
-
// interactionSetting: {
|
|
53
|
-
// enableEndCall: true,
|
|
54
|
-
// endMessage: "bye",
|
|
55
|
-
// },
|
|
56
|
-
// functions: [
|
|
57
|
-
// {
|
|
58
|
-
// name: "Test",
|
|
59
|
-
// description: "Test",
|
|
60
|
-
// parameters: {
|
|
61
|
-
// type: "object",
|
|
62
|
-
// required: ["location"],
|
|
63
|
-
// properties: {
|
|
64
|
-
// location: {
|
|
65
|
-
// type: "string",
|
|
66
|
-
// description: "The city and state, e.g. San Francisco, CA",
|
|
67
|
-
// },
|
|
68
|
-
// unit: {
|
|
69
|
-
// type: "string",
|
|
70
|
-
// enum: ["celsius", "fahrenheit"],
|
|
71
|
-
// },
|
|
72
|
-
// },
|
|
73
|
-
// },
|
|
74
|
-
// url: "http://localhost:3002/test",
|
|
75
|
-
// },
|
|
76
|
-
// ],
|
|
77
|
-
// },
|
|
78
|
-
// "ebff89152bc1defa7fa5251451310817",
|
|
79
|
-
// );
|
|
80
|
-
// console.log(res.agent);
|
|
81
|
-
// const res = await retell.getAgent("d9f66007232809aca1c3a6cdb84c3f47");
|
|
82
|
-
// console.log(res.agent);
|
|
83
|
-
// const res = await retell.listAgents();
|
|
84
|
-
// console.log(res.agents);
|
|
85
|
-
const res = await retell.updateAgent({
|
|
86
|
-
llmWebsocketUrl: "wss://123456",
|
|
87
|
-
}, "d9f66007232809aca1c3a6cdb84c3f47");
|
|
88
|
-
console.log(res.agent);
|
|
89
|
-
// const res = await retell.registerCall({
|
|
90
|
-
// agentId: "fd8b5df78d1cdab31194b2b6c349946d",
|
|
91
|
-
// audioEncoding: AudioEncoding.S16le,
|
|
92
|
-
// sampleRate: 24000,
|
|
93
|
-
// audioWebsocketProtocol: AudioWebsocketProtocol.Web,
|
|
94
|
-
// });
|
|
95
|
-
// console.log(res.callDetail);
|
|
96
|
-
// const res2 = await retell.getCall("b9c1fb64bc0f82be50ee83bd236cd437");
|
|
97
|
-
// console.log(res2.callDetail);
|
|
98
|
-
// const agent = await retell.updateAgent({
|
|
99
|
-
// agentName: "new name",
|
|
100
|
-
// interactionSetting: {
|
|
101
|
-
// enableEndCall: true,
|
|
102
|
-
// endMessage: "bye"
|
|
103
|
-
// },
|
|
104
|
-
// }, '5790c196cd6b7728de819c3de444d3b5');
|
|
105
|
-
// console.log(agent.agent);
|
|
106
|
-
// const res = await retell.deleteAgent('5790c196cd6b7728de819c3de444d3b5');
|
|
107
|
-
// console.log(res.statusCode)
|
|
108
|
-
// const res = await retell.createPhoneNumber({
|
|
109
|
-
// agentId: "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD",
|
|
110
|
-
// areaCode: 415,
|
|
111
|
-
// });
|
|
112
|
-
// res.phoneNumber
|
|
113
|
-
// const res = await retell.deletePhoneNumber("+14159095857");
|
|
114
|
-
// console.log(res.statusCode)
|
|
115
|
-
// const res = await retell.getCall("e208e53fe334b42a21bdf065f5b121e1");
|
|
116
|
-
// console.log(res.callDetail);
|
|
117
|
-
// const newPhoneNumber = await retell.createPhoneNumber({
|
|
118
|
-
// agentId: "5790c196cd6b7728de819c3de444d3b5", // Required
|
|
119
|
-
// // areaCode: 415, // Optional, default is 213
|
|
120
|
-
// });
|
|
121
|
-
// console.log("phone number: ", newPhoneNumber);
|
|
122
|
-
// const ongoingCall = await retell.createPhoneCall({
|
|
123
|
-
// phoneNumber: {
|
|
124
|
-
// from: "+12138954697", // Phone number you created
|
|
125
|
-
// to: "+12137134981",
|
|
126
|
-
// },
|
|
127
|
-
// });
|
|
128
|
-
// console.log("phone call: ", ongoingCall);
|
|
129
|
-
// const filterCriteria = {
|
|
130
|
-
// // afterEndTimestamp: 1703302428800,
|
|
131
|
-
// // afterStartTimestamp: 1703302407300,
|
|
132
|
-
// // agentId: ["oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD"],
|
|
133
|
-
// // beforeEndTimestamp: 1703302428899,
|
|
134
|
-
// // beforeStartTimestamp: 1703302407399,
|
|
135
|
-
// callType: [CallType.InboundPhoneCall, CallType.OutboundPhoneCall],
|
|
136
|
-
// };
|
|
137
|
-
// const limit = 1;
|
|
138
|
-
// const sortOrder = SortOrder.Descending;
|
|
139
|
-
// const res = await retell.listCalls(filterCriteria, limit, sortOrder);
|
|
140
|
-
// console.log(res)
|
|
141
|
-
}
|
|
142
|
-
main();
|
|
143
|
-
//# sourceMappingURL=example.js.map
|
package/example.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"example.js","sourceRoot":"","sources":["src/example.ts"],"names":[],"mappings":";;AAAA,+BAAqC;AACrC,+EAA+E;AAC/E,6DAA6D;AAE7D,MAAM,MAAM,GAAG,IAAI,kBAAY,CAAC;IAC9B,4BAA4B;IAC5B,MAAM,EAAE,sCAAsC;IAC9C,SAAS,EAAE,uBAAuB;CACnC,CAAC,CAAC;AAEH,KAAK,UAAU,IAAI;IACjB,yCAAyC;IACzC,iCAAiC;IACjC,oBAAoB;IACpB,8BAA8B;IAC9B,iCAAiC;IACjC,SAAS;IACT,8BAA8B;IAC9B,4BAA4B;IAC5B,oCAAoC;IACpC,4DAA4D;IAC5D,+BAA+B;IAC/B,mCAAmC;IACn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IACX,0CAA0C;IAC1C,4BAA4B;IAC5B,4EAA4E;IAC5E,8BAA8B;IAC9B,+CAA+C;IAC/C,mDAAmD;IACnD,qBAAqB;IACrB,MAAM;IACN,kBAAkB;IAClB,8DAA8D;IAC9D,8BAA8B;IAE9B,wEAAwE;IAExE,+BAA+B;IAE/B,0DAA0D;IAC1D,+DAA+D;IAC/D,oDAAoD;IACpD,QAAQ;IACR,mDAAmD;IAEnD,qDAAqD;IACrD,qBAAqB;IACrB,0DAA0D;IAC1D,4BAA4B;IAC5B,SAAS;IACT,QAAQ;IACR,8CAA8C;IAC9C,2BAA2B;IAC3B,2CAA2C;IAC3C,6CAA6C;IAC7C,wDAAwD;IACxD,4CAA4C;IAC5C,8CAA8C;IAC9C,yEAAyE;IACzE,KAAK;IACL,mBAAmB;IACnB,0CAA0C;IAE1C,wEAAwE;IACxE,mBAAmB;AACrB,CAAC;AAED,IAAI,EAAE,CAAC"}
|
package/src/example.ts
DELETED
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
import { RetellClient } from "./sdk";
|
|
2
|
-
// import { AudioEncoding, AudioWebsocketProtocol } from "./models/components";
|
|
3
|
-
// import { CallType, SortOrder } from "./models/operations";
|
|
4
|
-
|
|
5
|
-
const retell = new RetellClient({
|
|
6
|
-
// Find the key in dashboard
|
|
7
|
-
apiKey: "557e09e6-f8e6-4c24-bf8c-e7a1754e44e2",
|
|
8
|
-
serverURL: "http://localhost:3002",
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
async function main() {
|
|
12
|
-
// const res = await retell.createAgent({
|
|
13
|
-
// agentName: "testfunction",
|
|
14
|
-
// llmSetting: {
|
|
15
|
-
// provider: "retell",
|
|
16
|
-
// prompt: "test prompt",
|
|
17
|
-
// },
|
|
18
|
-
// voiceId: "11labs-Ryan",
|
|
19
|
-
// interactionSetting: {
|
|
20
|
-
// enableBeginMessage: true,
|
|
21
|
-
// beginMessage: "Hello there, how can I help you?",
|
|
22
|
-
// enableEndCall: true,
|
|
23
|
-
// enableEndMessage: false,
|
|
24
|
-
// endMessage: "Hope you have a good day, goodbye.",
|
|
25
|
-
// },
|
|
26
|
-
// functions: [{
|
|
27
|
-
// url: "http://localhost:3002/get-weather",
|
|
28
|
-
// description: "Get the current weather in a given location.",
|
|
29
|
-
// name: "get_current_weather",
|
|
30
|
-
// parameters: {
|
|
31
|
-
// type: "object",
|
|
32
|
-
// properties: {
|
|
33
|
-
// location: {
|
|
34
|
-
// type: "string",
|
|
35
|
-
// description: "The city and state, e.g. San Francisco, CA"
|
|
36
|
-
// },
|
|
37
|
-
// unit: {
|
|
38
|
-
// type: "string",
|
|
39
|
-
// enum: ["celsius", "fahrenheit"]
|
|
40
|
-
// }
|
|
41
|
-
// },
|
|
42
|
-
// required: ["location"]
|
|
43
|
-
// }
|
|
44
|
-
// }]
|
|
45
|
-
// });
|
|
46
|
-
// console.log(res.agent);
|
|
47
|
-
|
|
48
|
-
// const res = await retell.getAgent("147d9b8e9b698e275d0aaa353bce8864");
|
|
49
|
-
// console.log(res.agent);
|
|
50
|
-
|
|
51
|
-
// const res = await retell.updateAgent(
|
|
52
|
-
// {
|
|
53
|
-
// agentName: "new name",
|
|
54
|
-
// interactionSetting: {
|
|
55
|
-
// enableEndCall: true,
|
|
56
|
-
// endMessage: "bye",
|
|
57
|
-
// },
|
|
58
|
-
// functions: [
|
|
59
|
-
// {
|
|
60
|
-
// name: "Test",
|
|
61
|
-
// description: "Test",
|
|
62
|
-
// parameters: {
|
|
63
|
-
// type: "object",
|
|
64
|
-
// required: ["location"],
|
|
65
|
-
// properties: {
|
|
66
|
-
// location: {
|
|
67
|
-
// type: "string",
|
|
68
|
-
// description: "The city and state, e.g. San Francisco, CA",
|
|
69
|
-
// },
|
|
70
|
-
// unit: {
|
|
71
|
-
// type: "string",
|
|
72
|
-
// enum: ["celsius", "fahrenheit"],
|
|
73
|
-
// },
|
|
74
|
-
// },
|
|
75
|
-
// },
|
|
76
|
-
// url: "http://localhost:3002/test",
|
|
77
|
-
// },
|
|
78
|
-
// ],
|
|
79
|
-
// },
|
|
80
|
-
// "ebff89152bc1defa7fa5251451310817",
|
|
81
|
-
// );
|
|
82
|
-
// console.log(res.agent);
|
|
83
|
-
|
|
84
|
-
// const res = await retell.getAgent("d9f66007232809aca1c3a6cdb84c3f47");
|
|
85
|
-
// console.log(res.agent);
|
|
86
|
-
// const res = await retell.listAgents();
|
|
87
|
-
// console.log(res.agents);
|
|
88
|
-
|
|
89
|
-
const res = await retell.updateAgent(
|
|
90
|
-
{
|
|
91
|
-
llmWebsocketUrl: "wss://123456",
|
|
92
|
-
},
|
|
93
|
-
"d9f66007232809aca1c3a6cdb84c3f47",
|
|
94
|
-
);
|
|
95
|
-
console.log(res.agent);
|
|
96
|
-
|
|
97
|
-
// const res = await retell.registerCall({
|
|
98
|
-
// agentId: "fd8b5df78d1cdab31194b2b6c349946d",
|
|
99
|
-
// audioEncoding: AudioEncoding.S16le,
|
|
100
|
-
// sampleRate: 24000,
|
|
101
|
-
// audioWebsocketProtocol: AudioWebsocketProtocol.Web,
|
|
102
|
-
// });
|
|
103
|
-
// console.log(res.callDetail);
|
|
104
|
-
|
|
105
|
-
// const res2 = await retell.getCall("b9c1fb64bc0f82be50ee83bd236cd437");
|
|
106
|
-
// console.log(res2.callDetail);
|
|
107
|
-
|
|
108
|
-
// const agent = await retell.updateAgent({
|
|
109
|
-
// agentName: "new name",
|
|
110
|
-
// interactionSetting: {
|
|
111
|
-
// enableEndCall: true,
|
|
112
|
-
// endMessage: "bye"
|
|
113
|
-
// },
|
|
114
|
-
// }, '5790c196cd6b7728de819c3de444d3b5');
|
|
115
|
-
// console.log(agent.agent);
|
|
116
|
-
// const res = await retell.deleteAgent('5790c196cd6b7728de819c3de444d3b5');
|
|
117
|
-
// console.log(res.statusCode)
|
|
118
|
-
// const res = await retell.createPhoneNumber({
|
|
119
|
-
// agentId: "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD",
|
|
120
|
-
// areaCode: 415,
|
|
121
|
-
// });
|
|
122
|
-
// res.phoneNumber
|
|
123
|
-
// const res = await retell.deletePhoneNumber("+14159095857");
|
|
124
|
-
// console.log(res.statusCode)
|
|
125
|
-
|
|
126
|
-
// const res = await retell.getCall("e208e53fe334b42a21bdf065f5b121e1");
|
|
127
|
-
|
|
128
|
-
// console.log(res.callDetail);
|
|
129
|
-
|
|
130
|
-
// const newPhoneNumber = await retell.createPhoneNumber({
|
|
131
|
-
// agentId: "5790c196cd6b7728de819c3de444d3b5", // Required
|
|
132
|
-
// // areaCode: 415, // Optional, default is 213
|
|
133
|
-
// });
|
|
134
|
-
// console.log("phone number: ", newPhoneNumber);
|
|
135
|
-
|
|
136
|
-
// const ongoingCall = await retell.createPhoneCall({
|
|
137
|
-
// phoneNumber: {
|
|
138
|
-
// from: "+12138954697", // Phone number you created
|
|
139
|
-
// to: "+12137134981",
|
|
140
|
-
// },
|
|
141
|
-
// });
|
|
142
|
-
// console.log("phone call: ", ongoingCall);
|
|
143
|
-
// const filterCriteria = {
|
|
144
|
-
// // afterEndTimestamp: 1703302428800,
|
|
145
|
-
// // afterStartTimestamp: 1703302407300,
|
|
146
|
-
// // agentId: ["oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD"],
|
|
147
|
-
// // beforeEndTimestamp: 1703302428899,
|
|
148
|
-
// // beforeStartTimestamp: 1703302407399,
|
|
149
|
-
// callType: [CallType.InboundPhoneCall, CallType.OutboundPhoneCall],
|
|
150
|
-
// };
|
|
151
|
-
// const limit = 1;
|
|
152
|
-
// const sortOrder = SortOrder.Descending;
|
|
153
|
-
|
|
154
|
-
// const res = await retell.listCalls(filterCriteria, limit, sortOrder);
|
|
155
|
-
// console.log(res)
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
main();
|