@ai-sdk/bytedance 2.0.53 → 2.0.55
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 +16 -0
- package/dist/index.d.ts +128 -120
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +478 -635
- package/dist/index.js.map +1 -1
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @ai-sdk/bytedance
|
|
2
2
|
|
|
3
|
+
## 2.0.55
|
|
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
|
+
## 2.0.54
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Updated dependencies [c2511c1]
|
|
17
|
+
- @ai-sdk/provider-utils@5.0.51
|
|
18
|
+
|
|
3
19
|
## 2.0.53
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -1,141 +1,149 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { FetchFunction, Resolvable } from
|
|
3
|
-
|
|
1
|
+
import { Experimental_VideoModelV4, ImageModelV4, ImageModelV4CallOptions, ProviderV4 } from "@ai-sdk/provider";
|
|
2
|
+
import { FetchFunction, Resolvable } from "@ai-sdk/provider-utils";
|
|
3
|
+
//#region src/bytedance-image-settings.d.ts
|
|
4
4
|
type ByteDanceImageModelId = 'dola-seedream-5-0-pro-260628' | 'seedream-5-0-260128' | 'seedream-5-0-lite-260128' | 'seedream-4-5-251128' | 'seedream-4-0-250828' | (string & {});
|
|
5
|
-
|
|
5
|
+
//#endregion
|
|
6
|
+
//#region src/bytedance-video-settings.d.ts
|
|
6
7
|
type ByteDanceVideoModelId = 'dreamina-seedance-2-0-fast-260128' | 'dreamina-seedance-2-0-260128' | 'seedance-1-5-pro-251215' | 'seedance-1-0-pro-250528' | 'seedance-1-0-pro-fast-251015' | 'seedance-1-0-lite-t2v-250428' | 'seedance-1-0-lite-i2v-250428' | (string & {});
|
|
7
|
-
|
|
8
|
+
//#endregion
|
|
9
|
+
//#region src/bytedance-provider.d.ts
|
|
8
10
|
interface ByteDanceProviderSettings {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
11
|
+
/**
|
|
12
|
+
* ByteDance Ark API key. Default value is taken from the `ARK_API_KEY`
|
|
13
|
+
* environment variable.
|
|
14
|
+
*/
|
|
15
|
+
apiKey?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Base URL for the API calls.
|
|
18
|
+
* Default: https://ark.ap-southeast.bytepluses.com/api/v3
|
|
19
|
+
*/
|
|
20
|
+
baseURL?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Custom headers to include in the requests.
|
|
23
|
+
*/
|
|
24
|
+
headers?: Record<string, string>;
|
|
25
|
+
/**
|
|
26
|
+
* Custom fetch implementation. You can use it as a middleware to intercept
|
|
27
|
+
* requests, or to provide a custom fetch implementation for e.g. testing.
|
|
28
|
+
*/
|
|
29
|
+
fetch?: FetchFunction;
|
|
28
30
|
}
|
|
29
31
|
interface ByteDanceProvider extends ProviderV4 {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
32
|
+
/**
|
|
33
|
+
* Creates a model for video generation.
|
|
34
|
+
*/
|
|
35
|
+
video(modelId: ByteDanceVideoModelId): Experimental_VideoModelV4;
|
|
36
|
+
/**
|
|
37
|
+
* Creates a model for video generation.
|
|
38
|
+
*/
|
|
39
|
+
videoModel(modelId: ByteDanceVideoModelId): Experimental_VideoModelV4;
|
|
40
|
+
/**
|
|
41
|
+
* Creates a model for image generation.
|
|
42
|
+
*/
|
|
43
|
+
image(modelId: ByteDanceImageModelId): ImageModelV4;
|
|
44
|
+
/**
|
|
45
|
+
* Creates a model for image generation.
|
|
46
|
+
*/
|
|
47
|
+
imageModel(modelId: ByteDanceImageModelId): ImageModelV4;
|
|
46
48
|
}
|
|
47
49
|
/**
|
|
48
50
|
* Create a ByteDance provider instance.
|
|
49
51
|
*/
|
|
50
|
-
declare function createByteDance(options?: ByteDanceProviderSettings): ByteDanceProvider;
|
|
52
|
+
export declare function createByteDance(options?: ByteDanceProviderSettings): ByteDanceProvider;
|
|
51
53
|
/**
|
|
52
54
|
* Default ByteDance provider instance.
|
|
53
55
|
*/
|
|
54
|
-
declare const byteDance: ByteDanceProvider;
|
|
55
|
-
|
|
56
|
+
export declare const byteDance: ByteDanceProvider;
|
|
57
|
+
//#endregion
|
|
58
|
+
//#region src/bytedance-config.d.ts
|
|
56
59
|
interface ByteDanceConfig {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
60
|
+
provider: string;
|
|
61
|
+
baseURL: string;
|
|
62
|
+
headers: Resolvable<Record<string, string | undefined>>;
|
|
63
|
+
fetch?: FetchFunction;
|
|
61
64
|
}
|
|
62
|
-
|
|
65
|
+
//#endregion
|
|
66
|
+
//#region src/bytedance-image-model.d.ts
|
|
63
67
|
interface ByteDanceImageModelConfig extends ByteDanceConfig {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
68
|
+
_internal?: {
|
|
69
|
+
currentDate?: () => Date;
|
|
70
|
+
};
|
|
67
71
|
}
|
|
68
|
-
declare class ByteDanceImageModel implements ImageModelV4 {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
72
|
+
export declare class ByteDanceImageModel implements ImageModelV4 {
|
|
73
|
+
readonly modelId: ByteDanceImageModelId;
|
|
74
|
+
private readonly config;
|
|
75
|
+
readonly specificationVersion = "v4";
|
|
76
|
+
readonly maxImagesPerCall = 1;
|
|
77
|
+
get supportsFileInputs(): boolean | undefined;
|
|
78
|
+
get supportsMaskInputs(): boolean | undefined;
|
|
79
|
+
get provider(): string;
|
|
80
|
+
constructor(modelId: ByteDanceImageModelId, config: ByteDanceImageModelConfig);
|
|
81
|
+
doGenerate({ prompt, size, aspectRatio, seed, providerOptions, headers, abortSignal, files, mask }: ImageModelV4CallOptions): Promise<Awaited<ReturnType<ImageModelV4['doGenerate']>>>;
|
|
78
82
|
}
|
|
79
|
-
|
|
83
|
+
//#endregion
|
|
84
|
+
//#region src/bytedance-image-model-options.d.ts
|
|
80
85
|
type ByteDanceImageModelOptions = {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
86
|
+
/**
|
|
87
|
+
* Whether to add an "AI generated" watermark to the bottom-right corner of
|
|
88
|
+
* the output image.
|
|
89
|
+
*/
|
|
90
|
+
watermark?: boolean | null;
|
|
91
|
+
/**
|
|
92
|
+
* Format of the generated image file. Supported by `seedream-5-0` and
|
|
93
|
+
* `dola-seedream-5-0-pro`; `seedream-4-5` / `seedream-4-0` always return
|
|
94
|
+
* `jpeg`.
|
|
95
|
+
*/
|
|
96
|
+
outputFormat?: 'png' | 'jpeg' | null;
|
|
97
|
+
/**
|
|
98
|
+
* A resolution level (e.g. `1K`, `2K`, `3K`, `4K`) as an alternative to
|
|
99
|
+
* passing pixel dimensions via the top-level `size` parameter. When set, this
|
|
100
|
+
* overrides the top-level `size`. Available levels vary by model.
|
|
101
|
+
*/
|
|
102
|
+
size?: string | null;
|
|
103
|
+
/**
|
|
104
|
+
* Set to `'auto'` to generate a batch of related images (e.g. storyboards or
|
|
105
|
+
* brand visuals). Defaults to `'disabled'` (single image).
|
|
106
|
+
*/
|
|
107
|
+
sequentialImageGeneration?: 'auto' | 'disabled' | null;
|
|
108
|
+
/**
|
|
109
|
+
* Maximum number of images to generate when `sequentialImageGeneration` is
|
|
110
|
+
* `'auto'`. The number of input reference images plus generated images must
|
|
111
|
+
* not exceed the model's limit.
|
|
112
|
+
*/
|
|
113
|
+
maxImages?: number | null;
|
|
114
|
+
/**
|
|
115
|
+
* Prompt optimization mode. `seedream-4-0` supports both `'standard'` and
|
|
116
|
+
* `'fast'`; other models support `'standard'` only.
|
|
117
|
+
*/
|
|
118
|
+
optimizePromptMode?: 'standard' | 'fast' | null;
|
|
119
|
+
[key: string]: unknown;
|
|
115
120
|
};
|
|
116
|
-
|
|
121
|
+
//#endregion
|
|
122
|
+
//#region src/bytedance-video-model-options.d.ts
|
|
117
123
|
type ByteDanceVideoModelOptions = {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
124
|
+
watermark?: boolean | null;
|
|
125
|
+
generateAudio?: boolean | null;
|
|
126
|
+
cameraFixed?: boolean | null;
|
|
127
|
+
returnLastFrame?: boolean | null;
|
|
128
|
+
serviceTier?: 'default' | 'flex' | null;
|
|
129
|
+
draft?: boolean | null;
|
|
130
|
+
lastFrameImage?: string | null;
|
|
131
|
+
referenceImages?: string[] | null;
|
|
132
|
+
referenceVideos?: string[] | null;
|
|
133
|
+
referenceAudio?: string[] | null;
|
|
134
|
+
/**
|
|
135
|
+
* @deprecated Ignored. Pass `poll: { intervalMs }` to `generateVideo` instead.
|
|
136
|
+
*/
|
|
137
|
+
pollIntervalMs?: number | null;
|
|
138
|
+
/**
|
|
139
|
+
* @deprecated Ignored. Pass `poll: { timeoutMs }` to `generateVideo` instead.
|
|
140
|
+
*/
|
|
141
|
+
pollTimeoutMs?: number | null;
|
|
142
|
+
[key: string]: unknown;
|
|
137
143
|
};
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
144
|
+
//#endregion
|
|
145
|
+
//#region src/version.d.ts
|
|
146
|
+
export declare const VERSION: string;
|
|
147
|
+
//#endregion
|
|
148
|
+
export type { ByteDanceImageModelId, ByteDanceImageModelOptions, ByteDanceProvider, ByteDanceProviderSettings, ByteDanceVideoModelId, ByteDanceVideoModelOptions, ByteDanceVideoModelOptions as ByteDanceVideoProviderOptions };
|
|
149
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/bytedance-image-settings.ts","../src/bytedance-video-settings.ts","../src/bytedance-provider.ts","../src/bytedance-config.ts","../src/bytedance-image-model.ts","../src/bytedance-image-model-options.ts","../src/bytedance-video-model-options.ts","../src/version.ts"],"mappings":";;;KAAY;;;KCAA;;;UCgBK;;;;;EAKf;;;;;EAMA;;;;EAKA,UAAU;;;;;EAMV,QAAQ;;UAGO,0BAA0B;;;;EAIzC,MAAM,SAAS,wBAAwB;;;;EAKvC,WAAW,SAAS,wBAAwB;;;;EAK5C,MAAM,SAAS,wBAAwB;;;;EAKvC,WAAW,SAAS,wBAAwB;;;;;wBAQ9B,gBACd,UAAS,4BACR;;;;qBA+CU,WAAS;;;UCnHL;EACf;EACA;EACA,SAAS,WAAW;EACpB,QAAQ;;;;UC0BA,kCAAkC;EAC1C;IACE,oBAAoB;;;qBAIX,+BAA+B;WA4B/B,SAAS;mBACD;WA5BV;WAIA;MAEL;MAYA;MAIA;EAKO,YAAA,SAAS,uBACD,QAAQ;EAGrB,aACJ,QACA,MACA,aACA,MACA,iBACA,SACA,aACA,OACA,QACC,0BAA0B,QAC3B,QAAQ,WAAW;;;;KC9EX;;;;;EAKV;;;;;;EAOA;;;;;;EAOA;;;;;EAMA;;;;;;EAOA;;;;;EAMA;GAEC;;;;KCxCS;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;;EAIA;;;;EAIA;GACC;;;;qBCpBU"}
|