@ai-sdk/fish-audio 3.0.29 → 3.0.30

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,14 @@
1
1
  # @ai-sdk/fish-audio
2
2
 
3
+ ## 3.0.30
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.0.29
4
13
 
5
14
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -1,18 +1,18 @@
1
- import * as _ai_sdk_provider from '@ai-sdk/provider';
2
- import { SpeechModelV4, ProviderV4, TranscriptionModelV4 } 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/fish-audio-config.d.ts
6
5
  type FishAudioConfig = {
7
- provider: string;
8
- url: (options: {
9
- modelId: string;
10
- path: string;
11
- }) => string;
12
- headers?: () => Record<string, string | undefined>;
13
- fetch?: FetchFunction;
6
+ provider: string;
7
+ url: (options: {
8
+ modelId: string;
9
+ path: string;
10
+ }) => string;
11
+ headers?: () => Record<string, string | undefined>;
12
+ fetch?: FetchFunction;
14
13
  };
15
-
14
+ //#endregion
15
+ //#region src/fish-audio-speech-options.d.ts
16
16
  /**
17
17
  * Fish Audio TTS model IDs, sent via the `model` HTTP header.
18
18
  *
@@ -28,30 +28,32 @@ type FishAudioSpeechModelId = 's1' | 's2-pro' | 's2.1-pro' | 's2.1-pro-free' | (
28
28
  * voice library or one of your own uploaded models.
29
29
  */
30
30
  type FishAudioSpeechVoiceId = string;
31
-
31
+ //#endregion
32
+ //#region src/fish-audio-speech-model.d.ts
32
33
  interface FishAudioSpeechModelConfig extends FishAudioConfig {
33
- _internal?: {
34
- currentDate?: () => Date;
35
- };
34
+ _internal?: {
35
+ currentDate?: () => Date;
36
+ };
36
37
  }
37
- declare class FishAudioSpeechModel implements SpeechModelV4 {
38
- readonly modelId: FishAudioSpeechModelId;
39
- private readonly config;
40
- readonly specificationVersion = "v4";
41
- get provider(): string;
42
- static [WORKFLOW_SERIALIZE](model: FishAudioSpeechModel): {
43
- modelId: string;
44
- config: _ai_sdk_provider.JSONObject;
45
- };
46
- static [WORKFLOW_DESERIALIZE](options: {
47
- modelId: FishAudioSpeechModelId;
48
- config: FishAudioSpeechModelConfig;
49
- }): FishAudioSpeechModel;
50
- constructor(modelId: FishAudioSpeechModelId, config: FishAudioSpeechModelConfig);
51
- private getArgs;
52
- doGenerate(options: Parameters<SpeechModelV4['doGenerate']>[0]): Promise<Awaited<ReturnType<SpeechModelV4['doGenerate']>>>;
38
+ export declare class FishAudioSpeechModel implements SpeechModelV4 {
39
+ readonly modelId: FishAudioSpeechModelId;
40
+ private readonly config;
41
+ readonly specificationVersion = "v4";
42
+ get provider(): string;
43
+ static [WORKFLOW_SERIALIZE](model: FishAudioSpeechModel): {
44
+ modelId: string;
45
+ config: import("@ai-sdk/provider").JSONObject;
46
+ };
47
+ static [WORKFLOW_DESERIALIZE](options: {
48
+ modelId: FishAudioSpeechModelId;
49
+ config: FishAudioSpeechModelConfig;
50
+ }): FishAudioSpeechModel;
51
+ constructor(modelId: FishAudioSpeechModelId, config: FishAudioSpeechModelConfig);
52
+ private getArgs;
53
+ doGenerate(options: Parameters<SpeechModelV4['doGenerate']>[0]): Promise<Awaited<ReturnType<SpeechModelV4['doGenerate']>>>;
53
54
  }
54
-
55
+ //#endregion
56
+ //#region src/fish-audio-transcription-options.d.ts
55
57
  /**
56
58
  * Fish Audio transcription model ID.
57
59
  *
@@ -63,114 +65,120 @@ declare class FishAudioSpeechModel implements SpeechModelV4 {
63
65
  * https://docs.fish.audio/api-reference/endpoint/openapi-v1/speech-to-text
64
66
  */
65
67
  type FishAudioTranscriptionModelId = 'transcribe-1' | (string & {});
66
-
68
+ //#endregion
69
+ //#region src/fish-audio-provider.d.ts
67
70
  interface FishAudioProvider extends ProviderV4 {
68
- (modelId: FishAudioSpeechModelId, settings?: {}): {
69
- speech: FishAudioSpeechModel;
70
- };
71
- /**
72
- * Creates a model for speech generation.
73
- */
74
- speech(modelId: FishAudioSpeechModelId): SpeechModelV4;
75
- /**
76
- * Creates a model for speech generation.
77
- *
78
- * Narrowed to required: Fish Audio always provides speech models.
79
- */
80
- speechModel(modelId: FishAudioSpeechModelId): SpeechModelV4;
81
- /**
82
- * Creates a model for transcription.
83
- */
84
- transcription(modelId?: FishAudioTranscriptionModelId): TranscriptionModelV4;
85
- /**
86
- * Creates a model for transcription.
87
- *
88
- * Narrowed to required: Fish Audio always provides a transcription model.
89
- */
90
- transcriptionModel(modelId?: FishAudioTranscriptionModelId): TranscriptionModelV4;
71
+ (modelId: FishAudioSpeechModelId, settings?: {}): {
72
+ speech: FishAudioSpeechModel;
73
+ };
74
+ /**
75
+ * Creates a model for speech generation.
76
+ */
77
+ speech(modelId: FishAudioSpeechModelId): SpeechModelV4;
78
+ /**
79
+ * Creates a model for speech generation.
80
+ *
81
+ * Narrowed to required: Fish Audio always provides speech models.
82
+ */
83
+ speechModel(modelId: FishAudioSpeechModelId): SpeechModelV4;
84
+ /**
85
+ * Creates a model for transcription.
86
+ */
87
+ transcription(modelId?: FishAudioTranscriptionModelId): TranscriptionModelV4;
88
+ /**
89
+ * Creates a model for transcription.
90
+ *
91
+ * Narrowed to required: Fish Audio always provides a transcription model.
92
+ */
93
+ transcriptionModel(modelId?: FishAudioTranscriptionModelId): TranscriptionModelV4;
91
94
  }
92
95
  interface FishAudioProviderSettings {
93
- /**
94
- * API key for authenticating requests.
95
- */
96
- apiKey?: string;
97
- /**
98
- * Base URL for the API calls.
99
- */
100
- baseURL?: string;
101
- /**
102
- * Custom headers to include in the requests.
103
- */
104
- headers?: Record<string, string>;
105
- /**
106
- * Custom fetch implementation. You can use it as a middleware to intercept requests,
107
- * or to provide a custom fetch implementation for e.g. testing.
108
- */
109
- fetch?: FetchFunction;
96
+ /**
97
+ * API key for authenticating requests.
98
+ */
99
+ apiKey?: string;
100
+ /**
101
+ * Base URL for the API calls.
102
+ */
103
+ baseURL?: string;
104
+ /**
105
+ * Custom headers to include in the requests.
106
+ */
107
+ headers?: Record<string, string>;
108
+ /**
109
+ * Custom fetch implementation. You can use it as a middleware to intercept requests,
110
+ * or to provide a custom fetch implementation for e.g. testing.
111
+ */
112
+ fetch?: FetchFunction;
110
113
  }
111
114
  /**
112
115
  * Create a Fish Audio provider instance.
113
116
  */
114
- declare function createFishAudio(options?: FishAudioProviderSettings): FishAudioProvider;
117
+ export declare function createFishAudio(options?: FishAudioProviderSettings): FishAudioProvider;
115
118
  /**
116
119
  * Default Fish Audio provider instance.
117
120
  */
118
- declare const fishAudio: FishAudioProvider;
119
-
121
+ export declare const fishAudio: FishAudioProvider;
122
+ //#endregion
123
+ //#region src/fish-audio-transcription-model.d.ts
120
124
  interface FishAudioTranscriptionModelConfig extends FishAudioConfig {
121
- _internal?: {
122
- currentDate?: () => Date;
123
- };
125
+ _internal?: {
126
+ currentDate?: () => Date;
127
+ };
124
128
  }
125
- declare class FishAudioTranscriptionModel implements TranscriptionModelV4 {
126
- readonly modelId: FishAudioTranscriptionModelId;
127
- private readonly config;
128
- readonly specificationVersion = "v4";
129
- get provider(): string;
130
- static [WORKFLOW_SERIALIZE](model: FishAudioTranscriptionModel): {
131
- modelId: string;
132
- config: _ai_sdk_provider.JSONObject;
133
- };
134
- static [WORKFLOW_DESERIALIZE](options: {
135
- modelId: FishAudioTranscriptionModelId;
136
- config: FishAudioTranscriptionModelConfig;
137
- }): FishAudioTranscriptionModel;
138
- constructor(modelId: FishAudioTranscriptionModelId, config: FishAudioTranscriptionModelConfig);
139
- private getArgs;
140
- doGenerate(options: Parameters<TranscriptionModelV4['doGenerate']>[0]): Promise<Awaited<ReturnType<TranscriptionModelV4['doGenerate']>>>;
129
+ export declare class FishAudioTranscriptionModel implements TranscriptionModelV4 {
130
+ readonly modelId: FishAudioTranscriptionModelId;
131
+ private readonly config;
132
+ readonly specificationVersion = "v4";
133
+ get provider(): string;
134
+ static [WORKFLOW_SERIALIZE](model: FishAudioTranscriptionModel): {
135
+ modelId: string;
136
+ config: import("@ai-sdk/provider").JSONObject;
137
+ };
138
+ static [WORKFLOW_DESERIALIZE](options: {
139
+ modelId: FishAudioTranscriptionModelId;
140
+ config: FishAudioTranscriptionModelConfig;
141
+ }): FishAudioTranscriptionModel;
142
+ constructor(modelId: FishAudioTranscriptionModelId, config: FishAudioTranscriptionModelConfig);
143
+ private getArgs;
144
+ doGenerate(options: Parameters<TranscriptionModelV4['doGenerate']>[0]): Promise<Awaited<ReturnType<TranscriptionModelV4['doGenerate']>>>;
141
145
  }
142
-
146
+ //#endregion
147
+ //#region src/fish-audio-speech-model-options.d.ts
143
148
  declare const fishAudioSpeechModelOptionsSchema: z.ZodObject<{
144
- referenceId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
145
- sampleRate: z.ZodOptional<z.ZodNumber>;
146
- mp3Bitrate: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<64>, z.ZodLiteral<128>, z.ZodLiteral<192>]>>;
147
- opusBitrate: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<-1000>, z.ZodLiteral<24000>, z.ZodLiteral<32000>, z.ZodLiteral<48000>, z.ZodLiteral<64000>]>>;
148
- latency: z.ZodOptional<z.ZodEnum<{
149
- low: "low";
150
- normal: "normal";
151
- balanced: "balanced";
152
- }>>;
153
- volume: z.ZodOptional<z.ZodNumber>;
154
- normalizeLoudness: z.ZodOptional<z.ZodBoolean>;
155
- temperature: z.ZodOptional<z.ZodNumber>;
156
- topP: z.ZodOptional<z.ZodNumber>;
157
- chunkLength: z.ZodOptional<z.ZodNumber>;
158
- minChunkLength: z.ZodOptional<z.ZodNumber>;
159
- normalize: z.ZodOptional<z.ZodBoolean>;
160
- maxNewTokens: z.ZodOptional<z.ZodNumber>;
161
- repetitionPenalty: z.ZodOptional<z.ZodNumber>;
162
- conditionOnPreviousChunks: z.ZodOptional<z.ZodBoolean>;
163
- earlyStopThreshold: z.ZodOptional<z.ZodNumber>;
164
- features: z.ZodOptional<z.ZodArray<z.ZodString>>;
149
+ referenceId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
150
+ sampleRate: z.ZodOptional<z.ZodNumber>;
151
+ mp3Bitrate: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<64>, z.ZodLiteral<128>, z.ZodLiteral<192>]>>;
152
+ opusBitrate: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<-1000>, z.ZodLiteral<24000>, z.ZodLiteral<32000>, z.ZodLiteral<48000>, z.ZodLiteral<64000>]>>;
153
+ latency: z.ZodOptional<z.ZodEnum<{
154
+ low: "low";
155
+ normal: "normal";
156
+ balanced: "balanced";
157
+ }>>;
158
+ volume: z.ZodOptional<z.ZodNumber>;
159
+ normalizeLoudness: z.ZodOptional<z.ZodBoolean>;
160
+ temperature: z.ZodOptional<z.ZodNumber>;
161
+ topP: z.ZodOptional<z.ZodNumber>;
162
+ chunkLength: z.ZodOptional<z.ZodNumber>;
163
+ minChunkLength: z.ZodOptional<z.ZodNumber>;
164
+ normalize: z.ZodOptional<z.ZodBoolean>;
165
+ maxNewTokens: z.ZodOptional<z.ZodNumber>;
166
+ repetitionPenalty: z.ZodOptional<z.ZodNumber>;
167
+ conditionOnPreviousChunks: z.ZodOptional<z.ZodBoolean>;
168
+ earlyStopThreshold: z.ZodOptional<z.ZodNumber>;
169
+ features: z.ZodOptional<z.ZodArray<z.ZodString>>;
165
170
  }, z.core.$strip>;
166
171
  type FishAudioSpeechModelOptions = z.infer<typeof fishAudioSpeechModelOptionsSchema>;
167
-
172
+ //#endregion
173
+ //#region src/fish-audio-transcription-model-options.d.ts
168
174
  declare const fishAudioTranscriptionModelOptionsSchema: z.ZodObject<{
169
- language: z.ZodOptional<z.ZodString>;
170
- ignoreTimestamps: z.ZodOptional<z.ZodBoolean>;
175
+ language: z.ZodOptional<z.ZodString>;
176
+ ignoreTimestamps: z.ZodOptional<z.ZodBoolean>;
171
177
  }, z.core.$strip>;
172
178
  type FishAudioTranscriptionModelOptions = z.infer<typeof fishAudioTranscriptionModelOptionsSchema>;
173
-
174
- declare const VERSION: string;
175
-
176
- export { type FishAudioProvider, type FishAudioProviderSettings, FishAudioSpeechModel, type FishAudioSpeechModelId, type FishAudioSpeechModelOptions, type FishAudioSpeechVoiceId, FishAudioTranscriptionModel, type FishAudioTranscriptionModelId, type FishAudioTranscriptionModelOptions, VERSION, createFishAudio, fishAudio };
179
+ //#endregion
180
+ //#region src/version.d.ts
181
+ export declare const VERSION: string;
182
+ //#endregion
183
+ export type { FishAudioProvider, FishAudioProviderSettings, FishAudioSpeechModelId, FishAudioSpeechModelOptions, FishAudioSpeechVoiceId, FishAudioTranscriptionModelId, FishAudioTranscriptionModelOptions };
184
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/fish-audio-config.ts","../src/fish-audio-speech-options.ts","../src/fish-audio-speech-model.ts","../src/fish-audio-transcription-options.ts","../src/fish-audio-provider.ts","../src/fish-audio-transcription-model.ts","../src/fish-audio-speech-model-options.ts","../src/fish-audio-transcription-model-options.ts","../src/version.ts"],"mappings":";;;;KAEY;EACV;EACA,MAAM;IAAW;IAAiB;;EAClC,gBAAgB;EAChB,QAAQ;;;;;;;;;;;;;KCGE;;;;;KAWA;;;UCAF,mCAAmC;EAC3C;IACE,oBAAoB;;;qBA2CX,gCAAgC;WAsBhC,SAAS;mBACD;WAtBV;MAEL;UAII,oBAAoB,OAAO;;;;UAO3B,sBAAsB;IAC5B,SAAS;IACT,QAAQ;MACT;EAKU,YAAA,SAAS,wBACD,QAAQ;UAGb;EAqKR,WACJ,SAAS,WAAW,kCACnB,QAAQ,QAAQ,WAAW;;;;;;;;;;;;;;KCxPpB;;;UCOK,0BAA0B;GAEvC,SAAS,wBACT;IAEA,QAAQ;;;;;EAMV,OAAO,SAAS,yBAAyB;;;;;;EAOzC,YAAY,SAAS,yBAAyB;;;;EAK9C,cAAc,UAAU,gCAAgC;;;;;;EAOxD,mBACE,UAAU,gCACT;;UAGY;;;;EAIf;;;;EAKA;;;;EAKA,UAAU;;;;;EAMV,QAAQ;;;;;wBAQM,gBACd,UAAS,4BACR;;;;qBAgFU,WAAS;;;UChJZ,0CAA0C;EAClD;IACE,oBAAoB;;;qBAIX,uCAAuC;WAsBvC,SAAS;mBACD;WAtBV;MAEL;UAII,oBAAoB,OAAO;;;;UAO3B,sBAAsB;IAC5B,SAAS;IACT,QAAQ;MACT;EAKU,YAAA,SAAS,+BACD,QAAQ;UAGb;EAwCR,WACJ,SAAS,WAAW,yCACnB,QAAQ,QAAQ,WAAW;;;;cCzFnB,mCAAiC,EAAA;;;;;;;;;;;;;;;;;;;;;;GA2G5C,EAAA,KAAA;KAEU,8BAA8B,EAAE,aACnC;;;cC9GI,0CAAwC,EAAA;;;GAoBnD,EAAA,KAAA;KAEU,qCAAqC,EAAE,aAC1C;;;qBCxBI"}