retell-sdk 5.13.0 → 5.14.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.
@@ -0,0 +1,500 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../core/resource';
4
+ import { APIPromise } from '../core/api-promise';
5
+ import { RequestOptions } from '../internal/request-options';
6
+ import { path } from '../internal/utils/path';
7
+
8
+ export class Playground extends APIResource {
9
+ /**
10
+ * Stateless playground completion. Send the full conversation history (same shape
11
+ * as chat completion messages) and receive only the newly generated messages.
12
+ * Nothing is persisted server-side — the caller manages conversation state.
13
+ */
14
+ completion(
15
+ agentID: string,
16
+ params: PlaygroundCompletionParams,
17
+ options?: RequestOptions,
18
+ ): APIPromise<PlaygroundCompletionResponse> {
19
+ const { version, ...body } = params;
20
+ return this._client.post(path`/agent-playground-completion/${agentID}`, {
21
+ query: { version },
22
+ body,
23
+ timeout: (this._client as any)._options.timeout ?? 300000,
24
+ ...options,
25
+ });
26
+ }
27
+ }
28
+
29
+ export interface PlaygroundCompletionResponse {
30
+ /**
31
+ * New messages generated by the agent. Same shape as chat completion response
32
+ * messages. Does not include the input messages.
33
+ */
34
+ messages: Array<
35
+ | PlaygroundCompletionResponse.MessageBase
36
+ | PlaygroundCompletionResponse.ToolCallInvocationMessageBase
37
+ | PlaygroundCompletionResponse.ToolCallResultMessageBase
38
+ | PlaygroundCompletionResponse.NodeTransitionMessageBase
39
+ | PlaygroundCompletionResponse.StateTransitionMessageBase
40
+ >;
41
+
42
+ /**
43
+ * Whether the agent ended the conversation.
44
+ */
45
+ call_ended?: boolean;
46
+
47
+ /**
48
+ * Current node id (conversation-flow agents).
49
+ */
50
+ current_node_id?: string;
51
+
52
+ /**
53
+ * Current state name (retell-llm agents).
54
+ */
55
+ current_state?: string;
56
+
57
+ /**
58
+ * Updated dynamic variables after this turn.
59
+ */
60
+ dynamic_variables?: { [key: string]: string };
61
+
62
+ /**
63
+ * Knowledge base chunks retrieved for this turn.
64
+ */
65
+ knowledge_base_retrieved_contents?: Array<string>;
66
+ }
67
+
68
+ export namespace PlaygroundCompletionResponse {
69
+ export interface MessageBase {
70
+ /**
71
+ * Content of the message
72
+ */
73
+ content: string;
74
+
75
+ /**
76
+ * Documents whether this message is sent by agent or user.
77
+ */
78
+ role: 'agent' | 'user';
79
+
80
+ /**
81
+ * Create timestamp of the message
82
+ */
83
+ created_timestamp?: number;
84
+
85
+ /**
86
+ * Unique id of the message
87
+ */
88
+ message_id?: string;
89
+ }
90
+
91
+ export interface ToolCallInvocationMessageBase {
92
+ /**
93
+ * Arguments for this tool call, it's a stringified JSON object.
94
+ */
95
+ arguments: string;
96
+
97
+ /**
98
+ * Name of the function in this tool call.
99
+ */
100
+ name: string;
101
+
102
+ /**
103
+ * This is a tool call invocation.
104
+ */
105
+ role: 'tool_call_invocation';
106
+
107
+ /**
108
+ * Tool call id, globally unique.
109
+ */
110
+ tool_call_id: string;
111
+
112
+ /**
113
+ * Create timestamp of the message
114
+ */
115
+ created_timestamp?: number;
116
+
117
+ /**
118
+ * Unique id of the message
119
+ */
120
+ message_id?: string;
121
+
122
+ /**
123
+ * Optional thought signature from Google Gemini thinking models. This is used
124
+ * internally to maintain reasoning chain in multi-turn function calling.
125
+ */
126
+ thought_signature?: string;
127
+ }
128
+
129
+ export interface ToolCallResultMessageBase {
130
+ /**
131
+ * Result of the tool call, can be a string, a stringified json, etc.
132
+ */
133
+ content: string;
134
+
135
+ /**
136
+ * This is the result of a tool call.
137
+ */
138
+ role: 'tool_call_result';
139
+
140
+ /**
141
+ * Tool call id, globally unique.
142
+ */
143
+ tool_call_id: string;
144
+
145
+ /**
146
+ * Create timestamp of the message
147
+ */
148
+ created_timestamp?: number;
149
+
150
+ /**
151
+ * Unique id of the message
152
+ */
153
+ message_id?: string;
154
+
155
+ /**
156
+ * Whether the tool call was successful.
157
+ */
158
+ successful?: boolean;
159
+ }
160
+
161
+ export interface NodeTransitionMessageBase {
162
+ /**
163
+ * This is a node transition.
164
+ */
165
+ role: 'node_transition';
166
+
167
+ /**
168
+ * Create timestamp of the message
169
+ */
170
+ created_timestamp?: number;
171
+
172
+ /**
173
+ * Former node id
174
+ */
175
+ former_node_id?: string;
176
+
177
+ /**
178
+ * Former node name
179
+ */
180
+ former_node_name?: string;
181
+
182
+ /**
183
+ * Unique id of the message
184
+ */
185
+ message_id?: string;
186
+
187
+ /**
188
+ * New node id
189
+ */
190
+ new_node_id?: string;
191
+
192
+ /**
193
+ * New node name
194
+ */
195
+ new_node_name?: string;
196
+
197
+ /**
198
+ * How this node was reached. "global" means a global node transition,
199
+ * "global_go_back" means returning from a global node, "interrupt_go_back" means
200
+ * going back due to user interruption, and "normal" means a regular edge
201
+ * transition.
202
+ */
203
+ transition_type?: 'global' | 'global_go_back' | 'interrupt_go_back' | 'normal';
204
+ }
205
+
206
+ export interface StateTransitionMessageBase {
207
+ /**
208
+ * This is a state transition.
209
+ */
210
+ role: 'state_transition';
211
+
212
+ /**
213
+ * Create timestamp of the message
214
+ */
215
+ created_timestamp?: number;
216
+
217
+ /**
218
+ * Former state name
219
+ */
220
+ former_state_name?: string;
221
+
222
+ /**
223
+ * Unique id of the message
224
+ */
225
+ message_id?: string;
226
+
227
+ /**
228
+ * New state name
229
+ */
230
+ new_state_name?: string;
231
+ }
232
+ }
233
+
234
+ export interface PlaygroundCompletionParams {
235
+ /**
236
+ * Body param: Full conversation history, same shape as chat completion messages.
237
+ * message_id and created_timestamp are optional — server generates them if
238
+ * omitted.
239
+ */
240
+ messages: Array<
241
+ | PlaygroundCompletionParams.MessageBase
242
+ | PlaygroundCompletionParams.ToolCallInvocationMessageBase
243
+ | PlaygroundCompletionParams.ToolCallResultMessageBase
244
+ | PlaygroundCompletionParams.NodeTransitionMessageBase
245
+ | PlaygroundCompletionParams.StateTransitionMessageBase
246
+ >;
247
+
248
+ /**
249
+ * Query param: Agent version to use. Defaults to latest.
250
+ */
251
+ version?: number;
252
+
253
+ /**
254
+ * Body param: Conversation flow component id. Required when current_node_id refers
255
+ * to a node within a component.
256
+ */
257
+ component_id?: string;
258
+
259
+ /**
260
+ * Body param: Current node id for conversation-flow agents. Used to resume from a
261
+ * specific node. Must be provided together with component_id when testing
262
+ * components.
263
+ */
264
+ current_node_id?: string;
265
+
266
+ /**
267
+ * Body param: Current state name for retell-llm agents. Used to resume from a
268
+ * specific state.
269
+ */
270
+ current_state?: string;
271
+
272
+ /**
273
+ * Body param: Key-value pairs for dynamic variable substitution.
274
+ */
275
+ dynamic_variables?: { [key: string]: string };
276
+
277
+ /**
278
+ * Body param: Optional mock responses for tools. When provided, the agent uses
279
+ * these instead of executing real tool calls.
280
+ */
281
+ tool_mocks?: Array<PlaygroundCompletionParams.ToolMock>;
282
+ }
283
+
284
+ export namespace PlaygroundCompletionParams {
285
+ export interface MessageBase {
286
+ /**
287
+ * Content of the message
288
+ */
289
+ content: string;
290
+
291
+ /**
292
+ * Documents whether this message is sent by agent or user.
293
+ */
294
+ role: 'agent' | 'user';
295
+
296
+ /**
297
+ * Create timestamp of the message
298
+ */
299
+ created_timestamp?: number;
300
+
301
+ /**
302
+ * Unique id of the message
303
+ */
304
+ message_id?: string;
305
+ }
306
+
307
+ export interface ToolCallInvocationMessageBase {
308
+ /**
309
+ * Arguments for this tool call, it's a stringified JSON object.
310
+ */
311
+ arguments: string;
312
+
313
+ /**
314
+ * Name of the function in this tool call.
315
+ */
316
+ name: string;
317
+
318
+ /**
319
+ * This is a tool call invocation.
320
+ */
321
+ role: 'tool_call_invocation';
322
+
323
+ /**
324
+ * Tool call id, globally unique.
325
+ */
326
+ tool_call_id: string;
327
+
328
+ /**
329
+ * Create timestamp of the message
330
+ */
331
+ created_timestamp?: number;
332
+
333
+ /**
334
+ * Unique id of the message
335
+ */
336
+ message_id?: string;
337
+
338
+ /**
339
+ * Optional thought signature from Google Gemini thinking models. This is used
340
+ * internally to maintain reasoning chain in multi-turn function calling.
341
+ */
342
+ thought_signature?: string;
343
+ }
344
+
345
+ export interface ToolCallResultMessageBase {
346
+ /**
347
+ * Result of the tool call, can be a string, a stringified json, etc.
348
+ */
349
+ content: string;
350
+
351
+ /**
352
+ * This is the result of a tool call.
353
+ */
354
+ role: 'tool_call_result';
355
+
356
+ /**
357
+ * Tool call id, globally unique.
358
+ */
359
+ tool_call_id: string;
360
+
361
+ /**
362
+ * Create timestamp of the message
363
+ */
364
+ created_timestamp?: number;
365
+
366
+ /**
367
+ * Unique id of the message
368
+ */
369
+ message_id?: string;
370
+
371
+ /**
372
+ * Whether the tool call was successful.
373
+ */
374
+ successful?: boolean;
375
+ }
376
+
377
+ export interface NodeTransitionMessageBase {
378
+ /**
379
+ * This is a node transition.
380
+ */
381
+ role: 'node_transition';
382
+
383
+ /**
384
+ * Create timestamp of the message
385
+ */
386
+ created_timestamp?: number;
387
+
388
+ /**
389
+ * Former node id
390
+ */
391
+ former_node_id?: string;
392
+
393
+ /**
394
+ * Former node name
395
+ */
396
+ former_node_name?: string;
397
+
398
+ /**
399
+ * Unique id of the message
400
+ */
401
+ message_id?: string;
402
+
403
+ /**
404
+ * New node id
405
+ */
406
+ new_node_id?: string;
407
+
408
+ /**
409
+ * New node name
410
+ */
411
+ new_node_name?: string;
412
+
413
+ /**
414
+ * How this node was reached. "global" means a global node transition,
415
+ * "global_go_back" means returning from a global node, "interrupt_go_back" means
416
+ * going back due to user interruption, and "normal" means a regular edge
417
+ * transition.
418
+ */
419
+ transition_type?: 'global' | 'global_go_back' | 'interrupt_go_back' | 'normal';
420
+ }
421
+
422
+ export interface StateTransitionMessageBase {
423
+ /**
424
+ * This is a state transition.
425
+ */
426
+ role: 'state_transition';
427
+
428
+ /**
429
+ * Create timestamp of the message
430
+ */
431
+ created_timestamp?: number;
432
+
433
+ /**
434
+ * Former state name
435
+ */
436
+ former_state_name?: string;
437
+
438
+ /**
439
+ * Unique id of the message
440
+ */
441
+ message_id?: string;
442
+
443
+ /**
444
+ * New state name
445
+ */
446
+ new_state_name?: string;
447
+ }
448
+
449
+ export interface ToolMock {
450
+ /**
451
+ * Rule for matching tool calls
452
+ */
453
+ input_match_rule: ToolMock.Type | ToolMock.UnionMember1;
454
+
455
+ /**
456
+ * The output of the tool call that will be fed into the LLM. Should be a JSON
457
+ * string.
458
+ */
459
+ output: string;
460
+
461
+ /**
462
+ * Name of the tool to mock
463
+ */
464
+ tool_name: string;
465
+
466
+ /**
467
+ * For tool calls like transfer_call that require a boolean result. Optional for
468
+ * most tools.
469
+ */
470
+ result?: boolean | null;
471
+ }
472
+
473
+ export namespace ToolMock {
474
+ export interface Type {
475
+ /**
476
+ * Match any input of the tool
477
+ */
478
+ type: 'any';
479
+ }
480
+
481
+ export interface UnionMember1 {
482
+ /**
483
+ * Arguments to match. Only provided fields will be checked
484
+ */
485
+ args: { [key: string]: unknown };
486
+
487
+ /**
488
+ * Match only calls with specific arguments
489
+ */
490
+ type: 'partial_match';
491
+ }
492
+ }
493
+ }
494
+
495
+ export declare namespace Playground {
496
+ export {
497
+ type PlaygroundCompletionResponse as PlaygroundCompletionResponse,
498
+ type PlaygroundCompletionParams as PlaygroundCompletionParams,
499
+ };
500
+ }
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '5.13.0'; // x-release-please-version
1
+ export const VERSION = '5.14.1'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "5.13.0";
1
+ export declare const VERSION = "5.14.1";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "5.13.0";
1
+ export declare const VERSION = "5.14.1";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '5.13.0'; // x-release-please-version
4
+ exports.VERSION = '5.14.1'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '5.13.0'; // x-release-please-version
1
+ export const VERSION = '5.14.1'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map