retell-sdk 2.2.3 → 2.2.4
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 +34 -2
- package/example.js.map +1 -1
- package/lib/config.d.ts.map +1 -1
- package/lib/config.js.map +1 -1
- package/lib/sdks.d.ts.map +1 -1
- package/lib/sdks.js.map +1 -1
- package/lib/security.d.ts.map +1 -1
- package/lib/security.js +5 -1
- package/lib/security.js.map +1 -1
- package/models/components/agent.d.ts +3 -3
- package/models/components/agent.d.ts.map +1 -1
- package/models/components/agent.js +60 -26
- package/models/components/agent.js.map +1 -1
- package/models/components/agentpromptparams.d.ts.map +1 -1
- package/models/components/agentpromptparams.js.map +1 -1
- package/models/components/calldetail.d.ts.map +1 -1
- package/models/components/calldetail.js +18 -6
- package/models/components/calldetail.js.map +1 -1
- package/models/components/callphonenumber.d.ts.map +1 -1
- package/models/components/callphonenumber.js.map +1 -1
- package/models/components/phonenumber.d.ts.map +1 -1
- package/models/components/phonenumber.js.map +1 -1
- package/models/components/security.d.ts.map +1 -1
- package/models/errors/createagent.d.ts.map +1 -1
- package/models/errors/createagent.js +36 -12
- package/models/errors/createagent.js.map +1 -1
- package/models/errors/createphonecall.d.ts.map +1 -1
- package/models/errors/createphonecall.js +54 -18
- package/models/errors/createphonecall.js.map +1 -1
- package/models/errors/createphonenumber.d.ts.map +1 -1
- package/models/errors/createphonenumber.js +42 -14
- package/models/errors/createphonenumber.js.map +1 -1
- package/models/errors/deleteagent.d.ts.map +1 -1
- package/models/errors/deleteagent.js +36 -12
- package/models/errors/deleteagent.js.map +1 -1
- package/models/errors/deletephonenumber.d.ts.map +1 -1
- package/models/errors/deletephonenumber.js +33 -11
- package/models/errors/deletephonenumber.js.map +1 -1
- package/models/errors/getagent.d.ts.map +1 -1
- package/models/errors/getagent.js +36 -12
- package/models/errors/getagent.js.map +1 -1
- package/models/errors/getcall.d.ts.map +1 -1
- package/models/errors/getcall.js +30 -10
- package/models/errors/getcall.js.map +1 -1
- package/models/errors/getphonenumber.d.ts.map +1 -1
- package/models/errors/getphonenumber.js +36 -12
- package/models/errors/getphonenumber.js.map +1 -1
- package/models/errors/listagents.d.ts.map +1 -1
- package/models/errors/listagents.js +15 -5
- package/models/errors/listagents.js.map +1 -1
- package/models/errors/listcalls.d.ts.map +1 -1
- package/models/errors/listcalls.js +24 -8
- package/models/errors/listcalls.js.map +1 -1
- package/models/errors/listphonenumbers.d.ts.map +1 -1
- package/models/errors/listphonenumbers.js +27 -9
- package/models/errors/listphonenumbers.js.map +1 -1
- package/models/errors/updateagent.d.ts.map +1 -1
- package/models/errors/updateagent.js +36 -12
- package/models/errors/updateagent.js.map +1 -1
- package/models/errors/updatephoneagent.d.ts.map +1 -1
- package/models/errors/updatephoneagent.js +36 -12
- package/models/errors/updatephoneagent.js.map +1 -1
- package/models/operations/createagent.d.ts.map +1 -1
- package/models/operations/createagent.js +16 -6
- package/models/operations/createagent.js.map +1 -1
- package/models/operations/createphonecall.d.ts.map +1 -1
- package/models/operations/createphonecall.js +18 -6
- package/models/operations/createphonecall.js.map +1 -1
- package/models/operations/createphonenumber.d.ts.map +1 -1
- package/models/operations/createphonenumber.js +6 -2
- package/models/operations/createphonenumber.js.map +1 -1
- package/models/operations/createwebcall.d.ts.map +1 -1
- package/models/operations/deleteagent.d.ts.map +1 -1
- package/models/operations/deleteagent.js.map +1 -1
- package/models/operations/deletephonenumber.d.ts.map +1 -1
- package/models/operations/deletephonenumber.js.map +1 -1
- package/models/operations/getagent.d.ts.map +1 -1
- package/models/operations/getagent.js.map +1 -1
- package/models/operations/getcall.d.ts.map +1 -1
- package/models/operations/getcall.js.map +1 -1
- package/models/operations/getphonenumber.d.ts.map +1 -1
- package/models/operations/getphonenumber.js +6 -2
- package/models/operations/getphonenumber.js.map +1 -1
- package/models/operations/listagents.d.ts.map +1 -1
- package/models/operations/listagents.js.map +1 -1
- package/models/operations/listcalls.d.ts.map +1 -1
- package/models/operations/listcalls.js +6 -2
- package/models/operations/listcalls.js.map +1 -1
- package/models/operations/listphonenumbers.d.ts.map +1 -1
- package/models/operations/listphonenumbers.js +6 -2
- package/models/operations/listphonenumbers.js.map +1 -1
- package/models/operations/updateagent.d.ts.map +1 -1
- package/models/operations/updateagent.js +18 -4
- package/models/operations/updateagent.js.map +1 -1
- package/models/operations/updatephoneagent.d.ts.map +1 -1
- package/models/operations/updatephoneagent.js +6 -2
- package/models/operations/updatephoneagent.js.map +1 -1
- package/package.json +1 -1
- package/sdk/liveClient.d.ts.map +1 -1
- package/sdk/liveClient.js +7 -2
- package/sdk/liveClient.js.map +1 -1
- package/sdk/sdk.d.ts.map +1 -1
- package/sdk/sdk.js +22 -5
- package/sdk/sdk.js.map +1 -1
- package/src/example.ts +121 -87
- package/src/lib/config.ts +32 -32
- package/src/lib/sdks.ts +91 -82
- package/src/lib/security.ts +133 -118
- package/src/models/components/agent.ts +459 -387
- package/src/models/components/agentpromptparams.ts +46 -38
- package/src/models/components/calldetail.ts +137 -125
- package/src/models/components/callphonenumber.ts +46 -38
- package/src/models/components/phonenumber.ts +69 -68
- package/src/models/components/security.ts +1 -1
- package/src/models/errors/createagent.ts +359 -311
- package/src/models/errors/createphonecall.ts +537 -472
- package/src/models/errors/createphonenumber.ts +447 -395
- package/src/models/errors/deleteagent.ts +359 -311
- package/src/models/errors/deletephonenumber.ts +357 -315
- package/src/models/errors/getagent.ts +358 -302
- package/src/models/errors/getcall.ts +348 -294
- package/src/models/errors/getphonenumber.ts +357 -312
- package/src/models/errors/listagents.ts +174 -147
- package/src/models/errors/listcalls.ts +251 -211
- package/src/models/errors/listphonenumbers.ts +252 -217
- package/src/models/errors/updateagent.ts +359 -311
- package/src/models/errors/updatephoneagent.ts +357 -312
- package/src/models/operations/createagent.ts +165 -129
- package/src/models/operations/createphonecall.ts +283 -238
- package/src/models/operations/createphonenumber.ts +118 -98
- package/src/models/operations/createwebcall.ts +13 -13
- package/src/models/operations/deleteagent.ts +94 -78
- package/src/models/operations/deletephonenumber.ts +94 -78
- package/src/models/operations/getagent.ts +104 -88
- package/src/models/operations/getcall.ts +101 -88
- package/src/models/operations/getphonenumber.ts +108 -88
- package/src/models/operations/listagents.ts +68 -60
- package/src/models/operations/listcalls.ts +238 -213
- package/src/models/operations/listphonenumbers.ts +72 -60
- package/src/models/operations/updateagent.ts +226 -173
- package/src/models/operations/updatephoneagent.ts +160 -132
- package/src/sdk/liveClient.ts +11 -7
- package/src/sdk/sdk.ts +1313 -1160
|
@@ -7,150 +7,186 @@ import { Function } from "../../models/components";
|
|
|
7
7
|
import { z } from "zod";
|
|
8
8
|
|
|
9
9
|
export type CreateAgentRequestBody = {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
10
|
+
/**
|
|
11
|
+
* The name of the agent. Only used for your own reference.
|
|
12
|
+
*/
|
|
13
|
+
agentName?: string | undefined;
|
|
14
|
+
/*
|
|
15
|
+
* Determines how to generate the response in the call. Currently supports using our in-house LLM response system or your own custom
|
|
16
|
+
* response generation system.
|
|
17
|
+
*/
|
|
18
|
+
llmSetting: components.RetellLlmSetting | components.CustomLlmSetting;
|
|
19
|
+
/**
|
|
20
|
+
* Setting combination that controls interaction flow, like begin and end logic.
|
|
21
|
+
*/
|
|
22
|
+
interactionSetting?: components.InteractionSettingRequest | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Unique voice id used for the agent. Find list of available voices in documentation.
|
|
25
|
+
*/
|
|
26
|
+
voiceId: string;
|
|
27
|
+
/**
|
|
28
|
+
* Functions are the actions that the agent can perform, like booking appointments, retriving information, etc. By setting this field, either OpenAI's function calling feature or your own custom LLM's logic would determine when the function shall get called, and our server would make the call.
|
|
29
|
+
*/
|
|
30
|
+
functions?: Function[] | undefined;
|
|
31
31
|
};
|
|
32
32
|
|
|
33
33
|
export type CreateAgentResponse = {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
34
|
+
/**
|
|
35
|
+
* Successfully created a new agent.
|
|
36
|
+
*/
|
|
37
|
+
agent?: components.Agent | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* HTTP response content type for this operation
|
|
40
|
+
*/
|
|
41
|
+
contentType: string;
|
|
42
|
+
/**
|
|
43
|
+
* HTTP response status code for this operation
|
|
44
|
+
*/
|
|
45
|
+
statusCode: number;
|
|
46
|
+
/**
|
|
47
|
+
* Raw HTTP response; suitable for custom response parsing
|
|
48
|
+
*/
|
|
49
|
+
rawResponse: Response;
|
|
50
50
|
};
|
|
51
51
|
|
|
52
52
|
/** @internal */
|
|
53
53
|
export namespace CreateAgentRequestBody$ {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
54
|
+
export type Inbound = {
|
|
55
|
+
agent_name?: string | undefined;
|
|
56
|
+
llm_setting:
|
|
57
|
+
| components.RetellLlmSetting$.Inbound
|
|
58
|
+
| components.CustomLlmSetting$.Inbound;
|
|
59
|
+
interaction_setting?:
|
|
60
|
+
| components.InteractionSettingRequest$.Inbound
|
|
61
|
+
| undefined;
|
|
62
|
+
voice_id: string;
|
|
63
|
+
functions?: Function[] | undefined;
|
|
64
|
+
};
|
|
61
65
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
.
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
66
|
+
export const inboundSchema: z.ZodType<
|
|
67
|
+
CreateAgentRequestBody,
|
|
68
|
+
z.ZodTypeDef,
|
|
69
|
+
Inbound
|
|
70
|
+
> = z
|
|
71
|
+
.object({
|
|
72
|
+
agent_name: z.string().optional(),
|
|
73
|
+
llm_setting: z.union([
|
|
74
|
+
components.RetellLlmSetting$.inboundSchema,
|
|
75
|
+
components.CustomLlmSetting$.inboundSchema,
|
|
76
|
+
]),
|
|
77
|
+
interaction_setting:
|
|
78
|
+
components.InteractionSettingRequest$.inboundSchema.optional(),
|
|
79
|
+
voice_id: z.string(),
|
|
80
|
+
functions: z.array(components.Function$.inboundSchema).optional(),
|
|
81
|
+
})
|
|
82
|
+
.transform((v) => {
|
|
83
|
+
return {
|
|
84
|
+
...(v.agent_name === undefined ? null : { agentName: v.agent_name }),
|
|
85
|
+
llmSetting: v.llm_setting,
|
|
86
|
+
...(v.interaction_setting === undefined
|
|
87
|
+
? null
|
|
88
|
+
: { interactionSetting: v.interaction_setting }),
|
|
89
|
+
voiceId: v.voice_id,
|
|
90
|
+
...(v.functions === undefined ? null : { functions: v.functions }),
|
|
91
|
+
};
|
|
92
|
+
});
|
|
79
93
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
94
|
+
export type Outbound = {
|
|
95
|
+
agent_name?: string | undefined;
|
|
96
|
+
llm_setting:
|
|
97
|
+
| components.RetellLlmSetting$.Inbound
|
|
98
|
+
| components.CustomLlmSetting$.Inbound;
|
|
99
|
+
interaction_setting?:
|
|
100
|
+
| components.InteractionSettingRequest$.Inbound
|
|
101
|
+
| undefined;
|
|
102
|
+
voice_id: string;
|
|
103
|
+
functions?: Function[] | undefined;
|
|
104
|
+
};
|
|
87
105
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
.
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
106
|
+
export const outboundSchema: z.ZodType<
|
|
107
|
+
Outbound,
|
|
108
|
+
z.ZodTypeDef,
|
|
109
|
+
CreateAgentRequestBody
|
|
110
|
+
> = z
|
|
111
|
+
.object({
|
|
112
|
+
agentName: z.string().optional(),
|
|
113
|
+
llmSetting: z.union([
|
|
114
|
+
components.RetellLlmSetting$.outboundSchema,
|
|
115
|
+
components.CustomLlmSetting$.outboundSchema,
|
|
116
|
+
]),
|
|
117
|
+
interactionSetting:
|
|
118
|
+
components.InteractionSettingRequest$.outboundSchema.optional(),
|
|
119
|
+
voiceId: z.string(),
|
|
120
|
+
functions: z.array(components.Function$.inboundSchema).optional(),
|
|
121
|
+
})
|
|
122
|
+
.transform((v) => {
|
|
123
|
+
return {
|
|
124
|
+
...(v.agentName === undefined ? null : { agent_name: v.agentName }),
|
|
125
|
+
llm_setting: v.llmSetting,
|
|
126
|
+
...(v.interactionSetting === undefined
|
|
127
|
+
? null
|
|
128
|
+
: { interaction_setting: v.interactionSetting }),
|
|
129
|
+
voice_id: v.voiceId,
|
|
130
|
+
...(v.functions === undefined ? null : { functions: v.functions }),
|
|
131
|
+
};
|
|
132
|
+
});
|
|
105
133
|
}
|
|
106
134
|
|
|
107
135
|
/** @internal */
|
|
108
136
|
export namespace CreateAgentResponse$ {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
137
|
+
export type Inbound = {
|
|
138
|
+
Agent?: components.Agent$.Inbound | undefined;
|
|
139
|
+
ContentType: string;
|
|
140
|
+
StatusCode: number;
|
|
141
|
+
RawResponse: Response;
|
|
142
|
+
};
|
|
115
143
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
144
|
+
export const inboundSchema: z.ZodType<
|
|
145
|
+
CreateAgentResponse,
|
|
146
|
+
z.ZodTypeDef,
|
|
147
|
+
Inbound
|
|
148
|
+
> = z
|
|
149
|
+
.object({
|
|
150
|
+
Agent: components.Agent$.inboundSchema.optional(),
|
|
151
|
+
ContentType: z.string(),
|
|
152
|
+
StatusCode: z.number().int(),
|
|
153
|
+
RawResponse: z.instanceof(Response),
|
|
154
|
+
})
|
|
155
|
+
.transform((v) => {
|
|
156
|
+
return {
|
|
157
|
+
...(v.Agent === undefined ? null : { agent: v.Agent }),
|
|
158
|
+
contentType: v.ContentType,
|
|
159
|
+
statusCode: v.StatusCode,
|
|
160
|
+
rawResponse: v.RawResponse,
|
|
161
|
+
};
|
|
162
|
+
});
|
|
131
163
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
164
|
+
export type Outbound = {
|
|
165
|
+
Agent?: components.Agent$.Outbound | undefined;
|
|
166
|
+
ContentType: string;
|
|
167
|
+
StatusCode: number;
|
|
168
|
+
RawResponse: never;
|
|
169
|
+
};
|
|
138
170
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
171
|
+
export const outboundSchema: z.ZodType<
|
|
172
|
+
Outbound,
|
|
173
|
+
z.ZodTypeDef,
|
|
174
|
+
CreateAgentResponse
|
|
175
|
+
> = z
|
|
176
|
+
.object({
|
|
177
|
+
agent: components.Agent$.outboundSchema.optional(),
|
|
178
|
+
contentType: z.string(),
|
|
179
|
+
statusCode: z.number().int(),
|
|
180
|
+
rawResponse: z.instanceof(Response).transform(() => {
|
|
181
|
+
throw new Error("Response cannot be serialized");
|
|
182
|
+
}),
|
|
183
|
+
})
|
|
184
|
+
.transform((v) => {
|
|
185
|
+
return {
|
|
186
|
+
...(v.agent === undefined ? null : { Agent: v.agent }),
|
|
187
|
+
ContentType: v.contentType,
|
|
188
|
+
StatusCode: v.statusCode,
|
|
189
|
+
RawResponse: v.rawResponse,
|
|
190
|
+
};
|
|
191
|
+
});
|
|
156
192
|
}
|