retell-sdk 4.30.0 → 4.32.0

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,451 @@
1
+ import { APIResource } from "../resource.js";
2
+ import * as Core from "../core.js";
3
+ export declare class Chat extends APIResource {
4
+ /**
5
+ * Create a chat session
6
+ *
7
+ * @example
8
+ * ```ts
9
+ * const chatResponse = await client.chat.create({
10
+ * agent_id: 'oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD',
11
+ * });
12
+ * ```
13
+ */
14
+ create(body: ChatCreateParams, options?: Core.RequestOptions): Core.APIPromise<ChatResponse>;
15
+ /**
16
+ * Retrieve details of a specific chat
17
+ *
18
+ * @example
19
+ * ```ts
20
+ * const chatResponse = await client.chat.retrieve(
21
+ * '16b980523634a6dc504898cda492e939',
22
+ * );
23
+ * ```
24
+ */
25
+ retrieve(chatId: string, options?: Core.RequestOptions): Core.APIPromise<ChatResponse>;
26
+ /**
27
+ * List all chats
28
+ *
29
+ * @example
30
+ * ```ts
31
+ * const chatResponses = await client.chat.list();
32
+ * ```
33
+ */
34
+ list(options?: Core.RequestOptions): Core.APIPromise<ChatListResponse>;
35
+ /**
36
+ * Create a chat completion message
37
+ *
38
+ * @example
39
+ * ```ts
40
+ * const response = await client.chat.createChatCompletion({
41
+ * chat_id: 'oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD',
42
+ * content: 'hi how are you doing?',
43
+ * });
44
+ * ```
45
+ */
46
+ createChatCompletion(body: ChatCreateChatCompletionParams, options?: Core.RequestOptions): Core.APIPromise<ChatCreateChatCompletionResponse>;
47
+ /**
48
+ * End an ongoing chat
49
+ *
50
+ * @example
51
+ * ```ts
52
+ * await client.chat.end('16b980523634a6dc504898cda492e939');
53
+ * ```
54
+ */
55
+ end(chatId: string, options?: Core.RequestOptions): Core.APIPromise<void>;
56
+ }
57
+ export interface ChatResponse {
58
+ /**
59
+ * Corresponding chat agent id of this chat.
60
+ */
61
+ agent_id: string;
62
+ /**
63
+ * Unique id of the chat.
64
+ */
65
+ chat_id: string;
66
+ /**
67
+ * Status of chat.
68
+ *
69
+ * - `ongoing`: Chat session is ongoing, chat agent can receive new message and
70
+ * generate response.
71
+ *
72
+ * - `ended`: Chat session has ended can not generate new response.
73
+ *
74
+ * - `error`: Chat encountered error.
75
+ */
76
+ chat_status: 'ongoing' | 'ended' | 'error';
77
+ /**
78
+ * Post chat analysis that includes information such as sentiment, status, summary,
79
+ * and custom defined data to extract. Available after chat ends. Subscribe to
80
+ * `chat_analyzed` webhook event type to receive it once ready.
81
+ */
82
+ chat_analysis?: ChatResponse.ChatAnalysis;
83
+ chat_cost?: ChatResponse.ChatCost;
84
+ /**
85
+ * Dynamic variables collected from the chat. Only available after the chat ends.
86
+ */
87
+ collected_dynamic_variables?: Record<string, unknown>;
88
+ /**
89
+ * End timestamp (milliseconds since epoch) of the chat. Available after chat ends.
90
+ */
91
+ end_timestamp?: number;
92
+ /**
93
+ * Transcript of the chat weaved with tool call invocation and results.
94
+ */
95
+ message_with_tool_calls?: Array<ChatResponse.Message | ChatResponse.ToolCallInvocationMessage | ChatResponse.ToolCallResultMessage | ChatResponse.NodeTransitionMessage | ChatResponse.StateTransitionMessage>;
96
+ /**
97
+ * An arbitrary object for storage purpose only. You can put anything here like
98
+ * your internal customer id associated with the chat. Not used for processing. You
99
+ * can later get this field from the chat object.
100
+ */
101
+ metadata?: unknown;
102
+ /**
103
+ * Add optional dynamic variables in key value pairs of string that injects into
104
+ * your Response Engine prompt and tool description. Only applicable for Response
105
+ * Engine.
106
+ */
107
+ retell_llm_dynamic_variables?: Record<string, unknown>;
108
+ /**
109
+ * Begin timestamp (milliseconds since epoch) of the chat. Available after chat
110
+ * starts.
111
+ */
112
+ start_timestamp?: number;
113
+ /**
114
+ * Transcription of the chat.
115
+ */
116
+ transcript?: string;
117
+ }
118
+ export declare namespace ChatResponse {
119
+ /**
120
+ * Post chat analysis that includes information such as sentiment, status, summary,
121
+ * and custom defined data to extract. Available after chat ends. Subscribe to
122
+ * `chat_analyzed` webhook event type to receive it once ready.
123
+ */
124
+ interface ChatAnalysis {
125
+ /**
126
+ * Whether the agent seems to have a successful chat with the user, where the agent
127
+ * finishes the task, and the call was complete without being cutoff.
128
+ */
129
+ chat_successful?: boolean;
130
+ /**
131
+ * A high level summary of the chat.
132
+ */
133
+ chat_summary?: string;
134
+ /**
135
+ * Custom analysis data that was extracted based on the schema defined in chat
136
+ * agent post chat analysis data. Can be empty if nothing is specified.
137
+ */
138
+ custom_analysis_data?: unknown;
139
+ /**
140
+ * Sentiment of the user in the chat.
141
+ */
142
+ user_sentiment?: 'Negative' | 'Positive' | 'Neutral' | 'Unknown';
143
+ }
144
+ interface ChatCost {
145
+ /**
146
+ * Combined cost of all individual costs in cents
147
+ */
148
+ combined_cost?: number;
149
+ /**
150
+ * List of products with their unit prices and costs in cents
151
+ */
152
+ product_costs?: Array<ChatCost.ProductCost>;
153
+ }
154
+ namespace ChatCost {
155
+ interface ProductCost {
156
+ /**
157
+ * Cost for the product in cents for the duration of the call.
158
+ */
159
+ cost: number;
160
+ /**
161
+ * Product name that has a cost associated with it.
162
+ */
163
+ product: string;
164
+ /**
165
+ * Unit price of the product in cents per second.
166
+ */
167
+ unitPrice: number;
168
+ }
169
+ }
170
+ interface Message {
171
+ /**
172
+ * Content of the message
173
+ */
174
+ content: string;
175
+ /**
176
+ * Create timestamp of the message
177
+ */
178
+ created_timestamp: number;
179
+ /**
180
+ * Unique id ot the message
181
+ */
182
+ message_id: string;
183
+ /**
184
+ * Documents whether this message is sent by agent or user.
185
+ */
186
+ role: 'agent' | 'user';
187
+ }
188
+ interface ToolCallInvocationMessage {
189
+ /**
190
+ * Arguments for this tool call, it's a stringified JSON object.
191
+ */
192
+ arguments: string;
193
+ /**
194
+ * Unique id ot the message
195
+ */
196
+ message_id: string;
197
+ /**
198
+ * Name of the function in this tool call.
199
+ */
200
+ name: string;
201
+ /**
202
+ * This is a tool call invocation.
203
+ */
204
+ role: 'tool_call_invocation';
205
+ /**
206
+ * Tool call id, globally unique.
207
+ */
208
+ tool_call_id: string;
209
+ /**
210
+ * Create timestamp of the message
211
+ */
212
+ created_timestamp?: number;
213
+ }
214
+ interface ToolCallResultMessage {
215
+ /**
216
+ * Result of the tool call, can be a string, a stringified json, etc.
217
+ */
218
+ content: string;
219
+ /**
220
+ * Create timestamp of the message
221
+ */
222
+ created_timestamp: number;
223
+ /**
224
+ * Unique id ot the message
225
+ */
226
+ message_id: string;
227
+ /**
228
+ * This is result of a tool call.
229
+ */
230
+ role: 'tool_call_result';
231
+ /**
232
+ * Tool call id, globally unique.
233
+ */
234
+ tool_call_id: string;
235
+ }
236
+ interface NodeTransitionMessage {
237
+ /**
238
+ * Create timestamp of the message
239
+ */
240
+ created_timestamp: number;
241
+ /**
242
+ * Unique id ot the message
243
+ */
244
+ message_id: string;
245
+ /**
246
+ * This is node transition.
247
+ */
248
+ role: 'node_transition';
249
+ /**
250
+ * Former node id
251
+ */
252
+ former_node_id?: string;
253
+ /**
254
+ * Former node name
255
+ */
256
+ former_node_name?: string;
257
+ /**
258
+ * New node id
259
+ */
260
+ new_node_id?: string;
261
+ /**
262
+ * New node name
263
+ */
264
+ new_node_name?: string;
265
+ }
266
+ interface StateTransitionMessage {
267
+ /**
268
+ * Create timestamp of the message
269
+ */
270
+ created_timestamp: number;
271
+ /**
272
+ * Unique id ot the message
273
+ */
274
+ message_id: string;
275
+ /**
276
+ * This is state transition for .
277
+ */
278
+ role: 'state_transition';
279
+ /**
280
+ * Former state name
281
+ */
282
+ former_state_name?: string;
283
+ /**
284
+ * New state name
285
+ */
286
+ new_state_name?: string;
287
+ }
288
+ }
289
+ export type ChatListResponse = Array<ChatResponse>;
290
+ export interface ChatCreateChatCompletionResponse {
291
+ /**
292
+ * Transcript of the chat completion weaved with tool call invocation and results.
293
+ */
294
+ messages: Array<ChatCreateChatCompletionResponse.Message | ChatCreateChatCompletionResponse.ToolCallInvocationMessage | ChatCreateChatCompletionResponse.ToolCallResultMessage | ChatCreateChatCompletionResponse.NodeTransitionMessage | ChatCreateChatCompletionResponse.StateTransitionMessage>;
295
+ }
296
+ export declare namespace ChatCreateChatCompletionResponse {
297
+ interface Message {
298
+ /**
299
+ * Content of the message
300
+ */
301
+ content: string;
302
+ /**
303
+ * Create timestamp of the message
304
+ */
305
+ created_timestamp: number;
306
+ /**
307
+ * Unique id ot the message
308
+ */
309
+ message_id: string;
310
+ /**
311
+ * Documents whether this message is sent by agent or user.
312
+ */
313
+ role: 'agent' | 'user';
314
+ }
315
+ interface ToolCallInvocationMessage {
316
+ /**
317
+ * Arguments for this tool call, it's a stringified JSON object.
318
+ */
319
+ arguments: string;
320
+ /**
321
+ * Unique id ot the message
322
+ */
323
+ message_id: string;
324
+ /**
325
+ * Name of the function in this tool call.
326
+ */
327
+ name: string;
328
+ /**
329
+ * This is a tool call invocation.
330
+ */
331
+ role: 'tool_call_invocation';
332
+ /**
333
+ * Tool call id, globally unique.
334
+ */
335
+ tool_call_id: string;
336
+ /**
337
+ * Create timestamp of the message
338
+ */
339
+ created_timestamp?: number;
340
+ }
341
+ interface ToolCallResultMessage {
342
+ /**
343
+ * Result of the tool call, can be a string, a stringified json, etc.
344
+ */
345
+ content: string;
346
+ /**
347
+ * Create timestamp of the message
348
+ */
349
+ created_timestamp: number;
350
+ /**
351
+ * Unique id ot the message
352
+ */
353
+ message_id: string;
354
+ /**
355
+ * This is result of a tool call.
356
+ */
357
+ role: 'tool_call_result';
358
+ /**
359
+ * Tool call id, globally unique.
360
+ */
361
+ tool_call_id: string;
362
+ }
363
+ interface NodeTransitionMessage {
364
+ /**
365
+ * Create timestamp of the message
366
+ */
367
+ created_timestamp: number;
368
+ /**
369
+ * Unique id ot the message
370
+ */
371
+ message_id: string;
372
+ /**
373
+ * This is node transition.
374
+ */
375
+ role: 'node_transition';
376
+ /**
377
+ * Former node id
378
+ */
379
+ former_node_id?: string;
380
+ /**
381
+ * Former node name
382
+ */
383
+ former_node_name?: string;
384
+ /**
385
+ * New node id
386
+ */
387
+ new_node_id?: string;
388
+ /**
389
+ * New node name
390
+ */
391
+ new_node_name?: string;
392
+ }
393
+ interface StateTransitionMessage {
394
+ /**
395
+ * Create timestamp of the message
396
+ */
397
+ created_timestamp: number;
398
+ /**
399
+ * Unique id ot the message
400
+ */
401
+ message_id: string;
402
+ /**
403
+ * This is state transition for .
404
+ */
405
+ role: 'state_transition';
406
+ /**
407
+ * Former state name
408
+ */
409
+ former_state_name?: string;
410
+ /**
411
+ * New state name
412
+ */
413
+ new_state_name?: string;
414
+ }
415
+ }
416
+ export interface ChatCreateParams {
417
+ /**
418
+ * The chat agent to use for the call.
419
+ */
420
+ agent_id: string;
421
+ /**
422
+ * The version of the chat agent to use for the call.
423
+ */
424
+ agent_version?: number;
425
+ /**
426
+ * An arbitrary object for storage purpose only. You can put anything here like
427
+ * your internal customer id associated with the chat. Not used for processing. You
428
+ * can later get this field from the chat object.
429
+ */
430
+ metadata?: unknown;
431
+ /**
432
+ * Add optional dynamic variables in key value pairs of string that injects into
433
+ * your Response Engine prompt and tool description. Only applicable for Response
434
+ * Engine.
435
+ */
436
+ retell_llm_dynamic_variables?: Record<string, unknown>;
437
+ }
438
+ export interface ChatCreateChatCompletionParams {
439
+ /**
440
+ * Unique id of the chat to create completion.
441
+ */
442
+ chat_id: string;
443
+ /**
444
+ * user message to generate agent chat completion.
445
+ */
446
+ content: string;
447
+ }
448
+ export declare namespace Chat {
449
+ export { type ChatResponse as ChatResponse, type ChatListResponse as ChatListResponse, type ChatCreateChatCompletionResponse as ChatCreateChatCompletionResponse, type ChatCreateParams as ChatCreateParams, type ChatCreateChatCompletionParams as ChatCreateChatCompletionParams, };
450
+ }
451
+ //# sourceMappingURL=chat.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chat.d.ts","sourceRoot":"","sources":["../src/resources/chat.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AA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EG;QACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAE1B;;WAEG;QACH,WAAW,CAAC,EAAE,MAAM,CAAC;QAErB;;WAEG;QACH,aAAa,CAAC,EAAE,MAAM,CAAC;KACxB;IAED,UAAiB,sBAAsB;QACrC;;WAEG;QACH,iBAAiB,EAAE,MAAM,CAAC;QAE1B;;WAEG;QACH,UAAU,EAAE,MAAM,CAAC;QAEnB;;WAEG;QACH,IAAI,EAAE,kBAAkB,CAAC;QAEzB;;WAEG;QACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAE3B;;WAEG;QACH,cAAc,CAAC,EAAE,MAAM,CAAC;KACzB;CACF;AAED,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;OAIG;IACH,4BAA4B,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACxD;AAED,MAAM,WAAW,8BAA8B;IAC7C;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,CAAC,OAAO,WAAW,IAAI,CAAC;IAC5B,OAAO,EACL,KAAK,YAAY,IAAI,YAAY,EACjC,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,gCAAgC,IAAI,gCAAgC,EACzE,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,8BAA8B,IAAI,8BAA8B,GACtE,CAAC;CACH"}
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Chat = void 0;
5
+ const resource_1 = require("../resource.js");
6
+ class Chat extends resource_1.APIResource {
7
+ /**
8
+ * Create a chat session
9
+ *
10
+ * @example
11
+ * ```ts
12
+ * const chatResponse = await client.chat.create({
13
+ * agent_id: 'oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD',
14
+ * });
15
+ * ```
16
+ */
17
+ create(body, options) {
18
+ return this._client.post('/create-chat', { body, ...options });
19
+ }
20
+ /**
21
+ * Retrieve details of a specific chat
22
+ *
23
+ * @example
24
+ * ```ts
25
+ * const chatResponse = await client.chat.retrieve(
26
+ * '16b980523634a6dc504898cda492e939',
27
+ * );
28
+ * ```
29
+ */
30
+ retrieve(chatId, options) {
31
+ return this._client.get(`/get-chat/${chatId}`, options);
32
+ }
33
+ /**
34
+ * List all chats
35
+ *
36
+ * @example
37
+ * ```ts
38
+ * const chatResponses = await client.chat.list();
39
+ * ```
40
+ */
41
+ list(options) {
42
+ return this._client.get('/list-chat', options);
43
+ }
44
+ /**
45
+ * Create a chat completion message
46
+ *
47
+ * @example
48
+ * ```ts
49
+ * const response = await client.chat.createChatCompletion({
50
+ * chat_id: 'oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD',
51
+ * content: 'hi how are you doing?',
52
+ * });
53
+ * ```
54
+ */
55
+ createChatCompletion(body, options) {
56
+ return this._client.post('/create-chat-completion', { body, ...options });
57
+ }
58
+ /**
59
+ * End an ongoing chat
60
+ *
61
+ * @example
62
+ * ```ts
63
+ * await client.chat.end('16b980523634a6dc504898cda492e939');
64
+ * ```
65
+ */
66
+ end(chatId, options) {
67
+ return this._client.patch(`/end-chat/${chatId}`, {
68
+ ...options,
69
+ headers: { Accept: '*/*', ...options?.headers },
70
+ });
71
+ }
72
+ }
73
+ exports.Chat = Chat;
74
+ //# sourceMappingURL=chat.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chat.js","sourceRoot":"","sources":["../src/resources/chat.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,6CAA0C;AAG1C,MAAa,IAAK,SAAQ,sBAAW;IACnC;;;;;;;;;OASG;IACH,MAAM,CAAC,IAAsB,EAAE,OAA6B;QAC1D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACjE,CAAC;IAED;;;;;;;;;OASG;IACH,QAAQ,CAAC,MAAc,EAAE,OAA6B;QACpD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,MAAM,EAAE,EAAE,OAAO,CAAC,CAAC;IAC1D,CAAC;IAED;;;;;;;OAOG;IACH,IAAI,CAAC,OAA6B;QAChC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;IACjD,CAAC;IAED;;;;;;;;;;OAUG;IACH,oBAAoB,CAClB,IAAoC,EACpC,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,yBAAyB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5E,CAAC;IAED;;;;;;;OAOG;IACH,GAAG,CAAC,MAAc,EAAE,OAA6B;QAC/C,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,aAAa,MAAM,EAAE,EAAE;YAC/C,GAAG,OAAO;YACV,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE;SAChD,CAAC,CAAC;IACL,CAAC;CACF;AAzED,oBAyEC"}
@@ -0,0 +1,70 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../resource.mjs";
3
+ export class Chat extends APIResource {
4
+ /**
5
+ * Create a chat session
6
+ *
7
+ * @example
8
+ * ```ts
9
+ * const chatResponse = await client.chat.create({
10
+ * agent_id: 'oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD',
11
+ * });
12
+ * ```
13
+ */
14
+ create(body, options) {
15
+ return this._client.post('/create-chat', { body, ...options });
16
+ }
17
+ /**
18
+ * Retrieve details of a specific chat
19
+ *
20
+ * @example
21
+ * ```ts
22
+ * const chatResponse = await client.chat.retrieve(
23
+ * '16b980523634a6dc504898cda492e939',
24
+ * );
25
+ * ```
26
+ */
27
+ retrieve(chatId, options) {
28
+ return this._client.get(`/get-chat/${chatId}`, options);
29
+ }
30
+ /**
31
+ * List all chats
32
+ *
33
+ * @example
34
+ * ```ts
35
+ * const chatResponses = await client.chat.list();
36
+ * ```
37
+ */
38
+ list(options) {
39
+ return this._client.get('/list-chat', options);
40
+ }
41
+ /**
42
+ * Create a chat completion message
43
+ *
44
+ * @example
45
+ * ```ts
46
+ * const response = await client.chat.createChatCompletion({
47
+ * chat_id: 'oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD',
48
+ * content: 'hi how are you doing?',
49
+ * });
50
+ * ```
51
+ */
52
+ createChatCompletion(body, options) {
53
+ return this._client.post('/create-chat-completion', { body, ...options });
54
+ }
55
+ /**
56
+ * End an ongoing chat
57
+ *
58
+ * @example
59
+ * ```ts
60
+ * await client.chat.end('16b980523634a6dc504898cda492e939');
61
+ * ```
62
+ */
63
+ end(chatId, options) {
64
+ return this._client.patch(`/end-chat/${chatId}`, {
65
+ ...options,
66
+ headers: { Accept: '*/*', ...options?.headers },
67
+ });
68
+ }
69
+ }
70
+ //# sourceMappingURL=chat.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chat.mjs","sourceRoot":"","sources":["../src/resources/chat.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAGtB,MAAM,OAAO,IAAK,SAAQ,WAAW;IACnC;;;;;;;;;OASG;IACH,MAAM,CAAC,IAAsB,EAAE,OAA6B;QAC1D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACjE,CAAC;IAED;;;;;;;;;OASG;IACH,QAAQ,CAAC,MAAc,EAAE,OAA6B;QACpD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,MAAM,EAAE,EAAE,OAAO,CAAC,CAAC;IAC1D,CAAC;IAED;;;;;;;OAOG;IACH,IAAI,CAAC,OAA6B;QAChC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;IACjD,CAAC;IAED;;;;;;;;;;OAUG;IACH,oBAAoB,CAClB,IAAoC,EACpC,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,yBAAyB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5E,CAAC;IAED;;;;;;;OAOG;IACH,GAAG,CAAC,MAAc,EAAE,OAA6B;QAC/C,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,aAAa,MAAM,EAAE,EAAE;YAC/C,GAAG,OAAO;YACV,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE;SAChD,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -1,6 +1,7 @@
1
1
  export { Agent, type AgentResponse, type AgentListResponse, type AgentGetVersionsResponse, type AgentCreateParams, type AgentRetrieveParams, type AgentUpdateParams, } from "./agent.js";
2
2
  export { BatchCall, type BatchCallResponse, type BatchCallCreateBatchCallParams } from "./batch-call.js";
3
3
  export { Call, type CallResponse, type PhoneCallResponse, type WebCallResponse, type CallListResponse, type CallUpdateParams, type CallListParams, type CallCreatePhoneCallParams, type CallCreateWebCallParams, type CallRegisterPhoneCallParams, } from "./call.js";
4
+ export { Chat, type ChatResponse, type ChatListResponse, type ChatCreateChatCompletionResponse, type ChatCreateParams, type ChatCreateChatCompletionParams, } from "./chat.js";
4
5
  export { Concurrency, type ConcurrencyRetrieveResponse } from "./concurrency.js";
5
6
  export { KnowledgeBase, type KnowledgeBaseResponse, type KnowledgeBaseListResponse, type KnowledgeBaseCreateParams, type KnowledgeBaseAddSourcesParams, } from "./knowledge-base.js";
6
7
  export { Llm, type LlmResponse, type LlmListResponse, type LlmCreateParams, type LlmRetrieveParams, type LlmUpdateParams, } from "./llm.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,EACL,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,EAC7B,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,GACvB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,SAAS,EAAE,KAAK,iBAAiB,EAAE,KAAK,8BAA8B,EAAE,MAAM,cAAc,CAAC;AACtG,OAAO,EACL,IAAI,EACJ,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,yBAAyB,EAC9B,KAAK,uBAAuB,EAC5B,KAAK,2BAA2B,GACjC,MAAM,QAAQ,CAAC;AAChB,OAAO,EAAE,WAAW,EAAE,KAAK,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAC9E,OAAO,EACL,aAAa,EACb,KAAK,qBAAqB,EAC1B,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAC9B,KAAK,6BAA6B,GACnC,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,GAAG,EACH,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,eAAe,GACrB,MAAM,OAAO,CAAC;AACf,OAAO,EACL,WAAW,EACX,KAAK,mBAAmB,EACxB,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,GAC7B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,KAAK,EAAE,KAAK,aAAa,EAAE,KAAK,iBAAi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OAAO,EAAE,KAAK,EAAE,KAAK,aAAa,EAAE,KAAK,iBAAiB,EAAE,MAAM,SAAS,CAAC"}
@@ -1,13 +1,15 @@
1
1
  "use strict";
2
2
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.Voice = exports.PhoneNumber = exports.Llm = exports.KnowledgeBase = exports.Concurrency = exports.Call = exports.BatchCall = exports.Agent = void 0;
4
+ exports.Voice = exports.PhoneNumber = exports.Llm = exports.KnowledgeBase = exports.Concurrency = exports.Chat = exports.Call = exports.BatchCall = exports.Agent = void 0;
5
5
  var agent_1 = require("./agent.js");
6
6
  Object.defineProperty(exports, "Agent", { enumerable: true, get: function () { return agent_1.Agent; } });
7
7
  var batch_call_1 = require("./batch-call.js");
8
8
  Object.defineProperty(exports, "BatchCall", { enumerable: true, get: function () { return batch_call_1.BatchCall; } });
9
9
  var call_1 = require("./call.js");
10
10
  Object.defineProperty(exports, "Call", { enumerable: true, get: function () { return call_1.Call; } });
11
+ var chat_1 = require("./chat.js");
12
+ Object.defineProperty(exports, "Chat", { enumerable: true, get: function () { return chat_1.Chat; } });
11
13
  var concurrency_1 = require("./concurrency.js");
12
14
  Object.defineProperty(exports, "Concurrency", { enumerable: true, get: function () { return concurrency_1.Concurrency; } });
13
15
  var knowledge_base_1 = require("./knowledge-base.js");
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,oCAQiB;AAPf,8FAAA,KAAK,OAAA;AAQP,8CAAsG;AAA7F,uGAAA,SAAS,OAAA;AAClB,kCAWgB;AAVd,4FAAA,IAAI,OAAA;AAWN,gDAA8E;AAArE,0GAAA,WAAW,OAAA;AACpB,sDAM0B;AALxB,+GAAA,aAAa,OAAA;AAMf,gCAOe;AANb,0FAAA,GAAG,OAAA;AAOL,kDAOwB;AANtB,2GAAA,WAAW,OAAA;AAOb,oCAA4E;AAAnE,8FAAA,KAAK,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,oCAQiB;AAPf,8FAAA,KAAK,OAAA;AAQP,8CAAsG;AAA7F,uGAAA,SAAS,OAAA;AAClB,kCAWgB;AAVd,4FAAA,IAAI,OAAA;AAWN,kCAOgB;AANd,4FAAA,IAAI,OAAA;AAON,gDAA8E;AAArE,0GAAA,WAAW,OAAA;AACpB,sDAM0B;AALxB,+GAAA,aAAa,OAAA;AAMf,gCAOe;AANb,0FAAA,GAAG,OAAA;AAOL,kDAOwB;AANtB,2GAAA,WAAW,OAAA;AAOb,oCAA4E;AAAnE,8FAAA,KAAK,OAAA"}
@@ -2,6 +2,7 @@
2
2
  export { Agent, } from "./agent.mjs";
3
3
  export { BatchCall } from "./batch-call.mjs";
4
4
  export { Call, } from "./call.mjs";
5
+ export { Chat, } from "./chat.mjs";
5
6
  export { Concurrency } from "./concurrency.mjs";
6
7
  export { KnowledgeBase, } from "./knowledge-base.mjs";
7
8
  export { Llm, } from "./llm.mjs";
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EACL,KAAK,GAON;OACM,EAAE,SAAS,EAA+D;OAC1E,EACL,IAAI,GAUL;OACM,EAAE,WAAW,EAAoC;OACjD,EACL,aAAa,GAKd;OACM,EACL,GAAG,GAMJ;OACM,EACL,WAAW,GAMZ;OACM,EAAE,KAAK,EAA8C"}
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EACL,KAAK,GAON;OACM,EAAE,SAAS,EAA+D;OAC1E,EACL,IAAI,GAUL;OACM,EACL,IAAI,GAML;OACM,EAAE,WAAW,EAAoC;OACjD,EACL,aAAa,GAKd;OACM,EACL,GAAG,GAMJ;OACM,EACL,WAAW,GAMZ;OACM,EAAE,KAAK,EAA8C"}