@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.
@@ -207,7 +207,7 @@ export type AgentConfig = {
207
207
  /**
208
208
  * Language
209
209
  *
210
- * 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.
210
+ * 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.
211
211
  */
212
212
  language?: string | null;
213
213
  llm?: LLMSpec | null;
@@ -248,6 +248,9 @@ export type AgentConfig = {
248
248
  realtime?: RealtimeSpec | null;
249
249
  recording?: RecordingSpec;
250
250
  silence?: SilenceSpec;
251
+ /**
252
+ * Text agents: transcribes voice notes; null = the agent can't listen to them.
253
+ */
251
254
  stt?: STTSpec | null;
252
255
  /**
253
256
  * Tasks
@@ -349,7 +352,7 @@ export type AgentOverride = {
349
352
  /**
350
353
  * Language
351
354
  *
352
- * 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.
355
+ * 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.
353
356
  */
354
357
  language?: string | null;
355
358
  llm?: LLMSpecOverride | null;
@@ -390,6 +393,9 @@ export type AgentOverride = {
390
393
  realtime?: RealtimeSpecOverride | null;
391
394
  recording?: RecordingSpecOverride | null;
392
395
  silence?: SilenceSpecOverride | null;
396
+ /**
397
+ * Text agents: transcribes voice notes; null = the agent can't listen to them.
398
+ */
393
399
  stt?: STTSpecOverride | null;
394
400
  /**
395
401
  * Tasks
@@ -2110,6 +2116,29 @@ export type ConnectionQuality = {
2110
2116
  */
2111
2117
  overall: string;
2112
2118
  };
2119
+ /**
2120
+ * ContactCard
2121
+ *
2122
+ * One card in a shared contact file.
2123
+ */
2124
+ export type ContactCard = {
2125
+ /**
2126
+ * Emails
2127
+ */
2128
+ emails: Array<string>;
2129
+ /**
2130
+ * Name
2131
+ */
2132
+ name: string | null;
2133
+ /**
2134
+ * Organization
2135
+ */
2136
+ organization: string | null;
2137
+ /**
2138
+ * Phones
2139
+ */
2140
+ phones: Array<string>;
2141
+ };
2113
2142
  /**
2114
2143
  * ConversationActivity
2115
2144
  *
@@ -2121,6 +2150,120 @@ export type ConversationActivity = {
2121
2150
  */
2122
2151
  state: 'running' | 'idle';
2123
2152
  };
2153
+ /**
2154
+ * ConversationAudio
2155
+ *
2156
+ * A voice note or audio file the person sent, and what they said in it.
2157
+ */
2158
+ export type ConversationAudio = {
2159
+ /**
2160
+ * Bytes
2161
+ */
2162
+ bytes: number;
2163
+ /**
2164
+ * Duration Seconds
2165
+ */
2166
+ duration_seconds: number | null;
2167
+ /**
2168
+ * Extension
2169
+ *
2170
+ * The type read from its bytes, e.g. `ogg` or `m4a`.
2171
+ */
2172
+ extension: string;
2173
+ /**
2174
+ * Failed Reason
2175
+ *
2176
+ * Why it could not be transcribed.
2177
+ */
2178
+ failed_reason: string | null;
2179
+ /**
2180
+ * Filename
2181
+ */
2182
+ filename: string | null;
2183
+ /**
2184
+ * Id
2185
+ */
2186
+ id: string;
2187
+ /**
2188
+ * Kind
2189
+ */
2190
+ kind?: 'audio';
2191
+ /**
2192
+ * Mime Type
2193
+ */
2194
+ mime_type: string;
2195
+ /**
2196
+ * Playable
2197
+ *
2198
+ * Whether `url` plays in an `<audio>` element.
2199
+ */
2200
+ playable: boolean;
2201
+ /**
2202
+ * Status
2203
+ *
2204
+ * `pending` until an agent with a speech-to-text model takes a turn.
2205
+ */
2206
+ status: 'pending' | 'transcribed' | 'failed';
2207
+ /**
2208
+ * Transcript
2209
+ *
2210
+ * What was said; empty when there was no speech.
2211
+ */
2212
+ transcript: string | null;
2213
+ /**
2214
+ * Url
2215
+ *
2216
+ * Signed link; valid until `url_expires_at`.
2217
+ */
2218
+ url: string;
2219
+ /**
2220
+ * Url Expires At
2221
+ */
2222
+ url_expires_at: string;
2223
+ };
2224
+ /**
2225
+ * ConversationContact
2226
+ *
2227
+ * A contact card the person shared, as read from the vCard.
2228
+ */
2229
+ export type ConversationContact = {
2230
+ /**
2231
+ * Bytes
2232
+ */
2233
+ bytes: number;
2234
+ /**
2235
+ * Contacts
2236
+ *
2237
+ * One per card in the file.
2238
+ */
2239
+ contacts: Array<ContactCard>;
2240
+ /**
2241
+ * Filename
2242
+ */
2243
+ filename: string | null;
2244
+ /**
2245
+ * Id
2246
+ */
2247
+ id: string;
2248
+ /**
2249
+ * Kind
2250
+ */
2251
+ kind?: 'contact';
2252
+ /**
2253
+ * Mime Type
2254
+ */
2255
+ mime_type?: 'text/vcard';
2256
+ /**
2257
+ * Url
2258
+ *
2259
+ * Signed download of the .vcf; valid until `url_expires_at`.
2260
+ */
2261
+ url: string;
2262
+ /**
2263
+ * Url Expires At
2264
+ */
2265
+ url_expires_at: string;
2266
+ };
2124
2267
  /**
2125
2268
  * ConversationDocument
2126
2269
  *
@@ -2211,9 +2354,9 @@ export type ConversationFile = {
2211
2354
  /**
2212
2355
  * Playable
2213
2356
  *
2214
- * Set when `url` plays in an `<audio>` or `<video>` element.
2357
+ * Set when `url` plays in a `<video>` element.
2215
2358
  */
2216
- playable: 'audio' | 'video' | null;
2359
+ playable: 'video' | null;
2217
2360
  /**
2218
2361
  * Url
2219
2362
  *
@@ -2285,7 +2428,7 @@ export type ConversationItemResponse = {
2285
2428
  /**
2286
2429
  * Attachments
2287
2430
  */
2288
- attachments: Array<ConversationImage | ConversationDocument | ConversationFile>;
2431
+ attachments: Array<ConversationImage | ConversationDocument | ConversationAudio | ConversationContact | ConversationFile>;
2289
2432
  /**
2290
2433
  * Attachments Not Kept
2291
2434
  *
@@ -3158,6 +3301,9 @@ export type CreateChatRequest = {
3158
3301
  };
3159
3302
  /**
3160
3303
  * CreateEmailBatchRequest
3304
+ *
3305
+ * Each email is written either by an agent task (`task_id` + `field_map`) or by
3306
+ * a fixed `template` filled from the row's columns.
3161
3307
  */
3162
3308
  export type CreateEmailBatchRequest = {
3163
3309
  /**
@@ -3182,7 +3328,10 @@ export type CreateEmailBatchRequest = {
3182
3328
  * Draft Retry After Minutes
3183
3329
  */
3184
3330
  draft_retry_after_minutes?: number;
3185
- field_map: FieldMap;
3331
+ /**
3332
+ * With `task_id` only.
3333
+ */
3334
+ field_map?: FieldMap | null;
3186
3335
  /**
3187
3336
  * From Email
3188
3337
  *
@@ -3244,7 +3393,11 @@ export type CreateEmailBatchRequest = {
3244
3393
  *
3245
3394
  * The agent task that drafts each row.
3246
3395
  */
3247
- task_id: string;
3396
+ task_id?: string | null;
3397
+ /**
3398
+ * Instead of a task: no drafting, every row is ready at once.
3399
+ */
3400
+ template?: EmailTemplate | null;
3248
3401
  /**
3249
3402
  * Timezone
3250
3403
  */
@@ -4185,7 +4338,7 @@ export type EmailBatchResponse = {
4185
4338
  * Failure Reason
4186
4339
  */
4187
4340
  failure_reason: string | null;
4188
- field_map: FieldMap;
4341
+ field_map: FieldMap | null;
4189
4342
  /**
4190
4343
  * From Email
4191
4344
  */
@@ -4295,6 +4448,7 @@ export type EmailBatchResponse = {
4295
4448
  * Task Name
4296
4449
  */
4297
4450
  task_name: string | null;
4451
+ template: EmailTemplate | null;
4298
4452
  /**
4299
4453
  * Timezone
4300
4454
  */
@@ -4358,6 +4512,7 @@ export type EmailRecipientResponse = {
4358
4512
  columns: {
4359
4513
  [key: string]: unknown;
4360
4514
  };
4515
+ email: ResolvedEmail | null;
4361
4516
  /**
4362
4517
  * Id
4363
4518
  */
@@ -4564,6 +4719,27 @@ export type EmailSendResponse = {
4564
4719
  timezone: string;
4565
4720
  window: TimeWindow | null;
4566
4721
  };
4722
+ /**
4723
+ * EmailTemplate
4724
+ *
4725
+ * A fixed email, filled per row: `{{column}}` in subject or body takes that row's cell.
4726
+ */
4727
+ export type EmailTemplate = {
4728
+ /**
4729
+ * Body
4730
+ */
4731
+ body: string;
4732
+ /**
4733
+ * Subject
4734
+ */
4735
+ subject: string;
4736
+ /**
4737
+ * To
4738
+ *
4739
+ * The list column holding the address.
4740
+ */
4741
+ to: string;
4742
+ };
4567
4743
  /**
4568
4744
  * EndCallConfig
4569
4745
  *
@@ -6009,7 +6185,7 @@ export type ItemCreatedEvent = {
6009
6185
  /**
6010
6186
  * Attachments
6011
6187
  */
6012
- attachments: Array<ConversationImage | ConversationDocument | ConversationFile>;
6188
+ attachments: Array<ConversationImage | ConversationDocument | ConversationAudio | ConversationContact | ConversationFile>;
6013
6189
  /**
6014
6190
  * Attachments Not Kept
6015
6191
  *
@@ -8296,6 +8472,8 @@ export type PatchEmailBatchRequest = {
8296
8472
  draft_retry_after_minutes?: number;
8297
8473
  /**
8298
8474
  * Field Map
8475
+ *
8476
+ * Task batches only.
8299
8477
  */
8300
8478
  field_map?: FieldMap;
8301
8479
  /**
@@ -8338,6 +8516,12 @@ export type PatchEmailBatchRequest = {
8338
8516
  * Start At
8339
8517
  */
8340
8518
  start_at?: string | null;
8519
+ /**
8520
+ * Template
8521
+ *
8522
+ * Template batches only.
8523
+ */
8524
+ template?: EmailTemplate;
8341
8525
  /**
8342
8526
  * Timezone
8343
8527
  */
@@ -9889,6 +10073,25 @@ export type ReplyLatency = {
9889
10073
  */
9890
10074
  total_ms: number;
9891
10075
  };
10076
+ /**
10077
+ * ResolvedEmail
10078
+ *
10079
+ * The email this row sends, as it stands now.
10080
+ */
10081
+ export type ResolvedEmail = {
10082
+ /**
10083
+ * Body
10084
+ */
10085
+ body: string;
10086
+ /**
10087
+ * Subject
10088
+ */
10089
+ subject: string;
10090
+ /**
10091
+ * To
10092
+ */
10093
+ to: string;
10094
+ };
9892
10095
  /**
9893
10096
  * ResumeCallRequest
9894
10097
  */
@@ -10117,6 +10320,10 @@ export type STTCatalogEntryResponse = {
10117
10320
  * Default Language
10118
10321
  */
10119
10322
  default_language: string | null;
10323
+ /**
10324
+ * File Transcription
10325
+ */
10326
+ file_transcription: 'whole' | 'chunked' | null;
10120
10327
  /**
10121
10328
  * Label
10122
10329
  */
@@ -10463,6 +10670,62 @@ export type SendMessageResponse = {
10463
10670
  */
10464
10671
  turn_id: string;
10465
10672
  };
10673
+ /**
10674
+ * SendTestEmailRequest
10675
+ *
10676
+ * One email to yourself, filled from `vars` the way a template batch fills a row.
10677
+ */
10678
+ export type SendTestEmailRequest = {
10679
+ /**
10680
+ * Body
10681
+ */
10682
+ body: string;
10683
+ /**
10684
+ * Body Format
10685
+ */
10686
+ body_format?: 'text' | 'html';
10687
+ /**
10688
+ * From Email
10689
+ */
10690
+ from_email: string;
10691
+ /**
10692
+ * From Name
10693
+ */
10694
+ from_name?: string | null;
10695
+ /**
10696
+ * Integration Id
10697
+ */
10698
+ integration_id: string;
10699
+ /**
10700
+ * Reply To
10701
+ */
10702
+ reply_to?: string | null;
10703
+ /**
10704
+ * Subject
10705
+ */
10706
+ subject: string;
10707
+ /**
10708
+ * Vars
10709
+ *
10710
+ * One row's cells.
10711
+ */
10712
+ vars?: {
10713
+ [key: string]: string;
10714
+ };
10715
+ };
10716
+ /**
10717
+ * SendTestEmailResponse
10718
+ */
10719
+ export type SendTestEmailResponse = {
10720
+ /**
10721
+ * Provider Message Id
10722
+ */
10723
+ provider_message_id: string;
10724
+ /**
10725
+ * To
10726
+ */
10727
+ to: string;
10728
+ };
10466
10729
  /**
10467
10730
  * SendWhatsAppBatchRequest
10468
10731
  *
@@ -16800,6 +17063,10 @@ export type ConversationsAttachmentsGetResults = {
16800
17063
  } & ConversationImage) | ({
16801
17064
  kind: 'document';
16802
17065
  } & ConversationDocument) | ({
17066
+ kind: 'audio';
17067
+ } & ConversationAudio) | ({
17068
+ kind: 'contact';
17069
+ } & ConversationContact) | ({
16803
17070
  kind: 'file';
16804
17071
  } & ConversationFile);
16805
17072
  };
@@ -18322,6 +18589,46 @@ export type EmailSendersListResults = {
18322
18589
  200: VerifiedSendersResponse;
18323
18590
  };
18324
18591
  export type EmailSendersListResult = EmailSendersListResults[keyof EmailSendersListResults];
18592
+ export type EmailTestSendsCreateData = {
18593
+ body: SendTestEmailRequest;
18594
+ path?: never;
18595
+ query?: never;
18596
+ url: '/v1/email/test-sends';
18597
+ };
18598
+ export type EmailTestSendsCreateErrors = {
18599
+ /**
18600
+ * Well-formed, but rejected by a rule; `detail.errors` lists each problem.
18601
+ */
18602
+ 400: ErrorResponse;
18603
+ /**
18604
+ * Missing credential, or one that is revoked or no longer a member of this organization.
18605
+ */
18606
+ 401: ErrorResponse;
18607
+ /**
18608
+ * Authenticated, but this organization role may not perform the operation.
18609
+ */
18610
+ 403: ErrorResponse;
18611
+ /**
18612
+ * The resource's current state forbids this — a name already taken, a job already running.
18613
+ */
18614
+ 409: ErrorResponse;
18615
+ /**
18616
+ * The request did not match this operation's schema; `detail.errors` lists each field.
18617
+ */
18618
+ 422: ErrorResponse;
18619
+ /**
18620
+ * Unexpected error. Every error this API returns carries this body.
18621
+ */
18622
+ default: ErrorResponse;
18623
+ };
18624
+ export type EmailTestSendsCreateError = EmailTestSendsCreateErrors[keyof EmailTestSendsCreateErrors];
18625
+ export type EmailTestSendsCreateResults = {
18626
+ /**
18627
+ * Successful Response
18628
+ */
18629
+ 200: SendTestEmailResponse;
18630
+ };
18631
+ export type EmailTestSendsCreateResult = EmailTestSendsCreateResults[keyof EmailTestSendsCreateResults];
18325
18632
  export type FaqsListData = {
18326
18633
  body?: never;
18327
18634
  path?: never;