@ai-sdk/deepgram 3.1.21 → 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 CHANGED
@@ -1,5 +1,22 @@
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
+
12
+ ## 3.1.22
13
+
14
+ ### Patch Changes
15
+
16
+ - c2511c1: fix: use standards-compliant User-Agent header
17
+ - Updated dependencies [c2511c1]
18
+ - @ai-sdk/provider-utils@5.0.51
19
+
3
20
  ## 3.1.21
4
21
 
5
22
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -1,147 +1,155 @@
1
- import * as _ai_sdk_provider from '@ai-sdk/provider';
2
- import { TranscriptionModelV4, ProviderV4, SpeechModelV4 } from '@ai-sdk/provider';
3
- import { FetchFunction, WORKFLOW_SERIALIZE, WORKFLOW_DESERIALIZE } from '@ai-sdk/provider-utils';
4
- import { z } from 'zod/v4';
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
- provider: string;
8
- url: (options: {
9
- modelId: string;
10
- path: string;
11
- }) => string;
12
- headers?: () => Record<string, string | undefined>;
13
- fetch?: FetchFunction;
14
- generateId?: () => string;
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
- _internal?: {
21
- currentDate?: () => Date;
22
- };
21
+ _internal?: {
22
+ currentDate?: () => Date;
23
+ };
23
24
  }
24
25
  declare class DeepgramTranscriptionModel implements TranscriptionModelV4 {
25
- readonly modelId: DeepgramTranscriptionModelId;
26
- private readonly config;
27
- readonly specificationVersion = "v4";
28
- get provider(): string;
29
- static [WORKFLOW_SERIALIZE](model: DeepgramTranscriptionModel): {
30
- modelId: string;
31
- config: _ai_sdk_provider.JSONObject;
32
- };
33
- static [WORKFLOW_DESERIALIZE](options: {
34
- modelId: DeepgramTranscriptionModelId;
35
- config: DeepgramTranscriptionModelConfig;
36
- }): DeepgramTranscriptionModel;
37
- constructor(modelId: DeepgramTranscriptionModelId, config: DeepgramTranscriptionModelConfig);
38
- private getArgs;
39
- doGenerate(options: Parameters<TranscriptionModelV4['doGenerate']>[0]): Promise<Awaited<ReturnType<TranscriptionModelV4['doGenerate']>>>;
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
- (modelId: DeepgramTranscriptionModelId, settings?: {}): {
46
- transcription: DeepgramTranscriptionModel;
47
- };
48
- /**
49
- * Creates a model for transcription.
50
- */
51
- transcription(modelId: DeepgramTranscriptionModelId): TranscriptionModelV4;
52
- /**
53
- * Creates a model for speech generation.
54
- */
55
- speech(modelId: DeepgramSpeechModelId): SpeechModelV4;
56
- /**
57
- * @deprecated Use `embeddingModel` instead.
58
- */
59
- textEmbeddingModel(modelId: string): never;
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
- * API key for authenticating requests.
64
- */
65
- apiKey?: string;
66
- /**
67
- * Custom headers to include in the requests.
68
- */
69
- headers?: Record<string, string>;
70
- /**
71
- * Custom fetch implementation. You can use it as a middleware to intercept requests,
72
- * or to provide a custom fetch implementation for e.g. testing.
73
- */
74
- fetch?: FetchFunction;
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
- _internal?: {
87
- currentDate?: () => Date;
88
- };
90
+ _internal?: {
91
+ currentDate?: () => Date;
92
+ };
89
93
  }
90
- declare class DeepgramSpeechModel implements SpeechModelV4 {
91
- readonly modelId: DeepgramSpeechModelId;
92
- private readonly config;
93
- readonly specificationVersion = "v4";
94
- get provider(): string;
95
- static [WORKFLOW_SERIALIZE](model: DeepgramSpeechModel): {
96
- modelId: string;
97
- config: _ai_sdk_provider.JSONObject;
98
- };
99
- static [WORKFLOW_DESERIALIZE](options: {
100
- modelId: DeepgramSpeechModelId;
101
- config: DeepgramSpeechModelConfig;
102
- }): DeepgramSpeechModel;
103
- constructor(modelId: DeepgramSpeechModelId, config: DeepgramSpeechModelConfig);
104
- private getArgs;
105
- doGenerate(options: Parameters<SpeechModelV4['doGenerate']>[0]): Promise<Awaited<ReturnType<SpeechModelV4['doGenerate']>>>;
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
- bitRate: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>>;
110
- container: z.ZodOptional<z.ZodNullable<z.ZodString>>;
111
- encoding: z.ZodOptional<z.ZodNullable<z.ZodString>>;
112
- sampleRate: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
113
- callback: z.ZodOptional<z.ZodNullable<z.ZodString>>;
114
- callbackMethod: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
115
- POST: "POST";
116
- PUT: "PUT";
117
- }>>>;
118
- mipOptOut: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
119
- tag: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>;
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
- language: z.ZodOptional<z.ZodNullable<z.ZodString>>;
125
- detectLanguage: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
126
- smartFormat: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
127
- punctuate: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
128
- paragraphs: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
129
- summarize: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodLiteral<"v2">, z.ZodLiteral<false>]>>>;
130
- topics: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
131
- intents: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
132
- sentiment: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
133
- detectEntities: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
134
- redact: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>;
135
- replace: z.ZodOptional<z.ZodNullable<z.ZodString>>;
136
- search: z.ZodOptional<z.ZodNullable<z.ZodString>>;
137
- keyterm: z.ZodOptional<z.ZodNullable<z.ZodString>>;
138
- diarize: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
139
- utterances: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
140
- uttSplit: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
141
- fillerWords: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
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
- declare const VERSION: string;
146
-
147
- export { type DeepgramProvider, type DeepgramProviderSettings, type DeepgramSpeechModelOptions as DeepgramSpeechCallOptions, DeepgramSpeechModel, type DeepgramSpeechModelId, type DeepgramSpeechModelOptions, type DeepgramTranscriptionModelOptions, VERSION, createDeepgram, deepgram };
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"}