@absolutejs/voice-deepgram 0.0.2

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/README.md ADDED
@@ -0,0 +1,82 @@
1
+ # `@absolutejs/voice-deepgram`
2
+
3
+ Deepgram speech-to-text adapter for `@absolutejs/voice`.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ bun add @absolutejs/voice @absolutejs/voice-deepgram
9
+ ```
10
+
11
+ ## Setup
12
+
13
+ ```ts
14
+ import { deepgram } from '@absolutejs/voice-deepgram';
15
+
16
+ const stt = deepgram({
17
+ apiKey: process.env.DEEPGRAM_API_KEY!,
18
+ model: 'nova-3',
19
+ language: 'en-US',
20
+ punctuate: true,
21
+ smartFormat: true
22
+ });
23
+ ```
24
+
25
+ The adapter accepts `16kHz` mono `pcm_s16le` audio from core and forwards it to Deepgram without transcoding.
26
+
27
+ ## What It Maps
28
+
29
+ The adapter normalizes Deepgram events into the core `STTAdapter` contract.
30
+
31
+ - `Results` with `is_final=false` -> `partial`
32
+ - `Results` with `is_final=true` -> `final`
33
+ - `speech_final=true` -> normalized `endOfTurn`
34
+ - `UtteranceEnd` -> normalized `endOfTurn`
35
+ - Flux `EndOfTurn` or `EagerEndOfTurn` -> normalized `endOfTurn`
36
+ - SDK transport errors -> normalized `error`
37
+ - SDK socket close -> normalized `close`
38
+
39
+ ## Options
40
+
41
+ Supported options include:
42
+
43
+ - `apiKey`
44
+ - `model`
45
+ - `language`
46
+ - `punctuate`
47
+ - `smartFormat`
48
+ - `interimResults`
49
+ - `endpointing`
50
+ - `utteranceEndMs`
51
+ - `vadEvents`
52
+ - `diarize`
53
+ - `numerals`
54
+ - `profanityFilter`
55
+ - `redact`
56
+ - `keyterm` or `keyterms`
57
+ - `eotThreshold`
58
+ - `eagerEotThreshold`
59
+ - `eotTimeoutMs`
60
+ - `keepAliveMs`
61
+ - `tag`
62
+ - `extra`
63
+
64
+ Nova models typically use `endpointing`, `utteranceEndMs`, and `vadEvents`.
65
+
66
+ Flux models typically use:
67
+
68
+ - `eotThreshold`
69
+ - `eagerEotThreshold`
70
+ - `eotTimeoutMs`
71
+
72
+ ## API Key
73
+
74
+ Set `DEEPGRAM_API_KEY` in your runtime environment, or pass the key explicitly in the adapter config.
75
+
76
+ Deepgram references used for this adapter design:
77
+
78
+ - https://developers.deepgram.com/docs/audio-keep-alive
79
+ - https://developers.deepgram.com/docs/utterance-end
80
+ - https://developers.deepgram.com/docs/endpointing
81
+ - https://developers.deepgram.com/docs/flux/configuration
82
+ - https://www.npmjs.com/package/%40deepgram/sdk
@@ -0,0 +1,3 @@
1
+ import type { STTAdapter } from '@absolutejs/voice';
2
+ import type { DeepgramSTTOptions } from './types';
3
+ export declare const deepgram: (config: DeepgramSTTOptions) => STTAdapter;
@@ -0,0 +1,2 @@
1
+ export { deepgram } from './deepgram';
2
+ export type { DeepgramModel, DeepgramSTTOptions } from './types';