@scenario-labs/sdk 2.7.0 → 3.0.0
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/client.d.mts +10 -10
- package/client.d.mts.map +1 -1
- package/client.d.ts +10 -10
- package/client.d.ts.map +1 -1
- package/client.js.map +1 -1
- package/client.mjs.map +1 -1
- package/lib/job.d.mts +2 -2
- package/lib/job.d.mts.map +1 -1
- package/lib/job.d.ts +2 -2
- package/lib/job.d.ts.map +1 -1
- package/lib/job.js +3 -3
- package/lib/job.js.map +1 -1
- package/lib/job.mjs +3 -3
- package/lib/job.mjs.map +1 -1
- package/lib/upload.d.mts +2 -2
- package/lib/upload.d.mts.map +1 -1
- package/lib/upload.d.ts +2 -2
- package/lib/upload.d.ts.map +1 -1
- package/lib/upload.js +4 -4
- package/lib/upload.js.map +1 -1
- package/lib/upload.mjs +4 -4
- package/lib/upload.mjs.map +1 -1
- package/lib/workflow.d.mts +2 -2
- package/lib/workflow.d.mts.map +1 -1
- package/lib/workflow.d.ts +2 -2
- package/lib/workflow.d.ts.map +1 -1
- package/lib/workflow.js +2 -2
- package/lib/workflow.js.map +1 -1
- package/lib/workflow.mjs +2 -2
- package/lib/workflow.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/assets/assets.d.mts +1091 -8
- package/resources/assets/assets.d.mts.map +1 -1
- package/resources/assets/assets.d.ts +1091 -8
- package/resources/assets/assets.d.ts.map +1 -1
- package/resources/assets/assets.js +34 -16
- package/resources/assets/assets.js.map +1 -1
- package/resources/assets/assets.mjs +34 -16
- package/resources/assets/assets.mjs.map +1 -1
- package/resources/assets/download.d.mts +28 -5
- package/resources/assets/download.d.mts.map +1 -1
- package/resources/assets/download.d.ts +28 -5
- package/resources/assets/download.d.ts.map +1 -1
- package/resources/assets/download.js +8 -6
- package/resources/assets/download.js.map +1 -1
- package/resources/assets/download.mjs +8 -6
- package/resources/assets/download.mjs.map +1 -1
- package/resources/assets/index.d.mts +1 -1
- package/resources/assets/index.d.mts.map +1 -1
- package/resources/assets/index.d.ts +1 -1
- package/resources/assets/index.d.ts.map +1 -1
- package/resources/assets/index.js.map +1 -1
- package/resources/assets/index.mjs.map +1 -1
- package/resources/collections/assets.d.mts +15 -4
- package/resources/collections/assets.d.mts.map +1 -1
- package/resources/collections/assets.d.ts +15 -4
- package/resources/collections/assets.d.ts.map +1 -1
- package/resources/collections/assets.js +14 -4
- package/resources/collections/assets.js.map +1 -1
- package/resources/collections/assets.mjs +14 -4
- package/resources/collections/assets.mjs.map +1 -1
- package/resources/collections/collections.d.mts +38 -9
- package/resources/collections/collections.d.mts.map +1 -1
- package/resources/collections/collections.d.ts +38 -9
- package/resources/collections/collections.d.ts.map +1 -1
- package/resources/collections/collections.js +11 -8
- package/resources/collections/collections.js.map +1 -1
- package/resources/collections/collections.mjs +11 -8
- package/resources/collections/collections.mjs.map +1 -1
- package/resources/collections/index.d.mts +1 -1
- package/resources/collections/index.d.mts.map +1 -1
- package/resources/collections/index.d.ts +1 -1
- package/resources/collections/index.d.ts.map +1 -1
- package/resources/collections/index.js.map +1 -1
- package/resources/collections/index.mjs.map +1 -1
- package/resources/collections/models.d.mts +15 -4
- package/resources/collections/models.d.mts.map +1 -1
- package/resources/collections/models.d.ts +15 -4
- package/resources/collections/models.d.ts.map +1 -1
- package/resources/collections/models.js +14 -4
- package/resources/collections/models.js.map +1 -1
- package/resources/collections/models.mjs +14 -4
- package/resources/collections/models.mjs.map +1 -1
- package/resources/generate.d.mts +941 -0
- package/resources/generate.d.mts.map +1 -1
- package/resources/generate.d.ts +941 -0
- package/resources/generate.d.ts.map +1 -1
- package/resources/generate.js +28 -16
- package/resources/generate.js.map +1 -1
- package/resources/generate.mjs +28 -16
- package/resources/generate.mjs.map +1 -1
- package/resources/index.d.mts +5 -5
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +5 -5
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/jobs.d.mts +146 -2
- package/resources/jobs.d.mts.map +1 -1
- package/resources/jobs.d.ts +146 -2
- package/resources/jobs.d.ts.map +1 -1
- package/resources/jobs.js +8 -4
- package/resources/jobs.js.map +1 -1
- package/resources/jobs.mjs +8 -4
- package/resources/jobs.mjs.map +1 -1
- package/resources/models/description.d.mts +10 -0
- package/resources/models/description.d.mts.map +1 -1
- package/resources/models/description.d.ts +10 -0
- package/resources/models/description.d.ts.map +1 -1
- package/resources/models/description.js +2 -2
- package/resources/models/description.js.map +1 -1
- package/resources/models/description.mjs +2 -2
- package/resources/models/description.mjs.map +1 -1
- package/resources/models/examples.d.mts +344 -0
- package/resources/models/examples.d.mts.map +1 -1
- package/resources/models/examples.d.ts +344 -0
- package/resources/models/examples.d.ts.map +1 -1
- package/resources/models/examples.js +2 -2
- package/resources/models/examples.js.map +1 -1
- package/resources/models/examples.mjs +2 -2
- package/resources/models/examples.mjs.map +1 -1
- package/resources/models/index.d.mts +1 -1
- package/resources/models/index.d.mts.map +1 -1
- package/resources/models/index.d.ts +1 -1
- package/resources/models/index.d.ts.map +1 -1
- package/resources/models/index.js.map +1 -1
- package/resources/models/index.mjs.map +1 -1
- package/resources/models/models.d.mts +71 -13
- package/resources/models/models.d.mts.map +1 -1
- package/resources/models/models.d.ts +71 -13
- package/resources/models/models.d.ts.map +1 -1
- package/resources/models/models.js +30 -18
- package/resources/models/models.js.map +1 -1
- package/resources/models/models.mjs +30 -18
- package/resources/models/models.mjs.map +1 -1
- package/resources/models/train.d.mts +93 -0
- package/resources/models/train.d.mts.map +1 -1
- package/resources/models/train.d.ts +93 -0
- package/resources/models/train.d.ts.map +1 -1
- package/resources/models/train.js +4 -4
- package/resources/models/train.js.map +1 -1
- package/resources/models/train.mjs +4 -4
- package/resources/models/train.mjs.map +1 -1
- package/resources/models/training-images.d.mts +22 -2
- package/resources/models/training-images.d.mts.map +1 -1
- package/resources/models/training-images.d.ts +22 -2
- package/resources/models/training-images.d.ts.map +1 -1
- package/resources/models/training-images.js +15 -8
- package/resources/models/training-images.js.map +1 -1
- package/resources/models/training-images.mjs +15 -8
- package/resources/models/training-images.mjs.map +1 -1
- package/resources/search.d.mts +10 -0
- package/resources/search.d.mts.map +1 -1
- package/resources/search.d.ts +10 -0
- package/resources/search.d.ts.map +1 -1
- package/resources/search.js +4 -4
- package/resources/search.js.map +1 -1
- package/resources/search.mjs +4 -4
- package/resources/search.mjs.map +1 -1
- package/resources/tags.d.mts +5 -0
- package/resources/tags.d.mts.map +1 -1
- package/resources/tags.d.ts +5 -0
- package/resources/tags.d.ts.map +1 -1
- package/resources/uploads.d.mts +35 -20
- package/resources/uploads.d.mts.map +1 -1
- package/resources/uploads.d.ts +35 -20
- package/resources/uploads.d.ts.map +1 -1
- package/resources/uploads.js +8 -6
- package/resources/uploads.js.map +1 -1
- package/resources/uploads.mjs +8 -6
- package/resources/uploads.mjs.map +1 -1
- package/resources/usages.d.mts +53 -10
- package/resources/usages.d.mts.map +1 -1
- package/resources/usages.d.ts +53 -10
- package/resources/usages.d.ts.map +1 -1
- package/resources/workflows.d.mts +446 -266
- package/resources/workflows.d.mts.map +1 -1
- package/resources/workflows.d.ts +446 -266
- package/resources/workflows.d.ts.map +1 -1
- package/resources/workflows.js +20 -12
- package/resources/workflows.js.map +1 -1
- package/resources/workflows.mjs +20 -12
- package/resources/workflows.mjs.map +1 -1
- package/src/client.ts +14 -0
- package/src/lib/job.ts +8 -3
- package/src/lib/upload.ts +5 -3
- package/src/lib/workflow.ts +3 -1
- package/src/resources/assets/assets.ts +1310 -32
- package/src/resources/assets/download.ts +40 -7
- package/src/resources/assets/index.ts +1 -0
- package/src/resources/collections/assets.ts +29 -6
- package/src/resources/collections/collections.ts +59 -12
- package/src/resources/collections/index.ts +2 -0
- package/src/resources/collections/models.ts +29 -6
- package/src/resources/generate.ts +1247 -30
- package/src/resources/index.ts +7 -0
- package/src/resources/jobs.ts +169 -4
- package/src/resources/models/description.ts +14 -2
- package/src/resources/models/examples.ts +394 -2
- package/src/resources/models/index.ts +1 -0
- package/src/resources/models/models.ts +112 -26
- package/src/resources/models/train.ts +126 -4
- package/src/resources/models/training-images.ts +41 -10
- package/src/resources/search.ts +16 -4
- package/src/resources/tags.ts +6 -0
- package/src/resources/uploads.ts +47 -22
- package/src/resources/usages.ts +63 -10
- package/src/resources/workflows.ts +783 -563
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -52,8 +52,8 @@ export class Models extends APIResource {
|
|
|
52
52
|
* Create a new model
|
|
53
53
|
*/
|
|
54
54
|
create(params: ModelCreateParams, options?: RequestOptions): APIPromise<ModelCreateResponse> {
|
|
55
|
-
const { originalAssets, ...body } = params;
|
|
56
|
-
return this._client.post('/models', { query: { originalAssets }, body, ...options });
|
|
55
|
+
const { originalAssets, projectId, ...body } = params;
|
|
56
|
+
return this._client.post('/models', { query: { originalAssets, projectId }, body, ...options });
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
/**
|
|
@@ -78,8 +78,12 @@ export class Models extends APIResource {
|
|
|
78
78
|
params: ModelUpdateParams,
|
|
79
79
|
options?: RequestOptions,
|
|
80
80
|
): APIPromise<ModelUpdateResponse> {
|
|
81
|
-
const { originalAssets, ...body } = params;
|
|
82
|
-
return this._client.put(path`/models/${modelID}`, {
|
|
81
|
+
const { originalAssets, projectId, ...body } = params;
|
|
82
|
+
return this._client.put(path`/models/${modelID}`, {
|
|
83
|
+
query: { originalAssets, projectId },
|
|
84
|
+
body,
|
|
85
|
+
...options,
|
|
86
|
+
});
|
|
83
87
|
}
|
|
84
88
|
|
|
85
89
|
/**
|
|
@@ -96,8 +100,13 @@ export class Models extends APIResource {
|
|
|
96
100
|
/**
|
|
97
101
|
* Delete a model
|
|
98
102
|
*/
|
|
99
|
-
delete(
|
|
100
|
-
|
|
103
|
+
delete(
|
|
104
|
+
modelID: string,
|
|
105
|
+
params: ModelDeleteParams | null | undefined = {},
|
|
106
|
+
options?: RequestOptions,
|
|
107
|
+
): APIPromise<unknown> {
|
|
108
|
+
const { projectId } = params ?? {};
|
|
109
|
+
return this._client.delete(path`/models/${modelID}`, { query: { projectId }, ...options });
|
|
101
110
|
}
|
|
102
111
|
|
|
103
112
|
/**
|
|
@@ -105,8 +114,12 @@ export class Models extends APIResource {
|
|
|
105
114
|
* training images and pairs if any
|
|
106
115
|
*/
|
|
107
116
|
copy(modelID: string, params: ModelCopyParams, options?: RequestOptions): APIPromise<ModelCopyResponse> {
|
|
108
|
-
const { originalAssets, ...body } = params;
|
|
109
|
-
return this._client.post(path`/models/${modelID}/copy`, {
|
|
117
|
+
const { originalAssets, projectId, ...body } = params;
|
|
118
|
+
return this._client.post(path`/models/${modelID}/copy`, {
|
|
119
|
+
query: { originalAssets, projectId },
|
|
120
|
+
body,
|
|
121
|
+
...options,
|
|
122
|
+
});
|
|
110
123
|
}
|
|
111
124
|
|
|
112
125
|
/**
|
|
@@ -117,8 +130,8 @@ export class Models extends APIResource {
|
|
|
117
130
|
params: ModelDeleteImagesParams,
|
|
118
131
|
options?: RequestOptions,
|
|
119
132
|
): APIPromise<unknown> {
|
|
120
|
-
const { ids } = params;
|
|
121
|
-
return this._client.delete(path`/models/${modelID}/images`, { query: { ids }, ...options });
|
|
133
|
+
const { ids, projectId } = params;
|
|
134
|
+
return this._client.delete(path`/models/${modelID}/images`, { query: { ids, projectId }, ...options });
|
|
122
135
|
}
|
|
123
136
|
|
|
124
137
|
/**
|
|
@@ -126,18 +139,19 @@ export class Models extends APIResource {
|
|
|
126
139
|
*/
|
|
127
140
|
download(
|
|
128
141
|
modelID: string,
|
|
129
|
-
|
|
142
|
+
params: ModelDownloadParams,
|
|
130
143
|
options?: RequestOptions,
|
|
131
144
|
): APIPromise<ModelDownloadResponse> {
|
|
132
|
-
|
|
145
|
+
const { projectId, ...body } = params;
|
|
146
|
+
return this._client.post(path`/models/${modelID}/download`, { query: { projectId }, body, ...options });
|
|
133
147
|
}
|
|
134
148
|
|
|
135
149
|
/**
|
|
136
150
|
* Get multiple models by their `modelIds`
|
|
137
151
|
*/
|
|
138
152
|
getBulk(params: ModelGetBulkParams, options?: RequestOptions): APIPromise<ModelGetBulkResponse> {
|
|
139
|
-
const { originalAssets, ...body } = params;
|
|
140
|
-
return this._client.post('/models/get-bulk', { query: { originalAssets }, body, ...options });
|
|
153
|
+
const { originalAssets, projectId, ...body } = params;
|
|
154
|
+
return this._client.post('/models/get-bulk', { query: { originalAssets, projectId }, body, ...options });
|
|
141
155
|
}
|
|
142
156
|
|
|
143
157
|
/**
|
|
@@ -146,10 +160,11 @@ export class Models extends APIResource {
|
|
|
146
160
|
*/
|
|
147
161
|
transfer(
|
|
148
162
|
modelID: string,
|
|
149
|
-
|
|
163
|
+
params: ModelTransferParams,
|
|
150
164
|
options?: RequestOptions,
|
|
151
165
|
): APIPromise<ModelTransferResponse> {
|
|
152
|
-
|
|
166
|
+
const { projectId, ...body } = params;
|
|
167
|
+
return this._client.post(path`/models/${modelID}/transfer`, { query: { projectId }, body, ...options });
|
|
153
168
|
}
|
|
154
169
|
|
|
155
170
|
/**
|
|
@@ -157,10 +172,11 @@ export class Models extends APIResource {
|
|
|
157
172
|
*/
|
|
158
173
|
updateTags(
|
|
159
174
|
modelID: string,
|
|
160
|
-
|
|
175
|
+
params: ModelUpdateTagsParams,
|
|
161
176
|
options?: RequestOptions,
|
|
162
177
|
): APIPromise<ModelUpdateTagsResponse> {
|
|
163
|
-
|
|
178
|
+
const { projectId, ...body } = params;
|
|
179
|
+
return this._client.put(path`/models/${modelID}/tags`, { query: { projectId }, body, ...options });
|
|
164
180
|
}
|
|
165
181
|
}
|
|
166
182
|
|
|
@@ -9394,6 +9410,12 @@ export interface ModelCreateParams {
|
|
|
9394
9410
|
*/
|
|
9395
9411
|
originalAssets?: boolean;
|
|
9396
9412
|
|
|
9413
|
+
/**
|
|
9414
|
+
* Query param: The projectId used for ownership resource management. Either to
|
|
9415
|
+
* assert ownership or to set the owner of the resource(s)
|
|
9416
|
+
*/
|
|
9417
|
+
projectId?: string;
|
|
9418
|
+
|
|
9397
9419
|
/**
|
|
9398
9420
|
* Body param: The ID of the base model to use as a starting point for the training
|
|
9399
9421
|
* (example: "flux.1-dev")
|
|
@@ -9504,6 +9526,12 @@ export interface ModelRetrieveParams {
|
|
|
9504
9526
|
* If set to true, returns the original asset without transformation
|
|
9505
9527
|
*/
|
|
9506
9528
|
originalAssets?: boolean;
|
|
9529
|
+
|
|
9530
|
+
/**
|
|
9531
|
+
* The projectId used for ownership resource management. Either to assert ownership
|
|
9532
|
+
* or to set the owner of the resource(s)
|
|
9533
|
+
*/
|
|
9534
|
+
projectId?: string;
|
|
9507
9535
|
}
|
|
9508
9536
|
|
|
9509
9537
|
export interface ModelUpdateParams {
|
|
@@ -9512,6 +9540,12 @@ export interface ModelUpdateParams {
|
|
|
9512
9540
|
*/
|
|
9513
9541
|
originalAssets?: boolean;
|
|
9514
9542
|
|
|
9543
|
+
/**
|
|
9544
|
+
* Query param: The projectId used for ownership resource management. Either to
|
|
9545
|
+
* assert ownership or to set the owner of the resource(s)
|
|
9546
|
+
*/
|
|
9547
|
+
projectId?: string;
|
|
9548
|
+
|
|
9515
9549
|
/**
|
|
9516
9550
|
* Body param: The slug of the class you want to use (ex:
|
|
9517
9551
|
* "characters-npcs-mobs-characters"). Set to null to unset the class
|
|
@@ -9960,6 +9994,12 @@ export interface ModelListParams extends ModelsCursorParams {
|
|
|
9960
9994
|
*/
|
|
9961
9995
|
privacy?: 'private' | 'public';
|
|
9962
9996
|
|
|
9997
|
+
/**
|
|
9998
|
+
* The projectId used for ownership resource management. Either to assert ownership
|
|
9999
|
+
* or to set the owner of the resource(s)
|
|
10000
|
+
*/
|
|
10001
|
+
projectId?: string;
|
|
10002
|
+
|
|
9963
10003
|
/**
|
|
9964
10004
|
* Sort results by createdAt, updatedAt, or score. When privacy=public, defaults to
|
|
9965
10005
|
* score if not specified. When privacy=private/unlisted, supports createdAt and
|
|
@@ -10096,12 +10136,26 @@ export interface ModelListParams extends ModelsCursorParams {
|
|
|
10096
10136
|
updatedBefore?: string;
|
|
10097
10137
|
}
|
|
10098
10138
|
|
|
10139
|
+
export interface ModelDeleteParams {
|
|
10140
|
+
/**
|
|
10141
|
+
* The projectId used for ownership resource management. Either to assert ownership
|
|
10142
|
+
* or to set the owner of the resource(s)
|
|
10143
|
+
*/
|
|
10144
|
+
projectId?: string;
|
|
10145
|
+
}
|
|
10146
|
+
|
|
10099
10147
|
export interface ModelCopyParams {
|
|
10100
10148
|
/**
|
|
10101
10149
|
* Query param: If set to true, returns the original asset without transformation
|
|
10102
10150
|
*/
|
|
10103
10151
|
originalAssets?: boolean;
|
|
10104
10152
|
|
|
10153
|
+
/**
|
|
10154
|
+
* Query param: The projectId used for ownership resource management. Either to
|
|
10155
|
+
* assert ownership or to set the owner of the resource(s)
|
|
10156
|
+
*/
|
|
10157
|
+
projectId?: string;
|
|
10158
|
+
|
|
10105
10159
|
/**
|
|
10106
10160
|
* Body param: If set to true, the training data will be copied
|
|
10107
10161
|
*/
|
|
@@ -10118,13 +10172,26 @@ export interface ModelDeleteImagesParams {
|
|
|
10118
10172
|
* The asset ids of the images to delete
|
|
10119
10173
|
*/
|
|
10120
10174
|
ids: Array<string>;
|
|
10175
|
+
|
|
10176
|
+
/**
|
|
10177
|
+
* The projectId used for ownership resource management. Either to assert ownership
|
|
10178
|
+
* or to set the owner of the resource(s)
|
|
10179
|
+
*/
|
|
10180
|
+
projectId?: string;
|
|
10121
10181
|
}
|
|
10122
10182
|
|
|
10123
10183
|
export interface ModelDownloadParams {
|
|
10124
10184
|
/**
|
|
10125
|
-
*
|
|
10126
|
-
*
|
|
10127
|
-
|
|
10185
|
+
* Query param: The projectId used for ownership resource management. Either to
|
|
10186
|
+
* assert ownership or to set the owner of the resource(s)
|
|
10187
|
+
*/
|
|
10188
|
+
projectId?: string;
|
|
10189
|
+
|
|
10190
|
+
/**
|
|
10191
|
+
* Body param: The epoch hash of the model to download Only available for Flux Lora
|
|
10192
|
+
* Trained models with epochs Will only apply to the main model in the download
|
|
10193
|
+
* request If not set, the default (latest or setup at model level) epoch will be
|
|
10194
|
+
* used
|
|
10128
10195
|
*/
|
|
10129
10196
|
modelEpoch?: string;
|
|
10130
10197
|
}
|
|
@@ -10135,6 +10202,12 @@ export interface ModelGetBulkParams {
|
|
|
10135
10202
|
*/
|
|
10136
10203
|
originalAssets?: boolean;
|
|
10137
10204
|
|
|
10205
|
+
/**
|
|
10206
|
+
* Query param: The projectId used for ownership resource management. Either to
|
|
10207
|
+
* assert ownership or to set the owner of the resource(s)
|
|
10208
|
+
*/
|
|
10209
|
+
projectId?: string;
|
|
10210
|
+
|
|
10138
10211
|
/**
|
|
10139
10212
|
* Body param: If true will return all training images; otherwise returns only the
|
|
10140
10213
|
* first 3 training images.
|
|
@@ -10179,29 +10252,41 @@ export interface ModelGetBulkParams {
|
|
|
10179
10252
|
|
|
10180
10253
|
export interface ModelTransferParams {
|
|
10181
10254
|
/**
|
|
10182
|
-
* The id of the project to copy and transfer the model to
|
|
10255
|
+
* Body param: The id of the project to copy and transfer the model to
|
|
10183
10256
|
*/
|
|
10184
10257
|
destinationProjectId: string;
|
|
10185
10258
|
|
|
10186
10259
|
/**
|
|
10187
|
-
*
|
|
10260
|
+
* Query param: The projectId used for ownership resource management. Either to
|
|
10261
|
+
* assert ownership or to set the owner of the resource(s)
|
|
10262
|
+
*/
|
|
10263
|
+
projectId?: string;
|
|
10264
|
+
|
|
10265
|
+
/**
|
|
10266
|
+
* Body param: The id of the team to copy and transfer the model to
|
|
10188
10267
|
*/
|
|
10189
10268
|
destinationTeamId?: string;
|
|
10190
10269
|
}
|
|
10191
10270
|
|
|
10192
10271
|
export interface ModelUpdateTagsParams {
|
|
10193
10272
|
/**
|
|
10194
|
-
* The
|
|
10273
|
+
* Query param: The projectId used for ownership resource management. Either to
|
|
10274
|
+
* assert ownership or to set the owner of the resource(s)
|
|
10275
|
+
*/
|
|
10276
|
+
projectId?: string;
|
|
10277
|
+
|
|
10278
|
+
/**
|
|
10279
|
+
* Body param: The list of tags to add
|
|
10195
10280
|
*/
|
|
10196
10281
|
add?: Array<string>;
|
|
10197
10282
|
|
|
10198
10283
|
/**
|
|
10199
|
-
* The list of tags to delete
|
|
10284
|
+
* Body param: The list of tags to delete
|
|
10200
10285
|
*/
|
|
10201
10286
|
delete?: Array<string>;
|
|
10202
10287
|
|
|
10203
10288
|
/**
|
|
10204
|
-
* If true, the function will throw an error if:
|
|
10289
|
+
* Body param: If true, the function will throw an error if:
|
|
10205
10290
|
*
|
|
10206
10291
|
* - one of the tags to add already exists
|
|
10207
10292
|
* - one of the tags to delete is not found If false, the endpoint will behave as
|
|
@@ -10233,6 +10318,7 @@ export declare namespace Models {
|
|
|
10233
10318
|
type ModelRetrieveParams as ModelRetrieveParams,
|
|
10234
10319
|
type ModelUpdateParams as ModelUpdateParams,
|
|
10235
10320
|
type ModelListParams as ModelListParams,
|
|
10321
|
+
type ModelDeleteParams as ModelDeleteParams,
|
|
10236
10322
|
type ModelCopyParams as ModelCopyParams,
|
|
10237
10323
|
type ModelDeleteImagesParams as ModelDeleteImagesParams,
|
|
10238
10324
|
type ModelDownloadParams as ModelDownloadParams,
|
|
@@ -14,9 +14,9 @@ export class Train extends APIResource {
|
|
|
14
14
|
params: TrainActionParams,
|
|
15
15
|
options?: RequestOptions,
|
|
16
16
|
): APIPromise<TrainActionResponse> {
|
|
17
|
-
const { originalAssets, ...body } = params;
|
|
17
|
+
const { originalAssets, projectId, ...body } = params;
|
|
18
18
|
return this._client.post(path`/models/${modelID}/train/action`, {
|
|
19
|
-
query: { originalAssets },
|
|
19
|
+
query: { originalAssets, projectId },
|
|
20
20
|
body,
|
|
21
21
|
...options,
|
|
22
22
|
});
|
|
@@ -30,9 +30,9 @@ export class Train extends APIResource {
|
|
|
30
30
|
params: TrainTriggerParams,
|
|
31
31
|
options?: RequestOptions,
|
|
32
32
|
): APIPromise<TrainTriggerResponse> {
|
|
33
|
-
const { dryRun, originalAssets, trainingImagesCount, ...body } = params;
|
|
33
|
+
const { dryRun, originalAssets, projectId, trainingImagesCount, ...body } = params;
|
|
34
34
|
return this._client.put(path`/models/${modelID}/train`, {
|
|
35
|
-
query: { dryRun, originalAssets, trainingImagesCount },
|
|
35
|
+
query: { dryRun, originalAssets, projectId, trainingImagesCount },
|
|
36
36
|
body,
|
|
37
37
|
...options,
|
|
38
38
|
});
|
|
@@ -1359,6 +1359,14 @@ export interface TrainTriggerResponse {
|
|
|
1359
1359
|
|
|
1360
1360
|
model: TrainTriggerResponse.Model;
|
|
1361
1361
|
|
|
1362
|
+
/**
|
|
1363
|
+
* Compute Units cost per billing action for this request, after discount. Values
|
|
1364
|
+
* sum to `creativeUnitsCost`. Only Compute-Units-consuming actions with a non-zero
|
|
1365
|
+
* charge appear. Lets clients split the total (e.g. generation vs
|
|
1366
|
+
* `slop-detection`) — including on dryRun estimates.
|
|
1367
|
+
*/
|
|
1368
|
+
costDetails?: TrainTriggerResponse.CostDetails;
|
|
1369
|
+
|
|
1362
1370
|
/**
|
|
1363
1371
|
* The Compute Units cost for the request billed
|
|
1364
1372
|
*/
|
|
@@ -2323,6 +2331,27 @@ export namespace TrainTriggerResponse {
|
|
|
2323
2331
|
|
|
2324
2332
|
cuDiscount: number;
|
|
2325
2333
|
|
|
2334
|
+
/**
|
|
2335
|
+
* Compute Units charged for the ADD-ONS of this job, per action — the fees paid on
|
|
2336
|
+
* top of the generation itself, such as `slop-detection`.
|
|
2337
|
+
*
|
|
2338
|
+
* `cuCost` above is the main action alone, so the job's total is `cuCost` plus the
|
|
2339
|
+
* values here.
|
|
2340
|
+
*
|
|
2341
|
+
* Two caveats when displaying it:
|
|
2342
|
+
*
|
|
2343
|
+
* - These are a remaining refundable balance, not a receipt: a job that failed or
|
|
2344
|
+
* was cancelled has had its add-ons refunded, so they read 0 while `cuCost`
|
|
2345
|
+
* still shows the main action's original charge.
|
|
2346
|
+
* - `ip-detection` is part of the shape but is never populated today: that fee is
|
|
2347
|
+
* charged outside the job and reported once, as
|
|
2348
|
+
* `ipDetection.creativeUnitsCharged`, in the response of the request that ran
|
|
2349
|
+
* it.
|
|
2350
|
+
*
|
|
2351
|
+
* Absent when the job paid for no add-on.
|
|
2352
|
+
*/
|
|
2353
|
+
cuCostDetails?: Billing.CuCostDetails;
|
|
2354
|
+
|
|
2326
2355
|
/**
|
|
2327
2356
|
* When true, the credits charged for this job are not automatically refunded if
|
|
2328
2357
|
* the generation fails, because the model used does not support refund-on-failure.
|
|
@@ -2330,6 +2359,33 @@ export namespace TrainTriggerResponse {
|
|
|
2330
2359
|
*/
|
|
2331
2360
|
disableRefund?: boolean;
|
|
2332
2361
|
}
|
|
2362
|
+
|
|
2363
|
+
export namespace Billing {
|
|
2364
|
+
/**
|
|
2365
|
+
* Compute Units charged for the ADD-ONS of this job, per action — the fees paid on
|
|
2366
|
+
* top of the generation itself, such as `slop-detection`.
|
|
2367
|
+
*
|
|
2368
|
+
* `cuCost` above is the main action alone, so the job's total is `cuCost` plus the
|
|
2369
|
+
* values here.
|
|
2370
|
+
*
|
|
2371
|
+
* Two caveats when displaying it:
|
|
2372
|
+
*
|
|
2373
|
+
* - These are a remaining refundable balance, not a receipt: a job that failed or
|
|
2374
|
+
* was cancelled has had its add-ons refunded, so they read 0 while `cuCost`
|
|
2375
|
+
* still shows the main action's original charge.
|
|
2376
|
+
* - `ip-detection` is part of the shape but is never populated today: that fee is
|
|
2377
|
+
* charged outside the job and reported once, as
|
|
2378
|
+
* `ipDetection.creativeUnitsCharged`, in the response of the request that ran
|
|
2379
|
+
* it.
|
|
2380
|
+
*
|
|
2381
|
+
* Absent when the job paid for no add-on.
|
|
2382
|
+
*/
|
|
2383
|
+
export interface CuCostDetails {
|
|
2384
|
+
'ip-detection'?: number;
|
|
2385
|
+
|
|
2386
|
+
'slop-detection'?: number;
|
|
2387
|
+
}
|
|
2388
|
+
}
|
|
2333
2389
|
}
|
|
2334
2390
|
|
|
2335
2391
|
export interface Model {
|
|
@@ -3641,6 +3697,60 @@ export namespace TrainTriggerResponse {
|
|
|
3641
3697
|
}
|
|
3642
3698
|
}
|
|
3643
3699
|
|
|
3700
|
+
/**
|
|
3701
|
+
* Compute Units cost per billing action for this request, after discount. Values
|
|
3702
|
+
* sum to `creativeUnitsCost`. Only Compute-Units-consuming actions with a non-zero
|
|
3703
|
+
* charge appear. Lets clients split the total (e.g. generation vs
|
|
3704
|
+
* `slop-detection`) — including on dryRun estimates.
|
|
3705
|
+
*/
|
|
3706
|
+
export interface CostDetails {
|
|
3707
|
+
'assistant-message'?: number;
|
|
3708
|
+
|
|
3709
|
+
caption?: number;
|
|
3710
|
+
|
|
3711
|
+
'custom-generation'?: number;
|
|
3712
|
+
|
|
3713
|
+
'describe-style'?: number;
|
|
3714
|
+
|
|
3715
|
+
detection?: number;
|
|
3716
|
+
|
|
3717
|
+
embed?: number;
|
|
3718
|
+
|
|
3719
|
+
'image-prompt-editing'?: number;
|
|
3720
|
+
|
|
3721
|
+
'inference-images'?: number;
|
|
3722
|
+
|
|
3723
|
+
'ip-detection'?: number;
|
|
3724
|
+
|
|
3725
|
+
pixelate?: number;
|
|
3726
|
+
|
|
3727
|
+
prompt?: number;
|
|
3728
|
+
|
|
3729
|
+
'remove-background'?: number;
|
|
3730
|
+
|
|
3731
|
+
repaint?: number;
|
|
3732
|
+
|
|
3733
|
+
restyle?: number;
|
|
3734
|
+
|
|
3735
|
+
segmentation?: number;
|
|
3736
|
+
|
|
3737
|
+
'skybox-base-360'?: number;
|
|
3738
|
+
|
|
3739
|
+
'skybox-upscale-360'?: number;
|
|
3740
|
+
|
|
3741
|
+
'slop-detection'?: number;
|
|
3742
|
+
|
|
3743
|
+
texture?: number;
|
|
3744
|
+
|
|
3745
|
+
'train-model'?: number;
|
|
3746
|
+
|
|
3747
|
+
translate?: number;
|
|
3748
|
+
|
|
3749
|
+
upscale?: number;
|
|
3750
|
+
|
|
3751
|
+
vectorization?: number;
|
|
3752
|
+
}
|
|
3753
|
+
|
|
3644
3754
|
/**
|
|
3645
3755
|
* IP detection findings, when detection ran for this request.
|
|
3646
3756
|
*/
|
|
@@ -3730,6 +3840,12 @@ export interface TrainActionParams {
|
|
|
3730
3840
|
* Query param: If set to true, returns the original asset without transformation
|
|
3731
3841
|
*/
|
|
3732
3842
|
originalAssets?: boolean;
|
|
3843
|
+
|
|
3844
|
+
/**
|
|
3845
|
+
* Query param: The projectId used for ownership resource management. Either to
|
|
3846
|
+
* assert ownership or to set the owner of the resource(s)
|
|
3847
|
+
*/
|
|
3848
|
+
projectId?: string;
|
|
3733
3849
|
}
|
|
3734
3850
|
|
|
3735
3851
|
export interface TrainTriggerParams {
|
|
@@ -3743,6 +3859,12 @@ export interface TrainTriggerParams {
|
|
|
3743
3859
|
*/
|
|
3744
3860
|
originalAssets?: boolean;
|
|
3745
3861
|
|
|
3862
|
+
/**
|
|
3863
|
+
* Query param: The projectId used for ownership resource management. Either to
|
|
3864
|
+
* assert ownership or to set the owner of the resource(s)
|
|
3865
|
+
*/
|
|
3866
|
+
projectId?: string;
|
|
3867
|
+
|
|
3746
3868
|
/**
|
|
3747
3869
|
* Query param: Simulate the number of training images, used for dryRun purpose
|
|
3748
3870
|
*/
|
|
@@ -14,8 +14,11 @@ export class TrainingImages extends APIResource {
|
|
|
14
14
|
params: TrainingImageDeleteParams,
|
|
15
15
|
options?: RequestOptions,
|
|
16
16
|
): APIPromise<unknown> {
|
|
17
|
-
const { modelId } = params;
|
|
18
|
-
return this._client.delete(path`/models/${modelId}/training-images/${trainingImageID}`,
|
|
17
|
+
const { modelId, projectId } = params;
|
|
18
|
+
return this._client.delete(path`/models/${modelId}/training-images/${trainingImageID}`, {
|
|
19
|
+
query: { projectId },
|
|
20
|
+
...options,
|
|
21
|
+
});
|
|
19
22
|
}
|
|
20
23
|
|
|
21
24
|
/**
|
|
@@ -26,9 +29,9 @@ export class TrainingImages extends APIResource {
|
|
|
26
29
|
params: TrainingImageAddParams,
|
|
27
30
|
options?: RequestOptions,
|
|
28
31
|
): APIPromise<TrainingImageAddResponse> {
|
|
29
|
-
const { originalAssets, ...body } = params;
|
|
32
|
+
const { originalAssets, projectId, ...body } = params;
|
|
30
33
|
return this._client.post(path`/models/${modelID}/training-images`, {
|
|
31
|
-
query: { originalAssets },
|
|
34
|
+
query: { originalAssets, projectId },
|
|
32
35
|
body,
|
|
33
36
|
...options,
|
|
34
37
|
});
|
|
@@ -42,9 +45,9 @@ export class TrainingImages extends APIResource {
|
|
|
42
45
|
params: TrainingImageReplaceParams,
|
|
43
46
|
options?: RequestOptions,
|
|
44
47
|
): APIPromise<TrainingImageReplaceResponse> {
|
|
45
|
-
const { modelId, originalAssets, ...body } = params;
|
|
48
|
+
const { modelId, originalAssets, projectId, ...body } = params;
|
|
46
49
|
return this._client.put(path`/models/${modelId}/training-images/${trainingImageID}`, {
|
|
47
|
-
query: { originalAssets },
|
|
50
|
+
query: { originalAssets, projectId },
|
|
48
51
|
body,
|
|
49
52
|
...options,
|
|
50
53
|
});
|
|
@@ -58,8 +61,12 @@ export class TrainingImages extends APIResource {
|
|
|
58
61
|
params: TrainingImageReplacePairsParams,
|
|
59
62
|
options?: RequestOptions,
|
|
60
63
|
): APIPromise<TrainingImageReplacePairsResponse> {
|
|
61
|
-
const { body } = params;
|
|
62
|
-
return this._client.put(path`/models/${modelID}/training-images/pairs`, {
|
|
64
|
+
const { body, projectId } = params;
|
|
65
|
+
return this._client.put(path`/models/${modelID}/training-images/pairs`, {
|
|
66
|
+
query: { projectId },
|
|
67
|
+
body: body,
|
|
68
|
+
...options,
|
|
69
|
+
});
|
|
63
70
|
}
|
|
64
71
|
}
|
|
65
72
|
|
|
@@ -176,9 +183,15 @@ export namespace TrainingImageReplacePairsResponse {
|
|
|
176
183
|
|
|
177
184
|
export interface TrainingImageDeleteParams {
|
|
178
185
|
/**
|
|
179
|
-
* The training image's `modelId`
|
|
186
|
+
* Path param: The training image's `modelId`
|
|
180
187
|
*/
|
|
181
188
|
modelId: string;
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Query param: The projectId used for ownership resource management. Either to
|
|
192
|
+
* assert ownership or to set the owner of the resource(s)
|
|
193
|
+
*/
|
|
194
|
+
projectId?: string;
|
|
182
195
|
}
|
|
183
196
|
|
|
184
197
|
export interface TrainingImageAddParams {
|
|
@@ -187,6 +200,12 @@ export interface TrainingImageAddParams {
|
|
|
187
200
|
*/
|
|
188
201
|
originalAssets?: boolean;
|
|
189
202
|
|
|
203
|
+
/**
|
|
204
|
+
* Query param: The projectId used for ownership resource management. Either to
|
|
205
|
+
* assert ownership or to set the owner of the resource(s)
|
|
206
|
+
*/
|
|
207
|
+
projectId?: string;
|
|
208
|
+
|
|
190
209
|
/**
|
|
191
210
|
* Body param: The asset ID to use as a training image (example:
|
|
192
211
|
* "asset_GTrL3mq4SXWyMxkOHRxlpw"). If provided, "data" and "name" parameters will
|
|
@@ -231,6 +250,12 @@ export interface TrainingImageReplaceParams {
|
|
|
231
250
|
*/
|
|
232
251
|
originalAssets?: boolean;
|
|
233
252
|
|
|
253
|
+
/**
|
|
254
|
+
* Query param: The projectId used for ownership resource management. Either to
|
|
255
|
+
* assert ownership or to set the owner of the resource(s)
|
|
256
|
+
*/
|
|
257
|
+
projectId?: string;
|
|
258
|
+
|
|
234
259
|
/**
|
|
235
260
|
* Body param: The asset ID to use as a training image (example:
|
|
236
261
|
* "asset_GTrL3mq4SXWyMxkOHRxlpw"). If provided, "data" and "name" parameters will
|
|
@@ -266,9 +291,15 @@ export interface TrainingImageReplaceParams {
|
|
|
266
291
|
|
|
267
292
|
export interface TrainingImageReplacePairsParams {
|
|
268
293
|
/**
|
|
269
|
-
* Array of training image pairs
|
|
294
|
+
* Body param: Array of training image pairs
|
|
270
295
|
*/
|
|
271
296
|
body: Array<TrainingImageReplacePairsParams.Body>;
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* Query param: The projectId used for ownership resource management. Either to
|
|
300
|
+
* assert ownership or to set the owner of the resource(s)
|
|
301
|
+
*/
|
|
302
|
+
projectId?: string;
|
|
272
303
|
}
|
|
273
304
|
|
|
274
305
|
export namespace TrainingImageReplacePairsParams {
|
package/src/resources/search.ts
CHANGED
|
@@ -15,9 +15,9 @@ export class Search extends APIResource {
|
|
|
15
15
|
params: SearchAssetSearchParams,
|
|
16
16
|
options?: RequestOptions,
|
|
17
17
|
): PagePromise<SearchAssetSearchResponsesSearchHitsOffset, SearchAssetSearchResponse> {
|
|
18
|
-
const { originalAssets, ...body } = params;
|
|
18
|
+
const { originalAssets, projectId, ...body } = params;
|
|
19
19
|
return this._client.getAPIList('/search/assets', SearchHitsOffset<SearchAssetSearchResponse>, {
|
|
20
|
-
query: { originalAssets },
|
|
20
|
+
query: { originalAssets, projectId },
|
|
21
21
|
body,
|
|
22
22
|
method: 'post',
|
|
23
23
|
...options,
|
|
@@ -34,9 +34,9 @@ export class Search extends APIResource {
|
|
|
34
34
|
params: SearchModelSearchParams,
|
|
35
35
|
options?: RequestOptions,
|
|
36
36
|
): PagePromise<SearchModelSearchResponsesSearchHitsOffset, SearchModelSearchResponse> {
|
|
37
|
-
const { originalAssets, originalModels, ...body } = params;
|
|
37
|
+
const { originalAssets, originalModels, projectId, ...body } = params;
|
|
38
38
|
return this._client.getAPIList('/search/models', SearchHitsOffset<SearchModelSearchResponse>, {
|
|
39
|
-
query: { originalAssets, originalModels },
|
|
39
|
+
query: { originalAssets, originalModels, projectId },
|
|
40
40
|
body,
|
|
41
41
|
method: 'post',
|
|
42
42
|
...options,
|
|
@@ -419,6 +419,12 @@ export interface SearchAssetSearchParams extends SearchHitsOffsetParams {
|
|
|
419
419
|
*/
|
|
420
420
|
originalAssets?: boolean;
|
|
421
421
|
|
|
422
|
+
/**
|
|
423
|
+
* Query param: The projectId used for ownership resource management. Either to
|
|
424
|
+
* assert ownership or to set the owner of the resource(s)
|
|
425
|
+
*/
|
|
426
|
+
projectId?: string;
|
|
427
|
+
|
|
422
428
|
/**
|
|
423
429
|
* Body param: Filter queries by an attribute's value
|
|
424
430
|
*/
|
|
@@ -521,6 +527,12 @@ export interface SearchModelSearchParams extends SearchHitsOffsetParams {
|
|
|
521
527
|
*/
|
|
522
528
|
originalModels?: unknown;
|
|
523
529
|
|
|
530
|
+
/**
|
|
531
|
+
* Query param: The projectId used for ownership resource management. Either to
|
|
532
|
+
* assert ownership or to set the owner of the resource(s)
|
|
533
|
+
*/
|
|
534
|
+
projectId?: string;
|
|
535
|
+
|
|
524
536
|
/**
|
|
525
537
|
* Body param: Filter queries by an attribute's value
|
|
526
538
|
*/
|
package/src/resources/tags.ts
CHANGED
|
@@ -51,6 +51,12 @@ export interface TagListParams extends TagsCursorParams {
|
|
|
51
51
|
* value is 100, minimum value is 1
|
|
52
52
|
*/
|
|
53
53
|
pageSize?: number;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* The projectId used for ownership resource management. Either to assert ownership
|
|
57
|
+
* or to set the owner of the resource(s)
|
|
58
|
+
*/
|
|
59
|
+
projectId?: string;
|
|
54
60
|
}
|
|
55
61
|
|
|
56
62
|
export declare namespace Tags {
|