@ai-sdk/replicate 3.0.51 → 3.0.53

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @ai-sdk/replicate
2
2
 
3
+ ## 3.0.53
4
+
5
+ ### Patch Changes
6
+
7
+ - ede5b89: chore: migrate package builds from tsup to tsdown
8
+ - Updated dependencies [ede5b89]
9
+ - @ai-sdk/provider@4.0.20
10
+ - @ai-sdk/provider-utils@5.0.52
11
+
12
+ ## 3.0.52
13
+
14
+ ### Patch Changes
15
+
16
+ - c2511c1: fix: use standards-compliant User-Agent header
17
+ - Updated dependencies [c2511c1]
18
+ - @ai-sdk/provider-utils@5.0.51
19
+
3
20
  ## 3.0.51
4
21
 
5
22
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -1,96 +1,98 @@
1
- import * as _ai_sdk_provider from '@ai-sdk/provider';
2
- import { ImageModelV4, ProviderV4, Experimental_VideoModelV4 } from '@ai-sdk/provider';
3
- import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
4
- import { WORKFLOW_SERIALIZE, WORKFLOW_DESERIALIZE, Resolvable, FetchFunction, InferSchema } from '@ai-sdk/provider-utils';
5
-
1
+ import { Experimental_VideoModelV4, ImageModelV4, ProviderV4 } from "@ai-sdk/provider";
2
+ import { FetchFunction, InferSchema, Resolvable, WORKFLOW_DESERIALIZE, WORKFLOW_SERIALIZE } from "@ai-sdk/provider-utils";
3
+ //#region src/replicate-image-settings.d.ts
6
4
  type ReplicateImageModelId = 'black-forest-labs/flux-1.1-pro' | 'black-forest-labs/flux-1.1-pro-ultra' | 'black-forest-labs/flux-dev' | 'black-forest-labs/flux-pro' | 'black-forest-labs/flux-schnell' | 'bytedance/sdxl-lightning-4step' | 'fofr/aura-flow' | 'fofr/latent-consistency-model' | 'fofr/realvisxl-v3-multi-controlnet-lora' | 'fofr/sdxl-emoji' | 'fofr/sdxl-multi-controlnet-lora' | 'ideogram-ai/ideogram-v2' | 'ideogram-ai/ideogram-v2-turbo' | 'lucataco/dreamshaper-xl-turbo' | 'lucataco/open-dalle-v1.1' | 'lucataco/realvisxl-v2.0' | 'lucataco/realvisxl2-lcm' | 'luma/photon' | 'luma/photon-flash' | 'nvidia/sana' | 'playgroundai/playground-v2.5-1024px-aesthetic' | 'recraft-ai/recraft-v3' | 'recraft-ai/recraft-v3-svg' | 'stability-ai/stable-diffusion-3.5-large' | 'stability-ai/stable-diffusion-3.5-large-turbo' | 'stability-ai/stable-diffusion-3.5-medium' | 'tstramer/material-diffusion' | 'black-forest-labs/flux-fill-pro' | 'black-forest-labs/flux-fill-dev' | 'black-forest-labs/flux-2-pro' | 'black-forest-labs/flux-2-dev' | (string & {});
7
-
5
+ //#endregion
6
+ //#region src/replicate-image-model.d.ts
8
7
  interface ReplicateImageModelConfig {
9
- provider: string;
10
- baseURL: string;
11
- headers?: Resolvable<Record<string, string | undefined>>;
12
- fetch?: FetchFunction;
13
- _internal?: {
14
- currentDate?: () => Date;
15
- };
8
+ provider: string;
9
+ baseURL: string;
10
+ headers?: Resolvable<Record<string, string | undefined>>;
11
+ fetch?: FetchFunction;
12
+ _internal?: {
13
+ currentDate?: () => Date;
14
+ };
16
15
  }
17
16
  declare class ReplicateImageModel implements ImageModelV4 {
18
- readonly modelId: ReplicateImageModelId;
19
- private readonly config;
20
- readonly specificationVersion = "v4";
21
- get maxImagesPerCall(): number;
22
- get supportsFileInputs(): boolean | undefined;
23
- get supportsMaskInputs(): boolean | undefined;
24
- get provider(): string;
25
- private get isFlux2Model();
26
- static [WORKFLOW_SERIALIZE](model: ReplicateImageModel): {
27
- modelId: string;
28
- config: _ai_sdk_provider.JSONObject;
29
- };
30
- static [WORKFLOW_DESERIALIZE](options: {
31
- modelId: ReplicateImageModelId;
32
- config: ReplicateImageModelConfig;
33
- }): ReplicateImageModel;
34
- constructor(modelId: ReplicateImageModelId, config: ReplicateImageModelConfig);
35
- doGenerate({ prompt, n, aspectRatio, size, seed, providerOptions, headers, abortSignal, files, mask, }: Parameters<ImageModelV4['doGenerate']>[0]): Promise<Awaited<ReturnType<ImageModelV4['doGenerate']>>>;
36
- private pollPrediction;
37
- private getCompletedPrediction;
17
+ readonly modelId: ReplicateImageModelId;
18
+ private readonly config;
19
+ readonly specificationVersion = "v4";
20
+ get maxImagesPerCall(): number;
21
+ get supportsFileInputs(): boolean | undefined;
22
+ get supportsMaskInputs(): boolean | undefined;
23
+ get provider(): string;
24
+ private get isFlux2Model();
25
+ static [WORKFLOW_SERIALIZE](model: ReplicateImageModel): {
26
+ modelId: string;
27
+ config: import("@ai-sdk/provider").JSONObject;
28
+ };
29
+ static [WORKFLOW_DESERIALIZE](options: {
30
+ modelId: ReplicateImageModelId;
31
+ config: ReplicateImageModelConfig;
32
+ }): ReplicateImageModel;
33
+ constructor(modelId: ReplicateImageModelId, config: ReplicateImageModelConfig);
34
+ doGenerate({ prompt, n, aspectRatio, size, seed, providerOptions, headers, abortSignal, files, mask }: Parameters<ImageModelV4['doGenerate']>[0]): Promise<Awaited<ReturnType<ImageModelV4['doGenerate']>>>;
35
+ private pollPrediction;
36
+ private getCompletedPrediction;
38
37
  }
39
-
38
+ //#endregion
39
+ //#region src/replicate-video-settings.d.ts
40
40
  type ReplicateVideoModelId = 'minimax/video-01' | 'minimax/video-01:6c1e4171-288a-4ca2-a738-894f0e87699d' | 'stability-ai/stable-video-diffusion:3f0457e4619daac51203dedb472816fd4af51f3149fa7a9e0b5ffcf1b8172438' | (string & {});
41
-
41
+ //#endregion
42
+ //#region src/replicate-provider.d.ts
42
43
  interface ReplicateProviderSettings {
43
- /**
44
- * API token that is being send using the `Authorization` header.
45
- * It defaults to the `REPLICATE_API_TOKEN` environment variable.
46
- */
47
- apiToken?: string;
48
- /**
49
- * Use a different URL prefix for API calls, e.g. to use proxy servers.
50
- * The default prefix is `https://api.replicate.com/v1`.
51
- */
52
- baseURL?: string;
53
- /**
54
- * Custom headers to include in the requests.
55
- */
56
- headers?: Record<string, string>;
57
- /**
58
- * Custom fetch implementation. You can use it as a middleware to intercept requests,
59
- * or to provide a custom fetch implementation for e.g. testing.
60
- */
61
- fetch?: FetchFunction;
44
+ /**
45
+ * API token that is being send using the `Authorization` header.
46
+ * It defaults to the `REPLICATE_API_TOKEN` environment variable.
47
+ */
48
+ apiToken?: string;
49
+ /**
50
+ * Use a different URL prefix for API calls, e.g. to use proxy servers.
51
+ * The default prefix is `https://api.replicate.com/v1`.
52
+ */
53
+ baseURL?: string;
54
+ /**
55
+ * Custom headers to include in the requests.
56
+ */
57
+ headers?: Record<string, string>;
58
+ /**
59
+ * Custom fetch implementation. You can use it as a middleware to intercept requests,
60
+ * or to provide a custom fetch implementation for e.g. testing.
61
+ */
62
+ fetch?: FetchFunction;
62
63
  }
63
64
  interface ReplicateProvider extends ProviderV4 {
64
- /**
65
- * Creates a Replicate image generation model.
66
- */
67
- image(modelId: ReplicateImageModelId): ReplicateImageModel;
68
- /**
69
- * Creates a Replicate image generation model.
70
- */
71
- imageModel(modelId: ReplicateImageModelId): ReplicateImageModel;
72
- /**
73
- * @deprecated Use `embeddingModel` instead.
74
- */
75
- textEmbeddingModel(modelId: string): never;
76
- /**
77
- * Creates a Replicate video generation model.
78
- */
79
- video(modelId: ReplicateVideoModelId): Experimental_VideoModelV4;
80
- /**
81
- * Creates a Replicate video generation model.
82
- */
83
- videoModel(modelId: ReplicateVideoModelId): Experimental_VideoModelV4;
65
+ /**
66
+ * Creates a Replicate image generation model.
67
+ */
68
+ image(modelId: ReplicateImageModelId): ReplicateImageModel;
69
+ /**
70
+ * Creates a Replicate image generation model.
71
+ */
72
+ imageModel(modelId: ReplicateImageModelId): ReplicateImageModel;
73
+ /**
74
+ * @deprecated Use `embeddingModel` instead.
75
+ */
76
+ textEmbeddingModel(modelId: string): never;
77
+ /**
78
+ * Creates a Replicate video generation model.
79
+ */
80
+ video(modelId: ReplicateVideoModelId): Experimental_VideoModelV4;
81
+ /**
82
+ * Creates a Replicate video generation model.
83
+ */
84
+ videoModel(modelId: ReplicateVideoModelId): Experimental_VideoModelV4;
84
85
  }
85
86
  /**
86
87
  * Create a Replicate provider instance.
87
88
  */
88
- declare function createReplicate(options?: ReplicateProviderSettings): ReplicateProvider;
89
+ export declare function createReplicate(options?: ReplicateProviderSettings): ReplicateProvider;
89
90
  /**
90
91
  * Default Replicate provider instance.
91
92
  */
92
- declare const replicate: ReplicateProvider;
93
-
93
+ export declare const replicate: ReplicateProvider;
94
+ //#endregion
95
+ //#region src/replicate-image-model-options.d.ts
94
96
  /**
95
97
  * Provider options schema for Replicate image generation.
96
98
  *
@@ -98,36 +100,39 @@ declare const replicate: ReplicateProvider;
98
100
  * This schema includes common parameters, but you can pass any
99
101
  * model-specific parameters through the passthrough.
100
102
  */
101
- declare const replicateImageModelOptionsSchema: _ai_sdk_provider_utils.LazySchema<{
102
- [x: string]: unknown;
103
- maxWaitTimeInSeconds?: number | null | undefined;
104
- pollIntervalMillis?: number | null | undefined;
105
- maxPollAttempts?: number | null | undefined;
106
- guidance_scale?: number | null | undefined;
107
- num_inference_steps?: number | null | undefined;
108
- negative_prompt?: string | null | undefined;
109
- output_format?: "png" | "jpg" | "webp" | null | undefined;
110
- output_quality?: number | null | undefined;
111
- strength?: number | null | undefined;
103
+ declare const replicateImageModelOptionsSchema: import("@ai-sdk/provider-utils").LazySchema<{
104
+ [x: string]: unknown;
105
+ maxWaitTimeInSeconds?: number | null | undefined;
106
+ pollIntervalMillis?: number | null | undefined;
107
+ maxPollAttempts?: number | null | undefined;
108
+ guidance_scale?: number | null | undefined;
109
+ num_inference_steps?: number | null | undefined;
110
+ negative_prompt?: string | null | undefined;
111
+ output_format?: "png" | "jpg" | "webp" | null | undefined;
112
+ output_quality?: number | null | undefined;
113
+ strength?: number | null | undefined;
112
114
  }>;
113
115
  type ReplicateImageModelOptions = InferSchema<typeof replicateImageModelOptionsSchema>;
114
-
116
+ //#endregion
117
+ //#region src/replicate-video-model-options.d.ts
115
118
  type ReplicateVideoModelOptions = {
116
- pollIntervalMs?: number | null;
117
- pollTimeoutMs?: number | null;
118
- maxWaitTimeInSeconds?: number | null;
119
- guidance_scale?: number | null;
120
- num_inference_steps?: number | null;
121
- motion_bucket_id?: number | null;
122
- cond_aug?: number | null;
123
- decoding_t?: number | null;
124
- video_length?: string | null;
125
- sizing_strategy?: string | null;
126
- frames_per_second?: number | null;
127
- prompt_optimizer?: boolean | null;
128
- [key: string]: unknown;
119
+ pollIntervalMs?: number | null;
120
+ pollTimeoutMs?: number | null;
121
+ maxWaitTimeInSeconds?: number | null;
122
+ guidance_scale?: number | null;
123
+ num_inference_steps?: number | null;
124
+ motion_bucket_id?: number | null;
125
+ cond_aug?: number | null;
126
+ decoding_t?: number | null;
127
+ video_length?: string | null;
128
+ sizing_strategy?: string | null;
129
+ frames_per_second?: number | null;
130
+ prompt_optimizer?: boolean | null;
131
+ [key: string]: unknown;
129
132
  };
130
-
131
- declare const VERSION: string;
132
-
133
- export { type ReplicateImageModelOptions, type ReplicateImageModelOptions as ReplicateImageProviderOptions, type ReplicateProvider, type ReplicateProviderSettings, type ReplicateVideoModelId, type ReplicateVideoModelOptions, type ReplicateVideoModelOptions as ReplicateVideoProviderOptions, VERSION, createReplicate, replicate };
133
+ //#endregion
134
+ //#region src/version.d.ts
135
+ export declare const VERSION: string;
136
+ //#endregion
137
+ export type { ReplicateImageModelOptions, ReplicateImageModelOptions as ReplicateImageProviderOptions, ReplicateProvider, ReplicateProviderSettings, ReplicateVideoModelId, ReplicateVideoModelOptions, ReplicateVideoModelOptions as ReplicateVideoProviderOptions };
138
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/replicate-image-settings.ts","../src/replicate-image-model.ts","../src/replicate-video-settings.ts","../src/replicate-provider.ts","../src/replicate-image-model-options.ts","../src/replicate-video-model-options.ts","../src/version.ts"],"mappings":";;;KAAY;;;UC6BF;EACR;EACA;EACA,UAAU,WAAW;EACrB,QAAQ;EACR;IACE,oBAAoB;;;cAQX,+BAA+B;WAuD/B,SAAS;mBACD;WAvDV;MAEL;MAKA;MAaA;MAWA;cAIQ;UAIJ,oBAAoB,OAAO;;;;UAO3B,sBAAsB;IAC5B,SAAS;IACT,QAAQ;MACT;EAKU,YAAA,SAAS,uBACD,QAAQ;EAGrB,aACJ,QACA,GACA,aACA,MACA,MACA,iBACA,SACA,aACA,OACA,QACC,WAAW,iCAAiC,QAC7C,QAAQ,WAAW;UA+JP;UAoDN;;;;KCrUE;;;UCkBK;;;;;EAKf;;;;;EAMA;;;;EAKA,UAAU;;;;;EAMV,QAAQ;;UAGO,0BAA0B;;;;EAIzC,MAAM,SAAS,wBAAwB;;;;EAKvC,WAAW,SAAS,wBAAwB;;;;EAK5C,mBAAmB;;;;EAKnB,MAAM,SAAS,wBAAwB;;;;EAKvC,WAAW,SAAS,wBAAwB;;;;;wBAM9B,gBACd,UAAS,4BACR;;;;qBA6DU,WAAS;;;;;;;;;;cC1HT,mEAAgC;;;;;;;;;;;;KA4DjC,6BAA6B,mBAChC;;;KCxEG;EAEV;EACA;EACA;EAGA;EACA;EAGA;EACA;EACA;EACA;EACA;EACA;EAGA;GAEC;;;;qBCtBU"}