assemblyai 3.1.3 → 4.0.0-beta.1

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.
package/CHANGELOG.md ADDED
@@ -0,0 +1,92 @@
1
+ # Changelog
2
+
3
+ ## [4.0.0]
4
+
5
+ ### Added
6
+
7
+ - Add `browser` and `workerd` (Cloudflare Workers) exports to package.json. These exports are compatible versions of the SDK, with a few limitations. You can't use the file system and you have to use a temporary auth token with the real-time transcriber.
8
+ - Add `dist/assemblyai.umd.js` and `dist/assemblyai.umd.min.js`. You can reference these script files directly in the browser and the SDK will be available at the global `assemblyai` variable.
9
+
10
+ ### Changed
11
+
12
+ - `RealtimeService.sendAudio` accepts audio via type `ArrayBufferLike`.
13
+ - **Breaking**: `RealtimeService.stream` returns a [WHATWG Streams Standard stream](https://nodejs.org/api/webstreams.html), instead of a Node stream. In the browser, the native web standard stream will be used.
14
+ - `ws` is used as the WebSocket client as before, but in the browser, the native WebSocket client is used.
15
+ - Rename Node SDK to JavaScript SDK as the SDK is compatible with more runtimes now.
16
+
17
+ ## [3.1.1] - 2023-11-21
18
+
19
+ ### Added
20
+
21
+ - Add `client.transcripts.transcribe` function to transcribe an audio file with polling until transcript status is `completed` or `error`. This function takes an `audio` option which can be an audio file URL, path, stream, or buffer.
22
+ - Add `client.transcripts.submit` function to queue a transcript. You can use `client.transcripts.waitUntilReady` to poll the transcript returned by `submit`. This function also takes an `audio` option which can be an audio file URL, path, stream, or buffer.
23
+
24
+ ### Changed
25
+
26
+ - Deprecated `client.transcripts.create` in favor of `transcribe` and `submit`, to be more consistent with other AssemblyAI SDKs.
27
+ - Renamed types
28
+ - Renamed `Parameters` type suffix with `Params` type suffix
29
+ - Renamed `CreateTranscriptParameters` to `TranscriptParams`
30
+ - Renamed `CreateTranscriptOptionalParameters` to `TranscriptOptionalParams`.
31
+ - Added deprecated aliases for the forementioned types
32
+ - Improved type docs
33
+
34
+ ## [3.1.0] - 2023-11-16
35
+
36
+ ### Added
37
+
38
+ - Add `AssemblyAI.transcripts.waitUntilReady` function to wait until a transcript is ready, meaning `status` is `completed` or `error`.
39
+ - Add `chars_per_caption` parameter to `AssemblyAI.transcripts.subtitles` function.
40
+ - Add `input_text` property to LeMUR functions. Instead of using `transcript_ids`, you can use `input_text` to provide custom formatted transcripts as input to LeMUR.
41
+
42
+ ### Changed
43
+
44
+ - Change default timeout from 3 minutes to infinite (-1). Fixes [#17](https://github.com/AssemblyAI/assemblyai-node-sdk/issues/17)
45
+
46
+ ### Fixed
47
+
48
+ - Correctly serialize the keywords for `client.transcripts.wordSearch`.
49
+ - Use more widely compatible syntax for wildcard exporting types. Fixes [#18](https://github.com/AssemblyAI/assemblyai-node-sdk/issues/18).
50
+
51
+ ## [3.0.1] - 2023-10-30
52
+
53
+ ### Changed
54
+
55
+ - The SDK uses `fetch` instead of Axios. This removes the Axios dependency. Axios relies on XMLHttpRequest which isn't supported in Cloudflare Workers, Deno, Bun, etc. By using `fetch`, the SDK is now more compatible on the forementioned runtimes.
56
+
57
+ ### Fixed
58
+
59
+ - The SDK uses relative imports instead of using path aliases, to make the library transpilable with tsc for consumers. Fixes [#14](https://github.com/AssemblyAI/assemblyai-node-sdk/issues/14).
60
+ - Added `speaker` property to the `TranscriptUtterance` type, and removed `channel` property.
61
+
62
+ ## [3.0.0] - 2023-10-24
63
+
64
+ ### Changed
65
+
66
+ - `AssemblyAI.files.upload` accepts streams and buffers, in addition to a string (path to file).
67
+
68
+ ### Removed
69
+
70
+ - **Breaking**: The module does not have a default export anymore, because of inconsistent functionality across module systems. Instead, use `AssemblyAI` as a named import like this: `import { AssemblyAI } from 'assemblyai'`.
71
+
72
+ ## [2.0.2] - 2023-10-13
73
+
74
+ ### Added
75
+
76
+ - `AssemblyAI.transcripts.wordSearch` searches for keywords in the transcript.
77
+ - `AssemblyAI.lemur.purgeRequestData` deletes data related to your LeMUR request.
78
+ - `RealtimeService.stream` creates a writable stream that you can write audio data to instead of using `RealtimeService.sendAudio``.
79
+
80
+ ### Fixed
81
+
82
+ - The AssemblyAI class would be exported as default named export instead in certain module systems.
83
+
84
+ ## [2.0.1] - 2023-10-10
85
+
86
+ Re-implement the Node SDK in TypeScript and add all AssemblyAI APIs.
87
+
88
+ ### Added
89
+
90
+ - Transcript API client
91
+ - LeMUR API client
92
+ - Real-time transcript client
package/README.md CHANGED
@@ -10,10 +10,11 @@
10
10
  [![Discord](https://img.shields.io/discord/875120158014853141?logo=discord&label=Discord&link=https%3A%2F%2Fdiscord.com%2Fchannels%2F875120158014853141&style=social)
11
11
  ](https://assemblyai.com/discord)
12
12
 
13
- # AssemblyAI Node.js SDK
13
+ # AssemblyAI JavaScript SDK
14
14
 
15
- The AssemblyAI Node.js SDK provides an easy-to-use interface for interacting with the AssemblyAI API,
15
+ The AssemblyAI JavaScript SDK provides an easy-to-use interface for interacting with the AssemblyAI API,
16
16
  which supports async and real-time transcription, as well as the latest LeMUR models.
17
+ It is written primarily for Node.js in TypeScript with all types exported, but also [compatible with other runtimes](./docs/compat.md).
17
18
 
18
19
  ## Installation
19
20
 
@@ -51,7 +52,7 @@ You can now use the `client` object to interact with the AssemblyAI API.
51
52
 
52
53
  ## Create a transcript
53
54
 
54
- When you create a transcript, you can either pass in a URL to an audio file, or upload a file directly.
55
+ When you create a transcript, you can either pass in a URL to an audio file or upload a file directly.
55
56
 
56
57
  ```javascript
57
58
  // Transcribe file at remote URL
@@ -242,10 +243,10 @@ getAudio((chunk) => {
242
243
  });
243
244
  ```
244
245
 
245
- Or send audio data via a stream by piping to the realtime stream.
246
+ Or send audio data via a stream by piping to the real-time stream.
246
247
 
247
248
  ```typescript
248
- audioStream.pipe(rt.stream());
249
+ audioStream.pipeTo(rt.stream());
249
250
  ```
250
251
 
251
252
  Close the connection when you're finished.