retell-sdk 4.29.0 → 4.31.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,447 @@
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
+ * End timestamp (milliseconds since epoch) of the chat. Available after chat ends.
86
+ */
87
+ end_timestamp?: number;
88
+ /**
89
+ * Transcript of the chat weaved with tool call invocation and results.
90
+ */
91
+ message_with_tool_calls?: Array<ChatResponse.Message | ChatResponse.ToolCallInvocationMessage | ChatResponse.ToolCallResultMessage | ChatResponse.NodeTransitionMessage | ChatResponse.StateTransitionMessage>;
92
+ /**
93
+ * An arbitrary object for storage purpose only. You can put anything here like
94
+ * your internal customer id associated with the chat. Not used for processing. You
95
+ * can later get this field from the chat object.
96
+ */
97
+ metadata?: unknown;
98
+ /**
99
+ * Add optional dynamic variables in key value pairs of string that injects into
100
+ * your Response Engine prompt and tool description. Only applicable for Response
101
+ * Engine.
102
+ */
103
+ retell_llm_dynamic_variables?: Record<string, unknown>;
104
+ /**
105
+ * Begin timestamp (milliseconds since epoch) of the chat. Available after chat
106
+ * starts.
107
+ */
108
+ start_timestamp?: number;
109
+ /**
110
+ * Transcription of the chat.
111
+ */
112
+ transcript?: string;
113
+ }
114
+ export declare namespace ChatResponse {
115
+ /**
116
+ * Post chat analysis that includes information such as sentiment, status, summary,
117
+ * and custom defined data to extract. Available after chat ends. Subscribe to
118
+ * `chat_analyzed` webhook event type to receive it once ready.
119
+ */
120
+ interface ChatAnalysis {
121
+ /**
122
+ * Whether the agent seems to have a successful chat with the user, where the agent
123
+ * finishes the task, and the call was complete without being cutoff.
124
+ */
125
+ chat_successful?: boolean;
126
+ /**
127
+ * A high level summary of the chat.
128
+ */
129
+ chat_summary?: string;
130
+ /**
131
+ * Custom analysis data that was extracted based on the schema defined in chat
132
+ * agent post chat analysis data. Can be empty if nothing is specified.
133
+ */
134
+ custom_analysis_data?: unknown;
135
+ /**
136
+ * Sentiment of the user in the chat.
137
+ */
138
+ user_sentiment?: 'Negative' | 'Positive' | 'Neutral' | 'Unknown';
139
+ }
140
+ interface ChatCost {
141
+ /**
142
+ * Combined cost of all individual costs in cents
143
+ */
144
+ combined_cost?: number;
145
+ /**
146
+ * List of products with their unit prices and costs in cents
147
+ */
148
+ product_costs?: Array<ChatCost.ProductCost>;
149
+ }
150
+ namespace ChatCost {
151
+ interface ProductCost {
152
+ /**
153
+ * Cost for the product in cents for the duration of the call.
154
+ */
155
+ cost: number;
156
+ /**
157
+ * Product name that has a cost associated with it.
158
+ */
159
+ product: string;
160
+ /**
161
+ * Unit price of the product in cents per second.
162
+ */
163
+ unitPrice: number;
164
+ }
165
+ }
166
+ interface Message {
167
+ /**
168
+ * Content of the message
169
+ */
170
+ content: string;
171
+ /**
172
+ * Create timestamp of the message
173
+ */
174
+ created_timestamp: number;
175
+ /**
176
+ * Unique id ot the message
177
+ */
178
+ message_id: string;
179
+ /**
180
+ * Documents whether this message is sent by agent or user.
181
+ */
182
+ role: 'agent' | 'user';
183
+ }
184
+ interface ToolCallInvocationMessage {
185
+ /**
186
+ * Arguments for this tool call, it's a stringified JSON object.
187
+ */
188
+ arguments: string;
189
+ /**
190
+ * Unique id ot the message
191
+ */
192
+ message_id: string;
193
+ /**
194
+ * Name of the function in this tool call.
195
+ */
196
+ name: string;
197
+ /**
198
+ * This is a tool call invocation.
199
+ */
200
+ role: 'tool_call_invocation';
201
+ /**
202
+ * Tool call id, globally unique.
203
+ */
204
+ tool_call_id: string;
205
+ /**
206
+ * Create timestamp of the message
207
+ */
208
+ created_timestamp?: number;
209
+ }
210
+ interface ToolCallResultMessage {
211
+ /**
212
+ * Result of the tool call, can be a string, a stringified json, etc.
213
+ */
214
+ content: string;
215
+ /**
216
+ * Create timestamp of the message
217
+ */
218
+ created_timestamp: number;
219
+ /**
220
+ * Unique id ot the message
221
+ */
222
+ message_id: string;
223
+ /**
224
+ * This is result of a tool call.
225
+ */
226
+ role: 'tool_call_result';
227
+ /**
228
+ * Tool call id, globally unique.
229
+ */
230
+ tool_call_id: string;
231
+ }
232
+ interface NodeTransitionMessage {
233
+ /**
234
+ * Create timestamp of the message
235
+ */
236
+ created_timestamp: number;
237
+ /**
238
+ * Unique id ot the message
239
+ */
240
+ message_id: string;
241
+ /**
242
+ * This is node transition.
243
+ */
244
+ role: 'node_transition';
245
+ /**
246
+ * Former node id
247
+ */
248
+ former_node_id?: string;
249
+ /**
250
+ * Former node name
251
+ */
252
+ former_node_name?: string;
253
+ /**
254
+ * New node id
255
+ */
256
+ new_node_id?: string;
257
+ /**
258
+ * New node name
259
+ */
260
+ new_node_name?: string;
261
+ }
262
+ interface StateTransitionMessage {
263
+ /**
264
+ * Create timestamp of the message
265
+ */
266
+ created_timestamp: number;
267
+ /**
268
+ * Unique id ot the message
269
+ */
270
+ message_id: string;
271
+ /**
272
+ * This is state transition for .
273
+ */
274
+ role: 'state_transition';
275
+ /**
276
+ * Former state name
277
+ */
278
+ former_state_name?: string;
279
+ /**
280
+ * New state name
281
+ */
282
+ new_state_name?: string;
283
+ }
284
+ }
285
+ export type ChatListResponse = Array<ChatResponse>;
286
+ export interface ChatCreateChatCompletionResponse {
287
+ /**
288
+ * Transcript of the chat completion weaved with tool call invocation and results.
289
+ */
290
+ messages: Array<ChatCreateChatCompletionResponse.Message | ChatCreateChatCompletionResponse.ToolCallInvocationMessage | ChatCreateChatCompletionResponse.ToolCallResultMessage | ChatCreateChatCompletionResponse.NodeTransitionMessage | ChatCreateChatCompletionResponse.StateTransitionMessage>;
291
+ }
292
+ export declare namespace ChatCreateChatCompletionResponse {
293
+ interface Message {
294
+ /**
295
+ * Content of the message
296
+ */
297
+ content: string;
298
+ /**
299
+ * Create timestamp of the message
300
+ */
301
+ created_timestamp: number;
302
+ /**
303
+ * Unique id ot the message
304
+ */
305
+ message_id: string;
306
+ /**
307
+ * Documents whether this message is sent by agent or user.
308
+ */
309
+ role: 'agent' | 'user';
310
+ }
311
+ interface ToolCallInvocationMessage {
312
+ /**
313
+ * Arguments for this tool call, it's a stringified JSON object.
314
+ */
315
+ arguments: string;
316
+ /**
317
+ * Unique id ot the message
318
+ */
319
+ message_id: string;
320
+ /**
321
+ * Name of the function in this tool call.
322
+ */
323
+ name: string;
324
+ /**
325
+ * This is a tool call invocation.
326
+ */
327
+ role: 'tool_call_invocation';
328
+ /**
329
+ * Tool call id, globally unique.
330
+ */
331
+ tool_call_id: string;
332
+ /**
333
+ * Create timestamp of the message
334
+ */
335
+ created_timestamp?: number;
336
+ }
337
+ interface ToolCallResultMessage {
338
+ /**
339
+ * Result of the tool call, can be a string, a stringified json, etc.
340
+ */
341
+ content: string;
342
+ /**
343
+ * Create timestamp of the message
344
+ */
345
+ created_timestamp: number;
346
+ /**
347
+ * Unique id ot the message
348
+ */
349
+ message_id: string;
350
+ /**
351
+ * This is result of a tool call.
352
+ */
353
+ role: 'tool_call_result';
354
+ /**
355
+ * Tool call id, globally unique.
356
+ */
357
+ tool_call_id: string;
358
+ }
359
+ interface NodeTransitionMessage {
360
+ /**
361
+ * Create timestamp of the message
362
+ */
363
+ created_timestamp: number;
364
+ /**
365
+ * Unique id ot the message
366
+ */
367
+ message_id: string;
368
+ /**
369
+ * This is node transition.
370
+ */
371
+ role: 'node_transition';
372
+ /**
373
+ * Former node id
374
+ */
375
+ former_node_id?: string;
376
+ /**
377
+ * Former node name
378
+ */
379
+ former_node_name?: string;
380
+ /**
381
+ * New node id
382
+ */
383
+ new_node_id?: string;
384
+ /**
385
+ * New node name
386
+ */
387
+ new_node_name?: string;
388
+ }
389
+ interface StateTransitionMessage {
390
+ /**
391
+ * Create timestamp of the message
392
+ */
393
+ created_timestamp: number;
394
+ /**
395
+ * Unique id ot the message
396
+ */
397
+ message_id: string;
398
+ /**
399
+ * This is state transition for .
400
+ */
401
+ role: 'state_transition';
402
+ /**
403
+ * Former state name
404
+ */
405
+ former_state_name?: string;
406
+ /**
407
+ * New state name
408
+ */
409
+ new_state_name?: string;
410
+ }
411
+ }
412
+ export interface ChatCreateParams {
413
+ /**
414
+ * The chat agent to use for the call.
415
+ */
416
+ agent_id: string;
417
+ /**
418
+ * The version of the chat agent to use for the call.
419
+ */
420
+ agent_version?: number;
421
+ /**
422
+ * An arbitrary object for storage purpose only. You can put anything here like
423
+ * your internal customer id associated with the chat. Not used for processing. You
424
+ * can later get this field from the chat object.
425
+ */
426
+ metadata?: unknown;
427
+ /**
428
+ * Add optional dynamic variables in key value pairs of string that injects into
429
+ * your Response Engine prompt and tool description. Only applicable for Response
430
+ * Engine.
431
+ */
432
+ retell_llm_dynamic_variables?: Record<string, unknown>;
433
+ }
434
+ export interface ChatCreateChatCompletionParams {
435
+ /**
436
+ * Unique id of the chat to create completion.
437
+ */
438
+ chat_id: string;
439
+ /**
440
+ * user message to generate agent chat completion.
441
+ */
442
+ content: string;
443
+ }
444
+ export declare namespace Chat {
445
+ export { type ChatResponse as ChatResponse, type ChatListResponse as ChatListResponse, type ChatCreateChatCompletionResponse as ChatCreateChatCompletionResponse, type ChatCreateParams as ChatCreateParams, type ChatCreateChatCompletionParams as ChatCreateChatCompletionParams, };
446
+ }
447
+ //# 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;AAC1C,OAAO,KAAK,IAAI,MAAM,SAAS,CAAC;AAEhC,qBAAa,IAAK,SAAQ,WAAW;IACnC;;;;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ACrC;;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,iBAAiB,EAAE,MAAM,SAAS,CAAC"}
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,KA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
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"}