@ai-sdk/deepgram 3.1.22 → 3.1.23
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 +9 -0
- package/dist/index.d.ts +128 -120
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +622 -707
- package/dist/index.js.map +1 -1
- package/docs/110-deepgram.mdx +1 -1
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @ai-sdk/deepgram
|
|
2
2
|
|
|
3
|
+
## 3.1.23
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- ede5b89: chore: migrate package builds from tsup to tsdown
|
|
8
|
+
- Updated dependencies [ede5b89]
|
|
9
|
+
- @ai-sdk/provider@4.0.20
|
|
10
|
+
- @ai-sdk/provider-utils@5.0.52
|
|
11
|
+
|
|
3
12
|
## 3.1.22
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -1,147 +1,155 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { ProviderV4, SpeechModelV4, TranscriptionModelV4 } from "@ai-sdk/provider";
|
|
2
|
+
import { FetchFunction, WORKFLOW_DESERIALIZE, WORKFLOW_SERIALIZE } from "@ai-sdk/provider-utils";
|
|
3
|
+
import { z } from "zod/v4";
|
|
4
|
+
//#region src/deepgram-config.d.ts
|
|
6
5
|
type DeepgramConfig = {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
6
|
+
provider: string;
|
|
7
|
+
url: (options: {
|
|
8
|
+
modelId: string;
|
|
9
|
+
path: string;
|
|
10
|
+
}) => string;
|
|
11
|
+
headers?: () => Record<string, string | undefined>;
|
|
12
|
+
fetch?: FetchFunction;
|
|
13
|
+
generateId?: () => string;
|
|
15
14
|
};
|
|
16
|
-
|
|
15
|
+
//#endregion
|
|
16
|
+
//#region src/deepgram-transcription-options.d.ts
|
|
17
17
|
type DeepgramTranscriptionModelId = 'base' | 'base-general' | 'base-meeting' | 'base-phonecall' | 'base-finance' | 'base-conversationalai' | 'base-voicemail' | 'base-video' | 'enhanced' | 'enhanced-general' | 'enhanced-meeting' | 'enhanced-phonecall' | 'enhanced-finance' | 'nova' | 'nova-general' | 'nova-phonecall' | 'nova-medical' | 'nova-2' | 'nova-2-general' | 'nova-2-meeting' | 'nova-2-phonecall' | 'nova-2-finance' | 'nova-2-conversationalai' | 'nova-2-voicemail' | 'nova-2-video' | 'nova-2-medical' | 'nova-2-drivethru' | 'nova-2-automotive' | 'nova-2-atc' | 'nova-3' | 'nova-3-general' | 'nova-3-medical' | (string & {});
|
|
18
|
-
|
|
18
|
+
//#endregion
|
|
19
|
+
//#region src/deepgram-transcription-model.d.ts
|
|
19
20
|
interface DeepgramTranscriptionModelConfig extends DeepgramConfig {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
_internal?: {
|
|
22
|
+
currentDate?: () => Date;
|
|
23
|
+
};
|
|
23
24
|
}
|
|
24
25
|
declare class DeepgramTranscriptionModel implements TranscriptionModelV4 {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
26
|
+
readonly modelId: DeepgramTranscriptionModelId;
|
|
27
|
+
private readonly config;
|
|
28
|
+
readonly specificationVersion = "v4";
|
|
29
|
+
get provider(): string;
|
|
30
|
+
static [WORKFLOW_SERIALIZE](model: DeepgramTranscriptionModel): {
|
|
31
|
+
modelId: string;
|
|
32
|
+
config: import("@ai-sdk/provider").JSONObject;
|
|
33
|
+
};
|
|
34
|
+
static [WORKFLOW_DESERIALIZE](options: {
|
|
35
|
+
modelId: DeepgramTranscriptionModelId;
|
|
36
|
+
config: DeepgramTranscriptionModelConfig;
|
|
37
|
+
}): DeepgramTranscriptionModel;
|
|
38
|
+
constructor(modelId: DeepgramTranscriptionModelId, config: DeepgramTranscriptionModelConfig);
|
|
39
|
+
private getArgs;
|
|
40
|
+
doGenerate(options: Parameters<TranscriptionModelV4['doGenerate']>[0]): Promise<Awaited<ReturnType<TranscriptionModelV4['doGenerate']>>>;
|
|
40
41
|
}
|
|
41
|
-
|
|
42
|
+
//#endregion
|
|
43
|
+
//#region src/deepgram-speech-options.d.ts
|
|
42
44
|
type DeepgramSpeechModelId = 'aura' | 'aura-2' | (string & {});
|
|
43
|
-
|
|
45
|
+
//#endregion
|
|
46
|
+
//#region src/deepgram-provider.d.ts
|
|
44
47
|
interface DeepgramProvider extends ProviderV4 {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
48
|
+
(modelId: DeepgramTranscriptionModelId, settings?: {}): {
|
|
49
|
+
transcription: DeepgramTranscriptionModel;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Creates a model for transcription.
|
|
53
|
+
*/
|
|
54
|
+
transcription(modelId: DeepgramTranscriptionModelId): TranscriptionModelV4;
|
|
55
|
+
/**
|
|
56
|
+
* Creates a model for speech generation.
|
|
57
|
+
*/
|
|
58
|
+
speech(modelId: DeepgramSpeechModelId): SpeechModelV4;
|
|
59
|
+
/**
|
|
60
|
+
* @deprecated Use `embeddingModel` instead.
|
|
61
|
+
*/
|
|
62
|
+
textEmbeddingModel(modelId: string): never;
|
|
60
63
|
}
|
|
61
64
|
interface DeepgramProviderSettings {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
65
|
+
/**
|
|
66
|
+
* API key for authenticating requests.
|
|
67
|
+
*/
|
|
68
|
+
apiKey?: string;
|
|
69
|
+
/**
|
|
70
|
+
* Custom headers to include in the requests.
|
|
71
|
+
*/
|
|
72
|
+
headers?: Record<string, string>;
|
|
73
|
+
/**
|
|
74
|
+
* Custom fetch implementation. You can use it as a middleware to intercept requests,
|
|
75
|
+
* or to provide a custom fetch implementation for e.g. testing.
|
|
76
|
+
*/
|
|
77
|
+
fetch?: FetchFunction;
|
|
75
78
|
}
|
|
76
79
|
/**
|
|
77
80
|
* Create an Deepgram provider instance.
|
|
78
81
|
*/
|
|
79
|
-
declare function createDeepgram(options?: DeepgramProviderSettings): DeepgramProvider;
|
|
82
|
+
export declare function createDeepgram(options?: DeepgramProviderSettings): DeepgramProvider;
|
|
80
83
|
/**
|
|
81
84
|
* Default Deepgram provider instance.
|
|
82
85
|
*/
|
|
83
|
-
declare const deepgram: DeepgramProvider;
|
|
84
|
-
|
|
86
|
+
export declare const deepgram: DeepgramProvider;
|
|
87
|
+
//#endregion
|
|
88
|
+
//#region src/deepgram-speech-model.d.ts
|
|
85
89
|
interface DeepgramSpeechModelConfig extends DeepgramConfig {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
90
|
+
_internal?: {
|
|
91
|
+
currentDate?: () => Date;
|
|
92
|
+
};
|
|
89
93
|
}
|
|
90
|
-
declare class DeepgramSpeechModel implements SpeechModelV4 {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
94
|
+
export declare class DeepgramSpeechModel implements SpeechModelV4 {
|
|
95
|
+
readonly modelId: DeepgramSpeechModelId;
|
|
96
|
+
private readonly config;
|
|
97
|
+
readonly specificationVersion = "v4";
|
|
98
|
+
get provider(): string;
|
|
99
|
+
static [WORKFLOW_SERIALIZE](model: DeepgramSpeechModel): {
|
|
100
|
+
modelId: string;
|
|
101
|
+
config: import("@ai-sdk/provider").JSONObject;
|
|
102
|
+
};
|
|
103
|
+
static [WORKFLOW_DESERIALIZE](options: {
|
|
104
|
+
modelId: DeepgramSpeechModelId;
|
|
105
|
+
config: DeepgramSpeechModelConfig;
|
|
106
|
+
}): DeepgramSpeechModel;
|
|
107
|
+
constructor(modelId: DeepgramSpeechModelId, config: DeepgramSpeechModelConfig);
|
|
108
|
+
private getArgs;
|
|
109
|
+
doGenerate(options: Parameters<SpeechModelV4['doGenerate']>[0]): Promise<Awaited<ReturnType<SpeechModelV4['doGenerate']>>>;
|
|
106
110
|
}
|
|
107
|
-
|
|
111
|
+
//#endregion
|
|
112
|
+
//#region src/deepgram-speech-model-options.d.ts
|
|
108
113
|
declare const deepgramSpeechModelOptionsSchema: z.ZodObject<{
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
114
|
+
bitRate: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>>;
|
|
115
|
+
container: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
116
|
+
encoding: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
117
|
+
sampleRate: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
118
|
+
callback: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
119
|
+
callbackMethod: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
120
|
+
POST: "POST";
|
|
121
|
+
PUT: "PUT";
|
|
122
|
+
}>>>;
|
|
123
|
+
mipOptOut: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
124
|
+
tag: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>;
|
|
120
125
|
}, z.core.$strip>;
|
|
121
126
|
type DeepgramSpeechModelOptions = z.infer<typeof deepgramSpeechModelOptionsSchema>;
|
|
122
|
-
|
|
127
|
+
//#endregion
|
|
128
|
+
//#region src/deepgram-transcription-model-options.d.ts
|
|
123
129
|
declare const deepgramTranscriptionModelOptionsSchema: z.ZodObject<{
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
130
|
+
language: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
131
|
+
detectLanguage: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
132
|
+
smartFormat: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
133
|
+
punctuate: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
134
|
+
paragraphs: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
135
|
+
summarize: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodLiteral<"v2">, z.ZodLiteral<false>]>>>;
|
|
136
|
+
topics: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
137
|
+
intents: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
138
|
+
sentiment: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
139
|
+
detectEntities: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
140
|
+
redact: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>;
|
|
141
|
+
replace: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
142
|
+
search: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
143
|
+
keyterm: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
144
|
+
diarize: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
145
|
+
utterances: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
146
|
+
uttSplit: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
147
|
+
fillerWords: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
142
148
|
}, z.core.$strip>;
|
|
143
149
|
type DeepgramTranscriptionModelOptions = z.infer<typeof deepgramTranscriptionModelOptionsSchema>;
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
150
|
+
//#endregion
|
|
151
|
+
//#region src/version.d.ts
|
|
152
|
+
export declare const VERSION: string;
|
|
153
|
+
//#endregion
|
|
154
|
+
export type { DeepgramProvider, DeepgramProviderSettings, DeepgramSpeechModelOptions as DeepgramSpeechCallOptions, DeepgramSpeechModelOptions, DeepgramSpeechModelId, DeepgramTranscriptionModelOptions };
|
|
155
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/deepgram-config.ts","../src/deepgram-transcription-options.ts","../src/deepgram-transcription-model.ts","../src/deepgram-speech-options.ts","../src/deepgram-provider.ts","../src/deepgram-speech-model.ts","../src/deepgram-speech-model-options.ts","../src/deepgram-transcription-model-options.ts","../src/version.ts"],"mappings":";;;;KAEY;EACV;EACA,MAAM;IAAW;IAAiB;;EAClC,gBAAgB;EAChB,QAAQ;EACR;;;;KCPU;;;UCiBF,yCAAyC;EACjD;IACE,oBAAoB;;;cAIX,sCAAsC;WAsBtC,SAAS;mBACD;WAtBV;MAEL;UAII,oBAAoB,OAAO;;;;UAO3B,sBAAsB;IAC5B,SAAS;IACT,QAAQ;MACT;EAKU,YAAA,SAAS,8BACD,QAAQ;UAGb;EAoDR,WACJ,SAAS,WAAW,yCACnB,QAAQ,QAAQ,WAAW;;;;KClGpB;;;UCYK,yBAAyB;GAEtC,SAAS,8BACT;IAEA,eAAe;;;;;EAMjB,cAAc,SAAS,+BAA+B;;;;EAKtD,OAAO,SAAS,wBAAwB;;;;EAKxC,mBAAmB;;UAGJ;;;;EAIf;;;;EAKA,UAAU;;;;;EAMV,QAAQ;;;;;wBAMM,eACd,UAAS,2BACR;;;;qBA0EU,UAAQ;;;UC3HX,kCAAkC;EAC1C;IACE,oBAAoB;;;qBASX,+BAA+B;WAsB/B,SAAS;mBACD;WAtBV;MAEL;UAII,oBAAoB,OAAO;;;;UAO3B,sBAAsB;IAC5B,SAAS;IACT,QAAQ;MACT;EAKU,YAAA,SAAS,uBACD,QAAQ;UAGb;EAoaR,WACJ,SAAS,WAAW,kCACnB,QAAQ,QAAQ,WAAW;;;;cCvdnB,kCAAgC,EAAA;;;;;;;;;;;;GAiB3C,EAAA,KAAA;KAEU,6BAA6B,EAAE,aAClC;;;cCpBI,yCAAuC,EAAA;;;;;;;;;;;;;;;;;;;GAqClD,EAAA,KAAA;KAEU,oCAAoC,EAAE,aACzC;;;qBCzCI"}
|