@talqing/sdk 0.16.1 → 0.18.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.
@@ -220,7 +220,7 @@ export type AgentConfig = {
220
220
  /**
221
221
  * Language
222
222
  *
223
- * The one language the caller and the agent speak, shared by every model in the pipeline. Use a code from the provider catalog's language lists; null means Auto. Voice and video only.
223
+ * The one language the caller and the agent speak, shared by every model in the pipeline. Use a code from the provider catalog's language lists; null means Auto. On a text agent, only with `stt` set.
224
224
  */
225
225
  language?: string | null;
226
226
  llm?: LLMSpec | null;
@@ -261,6 +261,9 @@ export type AgentConfig = {
261
261
  realtime?: RealtimeSpec | null;
262
262
  recording?: RecordingSpec;
263
263
  silence?: SilenceSpec;
264
+ /**
265
+ * Text agents: transcribes voice notes; null = the agent can't listen to them.
266
+ */
264
267
  stt?: STTSpec | null;
265
268
  /**
266
269
  * Tasks
@@ -364,7 +367,7 @@ export type AgentOverride = {
364
367
  /**
365
368
  * Language
366
369
  *
367
- * The one language the caller and the agent speak, shared by every model in the pipeline. Use a code from the provider catalog's language lists; null means Auto. Voice and video only.
370
+ * The one language the caller and the agent speak, shared by every model in the pipeline. Use a code from the provider catalog's language lists; null means Auto. On a text agent, only with `stt` set.
368
371
  */
369
372
  language?: string | null;
370
373
  llm?: LLMSpecOverride | null;
@@ -405,6 +408,9 @@ export type AgentOverride = {
405
408
  realtime?: RealtimeSpecOverride | null;
406
409
  recording?: RecordingSpecOverride | null;
407
410
  silence?: SilenceSpecOverride | null;
411
+ /**
412
+ * Text agents: transcribes voice notes; null = the agent can't listen to them.
413
+ */
408
414
  stt?: STTSpecOverride | null;
409
415
  /**
410
416
  * Tasks
@@ -2177,6 +2183,30 @@ export type ConnectionQuality = {
2177
2183
  overall: string;
2178
2184
  };
2179
2185
 
2186
+ /**
2187
+ * ContactCard
2188
+ *
2189
+ * One card in a shared contact file.
2190
+ */
2191
+ export type ContactCard = {
2192
+ /**
2193
+ * Emails
2194
+ */
2195
+ emails: Array<string>;
2196
+ /**
2197
+ * Name
2198
+ */
2199
+ name: string | null;
2200
+ /**
2201
+ * Organization
2202
+ */
2203
+ organization: string | null;
2204
+ /**
2205
+ * Phones
2206
+ */
2207
+ phones: Array<string>;
2208
+ };
2209
+
2180
2210
  /**
2181
2211
  * ConversationActivity
2182
2212
  *
@@ -2189,6 +2219,122 @@ export type ConversationActivity = {
2189
2219
  state: 'running' | 'idle';
2190
2220
  };
2191
2221
 
2222
+ /**
2223
+ * ConversationAudio
2224
+ *
2225
+ * A voice note or audio file the person sent, and what they said in it.
2226
+ */
2227
+ export type ConversationAudio = {
2228
+ /**
2229
+ * Bytes
2230
+ */
2231
+ bytes: number;
2232
+ /**
2233
+ * Duration Seconds
2234
+ */
2235
+ duration_seconds: number | null;
2236
+ /**
2237
+ * Extension
2238
+ *
2239
+ * The type read from its bytes, e.g. `ogg` or `m4a`.
2240
+ */
2241
+ extension: string;
2242
+ /**
2243
+ * Failed Reason
2244
+ *
2245
+ * Why it could not be transcribed.
2246
+ */
2247
+ failed_reason: string | null;
2248
+ /**
2249
+ * Filename
2250
+ */
2251
+ filename: string | null;
2252
+ /**
2253
+ * Id
2254
+ */
2255
+ id: string;
2256
+ /**
2257
+ * Kind
2258
+ */
2259
+ kind?: 'audio';
2260
+ /**
2261
+ * Mime Type
2262
+ */
2263
+ mime_type: string;
2264
+ /**
2265
+ * Playable
2266
+ *
2267
+ * Whether `url` plays in an `<audio>` element.
2268
+ */
2269
+ playable: boolean;
2270
+ /**
2271
+ * Status
2272
+ *
2273
+ * `pending` until an agent with a speech-to-text model takes a turn.
2274
+ */
2275
+ status: 'pending' | 'transcribed' | 'failed';
2276
+ /**
2277
+ * Transcript
2278
+ *
2279
+ * What was said; empty when there was no speech.
2280
+ */
2281
+ transcript: string | null;
2282
+ /**
2283
+ * Url
2284
+ *
2285
+ * Signed link; valid until `url_expires_at`.
2286
+ */
2287
+ url: string;
2288
+ /**
2289
+ * Url Expires At
2290
+ */
2291
+ url_expires_at: string;
2292
+ };
2293
+
2294
+ /**
2295
+ * ConversationContact
2296
+ *
2297
+ * A contact card the person shared, as read from the vCard.
2298
+ */
2299
+ export type ConversationContact = {
2300
+ /**
2301
+ * Bytes
2302
+ */
2303
+ bytes: number;
2304
+ /**
2305
+ * Contacts
2306
+ *
2307
+ * One per card in the file.
2308
+ */
2309
+ contacts: Array<ContactCard>;
2310
+ /**
2311
+ * Filename
2312
+ */
2313
+ filename: string | null;
2314
+ /**
2315
+ * Id
2316
+ */
2317
+ id: string;
2318
+ /**
2319
+ * Kind
2320
+ */
2321
+ kind?: 'contact';
2322
+ /**
2323
+ * Mime Type
2324
+ */
2325
+ mime_type?: 'text/vcard';
2326
+ /**
2327
+ * Url
2328
+ *
2329
+ * Signed download of the .vcf; valid until `url_expires_at`.
2330
+ */
2331
+ url: string;
2332
+ /**
2333
+ * Url Expires At
2334
+ */
2335
+ url_expires_at: string;
2336
+ };
2337
+
2192
2338
  /**
2193
2339
  * ConversationDocument
2194
2340
  *
@@ -2280,9 +2426,9 @@ export type ConversationFile = {
2280
2426
  /**
2281
2427
  * Playable
2282
2428
  *
2283
- * Set when `url` plays in an `<audio>` or `<video>` element.
2429
+ * Set when `url` plays in a `<video>` element.
2284
2430
  */
2285
- playable: 'audio' | 'video' | null;
2431
+ playable: 'video' | null;
2286
2432
  /**
2287
2433
  * Url
2288
2434
  *
@@ -2356,7 +2502,7 @@ export type ConversationItemResponse = {
2356
2502
  /**
2357
2503
  * Attachments
2358
2504
  */
2359
- attachments: Array<ConversationImage | ConversationDocument | ConversationFile>;
2505
+ attachments: Array<ConversationImage | ConversationDocument | ConversationAudio | ConversationContact | ConversationFile>;
2360
2506
  /**
2361
2507
  * Attachments Not Kept
2362
2508
  *
@@ -3250,6 +3396,9 @@ export type CreateChatRequest = {
3250
3396
 
3251
3397
  /**
3252
3398
  * CreateEmailBatchRequest
3399
+ *
3400
+ * Each email is written either by an agent task (`task_id` + `field_map`) or by
3401
+ * a fixed `template` filled from the row's columns.
3253
3402
  */
3254
3403
  export type CreateEmailBatchRequest = {
3255
3404
  /**
@@ -3274,7 +3423,10 @@ export type CreateEmailBatchRequest = {
3274
3423
  * Draft Retry After Minutes
3275
3424
  */
3276
3425
  draft_retry_after_minutes?: number;
3277
- field_map: FieldMap;
3426
+ /**
3427
+ * With `task_id` only.
3428
+ */
3429
+ field_map?: FieldMap | null;
3278
3430
  /**
3279
3431
  * From Email
3280
3432
  *
@@ -3336,7 +3488,11 @@ export type CreateEmailBatchRequest = {
3336
3488
  *
3337
3489
  * The agent task that drafts each row.
3338
3490
  */
3339
- task_id: string;
3491
+ task_id?: string | null;
3492
+ /**
3493
+ * Instead of a task: no drafting, every row is ready at once.
3494
+ */
3495
+ template?: EmailTemplate | null;
3340
3496
  /**
3341
3497
  * Timezone
3342
3498
  */
@@ -4308,7 +4464,7 @@ export type EmailBatchResponse = {
4308
4464
  * Failure Reason
4309
4465
  */
4310
4466
  failure_reason: string | null;
4311
- field_map: FieldMap;
4467
+ field_map: FieldMap | null;
4312
4468
  /**
4313
4469
  * From Email
4314
4470
  */
@@ -4418,6 +4574,7 @@ export type EmailBatchResponse = {
4418
4574
  * Task Name
4419
4575
  */
4420
4576
  task_name: string | null;
4577
+ template: EmailTemplate | null;
4421
4578
  /**
4422
4579
  * Timezone
4423
4580
  */
@@ -4484,6 +4641,7 @@ export type EmailRecipientResponse = {
4484
4641
  columns: {
4485
4642
  [key: string]: unknown;
4486
4643
  };
4644
+ email: ResolvedEmail | null;
4487
4645
  /**
4488
4646
  * Id
4489
4647
  */
@@ -4693,6 +4851,28 @@ export type EmailSendResponse = {
4693
4851
  window: TimeWindow | null;
4694
4852
  };
4695
4853
 
4854
+ /**
4855
+ * EmailTemplate
4856
+ *
4857
+ * A fixed email, filled per row: `{{column}}` in subject or body takes that row's cell.
4858
+ */
4859
+ export type EmailTemplate = {
4860
+ /**
4861
+ * Body
4862
+ */
4863
+ body: string;
4864
+ /**
4865
+ * Subject
4866
+ */
4867
+ subject: string;
4868
+ /**
4869
+ * To
4870
+ *
4871
+ * The list column holding the address.
4872
+ */
4873
+ to: string;
4874
+ };
4875
+
4696
4876
  /**
4697
4877
  * EndCallConfig
4698
4878
  *
@@ -6192,7 +6372,7 @@ export type ItemCreatedEvent = {
6192
6372
  /**
6193
6373
  * Attachments
6194
6374
  */
6195
- attachments: Array<ConversationImage | ConversationDocument | ConversationFile>;
6375
+ attachments: Array<ConversationImage | ConversationDocument | ConversationAudio | ConversationContact | ConversationFile>;
6196
6376
  /**
6197
6377
  * Attachments Not Kept
6198
6378
  *
@@ -8561,6 +8741,8 @@ export type PatchEmailBatchRequest = {
8561
8741
  draft_retry_after_minutes?: number;
8562
8742
  /**
8563
8743
  * Field Map
8744
+ *
8745
+ * Task batches only.
8564
8746
  */
8565
8747
  field_map?: FieldMap;
8566
8748
  /**
@@ -8603,6 +8785,12 @@ export type PatchEmailBatchRequest = {
8603
8785
  * Start At
8604
8786
  */
8605
8787
  start_at?: string | null;
8788
+ /**
8789
+ * Template
8790
+ *
8791
+ * Template batches only.
8792
+ */
8793
+ template?: EmailTemplate;
8606
8794
  /**
8607
8795
  * Timezone
8608
8796
  */
@@ -10206,6 +10394,26 @@ export type ReplyLatency = {
10206
10394
  total_ms: number;
10207
10395
  };
10208
10396
 
10397
+ /**
10398
+ * ResolvedEmail
10399
+ *
10400
+ * The email this row sends, as it stands now.
10401
+ */
10402
+ export type ResolvedEmail = {
10403
+ /**
10404
+ * Body
10405
+ */
10406
+ body: string;
10407
+ /**
10408
+ * Subject
10409
+ */
10410
+ subject: string;
10411
+ /**
10412
+ * To
10413
+ */
10414
+ to: string;
10415
+ };
10416
+
10209
10417
  /**
10210
10418
  * ResumeCallRequest
10211
10419
  */
@@ -10441,6 +10649,10 @@ export type STTCatalogEntryResponse = {
10441
10649
  * Default Language
10442
10650
  */
10443
10651
  default_language: string | null;
10652
+ /**
10653
+ * File Transcription
10654
+ */
10655
+ file_transcription: 'whole' | 'chunked' | null;
10444
10656
  /**
10445
10657
  * Label
10446
10658
  */
@@ -10805,6 +11017,64 @@ export type SendMessageResponse = {
10805
11017
  turn_id: string;
10806
11018
  };
10807
11019
 
11020
+ /**
11021
+ * SendTestEmailRequest
11022
+ *
11023
+ * One email to yourself, filled from `vars` the way a template batch fills a row.
11024
+ */
11025
+ export type SendTestEmailRequest = {
11026
+ /**
11027
+ * Body
11028
+ */
11029
+ body: string;
11030
+ /**
11031
+ * Body Format
11032
+ */
11033
+ body_format?: 'text' | 'html';
11034
+ /**
11035
+ * From Email
11036
+ */
11037
+ from_email: string;
11038
+ /**
11039
+ * From Name
11040
+ */
11041
+ from_name?: string | null;
11042
+ /**
11043
+ * Integration Id
11044
+ */
11045
+ integration_id: string;
11046
+ /**
11047
+ * Reply To
11048
+ */
11049
+ reply_to?: string | null;
11050
+ /**
11051
+ * Subject
11052
+ */
11053
+ subject: string;
11054
+ /**
11055
+ * Vars
11056
+ *
11057
+ * One row's cells.
11058
+ */
11059
+ vars?: {
11060
+ [key: string]: string;
11061
+ };
11062
+ };
11063
+
11064
+ /**
11065
+ * SendTestEmailResponse
11066
+ */
11067
+ export type SendTestEmailResponse = {
11068
+ /**
11069
+ * Provider Message Id
11070
+ */
11071
+ provider_message_id: string;
11072
+ /**
11073
+ * To
11074
+ */
11075
+ to: string;
11076
+ };
11077
+
10808
11078
  /**
10809
11079
  * SendWhatsAppBatchRequest
10810
11080
  *
@@ -17559,6 +17829,10 @@ export type ConversationsAttachmentsGetResults = {
17559
17829
  } & ConversationImage) | ({
17560
17830
  kind: 'document';
17561
17831
  } & ConversationDocument) | ({
17832
+ kind: 'audio';
17833
+ } & ConversationAudio) | ({
17834
+ kind: 'contact';
17835
+ } & ConversationContact) | ({
17562
17836
  kind: 'file';
17563
17837
  } & ConversationFile);
17564
17838
  };
@@ -19243,6 +19517,51 @@ export type EmailSendersListResults = {
19243
19517
 
19244
19518
  export type EmailSendersListResult = EmailSendersListResults[keyof EmailSendersListResults];
19245
19519
 
19520
+ export type EmailTestSendsCreateData = {
19521
+ body: SendTestEmailRequest;
19522
+ path?: never;
19523
+ query?: never;
19524
+ url: '/v1/email/test-sends';
19525
+ };
19526
+
19527
+ export type EmailTestSendsCreateErrors = {
19528
+ /**
19529
+ * Well-formed, but rejected by a rule; `detail.errors` lists each problem.
19530
+ */
19531
+ 400: ErrorResponse;
19532
+ /**
19533
+ * Missing credential, or one that is revoked or no longer a member of this organization.
19534
+ */
19535
+ 401: ErrorResponse;
19536
+ /**
19537
+ * Authenticated, but this organization role may not perform the operation.
19538
+ */
19539
+ 403: ErrorResponse;
19540
+ /**
19541
+ * The resource's current state forbids this — a name already taken, a job already running.
19542
+ */
19543
+ 409: ErrorResponse;
19544
+ /**
19545
+ * The request did not match this operation's schema; `detail.errors` lists each field.
19546
+ */
19547
+ 422: ErrorResponse;
19548
+ /**
19549
+ * Unexpected error. Every error this API returns carries this body.
19550
+ */
19551
+ default: ErrorResponse;
19552
+ };
19553
+
19554
+ export type EmailTestSendsCreateError = EmailTestSendsCreateErrors[keyof EmailTestSendsCreateErrors];
19555
+
19556
+ export type EmailTestSendsCreateResults = {
19557
+ /**
19558
+ * Successful Response
19559
+ */
19560
+ 200: SendTestEmailResponse;
19561
+ };
19562
+
19563
+ export type EmailTestSendsCreateResult = EmailTestSendsCreateResults[keyof EmailTestSendsCreateResults];
19564
+
19246
19565
  export type FaqsListData = {
19247
19566
  body?: never;
19248
19567
  path?: never;
package/src/vocabulary.ts CHANGED
@@ -89,7 +89,7 @@ export type ConversationItemRole = NonNullable<ConversationItemResponse["role"]>
89
89
  /** Which way the row travelled, and whether the end customer saw it. */
90
90
  export type ConversationItemDirection = ConversationItemResponse["direction"];
91
91
  export type ConversationItemVisibility = ConversationItemResponse["visibility"];
92
- /** A file a person sent: a photo, a document, or any other file, by `kind`. */
92
+ /** A file a person sent: a photo, a document, a voice note, a contact card, or any other file, by `kind`. */
93
93
  export type ConversationAttachment = ConversationItemResponse["attachments"][number];
94
94
 
95
95
  /** One item on a CoPilot rail: a message, a tool call, or its output. A union