@talqing/sdk 0.17.0 → 0.19.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
  *
@@ -6226,7 +6372,7 @@ export type ItemCreatedEvent = {
6226
6372
  /**
6227
6373
  * Attachments
6228
6374
  */
6229
- attachments: Array<ConversationImage | ConversationDocument | ConversationFile>;
6375
+ attachments: Array<ConversationImage | ConversationDocument | ConversationAudio | ConversationContact | ConversationFile>;
6230
6376
  /**
6231
6377
  * Attachments Not Kept
6232
6378
  *
@@ -10503,6 +10649,10 @@ export type STTCatalogEntryResponse = {
10503
10649
  * Default Language
10504
10650
  */
10505
10651
  default_language: string | null;
10652
+ /**
10653
+ * File Transcription
10654
+ */
10655
+ file_transcription: 'whole' | 'chunked' | null;
10506
10656
  /**
10507
10657
  * Label
10508
10658
  */
@@ -14983,6 +15133,60 @@ export type AgentsVersionsRollbackResults = {
14983
15133
 
14984
15134
  export type AgentsVersionsRollbackResult = AgentsVersionsRollbackResults[keyof AgentsVersionsRollbackResults];
14985
15135
 
15136
+ export type AttachmentsGetData = {
15137
+ body?: never;
15138
+ path: {
15139
+ /**
15140
+ * Attachment Id
15141
+ */
15142
+ attachment_id: string;
15143
+ };
15144
+ query?: never;
15145
+ url: '/v1/attachments/{attachment_id}';
15146
+ };
15147
+
15148
+ export type AttachmentsGetErrors = {
15149
+ /**
15150
+ * Missing credential, or one that is revoked or no longer a member of this organization.
15151
+ */
15152
+ 401: ErrorResponse;
15153
+ /**
15154
+ * No such resource in this organization.
15155
+ */
15156
+ 404: ErrorResponse;
15157
+ /**
15158
+ * The request did not match this operation's schema; `detail.errors` lists each field.
15159
+ */
15160
+ 422: ErrorResponse;
15161
+ /**
15162
+ * Unexpected error. Every error this API returns carries this body.
15163
+ */
15164
+ default: ErrorResponse;
15165
+ };
15166
+
15167
+ export type AttachmentsGetError = AttachmentsGetErrors[keyof AttachmentsGetErrors];
15168
+
15169
+ export type AttachmentsGetResults = {
15170
+ /**
15171
+ * Response Attachments.Get
15172
+ *
15173
+ * Successful Response
15174
+ */
15175
+ 200: ({
15176
+ kind: 'image';
15177
+ } & ConversationImage) | ({
15178
+ kind: 'document';
15179
+ } & ConversationDocument) | ({
15180
+ kind: 'audio';
15181
+ } & ConversationAudio) | ({
15182
+ kind: 'contact';
15183
+ } & ConversationContact) | ({
15184
+ kind: 'file';
15185
+ } & ConversationFile);
15186
+ };
15187
+
15188
+ export type AttachmentsGetResult = AttachmentsGetResults[keyof AttachmentsGetResults];
15189
+
14986
15190
  export type BillingCreditsGetData = {
14987
15191
  body?: never;
14988
15192
  path?: never;
@@ -17631,60 +17835,6 @@ export type ConversationsUpdateResults = {
17631
17835
 
17632
17836
  export type ConversationsUpdateResult = ConversationsUpdateResults[keyof ConversationsUpdateResults];
17633
17837
 
17634
- export type ConversationsAttachmentsGetData = {
17635
- body?: never;
17636
- path: {
17637
- /**
17638
- * Conversation Id
17639
- */
17640
- conversation_id: string;
17641
- /**
17642
- * Attachment Id
17643
- */
17644
- attachment_id: string;
17645
- };
17646
- query?: never;
17647
- url: '/v1/conversations/{conversation_id}/attachments/{attachment_id}';
17648
- };
17649
-
17650
- export type ConversationsAttachmentsGetErrors = {
17651
- /**
17652
- * Missing credential, or one that is revoked or no longer a member of this organization.
17653
- */
17654
- 401: ErrorResponse;
17655
- /**
17656
- * No such resource in this organization.
17657
- */
17658
- 404: ErrorResponse;
17659
- /**
17660
- * The request did not match this operation's schema; `detail.errors` lists each field.
17661
- */
17662
- 422: ErrorResponse;
17663
- /**
17664
- * Unexpected error. Every error this API returns carries this body.
17665
- */
17666
- default: ErrorResponse;
17667
- };
17668
-
17669
- export type ConversationsAttachmentsGetError = ConversationsAttachmentsGetErrors[keyof ConversationsAttachmentsGetErrors];
17670
-
17671
- export type ConversationsAttachmentsGetResults = {
17672
- /**
17673
- * Response Conversations.Attachments.Get
17674
- *
17675
- * Successful Response
17676
- */
17677
- 200: ({
17678
- kind: 'image';
17679
- } & ConversationImage) | ({
17680
- kind: 'document';
17681
- } & ConversationDocument) | ({
17682
- kind: 'file';
17683
- } & ConversationFile);
17684
- };
17685
-
17686
- export type ConversationsAttachmentsGetResult = ConversationsAttachmentsGetResults[keyof ConversationsAttachmentsGetResults];
17687
-
17688
17838
  export type ConversationsEventsData = {
17689
17839
  body?: never;
17690
17840
  path: {
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