retell-sdk 0.1.0-alpha.1

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.
Files changed (193) hide show
  1. package/CHANGELOG.md +59 -0
  2. package/LICENSE +201 -0
  3. package/README.md +304 -0
  4. package/_shims/MultipartBody.d.ts +9 -0
  5. package/_shims/MultipartBody.d.ts.map +1 -0
  6. package/_shims/MultipartBody.js +16 -0
  7. package/_shims/MultipartBody.js.map +1 -0
  8. package/_shims/MultipartBody.mjs +12 -0
  9. package/_shims/MultipartBody.mjs.map +1 -0
  10. package/_shims/README.md +46 -0
  11. package/_shims/auto/runtime-bun.d.ts +5 -0
  12. package/_shims/auto/runtime-bun.d.ts.map +1 -0
  13. package/_shims/auto/runtime-bun.js +21 -0
  14. package/_shims/auto/runtime-bun.js.map +1 -0
  15. package/_shims/auto/runtime-bun.mjs +2 -0
  16. package/_shims/auto/runtime-bun.mjs.map +1 -0
  17. package/_shims/auto/runtime-node.d.ts +5 -0
  18. package/_shims/auto/runtime-node.d.ts.map +1 -0
  19. package/_shims/auto/runtime-node.js +21 -0
  20. package/_shims/auto/runtime-node.js.map +1 -0
  21. package/_shims/auto/runtime-node.mjs +2 -0
  22. package/_shims/auto/runtime-node.mjs.map +1 -0
  23. package/_shims/auto/runtime.d.ts +5 -0
  24. package/_shims/auto/runtime.d.ts.map +1 -0
  25. package/_shims/auto/runtime.js +21 -0
  26. package/_shims/auto/runtime.js.map +1 -0
  27. package/_shims/auto/runtime.mjs +2 -0
  28. package/_shims/auto/runtime.mjs.map +1 -0
  29. package/_shims/auto/types-node.d.ts +5 -0
  30. package/_shims/auto/types-node.d.ts.map +1 -0
  31. package/_shims/auto/types-node.js +21 -0
  32. package/_shims/auto/types-node.js.map +1 -0
  33. package/_shims/auto/types-node.mjs +2 -0
  34. package/_shims/auto/types-node.mjs.map +1 -0
  35. package/_shims/auto/types.d.ts +101 -0
  36. package/_shims/auto/types.js +3 -0
  37. package/_shims/auto/types.mjs +3 -0
  38. package/_shims/bun-runtime.d.ts +6 -0
  39. package/_shims/bun-runtime.d.ts.map +1 -0
  40. package/_shims/bun-runtime.js +14 -0
  41. package/_shims/bun-runtime.js.map +1 -0
  42. package/_shims/bun-runtime.mjs +10 -0
  43. package/_shims/bun-runtime.mjs.map +1 -0
  44. package/_shims/index.d.ts +81 -0
  45. package/_shims/index.js +13 -0
  46. package/_shims/index.mjs +7 -0
  47. package/_shims/manual-types.d.ts +12 -0
  48. package/_shims/manual-types.js +3 -0
  49. package/_shims/manual-types.mjs +3 -0
  50. package/_shims/node-runtime.d.ts +3 -0
  51. package/_shims/node-runtime.d.ts.map +1 -0
  52. package/_shims/node-runtime.js +90 -0
  53. package/_shims/node-runtime.js.map +1 -0
  54. package/_shims/node-runtime.mjs +56 -0
  55. package/_shims/node-runtime.mjs.map +1 -0
  56. package/_shims/node-types.d.ts +42 -0
  57. package/_shims/node-types.js +3 -0
  58. package/_shims/node-types.mjs +3 -0
  59. package/_shims/registry.d.ts +37 -0
  60. package/_shims/registry.d.ts.map +1 -0
  61. package/_shims/registry.js +41 -0
  62. package/_shims/registry.js.map +1 -0
  63. package/_shims/registry.mjs +37 -0
  64. package/_shims/registry.mjs.map +1 -0
  65. package/_shims/web-runtime.d.ts +5 -0
  66. package/_shims/web-runtime.d.ts.map +1 -0
  67. package/_shims/web-runtime.js +78 -0
  68. package/_shims/web-runtime.js.map +1 -0
  69. package/_shims/web-runtime.mjs +71 -0
  70. package/_shims/web-runtime.mjs.map +1 -0
  71. package/_shims/web-types.d.ts +83 -0
  72. package/_shims/web-types.js +3 -0
  73. package/_shims/web-types.mjs +3 -0
  74. package/core.d.ts +237 -0
  75. package/core.d.ts.map +1 -0
  76. package/core.js +868 -0
  77. package/core.js.map +1 -0
  78. package/core.mjs +837 -0
  79. package/core.mjs.map +1 -0
  80. package/error.d.ts +53 -0
  81. package/error.d.ts.map +1 -0
  82. package/error.js +143 -0
  83. package/error.js.map +1 -0
  84. package/error.mjs +127 -0
  85. package/error.mjs.map +1 -0
  86. package/index.d.mts +133 -0
  87. package/index.d.ts +133 -0
  88. package/index.d.ts.map +1 -0
  89. package/index.js +117 -0
  90. package/index.js.map +1 -0
  91. package/index.mjs +89 -0
  92. package/index.mjs.map +1 -0
  93. package/package.json +107 -0
  94. package/resource.d.ts +6 -0
  95. package/resource.d.ts.map +1 -0
  96. package/resource.js +11 -0
  97. package/resource.js.map +1 -0
  98. package/resource.mjs +7 -0
  99. package/resource.mjs.map +1 -0
  100. package/resources/agent.d.ts +372 -0
  101. package/resources/agent.d.ts.map +1 -0
  102. package/resources/agent.js +44 -0
  103. package/resources/agent.js.map +1 -0
  104. package/resources/agent.mjs +40 -0
  105. package/resources/agent.mjs.map +1 -0
  106. package/resources/call.d.ts +461 -0
  107. package/resources/call.d.ts.map +1 -0
  108. package/resources/call.js +36 -0
  109. package/resources/call.js.map +1 -0
  110. package/resources/call.mjs +32 -0
  111. package/resources/call.mjs.map +1 -0
  112. package/resources/index.d.ts +5 -0
  113. package/resources/index.d.ts.map +1 -0
  114. package/resources/index.js +13 -0
  115. package/resources/index.js.map +1 -0
  116. package/resources/index.mjs +6 -0
  117. package/resources/index.mjs.map +1 -0
  118. package/resources/llm.d.ts +1355 -0
  119. package/resources/llm.d.ts.map +1 -0
  120. package/resources/llm.js +44 -0
  121. package/resources/llm.js.map +1 -0
  122. package/resources/llm.mjs +40 -0
  123. package/resources/llm.mjs.map +1 -0
  124. package/resources/phone-number.d.ts +78 -0
  125. package/resources/phone-number.d.ts.map +1 -0
  126. package/resources/phone-number.js +44 -0
  127. package/resources/phone-number.js.map +1 -0
  128. package/resources/phone-number.mjs +40 -0
  129. package/resources/phone-number.mjs.map +1 -0
  130. package/shims/node.d.ts +29 -0
  131. package/shims/node.d.ts.map +1 -0
  132. package/shims/node.js +31 -0
  133. package/shims/node.js.map +1 -0
  134. package/shims/node.mjs +5 -0
  135. package/shims/node.mjs.map +1 -0
  136. package/shims/web.d.ts +26 -0
  137. package/shims/web.d.ts.map +1 -0
  138. package/shims/web.js +31 -0
  139. package/shims/web.js.map +1 -0
  140. package/shims/web.mjs +5 -0
  141. package/shims/web.mjs.map +1 -0
  142. package/src/_shims/MultipartBody.ts +9 -0
  143. package/src/_shims/README.md +46 -0
  144. package/src/_shims/auto/runtime-bun.ts +4 -0
  145. package/src/_shims/auto/runtime-node.ts +4 -0
  146. package/src/_shims/auto/runtime.ts +4 -0
  147. package/src/_shims/auto/types-node.ts +4 -0
  148. package/src/_shims/auto/types.d.ts +101 -0
  149. package/src/_shims/auto/types.js +3 -0
  150. package/src/_shims/auto/types.mjs +3 -0
  151. package/src/_shims/bun-runtime.ts +14 -0
  152. package/src/_shims/index.d.ts +81 -0
  153. package/src/_shims/index.js +13 -0
  154. package/src/_shims/index.mjs +7 -0
  155. package/src/_shims/manual-types.d.ts +12 -0
  156. package/src/_shims/manual-types.js +3 -0
  157. package/src/_shims/manual-types.mjs +3 -0
  158. package/src/_shims/node-runtime.ts +83 -0
  159. package/src/_shims/node-types.d.ts +42 -0
  160. package/src/_shims/node-types.js +3 -0
  161. package/src/_shims/node-types.mjs +3 -0
  162. package/src/_shims/registry.ts +67 -0
  163. package/src/_shims/web-runtime.ts +103 -0
  164. package/src/_shims/web-types.d.ts +83 -0
  165. package/src/_shims/web-types.js +3 -0
  166. package/src/_shims/web-types.mjs +3 -0
  167. package/src/core.ts +1146 -0
  168. package/src/error.ts +146 -0
  169. package/src/index.ts +215 -0
  170. package/src/lib/.keep +4 -0
  171. package/src/resource.ts +11 -0
  172. package/src/resources/agent.ts +468 -0
  173. package/src/resources/call.ts +542 -0
  174. package/src/resources/index.ts +21 -0
  175. package/src/resources/llm.ts +1643 -0
  176. package/src/resources/phone-number.ts +111 -0
  177. package/src/shims/node.ts +50 -0
  178. package/src/shims/web.ts +50 -0
  179. package/src/tsconfig.json +11 -0
  180. package/src/uploads.ts +248 -0
  181. package/src/version.ts +1 -0
  182. package/uploads.d.ts +75 -0
  183. package/uploads.d.ts.map +1 -0
  184. package/uploads.js +165 -0
  185. package/uploads.js.map +1 -0
  186. package/uploads.mjs +152 -0
  187. package/uploads.mjs.map +1 -0
  188. package/version.d.ts +2 -0
  189. package/version.d.ts.map +1 -0
  190. package/version.js +5 -0
  191. package/version.js.map +1 -0
  192. package/version.mjs +2 -0
  193. package/version.mjs.map +1 -0
@@ -0,0 +1,1355 @@
1
+ import * as Core from 'retell-sdk/core';
2
+ import { APIResource } from 'retell-sdk/resource';
3
+ import * as LlmAPI from 'retell-sdk/resources/llm';
4
+ export declare class Llm extends APIResource {
5
+ /**
6
+ * Create a new Retell LLM
7
+ */
8
+ create(body: LlmCreateParams, options?: Core.RequestOptions): Core.APIPromise<LlmResponse>;
9
+ /**
10
+ * Retrieve details of a specific Retell LLM
11
+ */
12
+ retrieve(llmId: string, options?: Core.RequestOptions): Core.APIPromise<LlmResponse>;
13
+ /**
14
+ * Update an existing Retell LLM
15
+ */
16
+ update(llmId: string, body: LlmUpdateParams, options?: Core.RequestOptions): Core.APIPromise<LlmResponse>;
17
+ /**
18
+ * List all retell LLM
19
+ */
20
+ list(options?: Core.RequestOptions): Core.APIPromise<LlmListResponse>;
21
+ /**
22
+ * Delete an existing Retell LLM
23
+ */
24
+ delete(llmId: string, options?: Core.RequestOptions): Core.APIPromise<void>;
25
+ }
26
+ export interface LlmResponse {
27
+ /**
28
+ * Last modification timestamp (milliseconds since epoch). Either the time of last
29
+ * update or creation if no updates available.
30
+ */
31
+ last_modification_timestamp: number;
32
+ /**
33
+ * Unique id of Retell LLM.
34
+ */
35
+ llm_id: string;
36
+ /**
37
+ * The LLM Websocket URL constructed from unique id of Retell LLM. Used in agent
38
+ * API to create / update agent.
39
+ */
40
+ llm_websocket_url: string;
41
+ /**
42
+ * First utterance said by the agent in the call. If not set, LLM will dynamically
43
+ * generate a message. If set to "", agent will wait for user to speak first.
44
+ */
45
+ begin_message?: string;
46
+ /**
47
+ * General prompt that's appended to system prompt no matter what state the agent
48
+ * is in.
49
+ *
50
+ * - System prompt (with state) = general prompt + state prompt.
51
+ *
52
+ * - System prompt (no state) = general prompt.
53
+ */
54
+ general_prompt?: string;
55
+ /**
56
+ * A list of tools the model may call (to get external knowledge, call API, etc).
57
+ * You can select from some common predefined tools like end call, transfer call,
58
+ * etc; or you can create your own custom tool (last option) for the LLM to use.
59
+ *
60
+ * - Tools of LLM (with state) = general tools + state tools + state transitions
61
+ *
62
+ * - Tools of LLM (no state) = general tools
63
+ */
64
+ general_tools?: Array<LlmResponse.EndCallTool | LlmResponse.TransferCallTool | LlmResponse.CheckAvailabilityCalTool | LlmResponse.BookAppointmentCalTool | LlmResponse.CustomTool>;
65
+ /**
66
+ * Name of the starting state. Required if states is not empty.
67
+ */
68
+ starting_state?: string;
69
+ /**
70
+ * States of the LLM. This is to help reduce prompt length and tool choices when
71
+ * the call can be broken into distinct states. With shorter prompts and less
72
+ * tools, the LLM can better focus and follow the rules, minimizing hallucination.
73
+ * If this field is not set, the agent would only have general prompt and general
74
+ * tools (essentially one state).
75
+ */
76
+ states?: Array<LlmResponse.State>;
77
+ }
78
+ export declare namespace LlmResponse {
79
+ interface EndCallTool {
80
+ /**
81
+ * Name of the tool. Must be unique within all tools available to LLM at any given
82
+ * time (general tools + state tools + state transitions).
83
+ */
84
+ name: string;
85
+ type: 'end_call';
86
+ /**
87
+ * Describes when to end the call.
88
+ */
89
+ description?: string;
90
+ }
91
+ interface TransferCallTool {
92
+ /**
93
+ * Name of the tool. Must be unique within all tools available to LLM at any given
94
+ * time (general tools + state tools + state edges).
95
+ */
96
+ name: string;
97
+ /**
98
+ * The number to transfer to in E.164 format (a + and country code, then the phone
99
+ * number with no space or other special characters). For example, +16175551212.
100
+ */
101
+ number: string;
102
+ type: 'transfer_call';
103
+ /**
104
+ * Describes when to transfer the call.
105
+ */
106
+ description?: string;
107
+ }
108
+ interface CheckAvailabilityCalTool {
109
+ /**
110
+ * Cal.com Api key that have access to the cal.com event you want to check
111
+ * availability for.
112
+ */
113
+ cal_api_key: string;
114
+ /**
115
+ * Cal.com event type id number for the cal.com event you want to check
116
+ * availability for.
117
+ */
118
+ event_type_id: number;
119
+ /**
120
+ * Name of the tool. Must be unique within all tools available to LLM at any given
121
+ * time (general tools + state tools + state transitions).
122
+ */
123
+ name: string;
124
+ type: 'check_availability_cal';
125
+ /**
126
+ * Describes when to check availability.
127
+ */
128
+ description?: string;
129
+ /**
130
+ * Timezone to be used when checking availability, must be in
131
+ * [IANA timezone database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).
132
+ * If not specified, will check if user specified timezone in call, and if not,
133
+ * will use the timezone of the Retell servers.
134
+ */
135
+ timezone?: string;
136
+ }
137
+ interface BookAppointmentCalTool {
138
+ /**
139
+ * Cal.com Api key that have access to the cal.com event you want to book
140
+ * appointment.
141
+ */
142
+ cal_api_key: string;
143
+ /**
144
+ * Cal.com event type id number for the cal.com event you want to book appointment.
145
+ */
146
+ event_type_id: number;
147
+ /**
148
+ * Name of the tool. Must be unique within all tools available to LLM at any given
149
+ * time (general tools + state tools + state transitions).
150
+ */
151
+ name: string;
152
+ type: 'book_appointment_cal';
153
+ /**
154
+ * Describes when to book the appointment.
155
+ */
156
+ description?: string;
157
+ /**
158
+ * Timezone to be used when booking appointment, must be in
159
+ * [IANA timezone database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).
160
+ * If not specified, will check if user specified timezone in call, and if not,
161
+ * will use the timezone of the Retell servers.
162
+ */
163
+ timezone?: string;
164
+ }
165
+ interface CustomTool {
166
+ /**
167
+ * Describes what this tool does and when to call this tool.
168
+ */
169
+ description: string;
170
+ /**
171
+ * Name of the tool. Must be unique within all tools available to LLM at any given
172
+ * time (general tools + state tools + state edges).
173
+ */
174
+ name: string;
175
+ /**
176
+ * Determines whether the agent would call LLM another time and speak when the
177
+ * result of function is obtained. Usually this needs to get turned on so user can
178
+ * get update for the function call.
179
+ */
180
+ speak_after_execution: boolean;
181
+ /**
182
+ * Determines whether the agent would say sentence like "One moment, let me check
183
+ * that." when executing the function. Recommend to turn on if your function call
184
+ * takes over 1s (including network) to complete, so that your agent remains
185
+ * responsive.
186
+ */
187
+ speak_during_execution: boolean;
188
+ type: 'custom';
189
+ /**
190
+ * The URL we will post the function name and arguments to get a result for the
191
+ * function. Usually this is your server.
192
+ */
193
+ url: string;
194
+ /**
195
+ * The description for the sentence agent say during execution. Only applicable
196
+ * when speak_during_execution is true. Can write what to say or even provide
197
+ * examples. The default is "The message you will say to callee when calling this
198
+ * tool. Make sure it fits into the conversation smoothly.".
199
+ */
200
+ execution_message_description?: string;
201
+ /**
202
+ * The parameters the functions accepts, described as a JSON Schema object. See
203
+ * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
204
+ * documentation about the format. Omitting parameters defines a function with an
205
+ * empty parameter list.
206
+ */
207
+ parameters?: CustomTool.Parameters;
208
+ }
209
+ namespace CustomTool {
210
+ /**
211
+ * The parameters the functions accepts, described as a JSON Schema object. See
212
+ * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
213
+ * documentation about the format. Omitting parameters defines a function with an
214
+ * empty parameter list.
215
+ */
216
+ interface Parameters {
217
+ /**
218
+ * The value of properties is an object, where each key is the name of a property
219
+ * and each value is a schema used to validate that property.
220
+ */
221
+ properties: Record<string, unknown>;
222
+ /**
223
+ * Type must be "object" for a JSON Schema object.
224
+ */
225
+ type: 'object';
226
+ /**
227
+ * List of names of required property when generating this parameter. LLM will do
228
+ * its best to generate the required properties in its function arguments. Property
229
+ * must exist in properties.
230
+ */
231
+ required?: Array<string>;
232
+ }
233
+ }
234
+ interface State {
235
+ /**
236
+ * Name of the state, must be unique for each state.
237
+ */
238
+ name: string;
239
+ /**
240
+ * Edges of the state define how and what state can be reached from this state.
241
+ */
242
+ edges?: Array<State.Edge>;
243
+ /**
244
+ * Prompt of the state, will be appended to the system prompt of LLM.
245
+ *
246
+ * - System prompt = general prompt + state prompt.
247
+ */
248
+ state_prompt?: string;
249
+ /**
250
+ * A list of tools specific to this state the model may call (to get external
251
+ * knowledge, call API, etc). You can select from some common predefined tools like
252
+ * end call, transfer call, etc; or you can create your own custom tool (last
253
+ * option) for the LLM to use.
254
+ *
255
+ * - Tools of LLM = general tools + state tools + state transitions
256
+ */
257
+ tools?: Array<State.EndCallTool | State.TransferCallTool | State.CheckAvailabilityCalTool | State.BookAppointmentCalTool | State.CustomTool>;
258
+ }
259
+ namespace State {
260
+ interface Edge {
261
+ /**
262
+ * Describes what's the transition and at what time / criteria should this
263
+ * transition happen.
264
+ */
265
+ description: string;
266
+ /**
267
+ * The destination state name when going through transition of state via this edge.
268
+ * State transition internally is implemented as a tool call of LLM, and a tool
269
+ * call with name "transition*to*{destination_state_name}" will get created. Feel
270
+ * free to reference it inside the prompt.
271
+ */
272
+ destination_state_name: string;
273
+ /**
274
+ * After the state transitions, the agent would speak based on the new prompt and
275
+ * tools in the new state. This bit here controls whether to speak a transition
276
+ * sentence during the transition (so agent would say sentences like "Let's move on
277
+ * to the next section to help you set up an acount.", and state transitions, and
278
+ * agent continue to speak.). Usually this is not necessary, and is recommended to
279
+ * set to false to avoid LLM repeating itself during and after transition.
280
+ */
281
+ speak_during_transition: boolean;
282
+ /**
283
+ * Describes what parameters you want to extract out when the transition changes.
284
+ * The parameters extracted here can be referenced in prompts & function
285
+ * descriptions of later states via dynamic variables. The parameters the functions
286
+ * accepts, described as a JSON Schema object. See
287
+ * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
288
+ * documentation about the format.
289
+ */
290
+ parameters?: Edge.Parameters;
291
+ }
292
+ namespace Edge {
293
+ /**
294
+ * Describes what parameters you want to extract out when the transition changes.
295
+ * The parameters extracted here can be referenced in prompts & function
296
+ * descriptions of later states via dynamic variables. The parameters the functions
297
+ * accepts, described as a JSON Schema object. See
298
+ * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
299
+ * documentation about the format.
300
+ */
301
+ interface Parameters {
302
+ /**
303
+ * The value of properties is an object, where each key is the name of a property
304
+ * and each value is a schema used to validate that property.
305
+ */
306
+ properties: Record<string, unknown>;
307
+ /**
308
+ * Type must be "object" for a JSON Schema object.
309
+ */
310
+ type: 'object';
311
+ /**
312
+ * List of names of required property when generating this parameter. LLM will do
313
+ * its best to generate the required properties in its function arguments. Property
314
+ * must exist in properties.
315
+ */
316
+ required?: Array<string>;
317
+ }
318
+ }
319
+ interface EndCallTool {
320
+ /**
321
+ * Name of the tool. Must be unique within all tools available to LLM at any given
322
+ * time (general tools + state tools + state transitions).
323
+ */
324
+ name: string;
325
+ type: 'end_call';
326
+ /**
327
+ * Describes when to end the call.
328
+ */
329
+ description?: string;
330
+ }
331
+ interface TransferCallTool {
332
+ /**
333
+ * Name of the tool. Must be unique within all tools available to LLM at any given
334
+ * time (general tools + state tools + state edges).
335
+ */
336
+ name: string;
337
+ /**
338
+ * The number to transfer to in E.164 format (a + and country code, then the phone
339
+ * number with no space or other special characters). For example, +16175551212.
340
+ */
341
+ number: string;
342
+ type: 'transfer_call';
343
+ /**
344
+ * Describes when to transfer the call.
345
+ */
346
+ description?: string;
347
+ }
348
+ interface CheckAvailabilityCalTool {
349
+ /**
350
+ * Cal.com Api key that have access to the cal.com event you want to check
351
+ * availability for.
352
+ */
353
+ cal_api_key: string;
354
+ /**
355
+ * Cal.com event type id number for the cal.com event you want to check
356
+ * availability for.
357
+ */
358
+ event_type_id: number;
359
+ /**
360
+ * Name of the tool. Must be unique within all tools available to LLM at any given
361
+ * time (general tools + state tools + state transitions).
362
+ */
363
+ name: string;
364
+ type: 'check_availability_cal';
365
+ /**
366
+ * Describes when to check availability.
367
+ */
368
+ description?: string;
369
+ /**
370
+ * Timezone to be used when checking availability, must be in
371
+ * [IANA timezone database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).
372
+ * If not specified, will check if user specified timezone in call, and if not,
373
+ * will use the timezone of the Retell servers.
374
+ */
375
+ timezone?: string;
376
+ }
377
+ interface BookAppointmentCalTool {
378
+ /**
379
+ * Cal.com Api key that have access to the cal.com event you want to book
380
+ * appointment.
381
+ */
382
+ cal_api_key: string;
383
+ /**
384
+ * Cal.com event type id number for the cal.com event you want to book appointment.
385
+ */
386
+ event_type_id: number;
387
+ /**
388
+ * Name of the tool. Must be unique within all tools available to LLM at any given
389
+ * time (general tools + state tools + state transitions).
390
+ */
391
+ name: string;
392
+ type: 'book_appointment_cal';
393
+ /**
394
+ * Describes when to book the appointment.
395
+ */
396
+ description?: string;
397
+ /**
398
+ * Timezone to be used when booking appointment, must be in
399
+ * [IANA timezone database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).
400
+ * If not specified, will check if user specified timezone in call, and if not,
401
+ * will use the timezone of the Retell servers.
402
+ */
403
+ timezone?: string;
404
+ }
405
+ interface CustomTool {
406
+ /**
407
+ * Describes what this tool does and when to call this tool.
408
+ */
409
+ description: string;
410
+ /**
411
+ * Name of the tool. Must be unique within all tools available to LLM at any given
412
+ * time (general tools + state tools + state edges).
413
+ */
414
+ name: string;
415
+ /**
416
+ * Determines whether the agent would call LLM another time and speak when the
417
+ * result of function is obtained. Usually this needs to get turned on so user can
418
+ * get update for the function call.
419
+ */
420
+ speak_after_execution: boolean;
421
+ /**
422
+ * Determines whether the agent would say sentence like "One moment, let me check
423
+ * that." when executing the function. Recommend to turn on if your function call
424
+ * takes over 1s (including network) to complete, so that your agent remains
425
+ * responsive.
426
+ */
427
+ speak_during_execution: boolean;
428
+ type: 'custom';
429
+ /**
430
+ * The URL we will post the function name and arguments to get a result for the
431
+ * function. Usually this is your server.
432
+ */
433
+ url: string;
434
+ /**
435
+ * The description for the sentence agent say during execution. Only applicable
436
+ * when speak_during_execution is true. Can write what to say or even provide
437
+ * examples. The default is "The message you will say to callee when calling this
438
+ * tool. Make sure it fits into the conversation smoothly.".
439
+ */
440
+ execution_message_description?: string;
441
+ /**
442
+ * The parameters the functions accepts, described as a JSON Schema object. See
443
+ * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
444
+ * documentation about the format. Omitting parameters defines a function with an
445
+ * empty parameter list.
446
+ */
447
+ parameters?: CustomTool.Parameters;
448
+ }
449
+ namespace CustomTool {
450
+ /**
451
+ * The parameters the functions accepts, described as a JSON Schema object. See
452
+ * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
453
+ * documentation about the format. Omitting parameters defines a function with an
454
+ * empty parameter list.
455
+ */
456
+ interface Parameters {
457
+ /**
458
+ * The value of properties is an object, where each key is the name of a property
459
+ * and each value is a schema used to validate that property.
460
+ */
461
+ properties: Record<string, unknown>;
462
+ /**
463
+ * Type must be "object" for a JSON Schema object.
464
+ */
465
+ type: 'object';
466
+ /**
467
+ * List of names of required property when generating this parameter. LLM will do
468
+ * its best to generate the required properties in its function arguments. Property
469
+ * must exist in properties.
470
+ */
471
+ required?: Array<string>;
472
+ }
473
+ }
474
+ }
475
+ }
476
+ export type LlmListResponse = Array<LlmResponse>;
477
+ export interface LlmCreateParams {
478
+ /**
479
+ * First utterance said by the agent in the call. If not set, LLM will dynamically
480
+ * generate a message. If set to "", agent will wait for user to speak first.
481
+ */
482
+ begin_message?: string;
483
+ /**
484
+ * General prompt that's appended to system prompt no matter what state the agent
485
+ * is in.
486
+ *
487
+ * - System prompt (with state) = general prompt + state prompt.
488
+ *
489
+ * - System prompt (no state) = general prompt.
490
+ */
491
+ general_prompt?: string;
492
+ /**
493
+ * A list of tools the model may call (to get external knowledge, call API, etc).
494
+ * You can select from some common predefined tools like end call, transfer call,
495
+ * etc; or you can create your own custom tool (last option) for the LLM to use.
496
+ *
497
+ * - Tools of LLM (with state) = general tools + state tools + state transitions
498
+ *
499
+ * - Tools of LLM (no state) = general tools
500
+ */
501
+ general_tools?: Array<LlmCreateParams.EndCallTool | LlmCreateParams.TransferCallTool | LlmCreateParams.CheckAvailabilityCalTool | LlmCreateParams.BookAppointmentCalTool | LlmCreateParams.CustomTool>;
502
+ /**
503
+ * Name of the starting state. Required if states is not empty.
504
+ */
505
+ starting_state?: string;
506
+ /**
507
+ * States of the LLM. This is to help reduce prompt length and tool choices when
508
+ * the call can be broken into distinct states. With shorter prompts and less
509
+ * tools, the LLM can better focus and follow the rules, minimizing hallucination.
510
+ * If this field is not set, the agent would only have general prompt and general
511
+ * tools (essentially one state).
512
+ */
513
+ states?: Array<LlmCreateParams.State>;
514
+ }
515
+ export declare namespace LlmCreateParams {
516
+ interface EndCallTool {
517
+ /**
518
+ * Name of the tool. Must be unique within all tools available to LLM at any given
519
+ * time (general tools + state tools + state transitions).
520
+ */
521
+ name: string;
522
+ type: 'end_call';
523
+ /**
524
+ * Describes when to end the call.
525
+ */
526
+ description?: string;
527
+ }
528
+ interface TransferCallTool {
529
+ /**
530
+ * Name of the tool. Must be unique within all tools available to LLM at any given
531
+ * time (general tools + state tools + state edges).
532
+ */
533
+ name: string;
534
+ /**
535
+ * The number to transfer to in E.164 format (a + and country code, then the phone
536
+ * number with no space or other special characters). For example, +16175551212.
537
+ */
538
+ number: string;
539
+ type: 'transfer_call';
540
+ /**
541
+ * Describes when to transfer the call.
542
+ */
543
+ description?: string;
544
+ }
545
+ interface CheckAvailabilityCalTool {
546
+ /**
547
+ * Cal.com Api key that have access to the cal.com event you want to check
548
+ * availability for.
549
+ */
550
+ cal_api_key: string;
551
+ /**
552
+ * Cal.com event type id number for the cal.com event you want to check
553
+ * availability for.
554
+ */
555
+ event_type_id: number;
556
+ /**
557
+ * Name of the tool. Must be unique within all tools available to LLM at any given
558
+ * time (general tools + state tools + state transitions).
559
+ */
560
+ name: string;
561
+ type: 'check_availability_cal';
562
+ /**
563
+ * Describes when to check availability.
564
+ */
565
+ description?: string;
566
+ /**
567
+ * Timezone to be used when checking availability, must be in
568
+ * [IANA timezone database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).
569
+ * If not specified, will check if user specified timezone in call, and if not,
570
+ * will use the timezone of the Retell servers.
571
+ */
572
+ timezone?: string;
573
+ }
574
+ interface BookAppointmentCalTool {
575
+ /**
576
+ * Cal.com Api key that have access to the cal.com event you want to book
577
+ * appointment.
578
+ */
579
+ cal_api_key: string;
580
+ /**
581
+ * Cal.com event type id number for the cal.com event you want to book appointment.
582
+ */
583
+ event_type_id: number;
584
+ /**
585
+ * Name of the tool. Must be unique within all tools available to LLM at any given
586
+ * time (general tools + state tools + state transitions).
587
+ */
588
+ name: string;
589
+ type: 'book_appointment_cal';
590
+ /**
591
+ * Describes when to book the appointment.
592
+ */
593
+ description?: string;
594
+ /**
595
+ * Timezone to be used when booking appointment, must be in
596
+ * [IANA timezone database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).
597
+ * If not specified, will check if user specified timezone in call, and if not,
598
+ * will use the timezone of the Retell servers.
599
+ */
600
+ timezone?: string;
601
+ }
602
+ interface CustomTool {
603
+ /**
604
+ * Describes what this tool does and when to call this tool.
605
+ */
606
+ description: string;
607
+ /**
608
+ * Name of the tool. Must be unique within all tools available to LLM at any given
609
+ * time (general tools + state tools + state edges).
610
+ */
611
+ name: string;
612
+ /**
613
+ * Determines whether the agent would call LLM another time and speak when the
614
+ * result of function is obtained. Usually this needs to get turned on so user can
615
+ * get update for the function call.
616
+ */
617
+ speak_after_execution: boolean;
618
+ /**
619
+ * Determines whether the agent would say sentence like "One moment, let me check
620
+ * that." when executing the function. Recommend to turn on if your function call
621
+ * takes over 1s (including network) to complete, so that your agent remains
622
+ * responsive.
623
+ */
624
+ speak_during_execution: boolean;
625
+ type: 'custom';
626
+ /**
627
+ * The URL we will post the function name and arguments to get a result for the
628
+ * function. Usually this is your server.
629
+ */
630
+ url: string;
631
+ /**
632
+ * The description for the sentence agent say during execution. Only applicable
633
+ * when speak_during_execution is true. Can write what to say or even provide
634
+ * examples. The default is "The message you will say to callee when calling this
635
+ * tool. Make sure it fits into the conversation smoothly.".
636
+ */
637
+ execution_message_description?: string;
638
+ /**
639
+ * The parameters the functions accepts, described as a JSON Schema object. See
640
+ * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
641
+ * documentation about the format. Omitting parameters defines a function with an
642
+ * empty parameter list.
643
+ */
644
+ parameters?: CustomTool.Parameters;
645
+ }
646
+ namespace CustomTool {
647
+ /**
648
+ * The parameters the functions accepts, described as a JSON Schema object. See
649
+ * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
650
+ * documentation about the format. Omitting parameters defines a function with an
651
+ * empty parameter list.
652
+ */
653
+ interface Parameters {
654
+ /**
655
+ * The value of properties is an object, where each key is the name of a property
656
+ * and each value is a schema used to validate that property.
657
+ */
658
+ properties: Record<string, unknown>;
659
+ /**
660
+ * Type must be "object" for a JSON Schema object.
661
+ */
662
+ type: 'object';
663
+ /**
664
+ * List of names of required property when generating this parameter. LLM will do
665
+ * its best to generate the required properties in its function arguments. Property
666
+ * must exist in properties.
667
+ */
668
+ required?: Array<string>;
669
+ }
670
+ }
671
+ interface State {
672
+ /**
673
+ * Name of the state, must be unique for each state.
674
+ */
675
+ name: string;
676
+ /**
677
+ * Edges of the state define how and what state can be reached from this state.
678
+ */
679
+ edges?: Array<State.Edge>;
680
+ /**
681
+ * Prompt of the state, will be appended to the system prompt of LLM.
682
+ *
683
+ * - System prompt = general prompt + state prompt.
684
+ */
685
+ state_prompt?: string;
686
+ /**
687
+ * A list of tools specific to this state the model may call (to get external
688
+ * knowledge, call API, etc). You can select from some common predefined tools like
689
+ * end call, transfer call, etc; or you can create your own custom tool (last
690
+ * option) for the LLM to use.
691
+ *
692
+ * - Tools of LLM = general tools + state tools + state transitions
693
+ */
694
+ tools?: Array<State.EndCallTool | State.TransferCallTool | State.CheckAvailabilityCalTool | State.BookAppointmentCalTool | State.CustomTool>;
695
+ }
696
+ namespace State {
697
+ interface Edge {
698
+ /**
699
+ * Describes what's the transition and at what time / criteria should this
700
+ * transition happen.
701
+ */
702
+ description: string;
703
+ /**
704
+ * The destination state name when going through transition of state via this edge.
705
+ * State transition internally is implemented as a tool call of LLM, and a tool
706
+ * call with name "transition*to*{destination_state_name}" will get created. Feel
707
+ * free to reference it inside the prompt.
708
+ */
709
+ destination_state_name: string;
710
+ /**
711
+ * After the state transitions, the agent would speak based on the new prompt and
712
+ * tools in the new state. This bit here controls whether to speak a transition
713
+ * sentence during the transition (so agent would say sentences like "Let's move on
714
+ * to the next section to help you set up an acount.", and state transitions, and
715
+ * agent continue to speak.). Usually this is not necessary, and is recommended to
716
+ * set to false to avoid LLM repeating itself during and after transition.
717
+ */
718
+ speak_during_transition: boolean;
719
+ /**
720
+ * Describes what parameters you want to extract out when the transition changes.
721
+ * The parameters extracted here can be referenced in prompts & function
722
+ * descriptions of later states via dynamic variables. The parameters the functions
723
+ * accepts, described as a JSON Schema object. See
724
+ * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
725
+ * documentation about the format.
726
+ */
727
+ parameters?: Edge.Parameters;
728
+ }
729
+ namespace Edge {
730
+ /**
731
+ * Describes what parameters you want to extract out when the transition changes.
732
+ * The parameters extracted here can be referenced in prompts & function
733
+ * descriptions of later states via dynamic variables. The parameters the functions
734
+ * accepts, described as a JSON Schema object. See
735
+ * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
736
+ * documentation about the format.
737
+ */
738
+ interface Parameters {
739
+ /**
740
+ * The value of properties is an object, where each key is the name of a property
741
+ * and each value is a schema used to validate that property.
742
+ */
743
+ properties: Record<string, unknown>;
744
+ /**
745
+ * Type must be "object" for a JSON Schema object.
746
+ */
747
+ type: 'object';
748
+ /**
749
+ * List of names of required property when generating this parameter. LLM will do
750
+ * its best to generate the required properties in its function arguments. Property
751
+ * must exist in properties.
752
+ */
753
+ required?: Array<string>;
754
+ }
755
+ }
756
+ interface EndCallTool {
757
+ /**
758
+ * Name of the tool. Must be unique within all tools available to LLM at any given
759
+ * time (general tools + state tools + state transitions).
760
+ */
761
+ name: string;
762
+ type: 'end_call';
763
+ /**
764
+ * Describes when to end the call.
765
+ */
766
+ description?: string;
767
+ }
768
+ interface TransferCallTool {
769
+ /**
770
+ * Name of the tool. Must be unique within all tools available to LLM at any given
771
+ * time (general tools + state tools + state edges).
772
+ */
773
+ name: string;
774
+ /**
775
+ * The number to transfer to in E.164 format (a + and country code, then the phone
776
+ * number with no space or other special characters). For example, +16175551212.
777
+ */
778
+ number: string;
779
+ type: 'transfer_call';
780
+ /**
781
+ * Describes when to transfer the call.
782
+ */
783
+ description?: string;
784
+ }
785
+ interface CheckAvailabilityCalTool {
786
+ /**
787
+ * Cal.com Api key that have access to the cal.com event you want to check
788
+ * availability for.
789
+ */
790
+ cal_api_key: string;
791
+ /**
792
+ * Cal.com event type id number for the cal.com event you want to check
793
+ * availability for.
794
+ */
795
+ event_type_id: number;
796
+ /**
797
+ * Name of the tool. Must be unique within all tools available to LLM at any given
798
+ * time (general tools + state tools + state transitions).
799
+ */
800
+ name: string;
801
+ type: 'check_availability_cal';
802
+ /**
803
+ * Describes when to check availability.
804
+ */
805
+ description?: string;
806
+ /**
807
+ * Timezone to be used when checking availability, must be in
808
+ * [IANA timezone database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).
809
+ * If not specified, will check if user specified timezone in call, and if not,
810
+ * will use the timezone of the Retell servers.
811
+ */
812
+ timezone?: string;
813
+ }
814
+ interface BookAppointmentCalTool {
815
+ /**
816
+ * Cal.com Api key that have access to the cal.com event you want to book
817
+ * appointment.
818
+ */
819
+ cal_api_key: string;
820
+ /**
821
+ * Cal.com event type id number for the cal.com event you want to book appointment.
822
+ */
823
+ event_type_id: number;
824
+ /**
825
+ * Name of the tool. Must be unique within all tools available to LLM at any given
826
+ * time (general tools + state tools + state transitions).
827
+ */
828
+ name: string;
829
+ type: 'book_appointment_cal';
830
+ /**
831
+ * Describes when to book the appointment.
832
+ */
833
+ description?: string;
834
+ /**
835
+ * Timezone to be used when booking appointment, must be in
836
+ * [IANA timezone database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).
837
+ * If not specified, will check if user specified timezone in call, and if not,
838
+ * will use the timezone of the Retell servers.
839
+ */
840
+ timezone?: string;
841
+ }
842
+ interface CustomTool {
843
+ /**
844
+ * Describes what this tool does and when to call this tool.
845
+ */
846
+ description: string;
847
+ /**
848
+ * Name of the tool. Must be unique within all tools available to LLM at any given
849
+ * time (general tools + state tools + state edges).
850
+ */
851
+ name: string;
852
+ /**
853
+ * Determines whether the agent would call LLM another time and speak when the
854
+ * result of function is obtained. Usually this needs to get turned on so user can
855
+ * get update for the function call.
856
+ */
857
+ speak_after_execution: boolean;
858
+ /**
859
+ * Determines whether the agent would say sentence like "One moment, let me check
860
+ * that." when executing the function. Recommend to turn on if your function call
861
+ * takes over 1s (including network) to complete, so that your agent remains
862
+ * responsive.
863
+ */
864
+ speak_during_execution: boolean;
865
+ type: 'custom';
866
+ /**
867
+ * The URL we will post the function name and arguments to get a result for the
868
+ * function. Usually this is your server.
869
+ */
870
+ url: string;
871
+ /**
872
+ * The description for the sentence agent say during execution. Only applicable
873
+ * when speak_during_execution is true. Can write what to say or even provide
874
+ * examples. The default is "The message you will say to callee when calling this
875
+ * tool. Make sure it fits into the conversation smoothly.".
876
+ */
877
+ execution_message_description?: string;
878
+ /**
879
+ * The parameters the functions accepts, described as a JSON Schema object. See
880
+ * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
881
+ * documentation about the format. Omitting parameters defines a function with an
882
+ * empty parameter list.
883
+ */
884
+ parameters?: CustomTool.Parameters;
885
+ }
886
+ namespace CustomTool {
887
+ /**
888
+ * The parameters the functions accepts, described as a JSON Schema object. See
889
+ * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
890
+ * documentation about the format. Omitting parameters defines a function with an
891
+ * empty parameter list.
892
+ */
893
+ interface Parameters {
894
+ /**
895
+ * The value of properties is an object, where each key is the name of a property
896
+ * and each value is a schema used to validate that property.
897
+ */
898
+ properties: Record<string, unknown>;
899
+ /**
900
+ * Type must be "object" for a JSON Schema object.
901
+ */
902
+ type: 'object';
903
+ /**
904
+ * List of names of required property when generating this parameter. LLM will do
905
+ * its best to generate the required properties in its function arguments. Property
906
+ * must exist in properties.
907
+ */
908
+ required?: Array<string>;
909
+ }
910
+ }
911
+ }
912
+ }
913
+ export interface LlmUpdateParams {
914
+ /**
915
+ * First utterance said by the agent in the call. If not set, LLM will dynamically
916
+ * generate a message. If set to "", agent will wait for user to speak first.
917
+ */
918
+ begin_message?: string;
919
+ /**
920
+ * General prompt that's appended to system prompt no matter what state the agent
921
+ * is in.
922
+ *
923
+ * - System prompt (with state) = general prompt + state prompt.
924
+ *
925
+ * - System prompt (no state) = general prompt.
926
+ */
927
+ general_prompt?: string;
928
+ /**
929
+ * A list of tools the model may call (to get external knowledge, call API, etc).
930
+ * You can select from some common predefined tools like end call, transfer call,
931
+ * etc; or you can create your own custom tool (last option) for the LLM to use.
932
+ *
933
+ * - Tools of LLM (with state) = general tools + state tools + state transitions
934
+ *
935
+ * - Tools of LLM (no state) = general tools
936
+ */
937
+ general_tools?: Array<LlmUpdateParams.EndCallTool | LlmUpdateParams.TransferCallTool | LlmUpdateParams.CheckAvailabilityCalTool | LlmUpdateParams.BookAppointmentCalTool | LlmUpdateParams.CustomTool>;
938
+ /**
939
+ * Name of the starting state. Required if states is not empty.
940
+ */
941
+ starting_state?: string;
942
+ /**
943
+ * States of the LLM. This is to help reduce prompt length and tool choices when
944
+ * the call can be broken into distinct states. With shorter prompts and less
945
+ * tools, the LLM can better focus and follow the rules, minimizing hallucination.
946
+ * If this field is not set, the agent would only have general prompt and general
947
+ * tools (essentially one state).
948
+ */
949
+ states?: Array<LlmUpdateParams.State>;
950
+ }
951
+ export declare namespace LlmUpdateParams {
952
+ interface EndCallTool {
953
+ /**
954
+ * Name of the tool. Must be unique within all tools available to LLM at any given
955
+ * time (general tools + state tools + state transitions).
956
+ */
957
+ name: string;
958
+ type: 'end_call';
959
+ /**
960
+ * Describes when to end the call.
961
+ */
962
+ description?: string;
963
+ }
964
+ interface TransferCallTool {
965
+ /**
966
+ * Name of the tool. Must be unique within all tools available to LLM at any given
967
+ * time (general tools + state tools + state edges).
968
+ */
969
+ name: string;
970
+ /**
971
+ * The number to transfer to in E.164 format (a + and country code, then the phone
972
+ * number with no space or other special characters). For example, +16175551212.
973
+ */
974
+ number: string;
975
+ type: 'transfer_call';
976
+ /**
977
+ * Describes when to transfer the call.
978
+ */
979
+ description?: string;
980
+ }
981
+ interface CheckAvailabilityCalTool {
982
+ /**
983
+ * Cal.com Api key that have access to the cal.com event you want to check
984
+ * availability for.
985
+ */
986
+ cal_api_key: string;
987
+ /**
988
+ * Cal.com event type id number for the cal.com event you want to check
989
+ * availability for.
990
+ */
991
+ event_type_id: number;
992
+ /**
993
+ * Name of the tool. Must be unique within all tools available to LLM at any given
994
+ * time (general tools + state tools + state transitions).
995
+ */
996
+ name: string;
997
+ type: 'check_availability_cal';
998
+ /**
999
+ * Describes when to check availability.
1000
+ */
1001
+ description?: string;
1002
+ /**
1003
+ * Timezone to be used when checking availability, must be in
1004
+ * [IANA timezone database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).
1005
+ * If not specified, will check if user specified timezone in call, and if not,
1006
+ * will use the timezone of the Retell servers.
1007
+ */
1008
+ timezone?: string;
1009
+ }
1010
+ interface BookAppointmentCalTool {
1011
+ /**
1012
+ * Cal.com Api key that have access to the cal.com event you want to book
1013
+ * appointment.
1014
+ */
1015
+ cal_api_key: string;
1016
+ /**
1017
+ * Cal.com event type id number for the cal.com event you want to book appointment.
1018
+ */
1019
+ event_type_id: number;
1020
+ /**
1021
+ * Name of the tool. Must be unique within all tools available to LLM at any given
1022
+ * time (general tools + state tools + state transitions).
1023
+ */
1024
+ name: string;
1025
+ type: 'book_appointment_cal';
1026
+ /**
1027
+ * Describes when to book the appointment.
1028
+ */
1029
+ description?: string;
1030
+ /**
1031
+ * Timezone to be used when booking appointment, must be in
1032
+ * [IANA timezone database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).
1033
+ * If not specified, will check if user specified timezone in call, and if not,
1034
+ * will use the timezone of the Retell servers.
1035
+ */
1036
+ timezone?: string;
1037
+ }
1038
+ interface CustomTool {
1039
+ /**
1040
+ * Describes what this tool does and when to call this tool.
1041
+ */
1042
+ description: string;
1043
+ /**
1044
+ * Name of the tool. Must be unique within all tools available to LLM at any given
1045
+ * time (general tools + state tools + state edges).
1046
+ */
1047
+ name: string;
1048
+ /**
1049
+ * Determines whether the agent would call LLM another time and speak when the
1050
+ * result of function is obtained. Usually this needs to get turned on so user can
1051
+ * get update for the function call.
1052
+ */
1053
+ speak_after_execution: boolean;
1054
+ /**
1055
+ * Determines whether the agent would say sentence like "One moment, let me check
1056
+ * that." when executing the function. Recommend to turn on if your function call
1057
+ * takes over 1s (including network) to complete, so that your agent remains
1058
+ * responsive.
1059
+ */
1060
+ speak_during_execution: boolean;
1061
+ type: 'custom';
1062
+ /**
1063
+ * The URL we will post the function name and arguments to get a result for the
1064
+ * function. Usually this is your server.
1065
+ */
1066
+ url: string;
1067
+ /**
1068
+ * The description for the sentence agent say during execution. Only applicable
1069
+ * when speak_during_execution is true. Can write what to say or even provide
1070
+ * examples. The default is "The message you will say to callee when calling this
1071
+ * tool. Make sure it fits into the conversation smoothly.".
1072
+ */
1073
+ execution_message_description?: string;
1074
+ /**
1075
+ * The parameters the functions accepts, described as a JSON Schema object. See
1076
+ * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
1077
+ * documentation about the format. Omitting parameters defines a function with an
1078
+ * empty parameter list.
1079
+ */
1080
+ parameters?: CustomTool.Parameters;
1081
+ }
1082
+ namespace CustomTool {
1083
+ /**
1084
+ * The parameters the functions accepts, described as a JSON Schema object. See
1085
+ * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
1086
+ * documentation about the format. Omitting parameters defines a function with an
1087
+ * empty parameter list.
1088
+ */
1089
+ interface Parameters {
1090
+ /**
1091
+ * The value of properties is an object, where each key is the name of a property
1092
+ * and each value is a schema used to validate that property.
1093
+ */
1094
+ properties: Record<string, unknown>;
1095
+ /**
1096
+ * Type must be "object" for a JSON Schema object.
1097
+ */
1098
+ type: 'object';
1099
+ /**
1100
+ * List of names of required property when generating this parameter. LLM will do
1101
+ * its best to generate the required properties in its function arguments. Property
1102
+ * must exist in properties.
1103
+ */
1104
+ required?: Array<string>;
1105
+ }
1106
+ }
1107
+ interface State {
1108
+ /**
1109
+ * Name of the state, must be unique for each state.
1110
+ */
1111
+ name: string;
1112
+ /**
1113
+ * Edges of the state define how and what state can be reached from this state.
1114
+ */
1115
+ edges?: Array<State.Edge>;
1116
+ /**
1117
+ * Prompt of the state, will be appended to the system prompt of LLM.
1118
+ *
1119
+ * - System prompt = general prompt + state prompt.
1120
+ */
1121
+ state_prompt?: string;
1122
+ /**
1123
+ * A list of tools specific to this state the model may call (to get external
1124
+ * knowledge, call API, etc). You can select from some common predefined tools like
1125
+ * end call, transfer call, etc; or you can create your own custom tool (last
1126
+ * option) for the LLM to use.
1127
+ *
1128
+ * - Tools of LLM = general tools + state tools + state transitions
1129
+ */
1130
+ tools?: Array<State.EndCallTool | State.TransferCallTool | State.CheckAvailabilityCalTool | State.BookAppointmentCalTool | State.CustomTool>;
1131
+ }
1132
+ namespace State {
1133
+ interface Edge {
1134
+ /**
1135
+ * Describes what's the transition and at what time / criteria should this
1136
+ * transition happen.
1137
+ */
1138
+ description: string;
1139
+ /**
1140
+ * The destination state name when going through transition of state via this edge.
1141
+ * State transition internally is implemented as a tool call of LLM, and a tool
1142
+ * call with name "transition*to*{destination_state_name}" will get created. Feel
1143
+ * free to reference it inside the prompt.
1144
+ */
1145
+ destination_state_name: string;
1146
+ /**
1147
+ * After the state transitions, the agent would speak based on the new prompt and
1148
+ * tools in the new state. This bit here controls whether to speak a transition
1149
+ * sentence during the transition (so agent would say sentences like "Let's move on
1150
+ * to the next section to help you set up an acount.", and state transitions, and
1151
+ * agent continue to speak.). Usually this is not necessary, and is recommended to
1152
+ * set to false to avoid LLM repeating itself during and after transition.
1153
+ */
1154
+ speak_during_transition: boolean;
1155
+ /**
1156
+ * Describes what parameters you want to extract out when the transition changes.
1157
+ * The parameters extracted here can be referenced in prompts & function
1158
+ * descriptions of later states via dynamic variables. The parameters the functions
1159
+ * accepts, described as a JSON Schema object. See
1160
+ * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
1161
+ * documentation about the format.
1162
+ */
1163
+ parameters?: Edge.Parameters;
1164
+ }
1165
+ namespace Edge {
1166
+ /**
1167
+ * Describes what parameters you want to extract out when the transition changes.
1168
+ * The parameters extracted here can be referenced in prompts & function
1169
+ * descriptions of later states via dynamic variables. The parameters the functions
1170
+ * accepts, described as a JSON Schema object. See
1171
+ * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
1172
+ * documentation about the format.
1173
+ */
1174
+ interface Parameters {
1175
+ /**
1176
+ * The value of properties is an object, where each key is the name of a property
1177
+ * and each value is a schema used to validate that property.
1178
+ */
1179
+ properties: Record<string, unknown>;
1180
+ /**
1181
+ * Type must be "object" for a JSON Schema object.
1182
+ */
1183
+ type: 'object';
1184
+ /**
1185
+ * List of names of required property when generating this parameter. LLM will do
1186
+ * its best to generate the required properties in its function arguments. Property
1187
+ * must exist in properties.
1188
+ */
1189
+ required?: Array<string>;
1190
+ }
1191
+ }
1192
+ interface EndCallTool {
1193
+ /**
1194
+ * Name of the tool. Must be unique within all tools available to LLM at any given
1195
+ * time (general tools + state tools + state transitions).
1196
+ */
1197
+ name: string;
1198
+ type: 'end_call';
1199
+ /**
1200
+ * Describes when to end the call.
1201
+ */
1202
+ description?: string;
1203
+ }
1204
+ interface TransferCallTool {
1205
+ /**
1206
+ * Name of the tool. Must be unique within all tools available to LLM at any given
1207
+ * time (general tools + state tools + state edges).
1208
+ */
1209
+ name: string;
1210
+ /**
1211
+ * The number to transfer to in E.164 format (a + and country code, then the phone
1212
+ * number with no space or other special characters). For example, +16175551212.
1213
+ */
1214
+ number: string;
1215
+ type: 'transfer_call';
1216
+ /**
1217
+ * Describes when to transfer the call.
1218
+ */
1219
+ description?: string;
1220
+ }
1221
+ interface CheckAvailabilityCalTool {
1222
+ /**
1223
+ * Cal.com Api key that have access to the cal.com event you want to check
1224
+ * availability for.
1225
+ */
1226
+ cal_api_key: string;
1227
+ /**
1228
+ * Cal.com event type id number for the cal.com event you want to check
1229
+ * availability for.
1230
+ */
1231
+ event_type_id: number;
1232
+ /**
1233
+ * Name of the tool. Must be unique within all tools available to LLM at any given
1234
+ * time (general tools + state tools + state transitions).
1235
+ */
1236
+ name: string;
1237
+ type: 'check_availability_cal';
1238
+ /**
1239
+ * Describes when to check availability.
1240
+ */
1241
+ description?: string;
1242
+ /**
1243
+ * Timezone to be used when checking availability, must be in
1244
+ * [IANA timezone database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).
1245
+ * If not specified, will check if user specified timezone in call, and if not,
1246
+ * will use the timezone of the Retell servers.
1247
+ */
1248
+ timezone?: string;
1249
+ }
1250
+ interface BookAppointmentCalTool {
1251
+ /**
1252
+ * Cal.com Api key that have access to the cal.com event you want to book
1253
+ * appointment.
1254
+ */
1255
+ cal_api_key: string;
1256
+ /**
1257
+ * Cal.com event type id number for the cal.com event you want to book appointment.
1258
+ */
1259
+ event_type_id: number;
1260
+ /**
1261
+ * Name of the tool. Must be unique within all tools available to LLM at any given
1262
+ * time (general tools + state tools + state transitions).
1263
+ */
1264
+ name: string;
1265
+ type: 'book_appointment_cal';
1266
+ /**
1267
+ * Describes when to book the appointment.
1268
+ */
1269
+ description?: string;
1270
+ /**
1271
+ * Timezone to be used when booking appointment, must be in
1272
+ * [IANA timezone database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).
1273
+ * If not specified, will check if user specified timezone in call, and if not,
1274
+ * will use the timezone of the Retell servers.
1275
+ */
1276
+ timezone?: string;
1277
+ }
1278
+ interface CustomTool {
1279
+ /**
1280
+ * Describes what this tool does and when to call this tool.
1281
+ */
1282
+ description: string;
1283
+ /**
1284
+ * Name of the tool. Must be unique within all tools available to LLM at any given
1285
+ * time (general tools + state tools + state edges).
1286
+ */
1287
+ name: string;
1288
+ /**
1289
+ * Determines whether the agent would call LLM another time and speak when the
1290
+ * result of function is obtained. Usually this needs to get turned on so user can
1291
+ * get update for the function call.
1292
+ */
1293
+ speak_after_execution: boolean;
1294
+ /**
1295
+ * Determines whether the agent would say sentence like "One moment, let me check
1296
+ * that." when executing the function. Recommend to turn on if your function call
1297
+ * takes over 1s (including network) to complete, so that your agent remains
1298
+ * responsive.
1299
+ */
1300
+ speak_during_execution: boolean;
1301
+ type: 'custom';
1302
+ /**
1303
+ * The URL we will post the function name and arguments to get a result for the
1304
+ * function. Usually this is your server.
1305
+ */
1306
+ url: string;
1307
+ /**
1308
+ * The description for the sentence agent say during execution. Only applicable
1309
+ * when speak_during_execution is true. Can write what to say or even provide
1310
+ * examples. The default is "The message you will say to callee when calling this
1311
+ * tool. Make sure it fits into the conversation smoothly.".
1312
+ */
1313
+ execution_message_description?: string;
1314
+ /**
1315
+ * The parameters the functions accepts, described as a JSON Schema object. See
1316
+ * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
1317
+ * documentation about the format. Omitting parameters defines a function with an
1318
+ * empty parameter list.
1319
+ */
1320
+ parameters?: CustomTool.Parameters;
1321
+ }
1322
+ namespace CustomTool {
1323
+ /**
1324
+ * The parameters the functions accepts, described as a JSON Schema object. See
1325
+ * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
1326
+ * documentation about the format. Omitting parameters defines a function with an
1327
+ * empty parameter list.
1328
+ */
1329
+ interface Parameters {
1330
+ /**
1331
+ * The value of properties is an object, where each key is the name of a property
1332
+ * and each value is a schema used to validate that property.
1333
+ */
1334
+ properties: Record<string, unknown>;
1335
+ /**
1336
+ * Type must be "object" for a JSON Schema object.
1337
+ */
1338
+ type: 'object';
1339
+ /**
1340
+ * List of names of required property when generating this parameter. LLM will do
1341
+ * its best to generate the required properties in its function arguments. Property
1342
+ * must exist in properties.
1343
+ */
1344
+ required?: Array<string>;
1345
+ }
1346
+ }
1347
+ }
1348
+ }
1349
+ export declare namespace Llm {
1350
+ export import LlmResponse = LlmAPI.LlmResponse;
1351
+ export import LlmListResponse = LlmAPI.LlmListResponse;
1352
+ export import LlmCreateParams = LlmAPI.LlmCreateParams;
1353
+ export import LlmUpdateParams = LlmAPI.LlmUpdateParams;
1354
+ }
1355
+ //# sourceMappingURL=llm.d.ts.map