@ai-sdk/replicate 3.0.52 → 3.0.54
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 +18 -0
- package/dist/index.d.ts +111 -106
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +491 -641
- package/dist/index.js.map +1 -1
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @ai-sdk/replicate
|
|
2
2
|
|
|
3
|
+
## 3.0.54
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [8c65988]
|
|
8
|
+
- Updated dependencies [527a163]
|
|
9
|
+
- @ai-sdk/provider@4.0.21
|
|
10
|
+
- @ai-sdk/provider-utils@5.0.53
|
|
11
|
+
|
|
12
|
+
## 3.0.53
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- ede5b89: chore: migrate package builds from tsup to tsdown
|
|
17
|
+
- Updated dependencies [ede5b89]
|
|
18
|
+
- @ai-sdk/provider@4.0.20
|
|
19
|
+
- @ai-sdk/provider-utils@5.0.52
|
|
20
|
+
|
|
3
21
|
## 3.0.52
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -1,96 +1,98 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
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
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
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
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
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:
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
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
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
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
|
-
|
|
132
|
-
|
|
133
|
-
|
|
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"}
|