langchain 0.0.169 → 0.0.171

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.
Files changed (97) hide show
  1. package/README.md +2 -2
  2. package/agents/format_scratchpad.cjs +1 -0
  3. package/agents/format_scratchpad.d.ts +1 -0
  4. package/agents/format_scratchpad.js +1 -0
  5. package/chat_models/llama_cpp.cjs +1 -0
  6. package/chat_models/llama_cpp.d.ts +1 -0
  7. package/chat_models/llama_cpp.js +1 -0
  8. package/dist/agents/agent.cjs +49 -1
  9. package/dist/agents/agent.d.ts +19 -1
  10. package/dist/agents/agent.js +47 -0
  11. package/dist/agents/executor.cjs +10 -1
  12. package/dist/agents/executor.d.ts +22 -8
  13. package/dist/agents/executor.js +11 -2
  14. package/dist/agents/format_scratchpad.cjs +25 -0
  15. package/dist/agents/format_scratchpad.d.ts +10 -0
  16. package/dist/agents/format_scratchpad.js +21 -0
  17. package/dist/agents/toolkits/aws_sfn.d.ts +4 -1
  18. package/dist/agents/toolkits/conversational_retrieval/openai_functions.d.ts +1 -1
  19. package/dist/agents/toolkits/json/json.d.ts +4 -1
  20. package/dist/agents/toolkits/openapi/openapi.cjs +8 -0
  21. package/dist/agents/toolkits/openapi/openapi.d.ts +12 -1
  22. package/dist/agents/toolkits/openapi/openapi.js +8 -0
  23. package/dist/agents/toolkits/sql/sql.d.ts +4 -1
  24. package/dist/agents/toolkits/vectorstore/vectorstore.d.ts +8 -2
  25. package/dist/agents/types.d.ts +13 -1
  26. package/dist/chains/sql_db/sql_db_chain.cjs +11 -0
  27. package/dist/chains/sql_db/sql_db_chain.d.ts +11 -0
  28. package/dist/chains/sql_db/sql_db_chain.js +11 -0
  29. package/dist/chat_models/baiduwenxin.cjs +12 -1
  30. package/dist/chat_models/baiduwenxin.d.ts +3 -1
  31. package/dist/chat_models/baiduwenxin.js +12 -1
  32. package/dist/chat_models/llama_cpp.cjs +243 -0
  33. package/dist/chat_models/llama_cpp.d.ts +94 -0
  34. package/dist/chat_models/llama_cpp.js +239 -0
  35. package/dist/document_loaders/web/assemblyai.cjs +63 -114
  36. package/dist/document_loaders/web/assemblyai.d.ts +38 -57
  37. package/dist/document_loaders/web/assemblyai.js +63 -100
  38. package/dist/document_loaders/web/pdf.cjs +23 -5
  39. package/dist/document_loaders/web/pdf.d.ts +9 -1
  40. package/dist/document_loaders/web/pdf.js +20 -2
  41. package/dist/graphs/neo4j_graph.cjs +14 -0
  42. package/dist/graphs/neo4j_graph.d.ts +14 -0
  43. package/dist/graphs/neo4j_graph.js +14 -0
  44. package/dist/llms/googlepalm.cjs +3 -0
  45. package/dist/llms/googlepalm.js +3 -0
  46. package/dist/load/import_constants.cjs +2 -0
  47. package/dist/load/import_constants.js +2 -0
  48. package/dist/load/import_map.cjs +3 -2
  49. package/dist/load/import_map.d.ts +1 -0
  50. package/dist/load/import_map.js +1 -0
  51. package/dist/memory/index.d.ts +1 -1
  52. package/dist/memory/index.js +1 -1
  53. package/dist/retrievers/parent_document.cjs +22 -2
  54. package/dist/retrievers/parent_document.d.ts +8 -1
  55. package/dist/retrievers/parent_document.js +22 -2
  56. package/dist/retrievers/time_weighted.cjs +1 -1
  57. package/dist/retrievers/time_weighted.d.ts +1 -1
  58. package/dist/retrievers/time_weighted.js +1 -1
  59. package/dist/schema/runnable/base.cjs +4 -1
  60. package/dist/schema/runnable/base.d.ts +1 -0
  61. package/dist/schema/runnable/base.js +4 -1
  62. package/dist/schema/runnable/passthrough.cjs +35 -1
  63. package/dist/schema/runnable/passthrough.d.ts +11 -1
  64. package/dist/schema/runnable/passthrough.js +34 -1
  65. package/dist/sql_db.cjs +14 -0
  66. package/dist/sql_db.d.ts +14 -0
  67. package/dist/sql_db.js +14 -0
  68. package/dist/storage/ioredis.cjs +2 -1
  69. package/dist/storage/ioredis.js +2 -1
  70. package/dist/storage/upstash_redis.cjs +155 -0
  71. package/dist/storage/upstash_redis.d.ts +59 -0
  72. package/dist/storage/upstash_redis.js +151 -0
  73. package/dist/storage/vercel_kv.cjs +2 -1
  74. package/dist/storage/vercel_kv.js +2 -1
  75. package/dist/types/assemblyai-types.cjs +0 -150
  76. package/dist/types/assemblyai-types.d.ts +4 -670
  77. package/dist/types/assemblyai-types.js +1 -149
  78. package/dist/util/stream.cjs +3 -0
  79. package/dist/util/stream.js +3 -0
  80. package/dist/vectorstores/cassandra.cjs +25 -4
  81. package/dist/vectorstores/cassandra.d.ts +11 -1
  82. package/dist/vectorstores/cassandra.js +25 -4
  83. package/dist/vectorstores/momento_vector_index.cjs +3 -15
  84. package/dist/vectorstores/momento_vector_index.d.ts +0 -8
  85. package/dist/vectorstores/momento_vector_index.js +3 -15
  86. package/dist/vectorstores/neo4j_vector.cjs +14 -0
  87. package/dist/vectorstores/neo4j_vector.d.ts +14 -0
  88. package/dist/vectorstores/neo4j_vector.js +14 -0
  89. package/dist/vectorstores/pgvector.cjs +1 -1
  90. package/dist/vectorstores/pgvector.js +1 -1
  91. package/package.json +37 -8
  92. package/storage/upstash_redis.cjs +1 -0
  93. package/storage/upstash_redis.d.ts +1 -0
  94. package/storage/upstash_redis.js +1 -0
  95. package/dist/util/assemblyai-client.cjs +0 -173
  96. package/dist/util/assemblyai-client.d.ts +0 -63
  97. package/dist/util/assemblyai-client.js +0 -170
@@ -1,670 +1,4 @@
1
- export type AssemblyAIOptions = {
2
- /**
3
- * The AssemblyAI API key. Alternatively, you can configure this as the `ASSEMBLYAI_API_KEY` environment variable.
4
- */
5
- apiKey: string;
6
- };
7
- /**
8
- * The parameters to create a Transcript in the AssemblyAI API.
9
- */
10
- export type CreateTranscriptParams = {
11
- /**
12
- * The URL of your media file to transcribe.
13
- */
14
- audio_url: string;
15
- /**
16
- * The language of your audio file. Possible values are found in [Supported Languages]{@link https://www.assemblyai.com/docs/Concepts/supported_languages}.
17
- * The default value is en_us.
18
- */
19
- language_code?: string;
20
- /**
21
- * Enable Automatic Punctuation, can be true or false
22
- */
23
- punctuate?: boolean;
24
- /**
25
- * Enable Text Formatting, can be true or false
26
- */
27
- format_text?: boolean;
28
- /**
29
- * Enable Dual Channel transcription, can be true or false
30
- */
31
- dual_channel?: boolean;
32
- /**
33
- * The URL we should send webhooks to when your transcript is complete
34
- */
35
- webhook_url?: string;
36
- /**
37
- * Defaults to null. Optionally allows a user to specify a header name and value to send back with a webhook call for added security.
38
- */
39
- webhook_auth_header_name?: string;
40
- /**
41
- * Defaults to null. Optionally allows a user to specify a header name and value to send back with a webhook call for added security.
42
- */
43
- webhook_auth_header_value?: string;
44
- /**
45
- * The point in time, in milliseconds, to begin transcription from in your media file
46
- */
47
- audio_start_from?: number;
48
- /**
49
- * The point in time, in milliseconds, to stop transcribing in your media file
50
- */
51
- audio_end_at?: number;
52
- /**
53
- * A list of custom vocabulary to boost transcription probability for. See [Custom vocabulary]{@link https://www.assemblyai.com/docs/Models/speech_recognition#custom-vocabulary} for more details.
54
- */
55
- word_boost?: string[];
56
- /**
57
- * The weight to apply to words/phrases in the word_boost array; can be "low", "default", or "high"
58
- */
59
- boost_param?: "low" | "default" | "high";
60
- /**
61
- * Filter profanity from the transcribed text, can be true or false
62
- */
63
- filter_profanity?: boolean;
64
- /**
65
- * Redact PII from the transcribed text using the Redact PII model, can be true or false
66
- */
67
- redact_pii?: boolean;
68
- /**
69
- * Generate a copy of the original media file with spoken PII "beeped" out, can be true or false. See [PII redaction]{@link https://www.assemblyai.com/docs/Models/pii_redaction} for more details.
70
- */
71
- redact_pii_audio?: boolean;
72
- /**
73
- * Controls the filetype of the audio created by redact_pii_audio. Currently supports mp3 (default) and wav. See [PII redaction]{@link https://www.assemblyai.com/docs/Models/pii_redaction} for more details.
74
- */
75
- redact_pii_audio_quality?: string;
76
- /**
77
- * The list of PII Redaction policies to enable. See [PII redaction]{@link https://www.assemblyai.com/docs/Models/pii_redaction} for more details.
78
- */
79
- redact_pii_policies?: (typeof PiiPolicy)[keyof typeof PiiPolicy];
80
- /**
81
- * The replacement logic for detected PII, can be "entity_type" or "hash". See [PII redaction]{@link https://www.assemblyai.com/docs/Models/pii_redaction} for more details.
82
- */
83
- redact_pii_sub?: "entity_type" | "hash";
84
- /**
85
- * Enable [Speaker diarization]{@link https://www.assemblyai.com/docs/Models/speaker_diarization}, can be true or false
86
- */
87
- speaker_labels?: boolean;
88
- /**
89
- * Defaults to null. Tells the speaker label model how many speakers it should attempt to identify, up to 10. See [Speaker diarization]{@link https://www.assemblyai.com/docs/Models/speaker_diarization} for more details.
90
- */
91
- speakers_expected?: number;
92
- /**
93
- * Enable [Content Moderation]{@link https://www.assemblyai.com/docs/Models/content_moderation}, can be true or false
94
- */
95
- content_safety?: boolean;
96
- /**
97
- * Enable [Topic Detection]{@link https://www.assemblyai.com/docs/Models/iab_classification}, can be true or false
98
- */
99
- iab_categories?: boolean;
100
- /**
101
- * Customize how words are spelled and formatted using to and from values
102
- */
103
- custom_spelling?: CustomSpelling[];
104
- /**
105
- * Transcribe Filler Words, like "umm", in your media file; can be true or false
106
- */
107
- disfluencies?: boolean;
108
- /**
109
- * Enable [Sentiment Analysis]{@link https://www.assemblyai.com/docs/Models/sentiment_analysis}, can be true or false
110
- */
111
- sentiment_analysis?: boolean;
112
- /**
113
- * Enable [Auto Chapters]{@link https://www.assemblyai.com/docs/Models/auto_chapters}, can be true or false
114
- */
115
- auto_chapters?: boolean;
116
- /**
117
- * Enable [Entity Detection]{@link https://www.assemblyai.com/docs/Models/entity_detection}, can be true or false
118
- */
119
- entity_detection?: boolean;
120
- /**
121
- * Defaults to null. Reject audio files that contain less than this fraction of speech.
122
- * Valid values are in the range [0, 1] inclusive.
123
- */
124
- speech_threshold?: number;
125
- } & Record<string, unknown>;
126
- /**
127
- * The list of PII Redaction policies to enable.
128
- * See [PII redaction]{@link https://www.assemblyai.com/docs/Models/pii_redaction} for more details.
129
- */
130
- export declare const PiiPolicy: {
131
- /**
132
- * Medical process, including treatments, procedures, and tests (e.g., heart surgery, CT scan)
133
- */
134
- readonly MedicalProcess: "medical_process";
135
- /**
136
- * Name of a medical condition, disease, syndrome, deficit, or disorder (e.g., chronic fatigue syndrome, arrhythmia, depression)
137
- */
138
- readonly MedicalCondition: "medical_condition";
139
- /**
140
- * Blood type (e.g., O-, AB positive)
141
- */
142
- readonly BloodType: "blood_type";
143
- /**
144
- * Medications, vitamins, or supplements (e.g., Advil, Acetaminophen, Panadol)
145
- */
146
- readonly Drug: "drug";
147
- /**
148
- * Bodily injury (e.g., I broke my arm, I have a sprained wrist)
149
- */
150
- readonly Injury: "injury";
151
- /**
152
- * A "lazy" rule that will redact any sequence of numbers equal to or greater than 2
153
- */
154
- readonly NumberSequence: "number_sequence";
155
- /**
156
- * Email address (e.g., support@assemblyai.com)
157
- */
158
- readonly EmailAddress: "email_address";
159
- /**
160
- * Date of Birth (e.g., Date of Birth: March 7,1961)
161
- */
162
- readonly DateOfBirth: "date_of_birth";
163
- /**
164
- * Telephone or fax number
165
- */
166
- readonly PhoneNumber: "phone_number";
167
- /**
168
- * Social Security Number or equivalent
169
- */
170
- readonly UsSocialSecurityNumber: "us_social_security_number";
171
- /**
172
- * Credit card number
173
- */
174
- readonly CreditCardNumber: "credit_card_number";
175
- /**
176
- * Expiration date of a credit card
177
- */
178
- readonly CreditCardExpiration: "credit_card_expiration";
179
- /**
180
- * Credit card verification code (e.g., CVV: 080)
181
- */
182
- readonly CreditCardCvv: "credit_card_cvv";
183
- /**
184
- * Specific calendar date (e.g., December 18)
185
- */
186
- readonly Date: "date";
187
- /**
188
- * Terms indicating nationality, ethnicity, or race (e.g., American, Asian, Caucasian)
189
- */
190
- readonly Nationality: "nationality";
191
- /**
192
- * Name of an event or holiday (e.g., Olympics, Yom Kippur)
193
- */
194
- readonly Event: "event";
195
- /**
196
- * Name of a natural language (e.g., Spanish, French)
197
- */
198
- readonly Language: "language";
199
- /**
200
- * Any Location reference including mailing address, postal code, city, state, province, or country
201
- */
202
- readonly Location: "location";
203
- /**
204
- * Name and/or amount of currency (e.g., 15 pesos, $94.50)
205
- */
206
- readonly MoneyAmount: "money_amount";
207
- /**
208
- * Name of a person (e.g., Bob, Doug Jones)
209
- */
210
- readonly PersonName: "person_name";
211
- /**
212
- * Number associated with an age (e.g., 27, 75)
213
- */
214
- readonly PersonAge: "person_age";
215
- /**
216
- * Name of an organization (e.g., CNN, McDonalds, University of Alaska)
217
- */
218
- readonly Organization: "organization";
219
- /**
220
- * Terms referring to a political party, movement, or ideology (e.g., Republican, Liberal)
221
- */
222
- readonly PoliticalAffiliation: "political_affiliation";
223
- /**
224
- * Job title or profession (e.g., professor, actors, engineer, CPA)
225
- */
226
- readonly Occupation: "occupation";
227
- /**
228
- * Terms indicating religious affiliation (e.g., Hindu, Catholic)
229
- */
230
- readonly Religion: "religion";
231
- /**
232
- * Driver’s license number (e.g., DL# 356933-540)
233
- */
234
- readonly DriversLicense: "drivers_license";
235
- /**
236
- * Banking information, including account and routing numbers
237
- */
238
- readonly BankingInformation: "banking_information";
239
- };
240
- /**
241
- * CustomSpelling specifies a mapping from a word or phrase to a new spelling or format.
242
- * CustomSpelling should include a `from` key, which specifies the word or phrase to be replaced,
243
- * and a `to` key, which specifies the new spelling or format.
244
- * Note that the value in the `to` key is case sensitive, but the value in the `from` key is not.
245
- * Additionally, the `to` key should only contain one word, while the `from` key can contain multiple words.
246
- */
247
- export type CustomSpelling = {
248
- from: string[];
249
- to: string;
250
- };
251
- /**
252
- * The transcript object returned by the AssemblyAI API.
253
- */
254
- export type Transcript = {
255
- /**
256
- * The unique identifier of your transcription
257
- */
258
- id: string;
259
- /**
260
- * The language model that was used for the transcription
261
- */
262
- language_model: string;
263
- /**
264
- * The acoustic model that was used for the transcription
265
- */
266
- acoustic_model: string;
267
- /**
268
- * The status of your transcription. Possible values are queued, processing, completed, or error
269
- */
270
- status: string;
271
- /**
272
- * The language of your audio file.
273
- * Possible values are found in [Supported Languages]{@link https://www.assemblyai.com/docs/Concepts/supported_languages}.
274
- * The default value is en_us.
275
- */
276
- language_code: string;
277
- /**
278
- * The URL of the media that was transcribed
279
- */
280
- audio_url: string;
281
- /**
282
- * The textual transcript of your media file
283
- */
284
- text: string;
285
- /**
286
- * An array of temporally-sequential word objects, one for each word in the transcript.
287
- * See [Speech recognition]{@link https://www.assemblyai.com/docs/Models/speech_recognition} for more information.
288
- */
289
- words: Word[] | null;
290
- /**
291
- * When dual_channel or speaker_labels is enabled, a list of turn-by-turn utterance objects.
292
- * See [Speaker diarization]{@link https://www.assemblyai.com/docs/Models/speaker_diarization} for more information.
293
- */
294
- utterances: TranscriptSegment[] | null;
295
- /**
296
- * The confidence score for the transcript, between 0.0 (low confidence) and 1.0 (high confidence)
297
- */
298
- confidence: number;
299
- /**
300
- * The duration of this transcript object's media file, in seconds
301
- */
302
- audio_duration: number;
303
- /**
304
- * Whether Automatic Punctuation was enabled in the transcription request, either true or false
305
- */
306
- punctuate: boolean;
307
- /**
308
- * Whether Text Formatting was enabled in the transcription request, either true or false
309
- */
310
- format_text: boolean;
311
- /**
312
- * Whether [Dual channel transcription]{@link https://www.assemblyai.com/docs/Models/speech_recognition#dual-channel-transcription} was enabled in the transcription request, either true or false
313
- */
314
- dual_channel: boolean | null;
315
- /**
316
- * The URL to which we send webhooks upon trancription completion, if provided in the transcription request
317
- */
318
- webhook_url: string | null;
319
- /**
320
- * The status code we received from your server when delivering your webhook, if a webhook URL was provided in the transcription request
321
- */
322
- webhook_status_code: string | null;
323
- /**
324
- * Whether webhook authentication details were provided in the transcription request
325
- */
326
- webhook_auth: boolean;
327
- /**
328
- * The header name which should be sent back with webhook calls, if provided in the transcription request
329
- */
330
- webhook_auth_header_name: string | null;
331
- /**
332
- * Whether speed boost was enabled in the transcription request
333
- * */
334
- speed_boost: boolean;
335
- /**
336
- * An array of results for the Key Phrases model, if it was enabled during the transcription request.
337
- * See [Key phrases]{@link https://www.assemblyai.com/docs/Models/key_phrases} for more information.
338
- */
339
- auto_highlights_result?: {
340
- /**
341
- * Will be either success, or unavailable in the rare case that the Key Phrases model failed
342
- */
343
- status: "success" | "unavailable";
344
- /**
345
- * A temporally-sequential array of Key Phrases
346
- */
347
- results: Array<{
348
- /**
349
- * The total number of times the i-th key phrase appears in the audio file
350
- */
351
- count: number;
352
- /**
353
- * The total relevancy to the overall audio file of this key phrase - a greater number means more relevant
354
- */
355
- rank: number;
356
- /**
357
- * The text itself of the key phrase
358
- */
359
- text: string;
360
- /**
361
- * The timestamp of the j-th appearance of the i-th key phrase
362
- */
363
- timestamps: Timestamp[];
364
- }>;
365
- } | null;
366
- /**
367
- * Whether Key Phrases was enabled in the transcription request, either true or false
368
- */
369
- auto_highlights: boolean;
370
- /**
371
- * The point in time, in milliseconds, in the file at which the transcription was started,
372
- * if provided in the transcription request
373
- */
374
- audio_start_from: number | null;
375
- /**
376
- * The point in time, in milliseconds, in the file at which the transcription was terminated,
377
- * if provided in the transcription request
378
- */
379
- audio_end_at: number | null;
380
- /**
381
- * The list of custom vocabulary to boost transcription probability for, if provided in the transcription request
382
- */
383
- word_boost: string[] | null;
384
- /**
385
- * The word boost parameter value, if provided in the transcription request
386
- */
387
- boost_param: string | null;
388
- /**
389
- * Whether [Profanity Filtering]{@link https://www.assemblyai.com/docs/Models/speech_recognition#profanity-filtering} was enabled in the transcription request, either true or false
390
- */
391
- filter_profanity: boolean;
392
- /**
393
- * Whether [PII Redaction]{@link https://www.assemblyai.com/docs/Models/pii_redaction} was enabled in the transcription request, either true or false
394
- */
395
- redact_pii: boolean;
396
- /**
397
- * Whether a redacted version of the audio file was generated (enabled or disabled in the transcription request),
398
- * either true or false. See [PII redaction]{@link https://www.assemblyai.com/docs/Models/pii_redaction} for more information.
399
- */
400
- redact_pii_audio: boolean;
401
- /**
402
- * The audio quality of the PII-redacted audio file, if enabled in the transcription request.
403
- * See [PII redaction]{@link https://www.assemblyai.com/docs/Models/pii_redaction} for more information.
404
- */
405
- redact_pii_audio_quality: string | null;
406
- /**
407
- * The list of PII Redaction policies that were enabled, if PII Redaction is enabled.
408
- * See [PII redaction]{@link https://www.assemblyai.com/docs/Models/pii_redaction} for more information.
409
- */
410
- redact_pii_policies: Array<(typeof PiiPolicy)[keyof typeof PiiPolicy]> | null;
411
- /**
412
- * Which replacement type was used to redact PII.
413
- * See [PII redaction]{@link https://www.assemblyai.com/docs/Models/pii_redaction} for more information.
414
- */
415
- redact_pii_sub: string | null;
416
- /**
417
- * Whether [Speaker diarization]{@link https://www.assemblyai.com/docs/Models/speaker_diarization} was enabled in the transcription request, either true or false
418
- */
419
- speaker_labels: boolean;
420
- /**
421
- * The value for the speaker_expected parameter in the transcription request, if provided.
422
- * See [Speaker diarization]{@link https://www.assemblyai.com/docs/Models/speaker_diarization} for more information.
423
- */
424
- speakers_expected: number | null;
425
- /**
426
- * Whether [Content Moderation]{@link https://www.assemblyai.com/docs/Models/content_moderation} was enabled in the transcription request, either true or false
427
- */
428
- content_safety: boolean;
429
- /**
430
- * Whether [Topic Detection]{@link https://www.assemblyai.com/docs/Models/iab_classification} was enabled in the transcription request, either true or false
431
- */
432
- iab_categories: boolean;
433
- /**
434
- * An array of results for the Content Moderation model, if it was enabled during the transcription request.
435
- * See [Content moderation]{@link https://www.assemblyai.com/docs/Models/content_moderation} for more information.
436
- */
437
- content_safety_labels?: unknown[];
438
- /**
439
- * An array of results for the Topic Detection model, if it was enabled during the transcription request.
440
- * See [Topic Detection]{@link https://www.assemblyai.com/docs/Models/iab_classification} for more information.
441
- */
442
- iab_categories_result: {
443
- /**
444
- * Will be either success, or unavailable in the rare case that the Content Moderation model failed
445
- */
446
- status: "success" | "unavailable";
447
- results: Array<{
448
- /**
449
- * The text in the transcript in which the i-th instance of a detected topic occurs
450
- */
451
- text: string;
452
- labels: Array<{
453
- /**
454
- * How relevant the j-th detected topic is in the i-th instance of a detected topic
455
- */
456
- relevance: number;
457
- /**
458
- * The IAB taxonomical label for the j-th label of the i-th instance of a detected topic, where > denotes supertopic/subtopic relationship
459
- */
460
- label: string;
461
- }>;
462
- timestamp: Timestamp;
463
- }>;
464
- /**
465
- * The overall relevance of topic to the entire audio file
466
- */
467
- summary: {
468
- [key: string]: number;
469
- };
470
- } | null;
471
- /**
472
- * Whether [Automatic language detection]{@link https://www.assemblyai.com/docs/Models/speech_recognition#automatic-language-detection} was enabled in the transcription request, either true or false
473
- */
474
- language_detection: boolean;
475
- /**
476
- * The custom spelling value passed in to the transcription request, if provided
477
- */
478
- custom_spelling: CustomSpelling[] | null;
479
- /**
480
- * Whether [Auto Chapters]{@link https://www.assemblyai.com/docs/Models/auto_chapters} was enabled in the transcription request, either true or false
481
- */
482
- auto_chapters: boolean;
483
- /**
484
- * Whether [Summarization]{@link https://www.assemblyai.com/docs/Models/summarization} was enabled in the transcription request, either true or false
485
- */
486
- summarization: boolean;
487
- /**
488
- * The type of summary generated, if [Summarization]{@link https://www.assemblyai.com/docs/Models/summarization} was enabled in the transcription request
489
- */
490
- summary_type: string | null;
491
- /**
492
- * The Summarization model used to generate the summary,
493
- * if [Summarization]{@link https://www.assemblyai.com/docs/Models/summarization} was enabled in the transcription request
494
- */
495
- summary_model: string | null;
496
- /**
497
- * Whether custom topics was enabled in the transcription request, either true or false
498
- */
499
- custom_topics: boolean;
500
- /**
501
- * The list of custom topics provided if custom topics was enabled in the transcription request
502
- */
503
- topics: string[] | null;
504
- /**
505
- * The value submitted for speech_threshold in the transcription request, if used. Otherwise, null.
506
- */
507
- speech_threshold: number | null;
508
- /**
509
- * Whether the transcription of disfluences was enabled in the transcription request, either true or false
510
- */
511
- disfluencies: boolean;
512
- /**
513
- * Whether [Sentiment Analysis]{@link https://www.assemblyai.com/docs/Models/sentiment_analysis} was enabled in the transcription request, either true or false
514
- */
515
- sentiment_analysis: boolean;
516
- /**
517
- * An array of results for the Sentiment Analysis model, if it was enabled during the transcription request.
518
- * See [Sentiment analysis]{@link https://www.assemblyai.com/docs/Models/sentiment_analysis} for more information.
519
- */
520
- sentiment_analysis_results: Array<{
521
- /**
522
- * The transcript of the sentence
523
- */
524
- text: string;
525
- /**
526
- * The starting time, in milliseconds, of the sentence
527
- */
528
- start: number;
529
- /**
530
- * The ending time, in milliseconds, of the sentence
531
- */
532
- end: number;
533
- /**
534
- * The detected sentiment for the sentence, one of POSITIVE, NEUTRAL, NEGATIVE
535
- */
536
- sentiment: "POSITIVE" | "NEUTRAL" | "NEGATIVE";
537
- /**
538
- * The confidence score for the detected sentiment of the sentence, from 0 to 1
539
- */
540
- confidence: number;
541
- /**
542
- * The speaker of the sentence if Speaker Diarization is enabled, else null
543
- */
544
- speaker: string | null;
545
- }> | null;
546
- /**
547
- * Whether [Entity detection]{@link https://www.assemblyai.com/docs/Models/entity_detection} was enabled in the transcription request, either true or false
548
- */
549
- entity_detection: boolean;
550
- /**
551
- * An array of results for the Entity Detection model, if it was enabled during the transcription request.
552
- * See [Entity detection]{@link https://www.assemblyai.com/docs/Models/entity_detection} for more information.
553
- */
554
- entities?: Array<{
555
- /**
556
- * The type of entity for the detected entity
557
- */
558
- entity_type: (typeof EntityType)[keyof typeof EntityType];
559
- /**
560
- * The text for the detected entity
561
- */
562
- text: string;
563
- /**
564
- * The starting time, in milliseconds, at which the detected entity appears in the audio file
565
- */
566
- start: number;
567
- /**
568
- * The ending time, in milliseconds, for the detected entity in the audio file
569
- */
570
- end: number;
571
- }> | null;
572
- /**
573
- * The generated summary of the media file, if [Summarization]{@link https://www.assemblyai.com/docs/Models/summarization} was enabled in the transcription request
574
- */
575
- summary: string | null;
576
- /**
577
- * True while a request is throttled and false when a request is no longer throttled
578
- */
579
- throttled: boolean | null;
580
- };
581
- export declare const EntityType: {
582
- readonly BloodType: "Blood type (e.g., O-, AB positive)";
583
- readonly CreditCardCvv: "Credit card verification code (e.g., CVV: 080)";
584
- readonly CreditCardExpiration: "Expiration date of a credit card";
585
- readonly CreditCardNumber: "Credit card number";
586
- readonly Date: "Specific calendar date (e.g., December 18)";
587
- readonly DateOfBirth: "Date of Birth (e.g., Date of Birth: March 7, 1961)";
588
- readonly Drug: "Medications, vitamins, or supplements (e.g., Advil, Acetaminophen, Panadol)";
589
- readonly Event: "Name of an event or holiday (e.g., Olympics, Yom Kippur)";
590
- readonly EmailAddress: "Email address (e.g., support@assemblyai.com)";
591
- readonly Injury: "Bodily injury (e.g., I broke my arm, I have a sprained wrist)";
592
- readonly Language: "Name of a natural language (e.g., Spanish, French)";
593
- readonly Location: "Any location reference including mailing address, postal code, city, state, province, or country";
594
- readonly MedicalCondition: "Name of a medical condition, disease, syndrome, deficit, or disorder (e.g., chronic fatigue syndrome, arrhythmia, depression)";
595
- readonly MedicalProcess: "Medical process, including treatments, procedures, and tests (e.g., heart surgery, CT scan)";
596
- readonly MoneyAmount: "Name and/or amount of currency (e.g., 15 pesos, $94.50)";
597
- readonly Nationality: "Terms indicating nationality, ethnicity, or race (e.g., American, Asian, Caucasian)";
598
- readonly Occupation: "Job title or profession (e.g., professor, actors, engineer, CPA)";
599
- readonly Organization: "Name of an organization (e.g., CNN, McDonalds, University of Alaska)";
600
- readonly PersonAge: "Number associated with an age (e.g., 27, 75)";
601
- readonly PersonName: "Name of a person (e.g., Bob, Doug Jones)";
602
- readonly PhoneNumber: "Telephone or fax number";
603
- readonly PoliticalAffiliation: "Terms referring to a political party, movement, or ideology (e.g., Republican, Liberal)";
604
- readonly Religion: "Terms indicating religious affiliation (e.g., Hindu, Catholic)";
605
- readonly UsSocialSecurityNumber: "Social Security Number or equivalent";
606
- readonly DriversLicense: "Driver's license number (e.g., DL #356933-540)";
607
- readonly BankingInformation: "Banking information, including account and routing numbers";
608
- };
609
- /**
610
- * A segment of a transcript.
611
- */
612
- export type TranscriptSegment = {
613
- text: string;
614
- start: number;
615
- end: number;
616
- confidence: number;
617
- speaker?: string;
618
- words: Word[];
619
- };
620
- /**
621
- * The paragraphs response for a transcript returned by the AssemblyAI API.
622
- */
623
- export type ParagraphsResponse = {
624
- id: string;
625
- confidence: number;
626
- audio_duration: number;
627
- paragraphs: TranscriptSegment[];
628
- };
629
- /**
630
- * The sentences response for a transcript returned by the AssemblyAI API.
631
- */
632
- export type SentencesResponse = {
633
- id: string;
634
- confidence: number;
635
- audio_duration: number;
636
- sentences: TranscriptSegment[];
637
- };
638
- /**
639
- * A word in a paragraph or sentence for a transcript returned by the AssemblyAI API.
640
- */
641
- export type Word = {
642
- text: string;
643
- start: number;
644
- end: number;
645
- confidence: number;
646
- speaker?: string;
647
- };
648
- export type Timestamp = {
649
- /**
650
- * The start of the timestamp in milliseconds.
651
- */
652
- start: number;
653
- /**
654
- * The end of the timestamp in milliseconds.
655
- */
656
- end: number;
657
- };
658
- /**
659
- * The error object returned by the AssemblyAI API.
660
- */
661
- export type ErrorBody = {
662
- error: string;
663
- };
664
- /**
665
- * The format of the subtitles.
666
- */
667
- export declare const SubtitleFormat: {
668
- readonly Srt: "srt";
669
- readonly Vtt: "vtt";
670
- };
1
+ import { BaseServiceParams } from "assemblyai";
2
+ import { Optional } from "./type-utils.js";
3
+ export type * from "assemblyai";
4
+ export type AssemblyAIOptions = Optional<BaseServiceParams, "apiKey">;