@ai-sdk/black-forest-labs 2.0.0-beta.8 → 2.0.0-canary.32

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,213 @@
1
1
  # @ai-sdk/black-forest-labs
2
2
 
3
+ ## 2.0.0-canary.32
4
+
5
+ ### Patch Changes
6
+
7
+ - 0c4c275: trigger initial canary release
8
+ - Updated dependencies [0c4c275]
9
+ - @ai-sdk/provider-utils@5.0.0-canary.31
10
+ - @ai-sdk/provider@4.0.0-canary.15
11
+
12
+ ## 2.0.0-beta.31
13
+
14
+ ### Major Changes
15
+
16
+ - 04e9009: chore: make provider implementations code patterns more consistent, including renaming certain exported symbols
17
+
18
+ For all externally exported symbols that were renamed, the old names continue to work via deprecated aliases.
19
+
20
+ ### Patch Changes
21
+
22
+ - Updated dependencies [08d2129]
23
+ - @ai-sdk/provider-utils@5.0.0-beta.30
24
+
25
+ ## 2.0.0-beta.30
26
+
27
+ ### Patch Changes
28
+
29
+ - 258c093: chore: ensure consistent import handling and avoid import duplicates or cycles
30
+ - Updated dependencies [9bd6512]
31
+ - Updated dependencies [258c093]
32
+ - Updated dependencies [b6783da]
33
+ - @ai-sdk/provider-utils@5.0.0-beta.29
34
+ - @ai-sdk/provider@4.0.0-beta.14
35
+
36
+ ## 2.0.0-beta.29
37
+
38
+ ### Patch Changes
39
+
40
+ - 9f0e36c: trigger release for all packages after provenance setup
41
+ - Updated dependencies [9f0e36c]
42
+ - @ai-sdk/provider@4.0.0-beta.13
43
+ - @ai-sdk/provider-utils@5.0.0-beta.28
44
+
45
+ ## 2.0.0-beta.28
46
+
47
+ ### Patch Changes
48
+
49
+ - Updated dependencies [785fe16]
50
+ - Updated dependencies [67df0a0]
51
+ - Updated dependencies [befb78c]
52
+ - Updated dependencies [0458559]
53
+ - Updated dependencies [5852c0a]
54
+ - Updated dependencies [fc92055]
55
+ - @ai-sdk/provider-utils@5.0.0-beta.27
56
+
57
+ ## 2.0.0-beta.27
58
+
59
+ ### Patch Changes
60
+
61
+ - Updated dependencies [2e98477]
62
+ - @ai-sdk/provider-utils@5.0.0-beta.26
63
+
64
+ ## 2.0.0-beta.26
65
+
66
+ ### Patch Changes
67
+
68
+ - Updated dependencies [eea8d98]
69
+ - @ai-sdk/provider-utils@5.0.0-beta.25
70
+
71
+ ## 2.0.0-beta.25
72
+
73
+ ### Patch Changes
74
+
75
+ - Updated dependencies [f807e45]
76
+ - @ai-sdk/provider-utils@5.0.0-beta.24
77
+
78
+ ## 2.0.0-beta.24
79
+
80
+ ### Patch Changes
81
+
82
+ - Updated dependencies [350ea38]
83
+ - @ai-sdk/provider-utils@5.0.0-beta.23
84
+
85
+ ## 2.0.0-beta.23
86
+
87
+ ### Patch Changes
88
+
89
+ - Updated dependencies [083947b]
90
+ - @ai-sdk/provider-utils@5.0.0-beta.22
91
+
92
+ ## 2.0.0-beta.22
93
+
94
+ ### Patch Changes
95
+
96
+ - Updated dependencies [add1126]
97
+ - @ai-sdk/provider-utils@5.0.0-beta.21
98
+
99
+ ## 2.0.0-beta.21
100
+
101
+ ### Patch Changes
102
+
103
+ - b3976a2: Add workflow serialization support to all provider models.
104
+
105
+ **`@ai-sdk/provider-utils`:** New `serializeModel()` helper that extracts only serializable properties from a model instance, filtering out functions and objects containing functions. Third-party provider authors can use this to add workflow support to their own models.
106
+
107
+ **All providers:** `headers` is now optional in provider config types. This is non-breaking — existing code that passes `headers` continues to work. Custom provider implementations that construct model configs manually can now omit `headers`, which is useful when models are deserialized from a workflow step boundary where auth is provided separately.
108
+
109
+ All provider model classes now include `WORKFLOW_SERIALIZE` and `WORKFLOW_DESERIALIZE` static methods, enabling them to cross workflow step boundaries without serialization errors.
110
+
111
+ - Updated dependencies [b3976a2]
112
+ - Updated dependencies [ff5eba1]
113
+ - @ai-sdk/provider-utils@5.0.0-beta.20
114
+ - @ai-sdk/provider@4.0.0-beta.12
115
+
116
+ ## 2.0.0-beta.20
117
+
118
+ ### Major Changes
119
+
120
+ - ef992f8: Remove CommonJS exports from all packages. All packages are now ESM-only (`"type": "module"`). Consumers using `require()` must switch to ESM `import` syntax.
121
+
122
+ ### Patch Changes
123
+
124
+ - Updated dependencies [ef992f8]
125
+ - @ai-sdk/provider@4.0.0-beta.11
126
+ - @ai-sdk/provider-utils@5.0.0-beta.19
127
+
128
+ ## 2.0.0-beta.19
129
+
130
+ ### Patch Changes
131
+
132
+ - Updated dependencies [90e2d8a]
133
+ - @ai-sdk/provider-utils@5.0.0-beta.18
134
+
135
+ ## 2.0.0-beta.18
136
+
137
+ ### Patch Changes
138
+
139
+ - Updated dependencies [3ae1786]
140
+ - @ai-sdk/provider-utils@5.0.0-beta.17
141
+
142
+ ## 2.0.0-beta.17
143
+
144
+ ### Patch Changes
145
+
146
+ - Updated dependencies [176466a]
147
+ - @ai-sdk/provider@4.0.0-beta.10
148
+ - @ai-sdk/provider-utils@5.0.0-beta.16
149
+
150
+ ## 2.0.0-beta.16
151
+
152
+ ### Patch Changes
153
+
154
+ - Updated dependencies [e311194]
155
+ - @ai-sdk/provider@4.0.0-beta.9
156
+ - @ai-sdk/provider-utils@5.0.0-beta.15
157
+
158
+ ## 2.0.0-beta.15
159
+
160
+ ### Patch Changes
161
+
162
+ - Updated dependencies [34bd95d]
163
+ - Updated dependencies [008271d]
164
+ - @ai-sdk/provider@4.0.0-beta.8
165
+ - @ai-sdk/provider-utils@5.0.0-beta.14
166
+
167
+ ## 2.0.0-beta.14
168
+
169
+ ### Patch Changes
170
+
171
+ - Updated dependencies [b0c2869]
172
+ - Updated dependencies [7e26e81]
173
+ - @ai-sdk/provider-utils@5.0.0-beta.13
174
+
175
+ ## 2.0.0-beta.13
176
+
177
+ ### Patch Changes
178
+
179
+ - Updated dependencies [46d1149]
180
+ - @ai-sdk/provider-utils@5.0.0-beta.12
181
+
182
+ ## 2.0.0-beta.12
183
+
184
+ ### Patch Changes
185
+
186
+ - Updated dependencies [6fd51c0]
187
+ - @ai-sdk/provider-utils@5.0.0-beta.11
188
+ - @ai-sdk/provider@4.0.0-beta.7
189
+
190
+ ## 2.0.0-beta.11
191
+
192
+ ### Patch Changes
193
+
194
+ - Updated dependencies [c29a26f]
195
+ - @ai-sdk/provider-utils@5.0.0-beta.10
196
+ - @ai-sdk/provider@4.0.0-beta.6
197
+
198
+ ## 2.0.0-beta.10
199
+
200
+ ### Patch Changes
201
+
202
+ - 38fc777: Add AI Gateway hint to provider READMEs
203
+
204
+ ## 2.0.0-beta.9
205
+
206
+ ### Patch Changes
207
+
208
+ - Updated dependencies [2e17091]
209
+ - @ai-sdk/provider-utils@5.0.0-beta.9
210
+
3
211
  ## 2.0.0-beta.8
4
212
 
5
213
  ### Patch Changes
package/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  The **[Black Forest Labs provider](https://ai-sdk.dev/providers/ai-sdk-providers/black-forest-labs)** for the [AI SDK](https://ai-sdk.dev/docs) adds image model support for the [Black Forest Labs API](https://docs.bfl.ai/).
4
4
 
5
+ > **Deploying to Vercel?** With Vercel's AI Gateway you can access Black Forest Labs (and hundreds of models from other providers) — no additional packages, API keys, or extra cost. [Get started with AI Gateway](https://vercel.com/ai-gateway).
6
+
5
7
  ## Setup
6
8
 
7
9
  The Black Forest Labs provider is available in the `@ai-sdk/black-forest-labs` module. You can install it with
package/dist/index.js CHANGED
@@ -1,41 +1,82 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
1
+ // src/black-forest-labs-provider.ts
2
+ import {
3
+ NoSuchModelError
4
+ } from "@ai-sdk/provider";
5
+ import {
6
+ loadApiKey,
7
+ withoutTrailingSlash,
8
+ withUserAgentSuffix
9
+ } from "@ai-sdk/provider-utils";
19
10
 
20
- // src/index.ts
21
- var index_exports = {};
22
- __export(index_exports, {
23
- VERSION: () => VERSION,
24
- blackForestLabs: () => blackForestLabs,
25
- createBlackForestLabs: () => createBlackForestLabs
26
- });
27
- module.exports = __toCommonJS(index_exports);
11
+ // src/black-forest-labs-image-model.ts
12
+ import {
13
+ combineHeaders,
14
+ createBinaryResponseHandler,
15
+ createJsonErrorResponseHandler,
16
+ createJsonResponseHandler,
17
+ createStatusCodeErrorResponseHandler,
18
+ delay,
19
+ getFromApi,
20
+ parseProviderOptions,
21
+ postJsonToApi,
22
+ resolve,
23
+ serializeModelOptions,
24
+ WORKFLOW_SERIALIZE,
25
+ WORKFLOW_DESERIALIZE
26
+ } from "@ai-sdk/provider-utils";
27
+ import { z as z2 } from "zod/v4";
28
28
 
29
- // src/black-forest-labs-provider.ts
30
- var import_provider = require("@ai-sdk/provider");
31
- var import_provider_utils2 = require("@ai-sdk/provider-utils");
29
+ // src/black-forest-labs-image-model-options.ts
30
+ import {
31
+ lazySchema,
32
+ zodSchema
33
+ } from "@ai-sdk/provider-utils";
34
+ import { z } from "zod/v4";
35
+ var blackForestLabsImageModelOptionsSchema = lazySchema(
36
+ () => zodSchema(
37
+ z.object({
38
+ imagePrompt: z.string().optional(),
39
+ imagePromptStrength: z.number().min(0).max(1).optional(),
40
+ /** @deprecated use prompt.images instead */
41
+ inputImage: z.string().optional(),
42
+ /** @deprecated use prompt.images instead */
43
+ inputImage2: z.string().optional(),
44
+ /** @deprecated use prompt.images instead */
45
+ inputImage3: z.string().optional(),
46
+ /** @deprecated use prompt.images instead */
47
+ inputImage4: z.string().optional(),
48
+ /** @deprecated use prompt.images instead */
49
+ inputImage5: z.string().optional(),
50
+ /** @deprecated use prompt.images instead */
51
+ inputImage6: z.string().optional(),
52
+ /** @deprecated use prompt.images instead */
53
+ inputImage7: z.string().optional(),
54
+ /** @deprecated use prompt.images instead */
55
+ inputImage8: z.string().optional(),
56
+ /** @deprecated use prompt.images instead */
57
+ inputImage9: z.string().optional(),
58
+ /** @deprecated use prompt.images instead */
59
+ inputImage10: z.string().optional(),
60
+ steps: z.number().int().positive().optional(),
61
+ guidance: z.number().min(0).optional(),
62
+ width: z.number().int().min(256).max(1920).optional(),
63
+ height: z.number().int().min(256).max(1920).optional(),
64
+ outputFormat: z.enum(["jpeg", "png"]).optional(),
65
+ promptUpsampling: z.boolean().optional(),
66
+ raw: z.boolean().optional(),
67
+ safetyTolerance: z.number().int().min(0).max(6).optional(),
68
+ webhookSecret: z.string().optional(),
69
+ webhookUrl: z.url().optional(),
70
+ pollIntervalMillis: z.number().int().positive().optional(),
71
+ pollTimeoutMillis: z.number().int().positive().optional()
72
+ })
73
+ )
74
+ );
32
75
 
33
76
  // src/black-forest-labs-image-model.ts
34
- var import_provider_utils = require("@ai-sdk/provider-utils");
35
- var import_v4 = require("zod/v4");
36
77
  var DEFAULT_POLL_INTERVAL_MILLIS = 500;
37
78
  var DEFAULT_POLL_TIMEOUT_MILLIS = 6e4;
38
- var BlackForestLabsImageModel = class {
79
+ var BlackForestLabsImageModel = class _BlackForestLabsImageModel {
39
80
  constructor(modelId, config) {
40
81
  this.modelId = modelId;
41
82
  this.config = config;
@@ -45,6 +86,15 @@ var BlackForestLabsImageModel = class {
45
86
  get provider() {
46
87
  return this.config.provider;
47
88
  }
89
+ static [WORKFLOW_SERIALIZE](model) {
90
+ return serializeModelOptions({
91
+ modelId: model.modelId,
92
+ config: model.config
93
+ });
94
+ }
95
+ static [WORKFLOW_DESERIALIZE](options) {
96
+ return new _BlackForestLabsImageModel(options.modelId, options.config);
97
+ }
48
98
  async getArgs({
49
99
  prompt,
50
100
  files,
@@ -70,7 +120,7 @@ var BlackForestLabsImageModel = class {
70
120
  details: "Black Forest Labs ignores size when aspectRatio is provided. Use the width and height provider options to specify dimensions for models that support them"
71
121
  });
72
122
  }
73
- const bflOptions = await (0, import_provider_utils.parseProviderOptions)({
123
+ const bflOptions = await parseProviderOptions({
74
124
  provider: "blackForestLabs",
75
125
  providerOptions,
76
126
  schema: blackForestLabsImageModelOptionsSchema
@@ -149,22 +199,22 @@ var BlackForestLabsImageModel = class {
149
199
  headers,
150
200
  abortSignal
151
201
  });
152
- const bflOptions = await (0, import_provider_utils.parseProviderOptions)({
202
+ const bflOptions = await parseProviderOptions({
153
203
  provider: "blackForestLabs",
154
204
  providerOptions,
155
205
  schema: blackForestLabsImageModelOptionsSchema
156
206
  });
157
207
  const currentDate = (_c = (_b = (_a = this.config._internal) == null ? void 0 : _a.currentDate) == null ? void 0 : _b.call(_a)) != null ? _c : /* @__PURE__ */ new Date();
158
- const combinedHeaders = (0, import_provider_utils.combineHeaders)(
159
- await (0, import_provider_utils.resolve)(this.config.headers),
208
+ const combinedHeaders = combineHeaders(
209
+ await resolve(this.config.headers),
160
210
  headers
161
211
  );
162
- const submit = await (0, import_provider_utils.postJsonToApi)({
212
+ const submit = await postJsonToApi({
163
213
  url: `${this.config.baseURL}/${this.modelId}`,
164
214
  headers: combinedHeaders,
165
215
  body,
166
216
  failedResponseHandler: bflFailedResponseHandler,
167
- successfulResponseHandler: (0, import_provider_utils.createJsonResponseHandler)(bflSubmitSchema),
217
+ successfulResponseHandler: createJsonResponseHandler(bflSubmitSchema),
168
218
  abortSignal,
169
219
  fetch: this.config.fetch
170
220
  });
@@ -186,12 +236,12 @@ var BlackForestLabsImageModel = class {
186
236
  pollTimeoutMillis: bflOptions == null ? void 0 : bflOptions.pollTimeoutMillis
187
237
  }
188
238
  });
189
- const { value: imageBytes, responseHeaders } = await (0, import_provider_utils.getFromApi)({
239
+ const { value: imageBytes, responseHeaders } = await getFromApi({
190
240
  url: imageUrl,
191
241
  headers: combinedHeaders,
192
242
  abortSignal,
193
- failedResponseHandler: (0, import_provider_utils.createStatusCodeErrorResponseHandler)(),
194
- successfulResponseHandler: (0, import_provider_utils.createBinaryResponseHandler)(),
243
+ failedResponseHandler: createStatusCodeErrorResponseHandler(),
244
+ successfulResponseHandler: createBinaryResponseHandler(),
195
245
  fetch: this.config.fetch
196
246
  });
197
247
  return {
@@ -241,11 +291,11 @@ var BlackForestLabsImageModel = class {
241
291
  url.searchParams.set("id", requestId);
242
292
  }
243
293
  for (let i = 0; i < maxPollAttempts; i++) {
244
- const { value } = await (0, import_provider_utils.getFromApi)({
294
+ const { value } = await getFromApi({
245
295
  url: url.toString(),
246
296
  headers,
247
297
  failedResponseHandler: bflFailedResponseHandler,
248
- successfulResponseHandler: (0, import_provider_utils.createJsonResponseHandler)(bflPollSchema),
298
+ successfulResponseHandler: createJsonResponseHandler(bflPollSchema),
249
299
  abortSignal,
250
300
  fetch: this.config.fetch
251
301
  });
@@ -267,51 +317,11 @@ var BlackForestLabsImageModel = class {
267
317
  if (status === "Error" || status === "Failed") {
268
318
  throw new Error("Black Forest Labs generation failed.");
269
319
  }
270
- await (0, import_provider_utils.delay)(pollIntervalMillis);
320
+ await delay(pollIntervalMillis);
271
321
  }
272
322
  throw new Error("Black Forest Labs generation timed out.");
273
323
  }
274
324
  };
275
- var blackForestLabsImageModelOptionsSchema = (0, import_provider_utils.lazySchema)(
276
- () => (0, import_provider_utils.zodSchema)(
277
- import_v4.z.object({
278
- imagePrompt: import_v4.z.string().optional(),
279
- imagePromptStrength: import_v4.z.number().min(0).max(1).optional(),
280
- /** @deprecated use prompt.images instead */
281
- inputImage: import_v4.z.string().optional(),
282
- /** @deprecated use prompt.images instead */
283
- inputImage2: import_v4.z.string().optional(),
284
- /** @deprecated use prompt.images instead */
285
- inputImage3: import_v4.z.string().optional(),
286
- /** @deprecated use prompt.images instead */
287
- inputImage4: import_v4.z.string().optional(),
288
- /** @deprecated use prompt.images instead */
289
- inputImage5: import_v4.z.string().optional(),
290
- /** @deprecated use prompt.images instead */
291
- inputImage6: import_v4.z.string().optional(),
292
- /** @deprecated use prompt.images instead */
293
- inputImage7: import_v4.z.string().optional(),
294
- /** @deprecated use prompt.images instead */
295
- inputImage8: import_v4.z.string().optional(),
296
- /** @deprecated use prompt.images instead */
297
- inputImage9: import_v4.z.string().optional(),
298
- /** @deprecated use prompt.images instead */
299
- inputImage10: import_v4.z.string().optional(),
300
- steps: import_v4.z.number().int().positive().optional(),
301
- guidance: import_v4.z.number().min(0).optional(),
302
- width: import_v4.z.number().int().min(256).max(1920).optional(),
303
- height: import_v4.z.number().int().min(256).max(1920).optional(),
304
- outputFormat: import_v4.z.enum(["jpeg", "png"]).optional(),
305
- promptUpsampling: import_v4.z.boolean().optional(),
306
- raw: import_v4.z.boolean().optional(),
307
- safetyTolerance: import_v4.z.number().int().min(0).max(6).optional(),
308
- webhookSecret: import_v4.z.string().optional(),
309
- webhookUrl: import_v4.z.url().optional(),
310
- pollIntervalMillis: import_v4.z.number().int().positive().optional(),
311
- pollTimeoutMillis: import_v4.z.number().int().positive().optional()
312
- })
313
- )
314
- );
315
325
  function convertSizeToAspectRatio(size) {
316
326
  const [wStr, hStr] = size.split("x");
317
327
  const width = Number(wStr);
@@ -332,30 +342,30 @@ function gcd(a, b) {
332
342
  }
333
343
  return x;
334
344
  }
335
- var bflSubmitSchema = import_v4.z.object({
336
- id: import_v4.z.string(),
337
- polling_url: import_v4.z.url(),
338
- cost: import_v4.z.number().nullish(),
339
- input_mp: import_v4.z.number().nullish(),
340
- output_mp: import_v4.z.number().nullish()
345
+ var bflSubmitSchema = z2.object({
346
+ id: z2.string(),
347
+ polling_url: z2.url(),
348
+ cost: z2.number().nullish(),
349
+ input_mp: z2.number().nullish(),
350
+ output_mp: z2.number().nullish()
341
351
  });
342
- var bflStatus = import_v4.z.union([
343
- import_v4.z.literal("Pending"),
344
- import_v4.z.literal("Ready"),
345
- import_v4.z.literal("Error"),
346
- import_v4.z.literal("Failed"),
347
- import_v4.z.literal("Request Moderated")
352
+ var bflStatus = z2.union([
353
+ z2.literal("Pending"),
354
+ z2.literal("Ready"),
355
+ z2.literal("Error"),
356
+ z2.literal("Failed"),
357
+ z2.literal("Request Moderated")
348
358
  ]);
349
- var bflPollSchema = import_v4.z.object({
359
+ var bflPollSchema = z2.object({
350
360
  status: bflStatus.optional(),
351
361
  state: bflStatus.optional(),
352
- details: import_v4.z.unknown().optional(),
353
- result: import_v4.z.object({
354
- sample: import_v4.z.url(),
355
- seed: import_v4.z.number().optional(),
356
- start_time: import_v4.z.number().optional(),
357
- end_time: import_v4.z.number().optional(),
358
- duration: import_v4.z.number().optional()
362
+ details: z2.unknown().optional(),
363
+ result: z2.object({
364
+ sample: z2.url(),
365
+ seed: z2.number().optional(),
366
+ start_time: z2.number().optional(),
367
+ end_time: z2.number().optional(),
368
+ duration: z2.number().optional()
359
369
  }).nullish()
360
370
  }).refine((v) => v.status != null || v.state != null, {
361
371
  message: "Missing status in Black Forest Labs poll response"
@@ -366,11 +376,11 @@ var bflPollSchema = import_v4.z.object({
366
376
  result: v.result
367
377
  };
368
378
  });
369
- var bflErrorSchema = import_v4.z.object({
370
- message: import_v4.z.string().optional(),
371
- detail: import_v4.z.any().optional()
379
+ var bflErrorSchema = z2.object({
380
+ message: z2.string().optional(),
381
+ detail: z2.any().optional()
372
382
  });
373
- var bflFailedResponseHandler = (0, import_provider_utils.createJsonErrorResponseHandler)({
383
+ var bflFailedResponseHandler = createJsonErrorResponseHandler({
374
384
  errorSchema: bflErrorSchema,
375
385
  errorToMessage: (error) => {
376
386
  var _a;
@@ -392,16 +402,16 @@ function bflErrorToMessage(error) {
392
402
  }
393
403
 
394
404
  // src/version.ts
395
- var VERSION = true ? "2.0.0-beta.8" : "0.0.0-test";
405
+ var VERSION = true ? "2.0.0-canary.32" : "0.0.0-test";
396
406
 
397
407
  // src/black-forest-labs-provider.ts
398
408
  var defaultBaseURL = "https://api.bfl.ai/v1";
399
409
  function createBlackForestLabs(options = {}) {
400
410
  var _a;
401
- const baseURL = (0, import_provider_utils2.withoutTrailingSlash)((_a = options.baseURL) != null ? _a : defaultBaseURL);
402
- const getHeaders = () => (0, import_provider_utils2.withUserAgentSuffix)(
411
+ const baseURL = withoutTrailingSlash((_a = options.baseURL) != null ? _a : defaultBaseURL);
412
+ const getHeaders = () => withUserAgentSuffix(
403
413
  {
404
- "x-key": (0, import_provider_utils2.loadApiKey)({
414
+ "x-key": loadApiKey({
405
415
  apiKey: options.apiKey,
406
416
  environmentVariableName: "BFL_API_KEY",
407
417
  description: "Black Forest Labs"
@@ -419,7 +429,7 @@ function createBlackForestLabs(options = {}) {
419
429
  pollTimeoutMillis: options.pollTimeoutMillis
420
430
  });
421
431
  const embeddingModel = (modelId) => {
422
- throw new import_provider.NoSuchModelError({
432
+ throw new NoSuchModelError({
423
433
  modelId,
424
434
  modelType: "embeddingModel"
425
435
  });
@@ -429,7 +439,7 @@ function createBlackForestLabs(options = {}) {
429
439
  imageModel: createImageModel,
430
440
  image: createImageModel,
431
441
  languageModel: (modelId) => {
432
- throw new import_provider.NoSuchModelError({
442
+ throw new NoSuchModelError({
433
443
  modelId,
434
444
  modelType: "languageModel"
435
445
  });
@@ -439,10 +449,9 @@ function createBlackForestLabs(options = {}) {
439
449
  };
440
450
  }
441
451
  var blackForestLabs = createBlackForestLabs();
442
- // Annotate the CommonJS export names for ESM import in node:
443
- 0 && (module.exports = {
452
+ export {
444
453
  VERSION,
445
454
  blackForestLabs,
446
455
  createBlackForestLabs
447
- });
456
+ };
448
457
  //# sourceMappingURL=index.js.map