@ai-sdk/fireworks 3.0.62 → 3.0.63
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 +10 -0
- package/dist/index.d.ts +151 -145
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +362 -501
- package/dist/index.js.map +1 -1
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @ai-sdk/fireworks
|
|
2
2
|
|
|
3
|
+
## 3.0.63
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- ede5b89: chore: migrate package builds from tsup to tsdown
|
|
8
|
+
- Updated dependencies [ede5b89]
|
|
9
|
+
- @ai-sdk/openai-compatible@3.0.60
|
|
10
|
+
- @ai-sdk/provider@4.0.20
|
|
11
|
+
- @ai-sdk/provider-utils@5.0.52
|
|
12
|
+
|
|
3
13
|
## 3.0.62
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -1,167 +1,173 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
import { WORKFLOW_SERIALIZE, WORKFLOW_DESERIALIZE, FetchFunction, InferSchema } from '@ai-sdk/provider-utils';
|
|
6
|
-
|
|
1
|
+
import { FetchFunction, InferSchema, WORKFLOW_DESERIALIZE, WORKFLOW_SERIALIZE } from "@ai-sdk/provider-utils";
|
|
2
|
+
import { z } from "zod/v4";
|
|
3
|
+
import { EmbeddingModelV4, ImageModelV4, LanguageModelV4, ProviderV4 } from "@ai-sdk/provider";
|
|
4
|
+
//#region src/fireworks-chat-options.d.ts
|
|
7
5
|
type FireworksChatModelId = 'accounts/fireworks/models/deepseek-v3' | 'accounts/fireworks/models/llama-v3p3-70b-instruct' | 'accounts/fireworks/models/llama-v3p2-3b-instruct' | 'accounts/fireworks/models/llama-v3p1-405b-instruct' | 'accounts/fireworks/models/llama-v3p1-8b-instruct' | 'accounts/fireworks/models/mixtral-8x7b-instruct' | 'accounts/fireworks/models/mixtral-8x22b-instruct' | 'accounts/fireworks/models/mixtral-8x7b-instruct-hf' | 'accounts/fireworks/models/qwen2p5-coder-32b-instruct' | 'accounts/fireworks/models/qwen2p5-72b-instruct' | 'accounts/fireworks/models/qwen-qwq-32b-preview' | 'accounts/fireworks/models/qwen2-vl-72b-instruct' | 'accounts/fireworks/models/llama-v3p2-11b-vision-instruct' | 'accounts/fireworks/models/qwq-32b' | 'accounts/fireworks/models/yi-large' | 'accounts/fireworks/models/kimi-k2-instruct' | 'accounts/fireworks/models/kimi-k2-thinking' | 'accounts/fireworks/models/kimi-k2p6' | 'accounts/fireworks/models/minimax-m2' | (string & {});
|
|
8
6
|
declare const fireworksLanguageModelOptions: z.ZodObject<{
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}>>;
|
|
18
|
-
budgetTokens: z.ZodOptional<z.ZodNumber>;
|
|
19
|
-
}, z.core.$strip>>;
|
|
20
|
-
reasoningHistory: z.ZodOptional<z.ZodEnum<{
|
|
21
|
-
disabled: "disabled";
|
|
22
|
-
interleaved: "interleaved";
|
|
23
|
-
preserved: "preserved";
|
|
7
|
+
promptCacheKey: z.ZodOptional<z.ZodString>;
|
|
8
|
+
serviceTier: z.ZodOptional<z.ZodEnum<{
|
|
9
|
+
priority: "priority";
|
|
10
|
+
}>>;
|
|
11
|
+
thinking: z.ZodOptional<z.ZodObject<{
|
|
12
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
13
|
+
enabled: "enabled";
|
|
14
|
+
disabled: "disabled";
|
|
24
15
|
}>>;
|
|
16
|
+
budgetTokens: z.ZodOptional<z.ZodNumber>;
|
|
17
|
+
}, z.core.$strip>>;
|
|
18
|
+
reasoningHistory: z.ZodOptional<z.ZodEnum<{
|
|
19
|
+
disabled: "disabled";
|
|
20
|
+
interleaved: "interleaved";
|
|
21
|
+
preserved: "preserved";
|
|
22
|
+
}>>;
|
|
25
23
|
}, z.core.$strip>;
|
|
26
24
|
type FireworksLanguageModelOptions = z.infer<typeof fireworksLanguageModelOptions>;
|
|
27
|
-
|
|
25
|
+
//#endregion
|
|
26
|
+
//#region src/fireworks-embedding-options.d.ts
|
|
28
27
|
type FireworksEmbeddingModelId = 'nomic-ai/nomic-embed-text-v1.5' | (string & {});
|
|
29
28
|
declare const fireworksEmbeddingModelOptions: z.ZodObject<{}, z.core.$strip>;
|
|
30
29
|
type FireworksEmbeddingModelOptions = z.infer<typeof fireworksEmbeddingModelOptions>;
|
|
31
|
-
|
|
30
|
+
//#endregion
|
|
31
|
+
//#region src/fireworks-image-options.d.ts
|
|
32
32
|
type FireworksImageModelId = 'accounts/fireworks/models/flux-1-dev-fp8' | 'accounts/fireworks/models/flux-1-schnell-fp8' | 'accounts/fireworks/models/flux-kontext-pro' | 'accounts/fireworks/models/flux-kontext-max' | 'accounts/fireworks/models/playground-v2-5-1024px-aesthetic' | 'accounts/fireworks/models/japanese-stable-diffusion-xl' | 'accounts/fireworks/models/playground-v2-1024px-aesthetic' | 'accounts/fireworks/models/SSD-1B' | 'accounts/fireworks/models/stable-diffusion-xl-1024-v1-0' | (string & {});
|
|
33
|
-
|
|
33
|
+
//#endregion
|
|
34
|
+
//#region src/fireworks-image-model.d.ts
|
|
34
35
|
interface FireworksImageModelConfig {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
36
|
+
provider: string;
|
|
37
|
+
baseURL: string;
|
|
38
|
+
headers?: () => Record<string, string>;
|
|
39
|
+
fetch?: FetchFunction;
|
|
40
|
+
/**
|
|
41
|
+
* Poll interval in milliseconds between status checks for async models.
|
|
42
|
+
* Defaults to 500ms.
|
|
43
|
+
*/
|
|
44
|
+
pollIntervalMillis?: number;
|
|
45
|
+
/**
|
|
46
|
+
* Overall timeout in milliseconds for polling before giving up.
|
|
47
|
+
* Defaults to 120000ms (2 minutes).
|
|
48
|
+
*/
|
|
49
|
+
pollTimeoutMillis?: number;
|
|
50
|
+
_internal?: {
|
|
51
|
+
currentDate?: () => Date;
|
|
52
|
+
};
|
|
52
53
|
}
|
|
53
|
-
declare class FireworksImageModel implements ImageModelV4 {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
54
|
+
export declare class FireworksImageModel implements ImageModelV4 {
|
|
55
|
+
readonly modelId: FireworksImageModelId;
|
|
56
|
+
private config;
|
|
57
|
+
readonly specificationVersion = "v4";
|
|
58
|
+
readonly maxImagesPerCall = 1;
|
|
59
|
+
get supportsFileInputs(): boolean | undefined;
|
|
60
|
+
get supportsMaskInputs(): boolean | undefined;
|
|
61
|
+
get provider(): string;
|
|
62
|
+
static [WORKFLOW_SERIALIZE](model: FireworksImageModel): {
|
|
63
|
+
modelId: string;
|
|
64
|
+
config: import("@ai-sdk/provider").JSONObject;
|
|
65
|
+
};
|
|
66
|
+
static [WORKFLOW_DESERIALIZE](options: {
|
|
67
|
+
modelId: FireworksImageModelId;
|
|
68
|
+
config: FireworksImageModelConfig;
|
|
69
|
+
}): FireworksImageModel;
|
|
70
|
+
constructor(modelId: FireworksImageModelId, config: FireworksImageModelConfig);
|
|
71
|
+
doGenerate({ prompt, n, size, aspectRatio, seed, providerOptions, headers, abortSignal, files, mask }: Parameters<ImageModelV4['doGenerate']>[0]): Promise<Awaited<ReturnType<ImageModelV4['doGenerate']>>>;
|
|
72
|
+
/**
|
|
73
|
+
* Handles async image generation for models like flux-kontext-* that return
|
|
74
|
+
* a request_id and require polling for results.
|
|
75
|
+
*/
|
|
76
|
+
private doGenerateAsync;
|
|
77
|
+
/**
|
|
78
|
+
* Polls the get_result endpoint until the image is ready.
|
|
79
|
+
*/
|
|
80
|
+
private pollForImageUrl;
|
|
80
81
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
82
|
+
//#endregion
|
|
83
|
+
//#region src/fireworks-image-model-options.d.ts
|
|
84
|
+
declare const fireworksImageModelOptionsSchema: import("@ai-sdk/provider-utils").LazySchema<{
|
|
85
|
+
[x: string]: unknown;
|
|
86
|
+
guidance_scale?: number | undefined;
|
|
87
|
+
num_inference_steps?: number | undefined;
|
|
88
|
+
output_format?: "jpeg" | "png" | undefined;
|
|
89
|
+
webhook_url?: string | undefined;
|
|
90
|
+
webhook_secret?: string | undefined;
|
|
91
|
+
prompt_upsampling?: boolean | undefined;
|
|
92
|
+
safety_tolerance?: number | undefined;
|
|
93
|
+
cfg_scale?: number | undefined;
|
|
94
|
+
steps?: number | undefined;
|
|
93
95
|
}>;
|
|
94
96
|
type FireworksImageModelOptions = InferSchema<typeof fireworksImageModelOptionsSchema>;
|
|
95
|
-
|
|
97
|
+
//#endregion
|
|
98
|
+
//#region src/fireworks-completion-options.d.ts
|
|
96
99
|
type FireworksCompletionModelId = 'accounts/fireworks/models/llama-v3-8b-instruct' | 'accounts/fireworks/models/llama-v2-34b-code' | (string & {});
|
|
97
|
-
|
|
100
|
+
//#endregion
|
|
101
|
+
//#region src/fireworks-provider.d.ts
|
|
98
102
|
type FireworksErrorData = z.infer<typeof fireworksErrorSchema>;
|
|
99
103
|
declare const fireworksErrorSchema: z.ZodObject<{
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
104
|
+
error: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
105
|
+
message: z.ZodString;
|
|
106
|
+
object: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
107
|
+
type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
108
|
+
param: z.ZodOptional<z.ZodNullable<z.ZodAny>>;
|
|
109
|
+
code: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
|
|
110
|
+
}, z.core.$strip>]>;
|
|
107
111
|
}, z.core.$strip>;
|
|
108
112
|
interface FireworksProviderSettings {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
113
|
+
/**
|
|
114
|
+
* Fireworks API key. Default value is taken from the `FIREWORKS_API_KEY`
|
|
115
|
+
* environment variable.
|
|
116
|
+
*/
|
|
117
|
+
apiKey?: string;
|
|
118
|
+
/**
|
|
119
|
+
* Base URL for the API calls.
|
|
120
|
+
*/
|
|
121
|
+
baseURL?: string;
|
|
122
|
+
/**
|
|
123
|
+
* Custom headers to include in the requests.
|
|
124
|
+
*/
|
|
125
|
+
headers?: Record<string, string>;
|
|
126
|
+
/**
|
|
127
|
+
* Custom fetch implementation. You can use it as a middleware to intercept requests,
|
|
128
|
+
* or to provide a custom fetch implementation for e.g. testing.
|
|
129
|
+
*/
|
|
130
|
+
fetch?: FetchFunction;
|
|
127
131
|
}
|
|
128
132
|
interface FireworksProvider extends ProviderV4 {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
133
|
+
/**
|
|
134
|
+
* Creates a model for text generation.
|
|
135
|
+
*/
|
|
136
|
+
(modelId: FireworksChatModelId): LanguageModelV4;
|
|
137
|
+
/**
|
|
138
|
+
* Creates a chat model for text generation.
|
|
139
|
+
*/
|
|
140
|
+
chatModel(modelId: FireworksChatModelId): LanguageModelV4;
|
|
141
|
+
/**
|
|
142
|
+
* Creates a completion model for text generation.
|
|
143
|
+
*/
|
|
144
|
+
completionModel(modelId: FireworksCompletionModelId): LanguageModelV4;
|
|
145
|
+
/**
|
|
146
|
+
* Creates a chat model for text generation.
|
|
147
|
+
*/
|
|
148
|
+
languageModel(modelId: FireworksChatModelId): LanguageModelV4;
|
|
149
|
+
/**
|
|
150
|
+
* Creates a text embedding model for text generation.
|
|
151
|
+
*/
|
|
152
|
+
embeddingModel(modelId: FireworksEmbeddingModelId): EmbeddingModelV4;
|
|
153
|
+
/**
|
|
154
|
+
* @deprecated Use `embeddingModel` instead.
|
|
155
|
+
*/
|
|
156
|
+
textEmbeddingModel(modelId: FireworksEmbeddingModelId): EmbeddingModelV4;
|
|
157
|
+
/**
|
|
158
|
+
* Creates a model for image generation.
|
|
159
|
+
*/
|
|
160
|
+
image(modelId: FireworksImageModelId): ImageModelV4;
|
|
161
|
+
/**
|
|
162
|
+
* Creates a model for image generation.
|
|
163
|
+
*/
|
|
164
|
+
imageModel(modelId: FireworksImageModelId): ImageModelV4;
|
|
161
165
|
}
|
|
162
|
-
declare function createFireworks(options?: FireworksProviderSettings): FireworksProvider;
|
|
163
|
-
declare const fireworks: FireworksProvider;
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
166
|
+
export declare function createFireworks(options?: FireworksProviderSettings): FireworksProvider;
|
|
167
|
+
export declare const fireworks: FireworksProvider;
|
|
168
|
+
//#endregion
|
|
169
|
+
//#region src/version.d.ts
|
|
170
|
+
export declare const VERSION: string;
|
|
171
|
+
//#endregion
|
|
172
|
+
export type { FireworksEmbeddingModelId, FireworksEmbeddingModelOptions, FireworksEmbeddingModelOptions as FireworksEmbeddingProviderOptions, FireworksErrorData, FireworksImageModelId, FireworksImageModelOptions, FireworksLanguageModelOptions, FireworksLanguageModelOptions as FireworksProviderOptions, FireworksProvider, FireworksProviderSettings };
|
|
173
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/fireworks-chat-options.ts","../src/fireworks-embedding-options.ts","../src/fireworks-image-options.ts","../src/fireworks-image-model.ts","../src/fireworks-image-model-options.ts","../src/fireworks-completion-options.ts","../src/fireworks-provider.ts","../src/version.ts"],"mappings":";;;;KAIY;cAsBC,+BAA6B,EAAA;;;;;;;;;;;;;;;;;GAoBxC,EAAA,KAAA;KAEU,gCAAgC,EAAE,aACrC;;;KC9CG;cAIC,gCAA8B,EAAA,cAAA,EAAA,KAAA;KAE/B,iCAAiC,EAAE,aACtC;;;KCTG;;;UC8FF;EACR;EACA;EACA,gBAAgB;EAChB,QAAQ;;;;;EAKR;;;;;EAKA;EACA;IACE,oBAAoB;;;qBAIX,+BAA+B;WAgD/B,SAAS;UACV;WAhDD;WACA;MAEL;MAqBA;MAIA;UAII,oBAAoB,OAAO;;;;UAO3B,sBAAsB;IAC5B,SAAS;IACT,QAAQ;MACT;EAKU,YAAA,SAAS,uBACV,QAAQ;EAGZ,aACJ,QACA,GACA,MACA,aACA,MACA,iBACA,SACA,aACA,OACA,QACC,WAAW,iCAAiC,QAC7C,QAAQ,WAAW;;;;;UA2GP;;;;UAkEA;;;;cCzVH,mEAAgC;;;;;;;;;;;;KAmDjC,6BAA6B,mBAChC;;;KC1DG;;;KCyBA,qBAAqB,EAAE,aAAa;cAE1C,sBAAoB,EAAA;;;;;;;;GAWxB,EAAA,KAAA;UAQe;;;;;EAKf;;;;EAIA;;;;EAIA,UAAU;;;;;EAKV,QAAQ;;UAGO,0BAA0B;;;;GAIxC,SAAS,uBAAuB;;;;EAKjC,UAAU,SAAS,uBAAuB;;;;EAK1C,gBAAgB,SAAS,6BAA6B;;;;EAKtD,cAAc,SAAS,uBAAuB;;;;EAK9C,eAAe,SAAS,4BAA4B;;;;EAKpD,mBAAmB,SAAS,4BAA4B;;;;EAKxD,MAAM,SAAS,wBAAwB;;;;EAKvC,WAAW,SAAS,wBAAwB;;wBAK9B,gBACd,UAAS,4BACR;qBAqHU,WAAS;;;qBCrOT"}
|