@ai-sdk/fireworks 3.0.101 → 3.0.102
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 +178 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +433 -411
- package/dist/index.js.map +1 -1
- package/package.json +9 -5
- package/src/fireworks-model-catalog.ts +595 -252
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/fireworks-model-catalog.ts","../src/fireworks-image-api.ts","../src/fireworks-image-model-options.ts","../src/fireworks-image-model.ts","../src/version.ts","../src/fireworks-provider.ts"],"sourcesContent":["import type {\n OpenAICompatibleLanguageModelChatOptions,\n OpenAICompatibleLanguageModelCompletionOptions,\n OpenAICompatibleEmbeddingModelOptions,\n} from '@ai-sdk/openai-compatible';\nimport type {\n ModelCapabilities,\n ModelEntry,\n ProviderOptionDefinition,\n ProviderOptionDefinitions,\n} from '@ai-sdk/provider';\nimport type { FireworksLanguageModelOptions } from './fireworks-chat-options';\nimport type { FireworksEmbeddingModelOptions } from './fireworks-embedding-options';\nimport type { FireworksImageModelOptions } from './fireworks-image-model-options';\nimport type { FireworksImageModelId } from './fireworks-image-options';\nconst compatiblelanguageProviderOptions = {\n user: {\n description:\n 'A unique identifier representing your end-user, which can help providers to\\nmonitor and detect abuse.',\n },\n reasoningEffort: {\n description:\n 'Reasoning effort for reasoning models. Defaults to `medium`.\\n\\nSet to `null` to send `\"reasoning_effort\": null`, for providers that treat\\nan explicit `null` differently from an omitted field.',\n },\n textVerbosity: {\n description:\n 'Controls the verbosity of the generated text. Defaults to `medium`.',\n },\n strictJsonSchema: {\n description:\n 'Whether to use strict JSON schema validation.\\nWhen true, the model uses constrained decoding to guarantee schema compliance.\\nOnly used when the provider supports structured outputs and a schema is provided.',\n },\n echo: { description: 'Echo back the prompt in addition to the completion.' },\n logitBias: {\n description:\n 'Modify the likelihood of specified tokens appearing in the completion.\\n\\nAccepts a JSON object that maps tokens (specified by their token ID in\\nthe GPT tokenizer) to an associated bias value from -100 to 100.',\n },\n suffix: {\n description: 'The suffix that comes after a completion of inserted text.',\n },\n} satisfies Record<\n | keyof OpenAICompatibleLanguageModelChatOptions\n | keyof OpenAICompatibleLanguageModelCompletionOptions,\n ProviderOptionDefinition\n>;\n\nconst compatibleembeddingProviderOptions = {\n dimensions: {\n description:\n 'The number of dimensions the resulting output embeddings should have.\\nOnly supported in text-embedding-3 and later models.',\n },\n user: {\n description:\n 'A unique identifier representing your end-user, which can help providers to\\nmonitor and detect abuse.',\n },\n} satisfies Record<\n keyof OpenAICompatibleEmbeddingModelOptions,\n ProviderOptionDefinition\n>;\n\n/** Known options accepted under providerOptions; open-ended extension keys remain undeclared. */\nexport const fireworksProviderOptions = {\n language: {\n ...compatiblelanguageProviderOptions,\n promptCacheKey: {\n description:\n 'A stable key for routing requests with shared prompt prefixes to the same prompt cache.',\n },\n serviceTier: {\n description:\n 'Use Fireworks Priority serving path for higher reliability during peak traffic.',\n },\n thinking: { description: 'thinking' },\n reasoningHistory: { description: 'reasoningHistory' },\n } satisfies Record<\n keyof FireworksLanguageModelOptions,\n ProviderOptionDefinition\n >,\n embedding: {\n ...compatibleembeddingProviderOptions,\n } satisfies Record<\n keyof FireworksEmbeddingModelOptions,\n ProviderOptionDefinition\n >,\n image: {\n guidance_scale: {\n description:\n 'Classifier-free guidance scale for the image diffusion process.',\n },\n num_inference_steps: {\n description:\n 'Number of denoising steps for the image generation process.',\n },\n output_format: { description: 'Desired output image format.' },\n webhook_url: {\n description:\n 'URL to receive webhook notifications for async Kontext requests.',\n },\n webhook_secret: {\n description: 'Secret for webhook signature verification.',\n },\n prompt_upsampling: {\n description:\n 'Whether Fireworks should automatically modify the prompt for more creative generation.',\n },\n safety_tolerance: {\n description: 'Moderation tolerance level for inputs and outputs.',\n },\n cfg_scale: {\n description: 'Guidance scale for legacy image_generation models.',\n },\n steps: {\n description:\n 'Number of generation steps for legacy image_generation models.',\n },\n } satisfies Record<\n keyof FireworksImageModelOptions,\n ProviderOptionDefinition\n >,\n} as const satisfies ProviderOptionDefinitions;\n\nconst languageDefinitions = {\n 'accounts/fireworks/models/deepseek-v3': { endpoints: ['chat'] },\n 'accounts/fireworks/models/llama-v3p3-70b-instruct': { endpoints: ['chat'] },\n 'accounts/fireworks/models/llama-v3p2-3b-instruct': { endpoints: ['chat'] },\n 'accounts/fireworks/models/llama-v3p1-405b-instruct': { endpoints: ['chat'] },\n 'accounts/fireworks/models/llama-v3p1-8b-instruct': { endpoints: ['chat'] },\n 'accounts/fireworks/models/mixtral-8x7b-instruct': { endpoints: ['chat'] },\n 'accounts/fireworks/models/mixtral-8x22b-instruct': { endpoints: ['chat'] },\n 'accounts/fireworks/models/mixtral-8x7b-instruct-hf': { endpoints: ['chat'] },\n 'accounts/fireworks/models/qwen2p5-coder-32b-instruct': {\n endpoints: ['chat'],\n },\n 'accounts/fireworks/models/qwen2p5-72b-instruct': { endpoints: ['chat'] },\n 'accounts/fireworks/models/qwen-qwq-32b-preview': { endpoints: ['chat'] },\n 'accounts/fireworks/models/qwen2-vl-72b-instruct': { endpoints: ['chat'] },\n 'accounts/fireworks/models/llama-v3p2-11b-vision-instruct': {\n endpoints: ['chat'],\n },\n 'accounts/fireworks/models/qwq-32b': { endpoints: ['chat'] },\n 'accounts/fireworks/models/yi-large': { endpoints: ['chat'] },\n 'accounts/fireworks/models/kimi-k2-instruct': { endpoints: ['chat'] },\n 'accounts/fireworks/models/kimi-k2-thinking': { endpoints: ['chat'] },\n 'accounts/fireworks/models/kimi-k2p6': { endpoints: ['chat'] },\n 'accounts/fireworks/models/minimax-m2': { endpoints: ['chat'] },\n 'accounts/fireworks/models/llama-v3-8b-instruct': {\n endpoints: ['completion'],\n },\n 'accounts/fireworks/models/llama-v2-34b-code': { endpoints: ['completion'] },\n} as const;\nconst embeddingModelIds = ['nomic-ai/nomic-embed-text-v1.5'] as const;\nconst imageModelIds = [\n 'accounts/fireworks/models/flux-1-dev-fp8',\n 'accounts/fireworks/models/flux-1-schnell-fp8',\n 'accounts/fireworks/models/flux-kontext-pro',\n 'accounts/fireworks/models/flux-kontext-max',\n 'accounts/fireworks/models/playground-v2-5-1024px-aesthetic',\n 'accounts/fireworks/models/japanese-stable-diffusion-xl',\n 'accounts/fireworks/models/playground-v2-1024px-aesthetic',\n 'accounts/fireworks/models/SSD-1B',\n 'accounts/fireworks/models/stable-diffusion-xl-1024-v1-0',\n] as const;\nconst documentedLanguageCapabilities: Record<\n string,\n NonNullable<ModelCapabilities['language']>\n> = {\n 'accounts/fireworks/models/firefunction-v1': {\n inputs: { image: false, audio: 'unknown' },\n objectGeneration: true,\n tools: { usage: true, streaming: true },\n reasoning: { support: 'unknown' },\n sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },\n },\n 'accounts/fireworks/models/deepseek-r1': {\n inputs: { image: false, audio: 'unknown' },\n objectGeneration: true,\n tools: { usage: false, streaming: false },\n reasoning: { support: 'unknown' },\n sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },\n },\n 'accounts/fireworks/models/deepseek-v3': {\n inputs: { image: false, audio: 'unknown' },\n objectGeneration: true,\n tools: { usage: true, streaming: false },\n reasoning: { support: 'unknown' },\n sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },\n },\n 'accounts/fireworks/models/llama-v3p1-405b-instruct': {\n inputs: { image: false, audio: 'unknown' },\n objectGeneration: true,\n tools: { usage: true, streaming: true },\n reasoning: { support: 'unknown' },\n sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },\n },\n 'accounts/fireworks/models/llama-v3p1-8b-instruct': {\n inputs: { image: false, audio: 'unknown' },\n objectGeneration: true,\n tools: { usage: true, streaming: false },\n reasoning: { support: 'unknown' },\n sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },\n },\n 'accounts/fireworks/models/llama-v3p2-3b-instruct': {\n inputs: { image: false, audio: 'unknown' },\n objectGeneration: true,\n tools: { usage: true, streaming: false },\n reasoning: { support: 'unknown' },\n sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },\n },\n 'accounts/fireworks/models/llama-v3p3-70b-instruct': {\n inputs: { image: false, audio: 'unknown' },\n objectGeneration: true,\n tools: { usage: true, streaming: false },\n reasoning: { support: 'unknown' },\n sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },\n },\n 'accounts/fireworks/models/mixtral-8x7b-instruct': {\n inputs: { image: false, audio: 'unknown' },\n objectGeneration: true,\n tools: { usage: true, streaming: false },\n reasoning: { support: 'unknown' },\n sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },\n },\n 'accounts/fireworks/models/mixtral-8x7b-instruct-hf': {\n inputs: { image: false, audio: 'unknown' },\n objectGeneration: true,\n tools: { usage: true, streaming: false },\n reasoning: { support: 'unknown' },\n sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },\n },\n 'accounts/fireworks/models/mixtral-8x22b-instruct': {\n inputs: { image: false, audio: 'unknown' },\n objectGeneration: true,\n tools: { usage: true, streaming: false },\n reasoning: { support: 'unknown' },\n sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },\n },\n 'accounts/fireworks/models/qwen2p5-coder-32b-instruct': {\n inputs: { image: false, audio: 'unknown' },\n objectGeneration: true,\n tools: { usage: true, streaming: false },\n reasoning: { support: 'unknown' },\n sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },\n },\n 'accounts/fireworks/models/qwen2p5-72b-instruct': {\n inputs: { image: false, audio: 'unknown' },\n objectGeneration: true,\n tools: { usage: true, streaming: false },\n reasoning: { support: 'unknown' },\n sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },\n },\n 'accounts/fireworks/models/qwen-qwq-32b-preview': {\n inputs: { image: false, audio: 'unknown' },\n objectGeneration: true,\n tools: { usage: false, streaming: false },\n reasoning: { support: 'unknown' },\n sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },\n },\n 'accounts/fireworks/models/qwen2-vl-72b-instruct': {\n inputs: { image: true, audio: 'unknown' },\n objectGeneration: true,\n tools: { usage: false, streaming: false },\n reasoning: { support: 'unknown' },\n sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },\n },\n 'accounts/fireworks/models/llama-v3p2-11b-vision-instruct': {\n inputs: { image: true, audio: 'unknown' },\n objectGeneration: true,\n tools: { usage: true, streaming: false },\n reasoning: { support: 'unknown' },\n sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },\n },\n 'accounts/fireworks/models/qwq-32b': {\n inputs: { image: false, audio: 'unknown' },\n objectGeneration: true,\n tools: { usage: false, streaming: false },\n reasoning: { support: 'unknown' },\n sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },\n },\n 'accounts/fireworks/models/yi-large': {\n inputs: { image: false, audio: 'unknown' },\n objectGeneration: true,\n tools: { usage: true, streaming: false },\n reasoning: { support: 'unknown' },\n sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },\n },\n 'accounts/fireworks/models/kimi-k2-instruct': {\n inputs: { image: false, audio: 'unknown' },\n objectGeneration: true,\n tools: { usage: true, streaming: false },\n reasoning: { support: 'unknown' },\n sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },\n },\n 'accounts/fireworks/models/kimi-k2-thinking': {\n inputs: { image: false, audio: 'unknown' },\n objectGeneration: true,\n tools: { usage: true, streaming: false },\n reasoning: { support: 'unknown' },\n sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },\n },\n 'accounts/fireworks/models/kimi-k2p6': {\n inputs: { image: true, audio: 'unknown' },\n objectGeneration: true,\n tools: { usage: true, streaming: false },\n reasoning: { support: 'unknown' },\n sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },\n },\n 'accounts/fireworks/models/minimax-m2': {\n inputs: { image: false, audio: 'unknown' },\n objectGeneration: true,\n tools: { usage: true, streaming: false },\n reasoning: { support: 'unknown' },\n sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },\n },\n};\nconst unknownLanguageCapabilities: NonNullable<ModelCapabilities['language']> =\n {\n inputs: { image: 'unknown', audio: 'unknown' },\n objectGeneration: 'unknown',\n tools: { usage: 'unknown', streaming: 'unknown' },\n reasoning: { support: 'unknown' },\n sampling: { temperature: 'unknown', topP: 'unknown', logprobs: 'unknown' },\n };\n\n// Model families that always reason and reject reasoning effort 'none'.\nconst modelsWithoutNoneReasoningEffort = /^(?:gpt-oss|glm-5p3|muse-spark)/;\n\n// Model families that reject reasoning effort 'minimal'.\nconst modelsWithoutMinimalReasoningEffort = /^(?:nemotron|inkling)/;\n\n/**\n * Fireworks accepts every reasoning effort for most models, so reasoning\n * values are sent directly, except to model families known to reject them.\n */\nfunction getFireworksReasoningEffortMap(modelId: string) {\n const modelName = modelId.slice(modelId.lastIndexOf('/') + 1);\n\n return {\n ...(!modelsWithoutNoneReasoningEffort.test(modelName) && {\n none: 'none' as const,\n }),\n ...(!modelsWithoutMinimalReasoningEffort.test(modelName) && {\n minimal: 'minimal' as const,\n }),\n low: 'low' as const,\n medium: 'medium' as const,\n high: 'high' as const,\n xhigh: 'xhigh' as const,\n max: 'max' as const,\n };\n}\n\nexport function getFireworksLanguageModelEntry(modelId: string) {\n const effortMap = getFireworksReasoningEffortMap(modelId);\n const entry = {\n capabilities: {\n language: {\n ...(documentedLanguageCapabilities[modelId] ??\n unknownLanguageCapabilities),\n reasoning: { support: 'unknown', efforts: Object.values(effortMap) },\n structuredOutput: { jsonSchema: true },\n },\n },\n providerOptions: {\n language: Object.fromEntries(\n Object.keys(fireworksProviderOptions.language).map(key => [\n key,\n 'unknown' as const,\n ]),\n ),\n },\n requestConfig: { language: { reasoningEffortMap: effortMap } },\n } as const;\n return entry satisfies ModelEntry<{\n language: { reasoningEffortMap: typeof effortMap };\n }>;\n}\ninterface FireworksImageModelBackendConfig {\n urlFormat: 'workflows' | 'workflows_async' | 'image_generation';\n supportsSize?: boolean;\n supportsEditing?: boolean;\n}\n\nconst modelToBackendConfig: Partial<\n Record<FireworksImageModelId, FireworksImageModelBackendConfig>\n> = {\n 'accounts/fireworks/models/flux-1-dev-fp8': {\n urlFormat: 'workflows',\n },\n 'accounts/fireworks/models/flux-1-schnell-fp8': {\n urlFormat: 'workflows',\n },\n 'accounts/fireworks/models/flux-kontext-pro': {\n urlFormat: 'workflows_async',\n supportsEditing: true,\n },\n 'accounts/fireworks/models/flux-kontext-max': {\n urlFormat: 'workflows_async',\n supportsEditing: true,\n },\n 'accounts/fireworks/models/playground-v2-5-1024px-aesthetic': {\n urlFormat: 'image_generation',\n supportsSize: true,\n },\n 'accounts/fireworks/models/japanese-stable-diffusion-xl': {\n urlFormat: 'image_generation',\n supportsSize: true,\n },\n 'accounts/fireworks/models/playground-v2-1024px-aesthetic': {\n urlFormat: 'image_generation',\n supportsSize: true,\n },\n 'accounts/fireworks/models/stable-diffusion-xl-1024-v1-0': {\n urlFormat: 'image_generation',\n supportsSize: true,\n },\n 'accounts/fireworks/models/SSD-1B': {\n urlFormat: 'image_generation',\n supportsSize: true,\n },\n};\n\nexport function getFireworksImageModelEntry(modelId: string) {\n const config = modelToBackendConfig[modelId];\n const fileInput =\n config == null ? 'unknown' : config.supportsEditing === true;\n const entry = {\n capabilities: {\n image: {\n sizes: {\n description: config?.supportsSize\n ? 'Explicit width and height.'\n : 'Aspect ratio; explicit sizes are not supported.',\n },\n fileInput,\n maskInput: config == null ? 'unknown' : false,\n maxImagesPerCall: 1,\n size: config?.supportsSize === true,\n },\n },\n providerOptions: {\n image: Object.fromEntries(\n Object.keys(fireworksProviderOptions.image).map(key => [\n key,\n 'unknown' as const,\n ]),\n ),\n },\n requestConfig: { image: { urlFormat: config?.urlFormat ?? 'workflows' } },\n } as const;\n return entry satisfies ModelEntry<{\n image: { urlFormat: FireworksImageModelBackendConfig['urlFormat'] };\n }>;\n}\nexport function getFireworksEmbeddingModelEntry(modelId: string) {\n return {\n capabilities: {\n ...(modelId === 'nomic-ai/nomic-embed-text-v1.5'\n ? {\n embedding: {\n defaultDimensions: 768,\n ...{ maxTokens: 8192 },\n customDimensions: 'unknown' as const,\n },\n }\n : {}),\n },\n providerOptions: {\n embedding: Object.fromEntries(\n Object.keys(fireworksProviderOptions.embedding).map(key => [\n key,\n 'unknown' as const,\n ]),\n ),\n },\n } satisfies ModelEntry;\n}\nexport const fireworksModelCatalog = Object.fromEntries([\n ...Object.keys(languageDefinitions).map(\n id => [id, getFireworksLanguageModelEntry(id)] as const,\n ),\n ...imageModelIds.map(id => [id, getFireworksImageModelEntry(id)] as const),\n ...embeddingModelIds.map(\n id => [id, getFireworksEmbeddingModelEntry(id)] as const,\n ),\n]);\n\nObject.assign(\n fireworksModelCatalog,\n Object.fromEntries(\n Object.keys(documentedLanguageCapabilities).map(id => [\n id,\n getFireworksLanguageModelEntry(id),\n ]),\n ),\n);\n\nexport const fireworksStabilityModelCatalog = Object.fromEntries(\n [\n 'accounts/stability/models/sd3-turbo',\n 'accounts/stability/models/sd3-medium',\n 'accounts/stability/models/sd3',\n ].map(id => [id, getFireworksImageModelEntry(id)]),\n);\n\ntype FireworksEndpointModelId<Endpoint extends 'chat' | 'completion'> = {\n [ModelId in keyof typeof languageDefinitions]: Endpoint extends (typeof languageDefinitions)[ModelId]['endpoints'][number]\n ? ModelId\n : never;\n}[keyof typeof languageDefinitions];\n\n/** Known model IDs, derived from the declarations used to build the catalog. */\nexport type FireworksModelIds = {\n chat: FireworksEndpointModelId<'chat'>;\n completion: FireworksEndpointModelId<'completion'>;\n embedding: (typeof embeddingModelIds)[number];\n image: (typeof imageModelIds)[number];\n};\n","import { lazySchema, zodSchema } from '@ai-sdk/provider-utils';\nimport { z } from 'zod/v4';\n\n// Schema for async submit response\nexport const asyncSubmitResponseSchema = lazySchema(() =>\n zodSchema(\n z.object({\n request_id: z.string(),\n }),\n ),\n);\n\n// Schema for async poll response\nexport const asyncPollResponseSchema = lazySchema(() =>\n zodSchema(\n z.object({\n id: z.string(),\n status: z.string(),\n result: z\n .object({\n sample: z.string().optional(),\n })\n .nullable(),\n }),\n ),\n);\n","import {\n lazySchema,\n zodSchema,\n type InferSchema,\n} from '@ai-sdk/provider-utils';\nimport { z } from 'zod/v4';\n\nexport const fireworksImageModelOptionsSchema = lazySchema(() =>\n zodSchema(\n z.looseObject({\n /**\n * Classifier-free guidance scale for the image diffusion process.\n */\n guidance_scale: z.number().optional(),\n\n /**\n * Number of denoising steps for the image generation process.\n */\n num_inference_steps: z.number().int().optional(),\n\n /**\n * Desired output image format.\n */\n output_format: z.enum(['jpeg', 'png']).optional(),\n\n /**\n * URL to receive webhook notifications for async Kontext requests.\n */\n webhook_url: z.string().optional(),\n\n /**\n * Secret for webhook signature verification.\n */\n webhook_secret: z.string().optional(),\n\n /**\n * Whether Fireworks should automatically modify the prompt for more creative generation.\n */\n prompt_upsampling: z.boolean().optional(),\n\n /**\n * Moderation tolerance level for inputs and outputs.\n */\n safety_tolerance: z.number().int().min(0).max(6).optional(),\n\n /**\n * Guidance scale for legacy image_generation models.\n */\n cfg_scale: z.number().optional(),\n\n /**\n * Number of generation steps for legacy image_generation models.\n */\n steps: z.number().int().optional(),\n }),\n ),\n);\n\nexport type FireworksImageModelOptions = InferSchema<\n typeof fireworksImageModelOptionsSchema\n>;\n","import { getFireworksImageModelEntry } from './fireworks-model-catalog';\nimport type { ImageModelV4, SharedV4Warning } from '@ai-sdk/provider';\nimport {\n type Resolvable,\n resolve,\n combineHeaders,\n convertImageModelFileToDataUri,\n createBinaryResponseHandler,\n createJsonResponseHandler,\n createStatusCodeErrorResponseHandler,\n delay,\n getFromApi,\n parseProviderOptions,\n postJsonToApi,\n serializeModelOptions,\n WORKFLOW_SERIALIZE,\n WORKFLOW_DESERIALIZE,\n type FetchFunction,\n} from '@ai-sdk/provider-utils';\nimport {\n asyncPollResponseSchema,\n asyncSubmitResponseSchema,\n} from './fireworks-image-api';\nimport { fireworksImageModelOptionsSchema } from './fireworks-image-model-options';\nimport type { FireworksImageModelId } from './fireworks-image-options';\n\nconst DEFAULT_POLL_INTERVAL_MILLIS = 500;\nconst DEFAULT_POLL_TIMEOUT_MILLIS = 120000; // 2 minutes for image generation\n\nfunction getUrlForModel(\n baseUrl: string,\n modelId: FireworksImageModelId,\n): string {\n const config = getFireworksImageModelEntry(modelId).requestConfig.image;\n\n switch (config?.urlFormat) {\n case 'image_generation':\n return `${baseUrl}/image_generation/${modelId}`;\n case 'workflows_async':\n return `${baseUrl}/workflows/${modelId}`;\n case 'workflows':\n default:\n return `${baseUrl}/workflows/${modelId}/text_to_image`;\n }\n}\n\nfunction getPollUrlForModel(\n baseUrl: string,\n modelId: FireworksImageModelId,\n): string {\n return `${baseUrl}/workflows/${modelId}/get_result`;\n}\n\ninterface FireworksImageModelConfig {\n provider: string;\n baseURL: string;\n headers?: Resolvable<Record<string, string>>;\n fetch?: FetchFunction;\n /**\n * Poll interval in milliseconds between status checks for async models.\n * Defaults to 500ms.\n */\n pollIntervalMillis?: number;\n /**\n * Overall timeout in milliseconds for polling before giving up.\n * Defaults to 120000ms (2 minutes).\n */\n pollTimeoutMillis?: number;\n _internal?: {\n currentDate?: () => Date;\n };\n}\n\nexport class FireworksImageModel implements ImageModelV4 {\n readonly specificationVersion = 'v4';\n get maxImagesPerCall() {\n return getFireworksImageModelEntry(this.modelId).capabilities.image\n .maxImagesPerCall;\n }\n\n get supportsFileInputs(): boolean | undefined {\n const support = getFireworksImageModelEntry(this.modelId).capabilities.image\n .fileInput;\n return support === 'unknown' ? undefined : support;\n }\n\n get supportsMaskInputs(): boolean | undefined {\n return this.supportsFileInputs == null ? undefined : false;\n }\n\n get provider(): string {\n return this.config.provider;\n }\n\n static [WORKFLOW_SERIALIZE](model: FireworksImageModel) {\n return serializeModelOptions({\n modelId: model.modelId,\n config: model.config,\n });\n }\n\n static [WORKFLOW_DESERIALIZE](options: {\n modelId: FireworksImageModelId;\n config: FireworksImageModelConfig;\n }) {\n return new FireworksImageModel(options.modelId, options.config);\n }\n\n constructor(\n readonly modelId: FireworksImageModelId,\n private config: FireworksImageModelConfig,\n ) {}\n\n async doGenerate({\n prompt,\n n,\n size,\n aspectRatio,\n seed,\n providerOptions,\n headers,\n abortSignal,\n files,\n mask,\n }: Parameters<ImageModelV4['doGenerate']>[0]): Promise<\n Awaited<ReturnType<ImageModelV4['doGenerate']>>\n > {\n const warnings: Array<SharedV4Warning> = [];\n\n const imageEntry = getFireworksImageModelEntry(this.modelId);\n if (!imageEntry.capabilities.image.size && size != null) {\n warnings.push({\n type: 'unsupported',\n feature: 'size',\n details:\n 'This model does not support the `size` option. Use `aspectRatio` instead.',\n });\n }\n\n // Use supportsSize as a proxy for whether the model does not support\n // aspectRatio. This invariant holds for the current set of models.\n if (imageEntry.capabilities.image.size && aspectRatio != null) {\n warnings.push({\n type: 'unsupported',\n feature: 'aspectRatio',\n details: 'This model does not support the `aspectRatio` option.',\n });\n }\n\n // Handle files for image editing\n const hasInputImage = files != null && files.length > 0;\n let inputImage: string | undefined;\n\n if (hasInputImage) {\n inputImage = convertImageModelFileToDataUri(files[0]);\n\n if (files.length > 1) {\n warnings.push({\n type: 'other',\n message:\n 'Fireworks only supports a single input image. Additional images are ignored.',\n });\n }\n }\n\n // Warn about mask - Fireworks Kontext models don't support explicit masks\n if (mask != null) {\n warnings.push({\n type: 'unsupported',\n feature: 'mask',\n details:\n 'Fireworks Kontext models do not support explicit masks. Use the prompt to describe the areas to edit.',\n });\n }\n\n const splitSize = size?.split('x');\n const currentDate = this.config._internal?.currentDate?.() ?? new Date();\n const fireworksOptions =\n (await parseProviderOptions({\n provider: 'fireworks',\n providerOptions,\n schema: fireworksImageModelOptionsSchema,\n })) ?? {};\n\n const body = {\n prompt,\n aspect_ratio: aspectRatio,\n seed,\n samples: n,\n ...(inputImage && { input_image: inputImage }),\n ...(splitSize && { width: splitSize[0], height: splitSize[1] }),\n ...fireworksOptions,\n };\n\n // Handle async models that require polling (e.g., flux-kontext-*)\n if (imageEntry.requestConfig.image.urlFormat === 'workflows_async') {\n return this.doGenerateAsync({\n body,\n headers,\n abortSignal,\n warnings,\n currentDate,\n });\n }\n\n // Handle sync models that return binary directly\n const { value: response, responseHeaders } = await postJsonToApi({\n url: getUrlForModel(this.config.baseURL, this.modelId),\n headers: combineHeaders(await resolve(this.config.headers), headers),\n body,\n failedResponseHandler: createStatusCodeErrorResponseHandler(),\n successfulResponseHandler: createBinaryResponseHandler(),\n abortSignal,\n fetch: this.config.fetch,\n });\n\n return {\n images: [response],\n warnings,\n response: {\n timestamp: currentDate,\n modelId: this.modelId,\n headers: responseHeaders,\n },\n };\n }\n\n /**\n * Handles async image generation for models like flux-kontext-* that return\n * a request_id and require polling for results.\n */\n private async doGenerateAsync({\n body,\n headers,\n abortSignal,\n warnings,\n currentDate,\n }: {\n body: Record<string, unknown>;\n headers: Record<string, string | undefined> | undefined;\n abortSignal: AbortSignal | undefined;\n warnings: Array<SharedV4Warning>;\n currentDate: Date;\n }): Promise<Awaited<ReturnType<ImageModelV4['doGenerate']>>> {\n // Submit the generation request\n const { value: submitResponse } = await postJsonToApi({\n url: getUrlForModel(this.config.baseURL, this.modelId),\n headers: combineHeaders(await resolve(this.config.headers), headers),\n body,\n failedResponseHandler: createStatusCodeErrorResponseHandler(),\n successfulResponseHandler: createJsonResponseHandler(\n asyncSubmitResponseSchema,\n ),\n abortSignal,\n fetch: this.config.fetch,\n });\n\n const requestId = submitResponse.request_id;\n\n // Poll for the result\n const imageUrl = await this.pollForImageUrl({\n requestId,\n headers,\n abortSignal,\n });\n\n // Download the image from the URL. The URL comes from the provider\n // response and typically points at a CDN, so only send credentials when it\n // stays on the provider's own origin (never leak the API key to a CDN or an\n // attacker-named host).\n const { value: imageBytes, responseHeaders } = await getFromApi({\n url: imageUrl,\n // imageUrl comes from the provider response body.\n validateUrl: true,\n credentialedOrigin: this.config.baseURL,\n trustedOrigin: this.config.baseURL,\n headers: combineHeaders(await resolve(this.config.headers), headers),\n abortSignal,\n failedResponseHandler: createStatusCodeErrorResponseHandler(),\n successfulResponseHandler: createBinaryResponseHandler(),\n fetch: this.config.fetch,\n });\n\n return {\n images: [imageBytes],\n warnings,\n response: {\n timestamp: currentDate,\n modelId: this.modelId,\n headers: responseHeaders,\n },\n };\n }\n\n /**\n * Polls the get_result endpoint until the image is ready.\n */\n private async pollForImageUrl({\n requestId,\n headers,\n abortSignal,\n }: {\n requestId: string;\n headers: Record<string, string | undefined> | undefined;\n abortSignal: AbortSignal | undefined;\n }): Promise<string> {\n const pollIntervalMillis =\n this.config.pollIntervalMillis ?? DEFAULT_POLL_INTERVAL_MILLIS;\n const pollTimeoutMillis =\n this.config.pollTimeoutMillis ?? DEFAULT_POLL_TIMEOUT_MILLIS;\n\n const pollUrl = getPollUrlForModel(this.config.baseURL, this.modelId);\n\n const timeoutController = new AbortController();\n let didTimeout = false;\n const timeoutId = setTimeout(() => {\n didTimeout = true;\n timeoutController.abort();\n }, pollTimeoutMillis);\n const pollingAbortSignal =\n abortSignal == null\n ? timeoutController.signal\n : AbortSignal.any([abortSignal, timeoutController.signal]);\n\n try {\n while (true) {\n const { value: pollResponse } = await postJsonToApi({\n url: pollUrl,\n headers: combineHeaders(await resolve(this.config.headers), headers),\n body: { id: requestId },\n failedResponseHandler: createStatusCodeErrorResponseHandler(),\n successfulResponseHandler: createJsonResponseHandler(\n asyncPollResponseSchema,\n ),\n abortSignal: pollingAbortSignal,\n fetch: this.config.fetch,\n });\n\n const status = pollResponse.status;\n\n if (status === 'Ready') {\n const imageUrl = pollResponse.result?.sample;\n if (typeof imageUrl === 'string') {\n return imageUrl;\n }\n throw new Error(\n 'Fireworks poll response is Ready but missing result.sample',\n );\n }\n\n if (status === 'Error' || status === 'Failed') {\n throw new Error(\n `Fireworks image generation failed with status: ${status}`,\n );\n }\n\n // Wait before next poll attempt\n await delay(pollIntervalMillis, {\n abortSignal: pollingAbortSignal,\n });\n }\n } catch (error) {\n if (didTimeout) {\n throw new Error(\n `Fireworks image generation timed out after ${pollTimeoutMillis}ms`,\n );\n }\n throw error;\n } finally {\n clearTimeout(timeoutId);\n }\n }\n}\n","// Version string of this package injected at build time.\ndeclare const __PACKAGE_VERSION__: string | undefined;\nexport const VERSION: string =\n typeof __PACKAGE_VERSION__ !== 'undefined'\n ? __PACKAGE_VERSION__\n : '0.0.0-test';\n","import { getFireworksLanguageModelEntry } from './fireworks-model-catalog';\nimport {\n OpenAICompatibleChatLanguageModel,\n OpenAICompatibleCompletionLanguageModel,\n OpenAICompatibleEmbeddingModel,\n type ProviderErrorStructure,\n} from '@ai-sdk/openai-compatible';\nimport type {\n EmbeddingModelV4,\n ImageModelV4,\n LanguageModelV4,\n ProviderV4,\n} from '@ai-sdk/provider';\nimport {\n type Resolvable,\n resolveWith,\n loadApiKey,\n mapReasoningToProviderEffort,\n withoutTrailingSlash,\n withUserAgentSuffix,\n type FetchFunction,\n} from '@ai-sdk/provider-utils';\nimport { z } from 'zod/v4';\nimport type { FireworksChatModelId } from './fireworks-chat-options';\nimport type { FireworksCompletionModelId } from './fireworks-completion-options';\nimport type { FireworksEmbeddingModelId } from './fireworks-embedding-options';\nimport { FireworksImageModel } from './fireworks-image-model';\nimport type { FireworksImageModelId } from './fireworks-image-options';\nimport { VERSION } from './version';\n\nexport type FireworksErrorData = z.infer<typeof fireworksErrorSchema>;\n\nconst fireworksErrorSchema = z.object({\n error: z.union([\n z.string(),\n z.object({\n message: z.string(),\n object: z.string().nullish(),\n type: z.string().nullish(),\n param: z.any().nullish(),\n code: z.union([z.string(), z.number()]).nullish(),\n }),\n ]),\n});\n\nconst fireworksErrorStructure: ProviderErrorStructure<FireworksErrorData> = {\n errorSchema: fireworksErrorSchema,\n errorToMessage: data =>\n typeof data.error === 'string' ? data.error : data.error.message,\n};\n\nexport interface FireworksProviderSettings {\n /**\n * Fireworks API key. Default value is taken from the `FIREWORKS_API_KEY`\n * environment variable.\n * A function is called before each request and may return a promise.\n */\n apiKey?: Resolvable<string>;\n /**\n * Base URL for the API calls.\n */\n baseURL?: string;\n /**\n * Custom headers to include in the requests.\n */\n headers?: Record<string, string>;\n /**\n * Custom fetch implementation. You can use it as a middleware to intercept requests,\n * or to provide a custom fetch implementation for e.g. testing.\n */\n fetch?: FetchFunction;\n}\n\nexport interface FireworksProvider extends ProviderV4 {\n /**\n * Creates a model for text generation.\n */\n (modelId: FireworksChatModelId): LanguageModelV4;\n\n /**\n * Creates a chat model for text generation.\n */\n chatModel(modelId: FireworksChatModelId): LanguageModelV4;\n\n /**\n * Creates a completion model for text generation.\n */\n completionModel(modelId: FireworksCompletionModelId): LanguageModelV4;\n\n /**\n * Creates a chat model for text generation.\n */\n languageModel(modelId: FireworksChatModelId): LanguageModelV4;\n\n /**\n * Creates a text embedding model for text generation.\n */\n embeddingModel(modelId: FireworksEmbeddingModelId): EmbeddingModelV4;\n\n /**\n * @deprecated Use `embeddingModel` instead.\n */\n textEmbeddingModel(modelId: FireworksEmbeddingModelId): EmbeddingModelV4;\n\n /**\n * Creates a model for image generation.\n */\n image(modelId: FireworksImageModelId): ImageModelV4;\n\n /**\n * Creates a model for image generation.\n */\n imageModel(modelId: FireworksImageModelId): ImageModelV4;\n}\n\nconst defaultBaseURL = 'https://api.fireworks.ai/inference/v1';\n\nexport function createFireworks(\n options: FireworksProviderSettings = {},\n): FireworksProvider {\n const baseURL = withoutTrailingSlash(options.baseURL ?? defaultBaseURL);\n const getHeaders = () =>\n resolveWith(options.apiKey, apiKey =>\n withUserAgentSuffix(\n {\n Authorization: `Bearer ${loadApiKey({\n apiKey,\n environmentVariableName: 'FIREWORKS_API_KEY',\n description: 'Fireworks API key',\n })}`,\n ...options.headers,\n },\n `ai-sdk-fireworks/${VERSION}`,\n ),\n );\n\n interface CommonModelConfig {\n provider: string;\n url: ({ path }: { path: string }) => string;\n headers: Resolvable<Record<string, string>>;\n fetch?: FetchFunction;\n }\n\n const getCommonModelConfig = (modelType: string): CommonModelConfig => ({\n provider: `fireworks.${modelType}`,\n url: ({ path }) => `${baseURL}${path}`,\n headers: getHeaders,\n fetch: options.fetch,\n });\n\n const createChatModel = (modelId: FireworksChatModelId) => {\n return new OpenAICompatibleChatLanguageModel(modelId, {\n ...getCommonModelConfig('chat'),\n includeUsage: true,\n errorStructure: fireworksErrorStructure,\n supportsStructuredOutputs:\n getFireworksLanguageModelEntry(modelId).capabilities.language\n .structuredOutput.jsonSchema,\n mapReasoning: ({ reasoning, warnings }) =>\n mapReasoningToProviderEffort({\n reasoning,\n effortMap:\n getFireworksLanguageModelEntry(modelId).requestConfig.language\n .reasoningEffortMap,\n warnings,\n }),\n transformRequestBody: args => {\n const thinking = args.thinking as\n | { type?: string; budgetTokens?: number }\n | undefined;\n const reasoningHistory = args.reasoningHistory as string | undefined;\n const promptCacheKey = args.promptCacheKey as string | undefined;\n const serviceTier = args.serviceTier as string | undefined;\n\n const {\n thinking: _,\n reasoningHistory: __,\n promptCacheKey: ___,\n serviceTier: ____,\n ...rest\n } = args;\n\n return {\n ...rest,\n ...(promptCacheKey !== undefined && {\n prompt_cache_key: promptCacheKey,\n }),\n ...(serviceTier !== undefined && {\n service_tier: serviceTier,\n }),\n ...(thinking && {\n thinking: {\n type: thinking.type,\n ...(thinking.budgetTokens !== undefined && {\n budget_tokens: thinking.budgetTokens,\n }),\n },\n }),\n ...(reasoningHistory && {\n reasoning_history: reasoningHistory,\n }),\n };\n },\n });\n };\n\n const createCompletionModel = (modelId: FireworksCompletionModelId) =>\n new OpenAICompatibleCompletionLanguageModel(modelId, {\n ...getCommonModelConfig('completion'),\n includeUsage: true,\n errorStructure: fireworksErrorStructure,\n });\n\n const createEmbeddingModel = (modelId: FireworksEmbeddingModelId) =>\n new OpenAICompatibleEmbeddingModel(modelId, {\n ...getCommonModelConfig('embedding'),\n errorStructure: fireworksErrorStructure,\n });\n\n const createImageModel = (modelId: FireworksImageModelId) =>\n new FireworksImageModel(modelId, {\n ...getCommonModelConfig('image'),\n baseURL: baseURL ?? defaultBaseURL,\n });\n\n const provider = (modelId: FireworksChatModelId) => createChatModel(modelId);\n\n provider.specificationVersion = 'v4' as const;\n provider.completionModel = createCompletionModel;\n provider.chatModel = createChatModel;\n provider.languageModel = createChatModel;\n provider.embeddingModel = createEmbeddingModel;\n provider.textEmbeddingModel = createEmbeddingModel;\n provider.image = createImageModel;\n provider.imageModel = createImageModel;\n return provider;\n}\n\nexport const fireworks = createFireworks();\n"],"mappings":";;;;AAeA,MAAM,oCAAoC;CACxC,MAAM,EACJ,aACE,yGACJ;CACA,iBAAiB,EACf,aACE,sMACJ;CACA,eAAe,EACb,aACE,sEACJ;CACA,kBAAkB,EAChB,aACE,mNACJ;CACA,MAAM,EAAE,aAAa,sDAAsD;CAC3E,WAAW,EACT,aACE,qNACJ;CACA,QAAQ,EACN,aAAa,6DACf;AACF;AAMA,MAAM,qCAAqC;CACzC,YAAY,EACV,aACE,8HACJ;CACA,MAAM,EACJ,aACE,yGACJ;AACF;;AAMA,MAAa,2BAA2B;CACtC,UAAU;EACR,GAAG;EACH,gBAAgB,EACd,aACE,0FACJ;EACA,aAAa,EACX,aACE,kFACJ;EACA,UAAU,EAAE,aAAa,WAAW;EACpC,kBAAkB,EAAE,aAAa,mBAAmB;CACtD;CAIA,WAAW,EACT,GAAG,mCACL;CAIA,OAAO;EACL,gBAAgB,EACd,aACE,kEACJ;EACA,qBAAqB,EACnB,aACE,8DACJ;EACA,eAAe,EAAE,aAAa,+BAA+B;EAC7D,aAAa,EACX,aACE,mEACJ;EACA,gBAAgB,EACd,aAAa,6CACf;EACA,mBAAmB,EACjB,aACE,yFACJ;EACA,kBAAkB,EAChB,aAAa,qDACf;EACA,WAAW,EACT,aAAa,qDACf;EACA,OAAO,EACL,aACE,iEACJ;CACF;AAIF;AAEA,MAAM,sBAAsB;CAC1B,yCAAyC,EAAE,WAAW,CAAC,MAAM,EAAE;CAC/D,qDAAqD,EAAE,WAAW,CAAC,MAAM,EAAE;CAC3E,oDAAoD,EAAE,WAA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,yBAAyB,YAC7B,IAAI,wCAAwC,SAAS;EACnD,GAAG,qBAAqB,YAAY;EACpC,cAAc;EACd,gBAAgB;CAClB,CAAC;CAEH,MAAM,wBAAwB,YAC5B,IAAI,+BAA+B,SAAS;EAC1C,GAAG,qBAAqB,WAAW;EACnC,gBAAgB;CAClB,CAAC;CAEH,MAAM,oBAAoB,YACxB,IAAI,oBAAoB,SAAS;EAC/B,GAAG,qBAAqB,OAAO;EAC/B,SAAS,WAAW;CACtB,CAAC;CAEH,MAAM,YAAY,YAAkC,gBAAgB,OAAO;CAE3E,SAAS,uBAAuB;CAChC,SAAS,kBAAkB;CAC3B,SAAS,YAAY;CACrB,SAAS,gBAAgB;CACzB,SAAS,iBAAiB;CAC1B,SAAS,qBAAqB;CAC9B,SAAS,QAAQ;CACjB,SAAS,aAAa;CACtB,OAAO;AACT;AAEA,MAAa,YAAY,gBAAgB"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/fireworks-model-catalog.ts","../src/fireworks-image-api.ts","../src/fireworks-image-model-options.ts","../src/fireworks-image-model.ts","../src/version.ts","../src/fireworks-provider.ts"],"sourcesContent":["import type {\n OpenAICompatibleLanguageModelChatOptions,\n OpenAICompatibleLanguageModelCompletionOptions,\n OpenAICompatibleEmbeddingModelOptions,\n} from '@ai-sdk/openai-compatible';\nimport type {\n ModelCapabilities,\n ModelCapability,\n ModelEntry,\n ProviderOptionDefinition,\n ProviderOptionDefinitions,\n} from '@ai-sdk/provider';\nimport type { FireworksLanguageModelOptions } from './fireworks-chat-options';\nimport type { FireworksEmbeddingModelOptions } from './fireworks-embedding-options';\nimport type { FireworksImageModelOptions } from './fireworks-image-model-options';\nconst compatiblelanguageProviderOptions = {\n user: {\n description:\n 'A unique identifier representing your end-user, which can help providers to\\nmonitor and detect abuse.',\n },\n reasoningEffort: {\n description:\n 'Reasoning effort for reasoning models. Defaults to `medium`.\\n\\nSet to `null` to send `\"reasoning_effort\": null`, for providers that treat\\nan explicit `null` differently from an omitted field.',\n },\n textVerbosity: {\n description:\n 'Controls the verbosity of the generated text. Defaults to `medium`.',\n },\n strictJsonSchema: {\n description:\n 'Whether to use strict JSON schema validation.\\nWhen true, the model uses constrained decoding to guarantee schema compliance.\\nOnly used when the provider supports structured outputs and a schema is provided.',\n },\n echo: { description: 'Echo back the prompt in addition to the completion.' },\n logitBias: {\n description:\n 'Modify the likelihood of specified tokens appearing in the completion.\\n\\nAccepts a JSON object that maps tokens (specified by their token ID in\\nthe GPT tokenizer) to an associated bias value from -100 to 100.',\n },\n suffix: {\n description: 'The suffix that comes after a completion of inserted text.',\n },\n} satisfies Record<\n | keyof OpenAICompatibleLanguageModelChatOptions\n | keyof OpenAICompatibleLanguageModelCompletionOptions,\n ProviderOptionDefinition\n>;\n\nconst compatibleembeddingProviderOptions = {\n dimensions: {\n description:\n 'The number of dimensions the resulting output embeddings should have.\\nOnly supported in text-embedding-3 and later models.',\n },\n user: {\n description:\n 'A unique identifier representing your end-user, which can help providers to\\nmonitor and detect abuse.',\n },\n} satisfies Record<\n keyof OpenAICompatibleEmbeddingModelOptions,\n ProviderOptionDefinition\n>;\n\n/** Known options accepted under providerOptions; open-ended extension keys remain undeclared. */\nexport const fireworksProviderOptions = {\n language: {\n ...compatiblelanguageProviderOptions,\n promptCacheKey: {\n description:\n 'A stable key for routing requests with shared prompt prefixes to the same prompt cache.',\n },\n serviceTier: {\n description:\n 'Use Fireworks Priority serving path for higher reliability during peak traffic.',\n },\n thinking: { description: 'thinking' },\n reasoningHistory: { description: 'reasoningHistory' },\n } satisfies Record<\n keyof FireworksLanguageModelOptions,\n ProviderOptionDefinition\n >,\n embedding: {\n ...compatibleembeddingProviderOptions,\n } satisfies Record<\n keyof FireworksEmbeddingModelOptions,\n ProviderOptionDefinition\n >,\n image: {\n guidance_scale: {\n description:\n 'Classifier-free guidance scale for the image diffusion process.',\n },\n num_inference_steps: {\n description:\n 'Number of denoising steps for the image generation process.',\n },\n output_format: { description: 'Desired output image format.' },\n webhook_url: {\n description:\n 'URL to receive webhook notifications for async Kontext requests.',\n },\n webhook_secret: {\n description: 'Secret for webhook signature verification.',\n },\n prompt_upsampling: {\n description:\n 'Whether Fireworks should automatically modify the prompt for more creative generation.',\n },\n safety_tolerance: {\n description: 'Moderation tolerance level for inputs and outputs.',\n },\n cfg_scale: {\n description: 'Guidance scale for legacy image_generation models.',\n },\n steps: {\n description:\n 'Number of generation steps for legacy image_generation models.',\n },\n } satisfies Record<\n keyof FireworksImageModelOptions,\n ProviderOptionDefinition\n >,\n} as const satisfies ProviderOptionDefinitions;\n\n/** A reasoning effort that Fireworks accepts in `reasoning_effort`. */\ntype FireworksReasoningEffort =\n | 'none'\n | 'minimal'\n | 'low'\n | 'medium'\n | 'high'\n | 'xhigh'\n | 'max';\n\ntype FireworksLanguageModelEntry = {\n capabilities: {\n language: NonNullable<ModelCapabilities['language']> & {\n structuredOutput: { jsonSchema: boolean };\n };\n };\n providerOptions: { language: Record<string, ModelCapability> };\n requestConfig: {\n language: {\n reasoningEffortMap: Partial<\n Record<FireworksReasoningEffort, FireworksReasoningEffort>\n >;\n };\n };\n};\n\n/**\n * One row of the language model matrix. Every capability that differs between\n * models is one flat cell, and every listed model fills in every cell. Nothing\n * is derived from the model ID.\n *\n * Facts that depend on each other share one cell, so a row cannot contradict\n * itself: a cell is a single value, one of a fixed set of values, or the list\n * of what the model supports.\n */\nexport type FireworksLanguageModelRow = {\n /**\n * The Fireworks APIs whose model ID types list this model ID. Empty: the\n * model ID is only in the catalog. It does not change a request.\n */\n endpoints: readonly ('chat' | 'completion')[];\n image: ModelCapability;\n objectGeneration: ModelCapability;\n /**\n * `false`: the model does not call function tools. Otherwise it does, and\n * the list holds what it supports on top of that: `streaming` means it\n * also calls tools in a streamed response. `'unknown'`: not documented.\n */\n functionTools: 'unknown' | false | readonly 'streaming'[];\n /**\n * The reasoning efforts the SDK sends for the portable `reasoning`\n * setting. A level that is not listed is sent as the closest listed effort\n * below it, or else above it.\n */\n reasoningEfforts: readonly FireworksReasoningEffort[];\n};\n\n/**\n * Language model matrix: model IDs by capability. To add a model, add a row\n * and fill in every column.\n */\nconst languageModelDefinitions = {\n 'accounts/fireworks/models/deepseek-v3': {\n endpoints: ['chat'],\n image: false,\n objectGeneration: true,\n functionTools: [],\n reasoningEfforts: [\n 'none',\n 'minimal',\n 'low',\n 'medium',\n 'high',\n 'xhigh',\n 'max',\n ],\n },\n 'accounts/fireworks/models/llama-v3p3-70b-instruct': {\n endpoints: ['chat'],\n image: false,\n objectGeneration: true,\n functionTools: [],\n reasoningEfforts: [\n 'none',\n 'minimal',\n 'low',\n 'medium',\n 'high',\n 'xhigh',\n 'max',\n ],\n },\n 'accounts/fireworks/models/llama-v3p2-3b-instruct': {\n endpoints: ['chat'],\n image: false,\n objectGeneration: true,\n functionTools: [],\n reasoningEfforts: [\n 'none',\n 'minimal',\n 'low',\n 'medium',\n 'high',\n 'xhigh',\n 'max',\n ],\n },\n 'accounts/fireworks/models/llama-v3p1-405b-instruct': {\n endpoints: ['chat'],\n image: false,\n objectGeneration: true,\n functionTools: ['streaming'],\n reasoningEfforts: [\n 'none',\n 'minimal',\n 'low',\n 'medium',\n 'high',\n 'xhigh',\n 'max',\n ],\n },\n 'accounts/fireworks/models/llama-v3p1-8b-instruct': {\n endpoints: ['chat'],\n image: false,\n objectGeneration: true,\n functionTools: [],\n reasoningEfforts: [\n 'none',\n 'minimal',\n 'low',\n 'medium',\n 'high',\n 'xhigh',\n 'max',\n ],\n },\n 'accounts/fireworks/models/mixtral-8x7b-instruct': {\n endpoints: ['chat'],\n image: false,\n objectGeneration: true,\n functionTools: [],\n reasoningEfforts: [\n 'none',\n 'minimal',\n 'low',\n 'medium',\n 'high',\n 'xhigh',\n 'max',\n ],\n },\n 'accounts/fireworks/models/mixtral-8x22b-instruct': {\n endpoints: ['chat'],\n image: false,\n objectGeneration: true,\n functionTools: [],\n reasoningEfforts: [\n 'none',\n 'minimal',\n 'low',\n 'medium',\n 'high',\n 'xhigh',\n 'max',\n ],\n },\n 'accounts/fireworks/models/mixtral-8x7b-instruct-hf': {\n endpoints: ['chat'],\n image: false,\n objectGeneration: true,\n functionTools: [],\n reasoningEfforts: [\n 'none',\n 'minimal',\n 'low',\n 'medium',\n 'high',\n 'xhigh',\n 'max',\n ],\n },\n 'accounts/fireworks/models/qwen2p5-coder-32b-instruct': {\n endpoints: ['chat'],\n image: false,\n objectGeneration: true,\n functionTools: [],\n reasoningEfforts: [\n 'none',\n 'minimal',\n 'low',\n 'medium',\n 'high',\n 'xhigh',\n 'max',\n ],\n },\n 'accounts/fireworks/models/qwen2p5-72b-instruct': {\n endpoints: ['chat'],\n image: false,\n objectGeneration: true,\n functionTools: [],\n reasoningEfforts: [\n 'none',\n 'minimal',\n 'low',\n 'medium',\n 'high',\n 'xhigh',\n 'max',\n ],\n },\n 'accounts/fireworks/models/qwen-qwq-32b-preview': {\n endpoints: ['chat'],\n image: false,\n objectGeneration: true,\n functionTools: false,\n reasoningEfforts: [\n 'none',\n 'minimal',\n 'low',\n 'medium',\n 'high',\n 'xhigh',\n 'max',\n ],\n },\n 'accounts/fireworks/models/qwen2-vl-72b-instruct': {\n endpoints: ['chat'],\n image: true,\n objectGeneration: true,\n functionTools: false,\n reasoningEfforts: [\n 'none',\n 'minimal',\n 'low',\n 'medium',\n 'high',\n 'xhigh',\n 'max',\n ],\n },\n 'accounts/fireworks/models/llama-v3p2-11b-vision-instruct': {\n endpoints: ['chat'],\n image: true,\n objectGeneration: true,\n functionTools: [],\n reasoningEfforts: [\n 'none',\n 'minimal',\n 'low',\n 'medium',\n 'high',\n 'xhigh',\n 'max',\n ],\n },\n 'accounts/fireworks/models/qwq-32b': {\n endpoints: ['chat'],\n image: false,\n objectGeneration: true,\n functionTools: false,\n reasoningEfforts: [\n 'none',\n 'minimal',\n 'low',\n 'medium',\n 'high',\n 'xhigh',\n 'max',\n ],\n },\n 'accounts/fireworks/models/yi-large': {\n endpoints: ['chat'],\n image: false,\n objectGeneration: true,\n functionTools: [],\n reasoningEfforts: [\n 'none',\n 'minimal',\n 'low',\n 'medium',\n 'high',\n 'xhigh',\n 'max',\n ],\n },\n 'accounts/fireworks/models/kimi-k2-instruct': {\n endpoints: ['chat'],\n image: false,\n objectGeneration: true,\n functionTools: [],\n reasoningEfforts: [\n 'none',\n 'minimal',\n 'low',\n 'medium',\n 'high',\n 'xhigh',\n 'max',\n ],\n },\n 'accounts/fireworks/models/kimi-k2-thinking': {\n endpoints: ['chat'],\n image: false,\n objectGeneration: true,\n functionTools: [],\n reasoningEfforts: [\n 'none',\n 'minimal',\n 'low',\n 'medium',\n 'high',\n 'xhigh',\n 'max',\n ],\n },\n 'accounts/fireworks/models/kimi-k2p6': {\n endpoints: ['chat'],\n image: true,\n objectGeneration: true,\n functionTools: [],\n reasoningEfforts: [\n 'none',\n 'minimal',\n 'low',\n 'medium',\n 'high',\n 'xhigh',\n 'max',\n ],\n },\n 'accounts/fireworks/models/minimax-m2': {\n endpoints: ['chat'],\n image: false,\n objectGeneration: true,\n functionTools: [],\n reasoningEfforts: [\n 'none',\n 'minimal',\n 'low',\n 'medium',\n 'high',\n 'xhigh',\n 'max',\n ],\n },\n 'accounts/fireworks/models/llama-v3-8b-instruct': {\n endpoints: ['completion'],\n image: 'unknown',\n objectGeneration: 'unknown',\n functionTools: 'unknown',\n reasoningEfforts: [\n 'none',\n 'minimal',\n 'low',\n 'medium',\n 'high',\n 'xhigh',\n 'max',\n ],\n },\n 'accounts/fireworks/models/llama-v2-34b-code': {\n endpoints: ['completion'],\n image: 'unknown',\n objectGeneration: 'unknown',\n functionTools: 'unknown',\n reasoningEfforts: [\n 'none',\n 'minimal',\n 'low',\n 'medium',\n 'high',\n 'xhigh',\n 'max',\n ],\n },\n 'accounts/fireworks/models/firefunction-v1': {\n endpoints: [],\n image: false,\n objectGeneration: true,\n functionTools: ['streaming'],\n reasoningEfforts: [\n 'none',\n 'minimal',\n 'low',\n 'medium',\n 'high',\n 'xhigh',\n 'max',\n ],\n },\n 'accounts/fireworks/models/deepseek-r1': {\n endpoints: [],\n image: false,\n objectGeneration: true,\n functionTools: false,\n reasoningEfforts: [\n 'none',\n 'minimal',\n 'low',\n 'medium',\n 'high',\n 'xhigh',\n 'max',\n ],\n },\n} as const satisfies Record<string, FireworksLanguageModelRow>;\n\n/** Maps a matrix row to its entry. Nothing here inspects the model ID. */\nfunction createLanguageModelEntry(\n row: FireworksLanguageModelRow,\n): FireworksLanguageModelEntry {\n return {\n capabilities: {\n language: {\n inputs: { image: row.image, audio: 'unknown' },\n objectGeneration: row.objectGeneration,\n tools: {\n usage:\n row.functionTools === 'unknown'\n ? 'unknown'\n : row.functionTools !== false,\n streaming:\n row.functionTools === 'unknown'\n ? 'unknown'\n : row.functionTools !== false &&\n row.functionTools.includes('streaming'),\n },\n reasoning: { support: 'unknown', efforts: [...row.reasoningEfforts] },\n sampling: {\n temperature: 'unknown',\n topP: 'unknown',\n logprobs: 'unknown',\n },\n structuredOutput: { jsonSchema: true },\n },\n },\n providerOptions: {\n language: Object.fromEntries(\n Object.keys(fireworksProviderOptions.language).map(key => [\n key,\n 'unknown' as const,\n ]),\n ),\n },\n requestConfig: {\n language: {\n reasoningEffortMap: Object.fromEntries(\n row.reasoningEfforts.map(effort => [effort, effort]),\n ),\n },\n },\n };\n}\n\nconst listedLanguageModelEntries = Object.fromEntries(\n Object.entries<FireworksLanguageModelRow>(languageModelDefinitions).map(\n ([modelId, row]) => [modelId, createLanguageModelEntry(row)],\n ),\n);\n\n// Family rules, used only for model IDs that are not listed in the matrix.\n// Model families that always reason and reject reasoning effort 'none'.\nconst unlistedModelsWithoutNoneReasoningEffort =\n /^(?:gpt-oss|glm-5p3|muse-spark)/;\n\n// Model families that reject reasoning effort 'minimal'.\nconst unlistedModelsWithoutMinimalReasoningEffort = /^(?:nemotron|inkling)/;\n\n/**\n * Resolves a model ID that is not listed in the matrix to a row. This is the\n * only place that looks at the model ID. Fireworks accepts every reasoning\n * effort for most models, so every effort is sent, except to model families\n * known to reject one.\n */\nfunction getUnlistedLanguageModelRow(\n modelId: string,\n): FireworksLanguageModelRow {\n const modelName = modelId.slice(modelId.lastIndexOf('/') + 1);\n return {\n endpoints: [],\n image: 'unknown',\n objectGeneration: 'unknown',\n functionTools: 'unknown',\n reasoningEfforts: [\n ...(unlistedModelsWithoutNoneReasoningEffort.test(modelName)\n ? []\n : ['none' as const]),\n ...(unlistedModelsWithoutMinimalReasoningEffort.test(modelName)\n ? []\n : ['minimal' as const]),\n 'low',\n 'medium',\n 'high',\n 'xhigh',\n 'max',\n ],\n };\n}\n\n/**\n * Returns the entry of a listed language model ID from its row. Every other\n * model ID uses the fallback for unlisted IDs.\n */\nexport function getFireworksLanguageModelEntry(modelId: string) {\n return Object.prototype.hasOwnProperty.call(\n listedLanguageModelEntries,\n modelId,\n )\n ? listedLanguageModelEntries[modelId]\n : createLanguageModelEntry(getUnlistedLanguageModelRow(modelId));\n}\n\n/**\n * The endpoint an image model is called on:\n *\n * - `workflows`: `/workflows/{model}/text_to_image`.\n * - `workflows_async`: `/workflows/{model}`, then polled with `get_result`.\n * - `image_generation`: `/image_generation/{model}`.\n */\ntype FireworksImageUrlFormat =\n | 'workflows'\n | 'workflows_async'\n | 'image_generation';\n\n/** One row of the image model matrix. Nothing is derived from the model ID. */\nexport type FireworksImageModelRow = {\n urlFormat: FireworksImageUrlFormat;\n /**\n * How the output size is set. `true`: an explicit width and height; an\n * aspect ratio is dropped with a warning. `false`: an aspect ratio; a size\n * is dropped with a warning.\n */\n size: boolean;\n /** Accepts an input image (image editing). */\n fileInput: boolean | 'unknown';\n maskInput: boolean | 'unknown';\n};\n\n/**\n * Image model matrix: model IDs by capability. To add a model, add a row and\n * fill in every column.\n */\nconst imageModelDefinitions = {\n 'accounts/fireworks/models/flux-1-dev-fp8': {\n urlFormat: 'workflows',\n size: false,\n fileInput: false,\n maskInput: false,\n },\n 'accounts/fireworks/models/flux-1-schnell-fp8': {\n urlFormat: 'workflows',\n size: false,\n fileInput: false,\n maskInput: false,\n },\n 'accounts/fireworks/models/flux-kontext-pro': {\n urlFormat: 'workflows_async',\n size: false,\n fileInput: true,\n maskInput: false,\n },\n 'accounts/fireworks/models/flux-kontext-max': {\n urlFormat: 'workflows_async',\n size: false,\n fileInput: true,\n maskInput: false,\n },\n 'accounts/fireworks/models/playground-v2-5-1024px-aesthetic': {\n urlFormat: 'image_generation',\n size: true,\n fileInput: false,\n maskInput: false,\n },\n 'accounts/fireworks/models/japanese-stable-diffusion-xl': {\n urlFormat: 'image_generation',\n size: true,\n fileInput: false,\n maskInput: false,\n },\n 'accounts/fireworks/models/playground-v2-1024px-aesthetic': {\n urlFormat: 'image_generation',\n size: true,\n fileInput: false,\n maskInput: false,\n },\n 'accounts/fireworks/models/SSD-1B': {\n urlFormat: 'image_generation',\n size: true,\n fileInput: false,\n maskInput: false,\n },\n 'accounts/fireworks/models/stable-diffusion-xl-1024-v1-0': {\n urlFormat: 'image_generation',\n size: true,\n fileInput: false,\n maskInput: false,\n },\n} satisfies Record<string, FireworksImageModelRow>;\n\n/** Maps a matrix row to its entry. Nothing here inspects the model ID. */\nfunction createImageModelEntry(row: FireworksImageModelRow) {\n const entry = {\n capabilities: {\n image: {\n sizes: {\n description: row.size\n ? 'Explicit width and height.'\n : 'Aspect ratio; explicit sizes are not supported.',\n },\n fileInput: row.fileInput,\n maskInput: row.maskInput,\n maxImagesPerCall: 1,\n size: row.size,\n },\n },\n providerOptions: {\n image: Object.fromEntries(\n Object.keys(fireworksProviderOptions.image).map(key => [\n key,\n 'unknown' as const,\n ]),\n ),\n },\n requestConfig: { image: { urlFormat: row.urlFormat } },\n };\n return entry satisfies ModelEntry<{\n image: { urlFormat: FireworksImageUrlFormat };\n }>;\n}\n\n/** Row for every image model ID that is not listed in the matrix. */\nconst unlistedImageModelRow: FireworksImageModelRow = {\n urlFormat: 'workflows',\n size: false,\n fileInput: 'unknown',\n maskInput: 'unknown',\n};\n\nexport function getFireworksImageModelEntry(modelId: string) {\n return createImageModelEntry(\n Object.prototype.hasOwnProperty.call(imageModelDefinitions, modelId)\n ? imageModelDefinitions[modelId as keyof typeof imageModelDefinitions]\n : unlistedImageModelRow,\n );\n}\n\ntype EmbeddingCapabilities = NonNullable<ModelCapabilities['embedding']> & {\n maxTokens: number;\n};\n\n/** One row of the embedding model matrix. */\nexport type FireworksEmbeddingModelRow = {\n defaultDimensions: number;\n maxTokens: number;\n customDimensions: ModelCapability;\n};\n\n/**\n * Embedding model matrix: model IDs by capability. To add a model, add a row\n * and fill in every column.\n */\nconst embeddingModelDefinitions = {\n 'nomic-ai/nomic-embed-text-v1.5': {\n defaultDimensions: 768,\n maxTokens: 8192,\n customDimensions: 'unknown',\n },\n} satisfies Record<string, FireworksEmbeddingModelRow>;\n\nconst embeddingProviderOptions = Object.fromEntries(\n Object.keys(fireworksProviderOptions.embedding).map(key => [\n key,\n 'unknown' as const,\n ]),\n);\n\n/** Maps a matrix row to its entry. Nothing here inspects the model ID. */\nfunction createEmbeddingModelEntry(row: FireworksEmbeddingModelRow) {\n const embedding: EmbeddingCapabilities = {\n defaultDimensions: row.defaultDimensions,\n maxTokens: row.maxTokens,\n customDimensions: row.customDimensions,\n };\n return {\n capabilities: { embedding },\n providerOptions: { embedding: embeddingProviderOptions },\n } satisfies ModelEntry;\n}\n\nexport function getFireworksEmbeddingModelEntry(modelId: string): ModelEntry {\n return Object.prototype.hasOwnProperty.call(\n embeddingModelDefinitions,\n modelId,\n )\n ? createEmbeddingModelEntry(\n embeddingModelDefinitions[\n modelId as keyof typeof embeddingModelDefinitions\n ],\n )\n : // Unlisted model IDs declare no embedding capabilities.\n {\n capabilities: {},\n providerOptions: { embedding: embeddingProviderOptions },\n };\n}\n\nexport const fireworksModelCatalog = Object.fromEntries([\n ...Object.entries(listedLanguageModelEntries),\n ...Object.keys(imageModelDefinitions).map(\n id => [id, getFireworksImageModelEntry(id)] as const,\n ),\n ...Object.keys(embeddingModelDefinitions).map(\n id => [id, getFireworksEmbeddingModelEntry(id)] as const,\n ),\n]);\n\nexport const fireworksStabilityModelCatalog = Object.fromEntries(\n [\n 'accounts/stability/models/sd3-turbo',\n 'accounts/stability/models/sd3-medium',\n 'accounts/stability/models/sd3',\n ].map(id => [id, getFireworksImageModelEntry(id)]),\n);\n\ntype FireworksEndpointModelId<Endpoint extends 'chat' | 'completion'> = {\n [ModelId in keyof typeof languageModelDefinitions]: Endpoint extends (typeof languageModelDefinitions)[ModelId]['endpoints'][number]\n ? ModelId\n : never;\n}[keyof typeof languageModelDefinitions];\n\n/** Known model IDs, derived from the declarations used to build the catalog. */\nexport type FireworksModelIds = {\n chat: FireworksEndpointModelId<'chat'>;\n completion: FireworksEndpointModelId<'completion'>;\n embedding: keyof typeof embeddingModelDefinitions;\n image: keyof typeof imageModelDefinitions;\n};\n","import { lazySchema, zodSchema } from '@ai-sdk/provider-utils';\nimport { z } from 'zod/v4';\n\n// Schema for async submit response\nexport const asyncSubmitResponseSchema = lazySchema(() =>\n zodSchema(\n z.object({\n request_id: z.string(),\n }),\n ),\n);\n\n// Schema for async poll response\nexport const asyncPollResponseSchema = lazySchema(() =>\n zodSchema(\n z.object({\n id: z.string(),\n status: z.string(),\n result: z\n .object({\n sample: z.string().optional(),\n })\n .nullable(),\n }),\n ),\n);\n","import {\n lazySchema,\n zodSchema,\n type InferSchema,\n} from '@ai-sdk/provider-utils';\nimport { z } from 'zod/v4';\n\nexport const fireworksImageModelOptionsSchema = lazySchema(() =>\n zodSchema(\n z.looseObject({\n /**\n * Classifier-free guidance scale for the image diffusion process.\n */\n guidance_scale: z.number().optional(),\n\n /**\n * Number of denoising steps for the image generation process.\n */\n num_inference_steps: z.number().int().optional(),\n\n /**\n * Desired output image format.\n */\n output_format: z.enum(['jpeg', 'png']).optional(),\n\n /**\n * URL to receive webhook notifications for async Kontext requests.\n */\n webhook_url: z.string().optional(),\n\n /**\n * Secret for webhook signature verification.\n */\n webhook_secret: z.string().optional(),\n\n /**\n * Whether Fireworks should automatically modify the prompt for more creative generation.\n */\n prompt_upsampling: z.boolean().optional(),\n\n /**\n * Moderation tolerance level for inputs and outputs.\n */\n safety_tolerance: z.number().int().min(0).max(6).optional(),\n\n /**\n * Guidance scale for legacy image_generation models.\n */\n cfg_scale: z.number().optional(),\n\n /**\n * Number of generation steps for legacy image_generation models.\n */\n steps: z.number().int().optional(),\n }),\n ),\n);\n\nexport type FireworksImageModelOptions = InferSchema<\n typeof fireworksImageModelOptionsSchema\n>;\n","import { getFireworksImageModelEntry } from './fireworks-model-catalog';\nimport type { ImageModelV4, SharedV4Warning } from '@ai-sdk/provider';\nimport {\n type Resolvable,\n resolve,\n combineHeaders,\n convertImageModelFileToDataUri,\n createBinaryResponseHandler,\n createJsonResponseHandler,\n createStatusCodeErrorResponseHandler,\n delay,\n getFromApi,\n parseProviderOptions,\n postJsonToApi,\n serializeModelOptions,\n WORKFLOW_SERIALIZE,\n WORKFLOW_DESERIALIZE,\n type FetchFunction,\n} from '@ai-sdk/provider-utils';\nimport {\n asyncPollResponseSchema,\n asyncSubmitResponseSchema,\n} from './fireworks-image-api';\nimport { fireworksImageModelOptionsSchema } from './fireworks-image-model-options';\nimport type { FireworksImageModelId } from './fireworks-image-options';\n\nconst DEFAULT_POLL_INTERVAL_MILLIS = 500;\nconst DEFAULT_POLL_TIMEOUT_MILLIS = 120000; // 2 minutes for image generation\n\nfunction getUrlForModel(\n baseUrl: string,\n modelId: FireworksImageModelId,\n): string {\n const config = getFireworksImageModelEntry(modelId).requestConfig.image;\n\n switch (config?.urlFormat) {\n case 'image_generation':\n return `${baseUrl}/image_generation/${modelId}`;\n case 'workflows_async':\n return `${baseUrl}/workflows/${modelId}`;\n case 'workflows':\n default:\n return `${baseUrl}/workflows/${modelId}/text_to_image`;\n }\n}\n\nfunction getPollUrlForModel(\n baseUrl: string,\n modelId: FireworksImageModelId,\n): string {\n return `${baseUrl}/workflows/${modelId}/get_result`;\n}\n\ninterface FireworksImageModelConfig {\n provider: string;\n baseURL: string;\n headers?: Resolvable<Record<string, string>>;\n fetch?: FetchFunction;\n /**\n * Poll interval in milliseconds between status checks for async models.\n * Defaults to 500ms.\n */\n pollIntervalMillis?: number;\n /**\n * Overall timeout in milliseconds for polling before giving up.\n * Defaults to 120000ms (2 minutes).\n */\n pollTimeoutMillis?: number;\n _internal?: {\n currentDate?: () => Date;\n };\n}\n\nexport class FireworksImageModel implements ImageModelV4 {\n readonly specificationVersion = 'v4';\n get maxImagesPerCall() {\n return getFireworksImageModelEntry(this.modelId).capabilities.image\n .maxImagesPerCall;\n }\n\n get supportsFileInputs(): boolean | undefined {\n const support = getFireworksImageModelEntry(this.modelId).capabilities.image\n .fileInput;\n return support === 'unknown' ? undefined : support;\n }\n\n get supportsMaskInputs(): boolean | undefined {\n return this.supportsFileInputs == null ? undefined : false;\n }\n\n get provider(): string {\n return this.config.provider;\n }\n\n static [WORKFLOW_SERIALIZE](model: FireworksImageModel) {\n return serializeModelOptions({\n modelId: model.modelId,\n config: model.config,\n });\n }\n\n static [WORKFLOW_DESERIALIZE](options: {\n modelId: FireworksImageModelId;\n config: FireworksImageModelConfig;\n }) {\n return new FireworksImageModel(options.modelId, options.config);\n }\n\n constructor(\n readonly modelId: FireworksImageModelId,\n private config: FireworksImageModelConfig,\n ) {}\n\n async doGenerate({\n prompt,\n n,\n size,\n aspectRatio,\n seed,\n providerOptions,\n headers,\n abortSignal,\n files,\n mask,\n }: Parameters<ImageModelV4['doGenerate']>[0]): Promise<\n Awaited<ReturnType<ImageModelV4['doGenerate']>>\n > {\n const warnings: Array<SharedV4Warning> = [];\n\n const imageEntry = getFireworksImageModelEntry(this.modelId);\n if (!imageEntry.capabilities.image.size && size != null) {\n warnings.push({\n type: 'unsupported',\n feature: 'size',\n details:\n 'This model does not support the `size` option. Use `aspectRatio` instead.',\n });\n }\n\n // Use supportsSize as a proxy for whether the model does not support\n // aspectRatio. This invariant holds for the current set of models.\n if (imageEntry.capabilities.image.size && aspectRatio != null) {\n warnings.push({\n type: 'unsupported',\n feature: 'aspectRatio',\n details: 'This model does not support the `aspectRatio` option.',\n });\n }\n\n // Handle files for image editing\n const hasInputImage = files != null && files.length > 0;\n let inputImage: string | undefined;\n\n if (hasInputImage) {\n inputImage = convertImageModelFileToDataUri(files[0]);\n\n if (files.length > 1) {\n warnings.push({\n type: 'other',\n message:\n 'Fireworks only supports a single input image. Additional images are ignored.',\n });\n }\n }\n\n // Warn about mask - Fireworks Kontext models don't support explicit masks\n if (mask != null) {\n warnings.push({\n type: 'unsupported',\n feature: 'mask',\n details:\n 'Fireworks Kontext models do not support explicit masks. Use the prompt to describe the areas to edit.',\n });\n }\n\n const splitSize = size?.split('x');\n const currentDate = this.config._internal?.currentDate?.() ?? new Date();\n const fireworksOptions =\n (await parseProviderOptions({\n provider: 'fireworks',\n providerOptions,\n schema: fireworksImageModelOptionsSchema,\n })) ?? {};\n\n const body = {\n prompt,\n aspect_ratio: aspectRatio,\n seed,\n samples: n,\n ...(inputImage && { input_image: inputImage }),\n ...(splitSize && { width: splitSize[0], height: splitSize[1] }),\n ...fireworksOptions,\n };\n\n // Handle async models that require polling (e.g., flux-kontext-*)\n if (imageEntry.requestConfig.image.urlFormat === 'workflows_async') {\n return this.doGenerateAsync({\n body,\n headers,\n abortSignal,\n warnings,\n currentDate,\n });\n }\n\n // Handle sync models that return binary directly\n const { value: response, responseHeaders } = await postJsonToApi({\n url: getUrlForModel(this.config.baseURL, this.modelId),\n headers: combineHeaders(await resolve(this.config.headers), headers),\n body,\n failedResponseHandler: createStatusCodeErrorResponseHandler(),\n successfulResponseHandler: createBinaryResponseHandler(),\n abortSignal,\n fetch: this.config.fetch,\n });\n\n return {\n images: [response],\n warnings,\n response: {\n timestamp: currentDate,\n modelId: this.modelId,\n headers: responseHeaders,\n },\n };\n }\n\n /**\n * Handles async image generation for models like flux-kontext-* that return\n * a request_id and require polling for results.\n */\n private async doGenerateAsync({\n body,\n headers,\n abortSignal,\n warnings,\n currentDate,\n }: {\n body: Record<string, unknown>;\n headers: Record<string, string | undefined> | undefined;\n abortSignal: AbortSignal | undefined;\n warnings: Array<SharedV4Warning>;\n currentDate: Date;\n }): Promise<Awaited<ReturnType<ImageModelV4['doGenerate']>>> {\n // Submit the generation request\n const { value: submitResponse } = await postJsonToApi({\n url: getUrlForModel(this.config.baseURL, this.modelId),\n headers: combineHeaders(await resolve(this.config.headers), headers),\n body,\n failedResponseHandler: createStatusCodeErrorResponseHandler(),\n successfulResponseHandler: createJsonResponseHandler(\n asyncSubmitResponseSchema,\n ),\n abortSignal,\n fetch: this.config.fetch,\n });\n\n const requestId = submitResponse.request_id;\n\n // Poll for the result\n const imageUrl = await this.pollForImageUrl({\n requestId,\n headers,\n abortSignal,\n });\n\n // Download the image from the URL. The URL comes from the provider\n // response and typically points at a CDN, so only send credentials when it\n // stays on the provider's own origin (never leak the API key to a CDN or an\n // attacker-named host).\n const { value: imageBytes, responseHeaders } = await getFromApi({\n url: imageUrl,\n // imageUrl comes from the provider response body.\n validateUrl: true,\n credentialedOrigin: this.config.baseURL,\n trustedOrigin: this.config.baseURL,\n headers: combineHeaders(await resolve(this.config.headers), headers),\n abortSignal,\n failedResponseHandler: createStatusCodeErrorResponseHandler(),\n successfulResponseHandler: createBinaryResponseHandler(),\n fetch: this.config.fetch,\n });\n\n return {\n images: [imageBytes],\n warnings,\n response: {\n timestamp: currentDate,\n modelId: this.modelId,\n headers: responseHeaders,\n },\n };\n }\n\n /**\n * Polls the get_result endpoint until the image is ready.\n */\n private async pollForImageUrl({\n requestId,\n headers,\n abortSignal,\n }: {\n requestId: string;\n headers: Record<string, string | undefined> | undefined;\n abortSignal: AbortSignal | undefined;\n }): Promise<string> {\n const pollIntervalMillis =\n this.config.pollIntervalMillis ?? DEFAULT_POLL_INTERVAL_MILLIS;\n const pollTimeoutMillis =\n this.config.pollTimeoutMillis ?? DEFAULT_POLL_TIMEOUT_MILLIS;\n\n const pollUrl = getPollUrlForModel(this.config.baseURL, this.modelId);\n\n const timeoutController = new AbortController();\n let didTimeout = false;\n const timeoutId = setTimeout(() => {\n didTimeout = true;\n timeoutController.abort();\n }, pollTimeoutMillis);\n const pollingAbortSignal =\n abortSignal == null\n ? timeoutController.signal\n : AbortSignal.any([abortSignal, timeoutController.signal]);\n\n try {\n while (true) {\n const { value: pollResponse } = await postJsonToApi({\n url: pollUrl,\n headers: combineHeaders(await resolve(this.config.headers), headers),\n body: { id: requestId },\n failedResponseHandler: createStatusCodeErrorResponseHandler(),\n successfulResponseHandler: createJsonResponseHandler(\n asyncPollResponseSchema,\n ),\n abortSignal: pollingAbortSignal,\n fetch: this.config.fetch,\n });\n\n const status = pollResponse.status;\n\n if (status === 'Ready') {\n const imageUrl = pollResponse.result?.sample;\n if (typeof imageUrl === 'string') {\n return imageUrl;\n }\n throw new Error(\n 'Fireworks poll response is Ready but missing result.sample',\n );\n }\n\n if (status === 'Error' || status === 'Failed') {\n throw new Error(\n `Fireworks image generation failed with status: ${status}`,\n );\n }\n\n // Wait before next poll attempt\n await delay(pollIntervalMillis, {\n abortSignal: pollingAbortSignal,\n });\n }\n } catch (error) {\n if (didTimeout) {\n throw new Error(\n `Fireworks image generation timed out after ${pollTimeoutMillis}ms`,\n );\n }\n throw error;\n } finally {\n clearTimeout(timeoutId);\n }\n }\n}\n","// Version string of this package injected at build time.\ndeclare const __PACKAGE_VERSION__: string | undefined;\nexport const VERSION: string =\n typeof __PACKAGE_VERSION__ !== 'undefined'\n ? __PACKAGE_VERSION__\n : '0.0.0-test';\n","import { getFireworksLanguageModelEntry } from './fireworks-model-catalog';\nimport {\n OpenAICompatibleChatLanguageModel,\n OpenAICompatibleCompletionLanguageModel,\n OpenAICompatibleEmbeddingModel,\n type ProviderErrorStructure,\n} from '@ai-sdk/openai-compatible';\nimport type {\n EmbeddingModelV4,\n ImageModelV4,\n LanguageModelV4,\n ProviderV4,\n} from '@ai-sdk/provider';\nimport {\n type Resolvable,\n resolveWith,\n loadApiKey,\n mapReasoningToProviderEffort,\n withoutTrailingSlash,\n withUserAgentSuffix,\n type FetchFunction,\n} from '@ai-sdk/provider-utils';\nimport { z } from 'zod/v4';\nimport type { FireworksChatModelId } from './fireworks-chat-options';\nimport type { FireworksCompletionModelId } from './fireworks-completion-options';\nimport type { FireworksEmbeddingModelId } from './fireworks-embedding-options';\nimport { FireworksImageModel } from './fireworks-image-model';\nimport type { FireworksImageModelId } from './fireworks-image-options';\nimport { VERSION } from './version';\n\nexport type FireworksErrorData = z.infer<typeof fireworksErrorSchema>;\n\nconst fireworksErrorSchema = z.object({\n error: z.union([\n z.string(),\n z.object({\n message: z.string(),\n object: z.string().nullish(),\n type: z.string().nullish(),\n param: z.any().nullish(),\n code: z.union([z.string(), z.number()]).nullish(),\n }),\n ]),\n});\n\nconst fireworksErrorStructure: ProviderErrorStructure<FireworksErrorData> = {\n errorSchema: fireworksErrorSchema,\n errorToMessage: data =>\n typeof data.error === 'string' ? data.error : data.error.message,\n};\n\nexport interface FireworksProviderSettings {\n /**\n * Fireworks API key. Default value is taken from the `FIREWORKS_API_KEY`\n * environment variable.\n * A function is called before each request and may return a promise.\n */\n apiKey?: Resolvable<string>;\n /**\n * Base URL for the API calls.\n */\n baseURL?: string;\n /**\n * Custom headers to include in the requests.\n */\n headers?: Record<string, string>;\n /**\n * Custom fetch implementation. You can use it as a middleware to intercept requests,\n * or to provide a custom fetch implementation for e.g. testing.\n */\n fetch?: FetchFunction;\n}\n\nexport interface FireworksProvider extends ProviderV4 {\n /**\n * Creates a model for text generation.\n */\n (modelId: FireworksChatModelId): LanguageModelV4;\n\n /**\n * Creates a chat model for text generation.\n */\n chatModel(modelId: FireworksChatModelId): LanguageModelV4;\n\n /**\n * Creates a completion model for text generation.\n */\n completionModel(modelId: FireworksCompletionModelId): LanguageModelV4;\n\n /**\n * Creates a chat model for text generation.\n */\n languageModel(modelId: FireworksChatModelId): LanguageModelV4;\n\n /**\n * Creates a text embedding model for text generation.\n */\n embeddingModel(modelId: FireworksEmbeddingModelId): EmbeddingModelV4;\n\n /**\n * @deprecated Use `embeddingModel` instead.\n */\n textEmbeddingModel(modelId: FireworksEmbeddingModelId): EmbeddingModelV4;\n\n /**\n * Creates a model for image generation.\n */\n image(modelId: FireworksImageModelId): ImageModelV4;\n\n /**\n * Creates a model for image generation.\n */\n imageModel(modelId: FireworksImageModelId): ImageModelV4;\n}\n\nconst defaultBaseURL = 'https://api.fireworks.ai/inference/v1';\n\nexport function createFireworks(\n options: FireworksProviderSettings = {},\n): FireworksProvider {\n const baseURL = withoutTrailingSlash(options.baseURL ?? defaultBaseURL);\n const getHeaders = () =>\n resolveWith(options.apiKey, apiKey =>\n withUserAgentSuffix(\n {\n Authorization: `Bearer ${loadApiKey({\n apiKey,\n environmentVariableName: 'FIREWORKS_API_KEY',\n description: 'Fireworks API key',\n })}`,\n ...options.headers,\n },\n `ai-sdk-fireworks/${VERSION}`,\n ),\n );\n\n interface CommonModelConfig {\n provider: string;\n url: ({ path }: { path: string }) => string;\n headers: Resolvable<Record<string, string>>;\n fetch?: FetchFunction;\n }\n\n const getCommonModelConfig = (modelType: string): CommonModelConfig => ({\n provider: `fireworks.${modelType}`,\n url: ({ path }) => `${baseURL}${path}`,\n headers: getHeaders,\n fetch: options.fetch,\n });\n\n const createChatModel = (modelId: FireworksChatModelId) => {\n return new OpenAICompatibleChatLanguageModel(modelId, {\n ...getCommonModelConfig('chat'),\n includeUsage: true,\n errorStructure: fireworksErrorStructure,\n supportsStructuredOutputs:\n getFireworksLanguageModelEntry(modelId).capabilities.language\n .structuredOutput.jsonSchema,\n mapReasoning: ({ reasoning, warnings }) =>\n mapReasoningToProviderEffort({\n reasoning,\n effortMap:\n getFireworksLanguageModelEntry(modelId).requestConfig.language\n .reasoningEffortMap,\n warnings,\n }),\n transformRequestBody: args => {\n const thinking = args.thinking as\n | { type?: string; budgetTokens?: number }\n | undefined;\n const reasoningHistory = args.reasoningHistory as string | undefined;\n const promptCacheKey = args.promptCacheKey as string | undefined;\n const serviceTier = args.serviceTier as string | undefined;\n\n const {\n thinking: _,\n reasoningHistory: __,\n promptCacheKey: ___,\n serviceTier: ____,\n ...rest\n } = args;\n\n return {\n ...rest,\n ...(promptCacheKey !== undefined && {\n prompt_cache_key: promptCacheKey,\n }),\n ...(serviceTier !== undefined && {\n service_tier: serviceTier,\n }),\n ...(thinking && {\n thinking: {\n type: thinking.type,\n ...(thinking.budgetTokens !== undefined && {\n budget_tokens: thinking.budgetTokens,\n }),\n },\n }),\n ...(reasoningHistory && {\n reasoning_history: reasoningHistory,\n }),\n };\n },\n });\n };\n\n const createCompletionModel = (modelId: FireworksCompletionModelId) =>\n new OpenAICompatibleCompletionLanguageModel(modelId, {\n ...getCommonModelConfig('completion'),\n includeUsage: true,\n errorStructure: fireworksErrorStructure,\n });\n\n const createEmbeddingModel = (modelId: FireworksEmbeddingModelId) =>\n new OpenAICompatibleEmbeddingModel(modelId, {\n ...getCommonModelConfig('embedding'),\n errorStructure: fireworksErrorStructure,\n });\n\n const createImageModel = (modelId: FireworksImageModelId) =>\n new FireworksImageModel(modelId, {\n ...getCommonModelConfig('image'),\n baseURL: baseURL ?? defaultBaseURL,\n });\n\n const provider = (modelId: FireworksChatModelId) => createChatModel(modelId);\n\n provider.specificationVersion = 'v4' as const;\n provider.completionModel = createCompletionModel;\n provider.chatModel = createChatModel;\n provider.languageModel = createChatModel;\n provider.embeddingModel = createEmbeddingModel;\n provider.textEmbeddingModel = createEmbeddingModel;\n provider.image = createImageModel;\n provider.imageModel = createImageModel;\n return provider;\n}\n\nexport const fireworks = createFireworks();\n"],"mappings":";;;;AAeA,MAAM,oCAAoC;CACxC,MAAM,EACJ,aACE,yGACJ;CACA,iBAAiB,EACf,aACE,sMACJ;CACA,eAAe,EACb,aACE,sEACJ;CACA,kBAAkB,EAChB,aACE,mNACJ;CACA,MAAM,EAAE,aAAa,sDAAsD;CAC3E,WAAW,EACT,aACE,qNACJ;CACA,QAAQ,EACN,aAAa,6DACf;AACF;AAMA,MAAM,qCAAqC;CACzC,YAAY,EACV,aACE,8HACJ;CACA,MAAM,EACJ,aACE,yGACJ;AACF;;AAMA,MAAa,2BAA2B;CACtC,UAAU;EACR,GAAG;EACH,gBAAgB,EACd,aACE,0FACJ;EACA,aAAa,EACX,aACE,kFACJ;EACA,UAAU,EAAE,aAAa,WAAW;EACpC,kBAAkB,EAAE,aAAa,mBAAmB;CACtD;CAIA,WAAW,EACT,GAAG,mCACL;CAIA,OAAO;EACL,gBAAgB,EACd,aACE,kEACJ;EACA,qBAAqB,EACnB,aACE,8DACJ;EACA,eAAe,EAAE,aAAa,+BAA+B;EAC7D,aAAa,EACX,aACE,mEACJ;EACA,gBAAgB,EACd,aAAa,6CACf;EACA,mBAAmB,EACjB,aACE,yFACJ;EACA,kBAAkB,EAChB,aAAa,qDACf;EACA,WAAW,EACT,aAAa,qDACf;EACA,OAAO,EACL,aACE,iEACJ;CACF;AAIF;;;;;AA+DA,MAAM,2BAA2B;CAC/B,yCAAyC;EACvC,WAAW,CAAC,MAAM;EAClB,OAAO;EACP,kBAAkB;EAClB,eAAe,CAAC;EAChB,kBAAkB;GAChB;GACA;GACA;GACA;GACA;GACA;GACA;EACF;CACF;CACA,qDAAqD;EACnD,WAAW,CAAC,MAAM;EAClB,OAAO;EACP,kBAAkB;EAClB,eAAe,CAAC;EAChB,kBAAkB;GAChB;GACA;GACA;GACA;GACA;GACA;GACA;EACF;CACF;CACA,oDAAoD;EAClD,WAAW,CAAC,MAAM;EAClB,OAAO;EACP,kBAAkB;EAClB,eAAe,CAAC;EAChB,kBAAkB;GAChB;GACA;GACA;GACA;GACA;GACA;GACA;EACF;CACF;CACA,sDAAsD;EACpD,WAAW,CAAC,MAAM;EAClB,OAAO;EACP,kBAAkB;EAClB,eAAe,CAAC,WAAW;EAC3B,kBAAkB;GAChB;GACA;GACA;GACA;GACA;GACA;GACA;EACF;CACF;CACA,oDAAoD;EAClD,WAAW,CAAC,MAAM;EAClB,OAAO;EACP,kBAAkB;EAClB,eAAe,CAAC;EAChB,kBAAkB;GAChB;GACA;GACA;GACA;GACA;GACA;GACA;EACF;CACF;CACA,mDAAmD;EACjD,WAAW,CAAC,MAAM;EAClB,OAAO;EACP,kBAAkB;EAClB,eAAe,CAAC;EAChB,kBAAkB;GAChB;GACA;GACA;GACA;GACA;GACA;GACA;EACF;CACF;CACA,oDAAoD;EAClD,WAAW,CAAC,MAAM;EAClB,OAAO;EACP,kBAAkB;EAClB,eAAe,CAAC;EAChB,kBAAkB;GAChB;GACA;GACA;GACA;GACA;GACA;GACA;EACF;CACF;CACA,sDAAsD;EACpD,WAAW,CAAC,MAAM;EAClB,OAAO;EACP,kBAAkB;EAClB,eAAe,CAAC;EAChB,kBAAkB;GAChB;GACA;GACA;GACA;GACA;GACA;GACA;EACF;CACF;CACA,wDAAwD;EACtD,WAAW,CAAC,MAAM;EAClB,OAAO;EACP,kBAAkB;EAClB,eAAe,CAAC;EAChB,kBAAkB;GAChB;GACA;GACA;GACA;GACA;GACA;GACA;EACF;CACF;CACA,kDAAkD;EAChD,WAAW,CAAC,MAAM;EAClB,OAAO;EACP,kBAAkB;EAClB,eAAe,CAAC;EAChB,kBAAkB;GAChB;GACA;GACA;GACA;GACA;GACA;GACA;EACF;CACF;CACA,kDAAkD;EAChD,WAAW,CAAC,MAAM;EAClB,OAAO;EACP,kBAAkB;EAClB,eAAe;EACf,kBAAkB;GAChB;GACA;GACA;GACA;GACA;GACA;GACA;EACF;CACF;CACA,mDAAmD;EACjD,WAAW,CAAC,MAAM;EAClB,OAAO;EACP,kBAAkB;EAClB,eAAe;EACf,kBAAkB;GAChB;GACA;GACA;GACA;GACA;GACA;GACA;EACF;CACF;CACA,4DAA4D;EAC1D,WAAW,CAAC,MAAM;EAClB,OAAO;EACP,kBAAkB;EAClB,eAAe,CAAC;EAChB,kBAAkB;GAChB;GACA;GACA;GACA;GACA;GACA;GACA;EACF;CACF;CACA,qCAAqC;EACnC,WAAW,CAAC,MAAM;EAClB,OAAO;EACP,kBAAkB;EAClB,eAAe;EACf,kBAAkB;GAChB;GACA;GACA;GACA;GACA;GACA;GACA;EACF;CACF;CACA,sCAAsC;EACpC,WAAW,CAAC,MAAM;EAClB,OAAO;EACP,kBAAkB;EAClB,eAAe,CAAC;EAChB,kBAAkB;GAChB;GACA;GACA;GACA;GACA;GACA;GACA;EACF;CACF;CACA,8CAA8C;EAC5C,WAAW,CAAC,MAAM;EAClB,OAAO;EACP,kBAAkB;EAClB,eAAe,CAAC;EAChB,kBAAkB;GAChB;GACA;GACA;GACA;GACA;GACA;GACA;EACF;CACF;CACA,8CAA8C;EAC5C,WAAW,CAAC,MAAM;EAClB,OAAO;EACP,kBAAkB;EAClB,eAAe,CAAC;EAChB,kBAAkB;GAChB;GACA;GACA;GACA;GACA;GACA;GACA;EACF;CACF;CACA,uCAAuC;EACrC,WAAW,CAAC,MAAM;EAClB,OAAO;EACP,kBAAkB;EAClB,eAAe,CAAC;EAChB,kBAAkB;GAChB;GACA;GACA;GACA;GACA;GACA;GACA;EACF;CACF;CACA,wCAAwC;EACtC,WAAW,CAAC,MAAM;EAClB,OAAO;EACP,kBAAkB;EAClB,eAAe,CAAC;EAChB,kBAAkB;GAChB;GACA;GACA;GACA;GACA;GACA;GACA;EACF;CACF;CACA,kDAAkD;EAChD,WAAW,CAAC,YAAY;EACxB,OAAO;EACP,kBAAkB;EAClB,eAAe;EACf,kBAAkB;GAChB;GACA;GACA;GACA;GACA;GACA;GACA;EACF;CACF;CACA,+CAA+C;EAC7C,WAAW,CAAC,YAAY;EACxB,OAAO;EACP,kBAAkB;EAClB,eAAe;EACf,kBAAkB;GAChB;GACA;GACA;GACA;GACA;GACA;GACA;EACF;CACF;CACA,6CAA6C;EAC3C,WAAW,CAAC;EACZ,OAAO;EACP,kBAAkB;EAClB,eAAe,CAAC,WAAW;EAC3B,kBAAkB;GAChB;GACA;GACA;GACA;GACA;GACA;GACA;EACF;CACF;CACA,yCAAyC;EACvC,WAAW,CAAC;EACZ,OAAO;EACP,kBAAkB;EAClB,eAAe;EACf,kBAAkB;GAChB;GACA;GACA;GACA;GACA;GACA;GACA;EACF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AAK;IAGtB,MAAM,mBAAmB,KAAK;IAC9B,MAAM,iBAAiB,KAAK;IAC5B,MAAM,cAAc,KAAK;IAEzB,MAAM,EACJ,UAAU,GACV,kBAAkB,IAClB,gBAAgB,KAChB,aAAa,MACb,GAAG,SACD;IAEJ,OAAO;KACL,GAAG;KACH,GAAI,mBAAmB,KAAA,KAAa,EAClC,kBAAkB,eACpB;KACA,GAAI,gBAAgB,KAAA,KAAa,EAC/B,cAAc,YAChB;KACA,GAAI,YAAY,EACd,UAAU;MACR,MAAM,SAAS;MACf,GAAI,SAAS,iBAAiB,KAAA,KAAa,EACzC,eAAe,SAAS,aAC1B;KACF,EACF;KACA,GAAI,oBAAoB,EACtB,mBAAmB,iBACrB;IACF;GACF;EACF,CAAC;CACH;CAEA,MAAM,yBAAyB,YAC7B,IAAI,wCAAwC,SAAS;EACnD,GAAG,qBAAqB,YAAY;EACpC,cAAc;EACd,gBAAgB;CAClB,CAAC;CAEH,MAAM,wBAAwB,YAC5B,IAAI,+BAA+B,SAAS;EAC1C,GAAG,qBAAqB,WAAW;EACnC,gBAAgB;CAClB,CAAC;CAEH,MAAM,oBAAoB,YACxB,IAAI,oBAAoB,SAAS;EAC/B,GAAG,qBAAqB,OAAO;EAC/B,SAAS,WAAW;CACtB,CAAC;CAEH,MAAM,YAAY,YAAkC,gBAAgB,OAAO;CAE3E,SAAS,uBAAuB;CAChC,SAAS,kBAAkB;CAC3B,SAAS,YAAY;CACrB,SAAS,gBAAgB;CACzB,SAAS,iBAAiB;CAC1B,SAAS,qBAAqB;CAC9B,SAAS,QAAQ;CACjB,SAAS,aAAa;CACtB,OAAO;AACT;AAEA,MAAa,YAAY,gBAAgB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-sdk/fireworks",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.102",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -29,17 +29,18 @@
|
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@ai-sdk/openai-compatible": "3.0.
|
|
33
|
-
"@ai-sdk/provider": "4.0.
|
|
34
|
-
"@ai-sdk/provider-utils": "5.0.
|
|
32
|
+
"@ai-sdk/openai-compatible": "3.0.98",
|
|
33
|
+
"@ai-sdk/provider": "4.0.40",
|
|
34
|
+
"@ai-sdk/provider-utils": "5.0.87"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@ai-sdk/test-server": "2.0.4",
|
|
38
38
|
"@types/node": "22.19.19",
|
|
39
|
+
"@typescript/native": "npm:typescript@7.0.2",
|
|
39
40
|
"@vercel/ai-tsconfig": "0.0.0",
|
|
40
41
|
"@vercel/ai-tsdown-config": "0.0.0",
|
|
41
42
|
"tsdown": "^0.23.0",
|
|
42
|
-
"typescript": "6.0.
|
|
43
|
+
"typescript": "npm:@typescript/typescript6@6.0.2",
|
|
43
44
|
"zod": "4.6.7"
|
|
44
45
|
},
|
|
45
46
|
"peerDependencies": {
|
|
@@ -70,6 +71,9 @@
|
|
|
70
71
|
"clean": "del-cli docs",
|
|
71
72
|
"type-check": "tsc --noEmit",
|
|
72
73
|
"test": "pnpm test:node && pnpm test:edge",
|
|
74
|
+
"test:node22": "node ../../tools/with-node.mjs 22 pnpm test",
|
|
75
|
+
"test:node24": "node ../../tools/with-node.mjs 24 pnpm test",
|
|
76
|
+
"test:node26": "node ../../tools/with-node.mjs 26 pnpm test",
|
|
73
77
|
"test:update": "pnpm test:node -u",
|
|
74
78
|
"test:watch": "vitest --config vitest.node.config.js",
|
|
75
79
|
"test:edge": "vitest --config vitest.edge.config.js --run",
|