@runwayml/sdk 4.30.0 → 4.31.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 +11 -0
- package/client.d.mts +15 -0
- package/client.d.mts.map +1 -1
- package/client.d.ts +15 -0
- package/client.d.ts.map +1 -1
- package/client.js +15 -0
- package/client.js.map +1 -1
- package/client.mjs +15 -0
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/generate/generate.d.mts +4 -0
- package/resources/generate/generate.d.mts.map +1 -1
- package/resources/generate/generate.d.ts +4 -0
- package/resources/generate/generate.d.ts.map +1 -1
- package/resources/generate/generate.js +4 -0
- package/resources/generate/generate.js.map +1 -1
- package/resources/generate/generate.mjs +4 -0
- package/resources/generate/generate.mjs.map +1 -1
- package/resources/generate/index.d.mts +1 -0
- package/resources/generate/index.d.mts.map +1 -1
- package/resources/generate/index.d.ts +1 -0
- package/resources/generate/index.d.ts.map +1 -1
- package/resources/generate/index.js +3 -1
- package/resources/generate/index.js.map +1 -1
- package/resources/generate/index.mjs +1 -0
- package/resources/generate/index.mjs.map +1 -1
- package/resources/generate/mesh.d.mts +162 -0
- package/resources/generate/mesh.d.mts.map +1 -0
- package/resources/generate/mesh.d.ts +162 -0
- package/resources/generate/mesh.d.ts.map +1 -0
- package/resources/generate/mesh.js +16 -0
- package/resources/generate/mesh.js.map +1 -0
- package/resources/generate/mesh.mjs +12 -0
- package/resources/generate/mesh.mjs.map +1 -0
- package/resources/image-to-mesh.d.mts +128 -0
- package/resources/image-to-mesh.d.mts.map +1 -0
- package/resources/image-to-mesh.d.ts +128 -0
- package/resources/image-to-mesh.d.ts.map +1 -0
- package/resources/image-to-mesh.js +27 -0
- package/resources/image-to-mesh.js.map +1 -0
- package/resources/image-to-mesh.mjs +23 -0
- package/resources/image-to-mesh.mjs.map +1 -0
- package/resources/index.d.mts +3 -0
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +3 -0
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +7 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +3 -0
- package/resources/index.mjs.map +1 -1
- package/resources/model-catalog.d.mts +139 -0
- package/resources/model-catalog.d.mts.map +1 -0
- package/resources/model-catalog.d.ts +139 -0
- package/resources/model-catalog.d.ts.map +1 -0
- package/resources/model-catalog.js +28 -0
- package/resources/model-catalog.js.map +1 -0
- package/resources/model-catalog.mjs +24 -0
- package/resources/model-catalog.mjs.map +1 -0
- package/resources/text-to-mesh.d.mts +83 -0
- package/resources/text-to-mesh.d.mts.map +1 -0
- package/resources/text-to-mesh.d.ts +83 -0
- package/resources/text-to-mesh.d.ts.map +1 -0
- package/resources/text-to-mesh.js +19 -0
- package/resources/text-to-mesh.js.map +1 -0
- package/resources/text-to-mesh.mjs +15 -0
- package/resources/text-to-mesh.mjs.map +1 -0
- package/src/client.ts +29 -0
- package/src/resources/generate/generate.ts +10 -0
- package/src/resources/generate/index.ts +1 -0
- package/src/resources/generate/mesh.ts +214 -0
- package/src/resources/image-to-mesh.ts +176 -0
- package/src/resources/index.ts +3 -0
- package/src/resources/model-catalog.ts +161 -0
- package/src/resources/text-to-mesh.ts +118 -0
- 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
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../core/resource';
|
|
4
|
+
import { RequestOptions } from '../../internal/request-options';
|
|
5
|
+
import { APIPromiseWithAwaitableTask, wrapAsWaitableResource } from '../../lib/polling';
|
|
6
|
+
|
|
7
|
+
export class Mesh extends APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Generate a GLB mesh using a saved Model Router config.
|
|
10
|
+
*/
|
|
11
|
+
create(body: MeshCreateParams, options?: RequestOptions): APIPromiseWithAwaitableTask<MeshCreateResponse> {
|
|
12
|
+
return wrapAsWaitableResource<MeshCreateResponse>(this._client)(
|
|
13
|
+
this._client.post('/v1/generate/mesh', { body, ...options }),
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface MeshCreateResponse {
|
|
19
|
+
/**
|
|
20
|
+
* The ID of the created task. Poll GET /v1/tasks/:id for the result.
|
|
21
|
+
*/
|
|
22
|
+
id: string;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Metadata describing which model the router selected and why.
|
|
26
|
+
*/
|
|
27
|
+
routing: MeshCreateResponse.Routing;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export namespace MeshCreateResponse {
|
|
31
|
+
/**
|
|
32
|
+
* Metadata describing which model the router selected and why.
|
|
33
|
+
*/
|
|
34
|
+
export interface Routing {
|
|
35
|
+
/**
|
|
36
|
+
* The slug of the router config that was applied to this request.
|
|
37
|
+
*/
|
|
38
|
+
configId: string;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Estimated cost, computed against current pricing.
|
|
42
|
+
*/
|
|
43
|
+
estimatedCost: Routing.EstimatedCost;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* The public name of the model the router selected.
|
|
47
|
+
*/
|
|
48
|
+
model: string;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* The provider of the selected model.
|
|
52
|
+
*/
|
|
53
|
+
provider: string;
|
|
54
|
+
|
|
55
|
+
resolvedInput: Routing.ResolvedInput;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* The resolved config settings the router used for this request.
|
|
59
|
+
*/
|
|
60
|
+
resolvedSettings: Routing.ResolvedSettings;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Present only when the config enables fallback.onCapacity and capacity affected
|
|
64
|
+
* this request.
|
|
65
|
+
*/
|
|
66
|
+
capacityFallback?: Routing.CapacityFallback;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export namespace Routing {
|
|
70
|
+
/**
|
|
71
|
+
* Estimated cost, computed against current pricing.
|
|
72
|
+
*/
|
|
73
|
+
export interface EstimatedCost {
|
|
74
|
+
/**
|
|
75
|
+
* Estimated cost of the generation in credits.
|
|
76
|
+
*/
|
|
77
|
+
credits: number;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export interface ResolvedInput {
|
|
81
|
+
outputFormat: 'glb';
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* The resolved config settings the router used for this request.
|
|
86
|
+
*/
|
|
87
|
+
export interface ResolvedSettings {
|
|
88
|
+
/**
|
|
89
|
+
* The single optimization preference the config selected, used as the soft
|
|
90
|
+
* weighting when scoring eligible models.
|
|
91
|
+
*/
|
|
92
|
+
optimizeFor: 'cost' | 'latency' | 'quality';
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* The applied maximum credits per generation for this request's modality, or null
|
|
96
|
+
* if the config sets no ceiling.
|
|
97
|
+
*/
|
|
98
|
+
priceCeiling: number | null;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Present only when the config enables fallback.onCapacity and capacity affected
|
|
103
|
+
* this request.
|
|
104
|
+
*/
|
|
105
|
+
export interface CapacityFallback {
|
|
106
|
+
/**
|
|
107
|
+
* True when every eligible model was at its concurrency limit, so the best-ranked
|
|
108
|
+
* model was used and the task will queue.
|
|
109
|
+
*/
|
|
110
|
+
allExhausted: boolean;
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Eligible models that were considered for this request but not selected because
|
|
114
|
+
* this account is at its concurrency limit for them.
|
|
115
|
+
*/
|
|
116
|
+
skipped: Array<string>;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export interface MeshCreateParams {
|
|
122
|
+
/**
|
|
123
|
+
* The slug of a saved Model Router config to route this request with.
|
|
124
|
+
*/
|
|
125
|
+
configId: string;
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Generate a GLB mesh from either text or views of the same object, not both.
|
|
129
|
+
*/
|
|
130
|
+
input: MeshCreateParams.FromText | MeshCreateParams.FromReferenceImages;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export namespace MeshCreateParams {
|
|
134
|
+
export interface FromText {
|
|
135
|
+
promptText: string;
|
|
136
|
+
|
|
137
|
+
autoSize?: boolean;
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Maximum face count: 1,500,000 with standard geometry or 2,000,000 with detailed
|
|
141
|
+
* geometry.
|
|
142
|
+
*/
|
|
143
|
+
faceLimit?: number;
|
|
144
|
+
|
|
145
|
+
geometryQuality?: 'standard' | 'detailed';
|
|
146
|
+
|
|
147
|
+
imageSeed?: number;
|
|
148
|
+
|
|
149
|
+
modelSeed?: number;
|
|
150
|
+
|
|
151
|
+
orientation?: 'default' | 'align_image';
|
|
152
|
+
|
|
153
|
+
pbr?: boolean;
|
|
154
|
+
|
|
155
|
+
referenceImages?: unknown;
|
|
156
|
+
|
|
157
|
+
texture?: boolean;
|
|
158
|
+
|
|
159
|
+
textureAlignment?: 'original_image' | 'geometry';
|
|
160
|
+
|
|
161
|
+
textureQuality?: 'standard' | 'detailed';
|
|
162
|
+
|
|
163
|
+
textureSeed?: number;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export interface FromReferenceImages {
|
|
167
|
+
referenceImages: Array<FromReferenceImages.ReferenceImage>;
|
|
168
|
+
|
|
169
|
+
autoSize?: boolean;
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Maximum face count: 1,500,000 with standard geometry or 2,000,000 with detailed
|
|
173
|
+
* geometry.
|
|
174
|
+
*/
|
|
175
|
+
faceLimit?: number;
|
|
176
|
+
|
|
177
|
+
geometryQuality?: 'standard' | 'detailed';
|
|
178
|
+
|
|
179
|
+
imageSeed?: number;
|
|
180
|
+
|
|
181
|
+
modelSeed?: number;
|
|
182
|
+
|
|
183
|
+
orientation?: 'default' | 'align_image';
|
|
184
|
+
|
|
185
|
+
pbr?: boolean;
|
|
186
|
+
|
|
187
|
+
promptText?: unknown;
|
|
188
|
+
|
|
189
|
+
texture?: boolean;
|
|
190
|
+
|
|
191
|
+
textureAlignment?: 'original_image' | 'geometry';
|
|
192
|
+
|
|
193
|
+
textureQuality?: 'standard' | 'detailed';
|
|
194
|
+
|
|
195
|
+
textureSeed?: number;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
export namespace FromReferenceImages {
|
|
199
|
+
export interface ReferenceImage {
|
|
200
|
+
/**
|
|
201
|
+
* A HTTPS URL, Runway upload URI, or base64 data URI (e.g.
|
|
202
|
+
* `data:image/png;base64,...`, up to 5MB) containing an encoded image. See
|
|
203
|
+
* [our docs](/assets/inputs#images) on image inputs for more information.
|
|
204
|
+
*/
|
|
205
|
+
uri: string;
|
|
206
|
+
|
|
207
|
+
type?: 'front' | 'left' | 'back' | 'right';
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
export declare namespace Mesh {
|
|
213
|
+
export { type MeshCreateResponse as MeshCreateResponse, type MeshCreateParams as MeshCreateParams };
|
|
214
|
+
}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../core/resource';
|
|
4
|
+
import { RequestOptions } from '../internal/request-options';
|
|
5
|
+
import { APIPromiseWithAwaitableTask, wrapAsWaitableResource } from '../lib/polling';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* These endpoints all kick off tasks to create generations.
|
|
9
|
+
*/
|
|
10
|
+
export class ImageToMesh extends APIResource {
|
|
11
|
+
/**
|
|
12
|
+
* Generate a GLB mesh from one image or ordered views of the same object.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* const imageToMesh = await client.imageToMesh.create({
|
|
17
|
+
* imageUri: 'https://example.com/image.jpg',
|
|
18
|
+
* model: 'trellis_2',
|
|
19
|
+
* });
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
create(
|
|
23
|
+
body: ImageToMeshCreateParams,
|
|
24
|
+
options?: RequestOptions,
|
|
25
|
+
): APIPromiseWithAwaitableTask<ImageToMeshCreateResponse> {
|
|
26
|
+
return wrapAsWaitableResource<ImageToMeshCreateResponse>(this._client)(
|
|
27
|
+
this._client.post('/v1/image_to_mesh', { body, ...options }),
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface ImageToMeshCreateResponse {
|
|
33
|
+
/**
|
|
34
|
+
* The ID of the task that was created. Use this to retrieve the task later.
|
|
35
|
+
*/
|
|
36
|
+
id: string;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* The maximum credits this task may charge. The final amount may be lower after
|
|
40
|
+
* the task completes.
|
|
41
|
+
*/
|
|
42
|
+
estimatedCost: ImageToMeshCreateResponse.EstimatedCost;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export namespace ImageToMeshCreateResponse {
|
|
46
|
+
/**
|
|
47
|
+
* The maximum credits this task may charge. The final amount may be lower after
|
|
48
|
+
* the task completes.
|
|
49
|
+
*/
|
|
50
|
+
export interface EstimatedCost {
|
|
51
|
+
/**
|
|
52
|
+
* Estimated cost of the generation in credits.
|
|
53
|
+
*/
|
|
54
|
+
credits: number;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export type ImageToMeshCreateParams =
|
|
59
|
+
| ImageToMeshCreateParams.Tripo3dH3_1
|
|
60
|
+
| ImageToMeshCreateParams.Hunyuan3d3_1Pro
|
|
61
|
+
| ImageToMeshCreateParams.Trellis2;
|
|
62
|
+
|
|
63
|
+
export declare namespace ImageToMeshCreateParams {
|
|
64
|
+
export interface Tripo3dH3_1 {
|
|
65
|
+
model: 'tripo3d_h3_1';
|
|
66
|
+
|
|
67
|
+
referenceImages: Array<Tripo3dH3_1.ReferenceImage>;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Estimate the physical size of the object.
|
|
71
|
+
*/
|
|
72
|
+
autoSize?: boolean;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* The maximum number of faces in the generated mesh.
|
|
76
|
+
*/
|
|
77
|
+
faceLimit?: number;
|
|
78
|
+
|
|
79
|
+
geometryQuality?: 'standard' | 'detailed';
|
|
80
|
+
|
|
81
|
+
modelSeed?: number;
|
|
82
|
+
|
|
83
|
+
orientation?: 'default' | 'align_image';
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Generate physically based materials for the mesh.
|
|
87
|
+
*/
|
|
88
|
+
pbr?: boolean;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Generate textures for the mesh. PBR also enables textures.
|
|
92
|
+
*/
|
|
93
|
+
texture?: boolean;
|
|
94
|
+
|
|
95
|
+
textureAlignment?: 'original_image' | 'geometry';
|
|
96
|
+
|
|
97
|
+
textureQuality?: 'standard' | 'detailed';
|
|
98
|
+
|
|
99
|
+
textureSeed?: number;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export namespace Tripo3dH3_1 {
|
|
103
|
+
export interface ReferenceImage {
|
|
104
|
+
/**
|
|
105
|
+
* A HTTPS URL, Runway upload URI, or base64 data URI (e.g.
|
|
106
|
+
* `data:image/png;base64,...`, up to 5MB) containing an encoded image. See
|
|
107
|
+
* [our docs](/assets/inputs#images) on image inputs for more information.
|
|
108
|
+
*/
|
|
109
|
+
uri: string;
|
|
110
|
+
|
|
111
|
+
type?: 'front' | 'left' | 'back' | 'right';
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export interface Hunyuan3d3_1Pro {
|
|
116
|
+
model: 'hunyuan_3d_3_1_pro';
|
|
117
|
+
|
|
118
|
+
referenceImages: Array<Hunyuan3d3_1Pro.ReferenceImage>;
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Generate physically based materials for a textured model.
|
|
122
|
+
*/
|
|
123
|
+
enablePbr?: boolean;
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* The target number of faces in the generated mesh.
|
|
127
|
+
*/
|
|
128
|
+
faceCount?: number;
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Generate a textured model or geometry without textures.
|
|
132
|
+
*/
|
|
133
|
+
generateType?: 'Normal' | 'Geometry';
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export namespace Hunyuan3d3_1Pro {
|
|
137
|
+
export interface ReferenceImage {
|
|
138
|
+
/**
|
|
139
|
+
* A HTTPS URL, Runway upload URI, or base64 data URI (e.g.
|
|
140
|
+
* `data:image/png;base64,...`, up to 5MB) containing an encoded image. See
|
|
141
|
+
* [our docs](/assets/inputs#images) on image inputs for more information.
|
|
142
|
+
*/
|
|
143
|
+
uri: string;
|
|
144
|
+
|
|
145
|
+
type?: 'front' | 'back' | 'left' | 'right' | 'top' | 'bottom' | 'left_front' | 'right_front';
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export interface Trellis2 {
|
|
150
|
+
/**
|
|
151
|
+
* A HTTPS URL, Runway upload URI, or base64 data URI (e.g.
|
|
152
|
+
* `data:image/png;base64,...`, up to 5MB) containing an encoded image. See
|
|
153
|
+
* [our docs](/assets/inputs#images) on image inputs for more information.
|
|
154
|
+
*/
|
|
155
|
+
imageUri: string;
|
|
156
|
+
|
|
157
|
+
model: 'trellis_2';
|
|
158
|
+
|
|
159
|
+
decimationTarget?: number;
|
|
160
|
+
|
|
161
|
+
remesh?: boolean;
|
|
162
|
+
|
|
163
|
+
resolution?: 512 | 1024 | 1536;
|
|
164
|
+
|
|
165
|
+
seed?: number;
|
|
166
|
+
|
|
167
|
+
textureSize?: 1024 | 2048 | 4096;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
export declare namespace ImageToMesh {
|
|
172
|
+
export {
|
|
173
|
+
type ImageToMeshCreateResponse as ImageToMeshCreateResponse,
|
|
174
|
+
type ImageToMeshCreateParams as ImageToMeshCreateParams,
|
|
175
|
+
};
|
|
176
|
+
}
|
package/src/resources/index.ts
CHANGED
|
@@ -37,6 +37,7 @@ export {
|
|
|
37
37
|
type DocumentListResponsesCursorPage,
|
|
38
38
|
} from './documents';
|
|
39
39
|
export { Generate } from './generate/generate';
|
|
40
|
+
export { ImageToMesh, type ImageToMeshCreateResponse, type ImageToMeshCreateParams } from './image-to-mesh';
|
|
40
41
|
export {
|
|
41
42
|
ImageToVector,
|
|
42
43
|
type ImageToVectorCreateResponse,
|
|
@@ -52,6 +53,7 @@ export {
|
|
|
52
53
|
type ImageUpscaleCreateResponse,
|
|
53
54
|
type ImageUpscaleCreateParams,
|
|
54
55
|
} from './image-upscale';
|
|
56
|
+
export { ModelCatalog, type ModelCatalogListResponse } from './model-catalog';
|
|
55
57
|
export {
|
|
56
58
|
Organization,
|
|
57
59
|
type OrganizationRetrieveResponse,
|
|
@@ -104,6 +106,7 @@ export {
|
|
|
104
106
|
} from './speech-to-speech';
|
|
105
107
|
export { Tasks, type TaskRetrieveResponse } from './tasks';
|
|
106
108
|
export { TextToImage, type TextToImageCreateResponse, type TextToImageCreateParams } from './text-to-image';
|
|
109
|
+
export { TextToMesh, type TextToMeshCreateResponse, type TextToMeshCreateParams } from './text-to-mesh';
|
|
107
110
|
export { TextToMusic, type TextToMusicCreateResponse, type TextToMusicCreateParams } from './text-to-music';
|
|
108
111
|
export {
|
|
109
112
|
TextToSpeech,
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../core/resource';
|
|
4
|
+
import { APIPromise } from '../core/api-promise';
|
|
5
|
+
import { RequestOptions } from '../internal/request-options';
|
|
6
|
+
|
|
7
|
+
export class ModelCatalog extends APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* List the endpoints and `model` values the organization associated with the API
|
|
10
|
+
* key has access to, grouped by model. An entry is `available` when model
|
|
11
|
+
* admission, the check a request makes on its `model` value before reading the
|
|
12
|
+
* body, accepts that value on that endpoint for the organization now, and `gated`
|
|
13
|
+
* with a reason when admission refuses it for a workspace policy or because the
|
|
14
|
+
* task it runs has been retired. A `model` value admission refuses for any other
|
|
15
|
+
* reason, such as no access or a release that has not reached the organization,
|
|
16
|
+
* has no entry. Deprecated and retired `model` values have no entry, and a request
|
|
17
|
+
* for a retired one is refused with a sunset error. A `model` value not yet
|
|
18
|
+
* announced has an entry only when admission accepts it, listed in
|
|
19
|
+
* `ungroupedEntries` and never `gated`. Checks that depend on the caller, the
|
|
20
|
+
* request or the moment run afterwards, at submission, and refuse with their own
|
|
21
|
+
* errors: the caller's region, the organization's country lock, daily task limits,
|
|
22
|
+
* credits, and provider outages.
|
|
23
|
+
*/
|
|
24
|
+
list(options?: RequestOptions): APIPromise<ModelCatalogListResponse> {
|
|
25
|
+
return this._client.get('/v1/model_catalog', options);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface ModelCatalogListResponse {
|
|
30
|
+
/**
|
|
31
|
+
* The models the organization has access to, with an entry per endpoint and
|
|
32
|
+
* `model` value. A `model` value admission refuses on an endpoint for a reason
|
|
33
|
+
* other than a workspace policy or a retired task, such as no access, has no
|
|
34
|
+
* entry. Deprecated and retired `model` values have no entry, and neither does a
|
|
35
|
+
* `model` value not yet announced that admission refuses.
|
|
36
|
+
*/
|
|
37
|
+
models: Array<ModelCatalogListResponse.Model>;
|
|
38
|
+
|
|
39
|
+
schemaVersion: 1;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Entries for `model` values that belong to no model listed in `models`, including
|
|
43
|
+
* every `model` value not yet announced.
|
|
44
|
+
*/
|
|
45
|
+
ungroupedEntries: Array<ModelCatalogListResponse.UngroupedEntry>;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export namespace ModelCatalogListResponse {
|
|
49
|
+
/**
|
|
50
|
+
* A model, with the endpoints and `model` values that request it.
|
|
51
|
+
*/
|
|
52
|
+
export interface Model {
|
|
53
|
+
/**
|
|
54
|
+
* The model's catalog identifier.
|
|
55
|
+
*/
|
|
56
|
+
id: string;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Each endpoint and `model` value for this model, each answered on its own.
|
|
60
|
+
*/
|
|
61
|
+
entries: Array<Model.Entry>;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* The kind of media the model produces.
|
|
65
|
+
*/
|
|
66
|
+
medium: 'image' | 'video' | 'audio' | 'mesh';
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* The model's display name.
|
|
70
|
+
*/
|
|
71
|
+
name: string;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export namespace Model {
|
|
75
|
+
/**
|
|
76
|
+
* A `model` value one endpoint accepts, and whether the organization may request
|
|
77
|
+
* it there.
|
|
78
|
+
*/
|
|
79
|
+
export interface Entry {
|
|
80
|
+
/**
|
|
81
|
+
* The endpoint path that accepts this `model` value.
|
|
82
|
+
*/
|
|
83
|
+
path: string;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* The value to send as `model` in a request to `path`.
|
|
87
|
+
*/
|
|
88
|
+
requestName: string;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* `available` when model admission accepts this `model` value on this endpoint for
|
|
92
|
+
* the organization now. `gated` when admission refuses it for a workspace policy
|
|
93
|
+
* or because the task it runs has been retired, explained in `reason`; a `model`
|
|
94
|
+
* value not yet announced is never `gated`. Admission does not cover the checks a
|
|
95
|
+
* request meets later at submission, which refuse with their own errors.
|
|
96
|
+
*/
|
|
97
|
+
state: 'available' | 'gated';
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Why a request for a gated model would be refused.
|
|
101
|
+
*/
|
|
102
|
+
reason?: string;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* A stable code for `reason` on a gated entry, for clients that write their own
|
|
106
|
+
* message. Known codes: `sunset` when admission refuses because the task it runs
|
|
107
|
+
* has been retired; `admin_disabled`, `runway_disabled`, `not_purchased` or
|
|
108
|
+
* `region_restricted` when a workspace policy refuses it (`runway_disabled` when
|
|
109
|
+
* Runway turned the model off for the workspace and its admins cannot turn it on).
|
|
110
|
+
* New codes may be added; treat a code you do not recognize as absent and show
|
|
111
|
+
* `reason`.
|
|
112
|
+
*/
|
|
113
|
+
reasonCode?: string;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* A `model` value one endpoint accepts, and whether the organization may request
|
|
119
|
+
* it there.
|
|
120
|
+
*/
|
|
121
|
+
export interface UngroupedEntry {
|
|
122
|
+
/**
|
|
123
|
+
* The endpoint path that accepts this `model` value.
|
|
124
|
+
*/
|
|
125
|
+
path: string;
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* The value to send as `model` in a request to `path`.
|
|
129
|
+
*/
|
|
130
|
+
requestName: string;
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* `available` when model admission accepts this `model` value on this endpoint for
|
|
134
|
+
* the organization now. `gated` when admission refuses it for a workspace policy
|
|
135
|
+
* or because the task it runs has been retired, explained in `reason`; a `model`
|
|
136
|
+
* value not yet announced is never `gated`. Admission does not cover the checks a
|
|
137
|
+
* request meets later at submission, which refuse with their own errors.
|
|
138
|
+
*/
|
|
139
|
+
state: 'available' | 'gated';
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Why a request for a gated model would be refused.
|
|
143
|
+
*/
|
|
144
|
+
reason?: string;
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* A stable code for `reason` on a gated entry, for clients that write their own
|
|
148
|
+
* message. Known codes: `sunset` when admission refuses because the task it runs
|
|
149
|
+
* has been retired; `admin_disabled`, `runway_disabled`, `not_purchased` or
|
|
150
|
+
* `region_restricted` when a workspace policy refuses it (`runway_disabled` when
|
|
151
|
+
* Runway turned the model off for the workspace and its admins cannot turn it on).
|
|
152
|
+
* New codes may be added; treat a code you do not recognize as absent and show
|
|
153
|
+
* `reason`.
|
|
154
|
+
*/
|
|
155
|
+
reasonCode?: string;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
export declare namespace ModelCatalog {
|
|
160
|
+
export { type ModelCatalogListResponse as ModelCatalogListResponse };
|
|
161
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../core/resource';
|
|
4
|
+
import { RequestOptions } from '../internal/request-options';
|
|
5
|
+
import { APIPromiseWithAwaitableTask, wrapAsWaitableResource } from '../lib/polling';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* These endpoints all kick off tasks to create generations.
|
|
9
|
+
*/
|
|
10
|
+
export class TextToMesh extends APIResource {
|
|
11
|
+
/**
|
|
12
|
+
* Generate a GLB mesh from a text description.
|
|
13
|
+
*/
|
|
14
|
+
create(
|
|
15
|
+
body: TextToMeshCreateParams,
|
|
16
|
+
options?: RequestOptions,
|
|
17
|
+
): APIPromiseWithAwaitableTask<TextToMeshCreateResponse> {
|
|
18
|
+
return wrapAsWaitableResource<TextToMeshCreateResponse>(this._client)(
|
|
19
|
+
this._client.post('/v1/text_to_mesh', { body, ...options }),
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface TextToMeshCreateResponse {
|
|
25
|
+
/**
|
|
26
|
+
* The ID of the task that was created. Use this to retrieve the task later.
|
|
27
|
+
*/
|
|
28
|
+
id: string;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* The maximum credits this task may charge. The final amount may be lower after
|
|
32
|
+
* the task completes.
|
|
33
|
+
*/
|
|
34
|
+
estimatedCost: TextToMeshCreateResponse.EstimatedCost;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export namespace TextToMeshCreateResponse {
|
|
38
|
+
/**
|
|
39
|
+
* The maximum credits this task may charge. The final amount may be lower after
|
|
40
|
+
* the task completes.
|
|
41
|
+
*/
|
|
42
|
+
export interface EstimatedCost {
|
|
43
|
+
/**
|
|
44
|
+
* Estimated cost of the generation in credits.
|
|
45
|
+
*/
|
|
46
|
+
credits: number;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export type TextToMeshCreateParams =
|
|
51
|
+
| TextToMeshCreateParams.Tripo3dH3_1
|
|
52
|
+
| TextToMeshCreateParams.Hunyuan3d3_1Pro;
|
|
53
|
+
|
|
54
|
+
export declare namespace TextToMeshCreateParams {
|
|
55
|
+
export interface Tripo3dH3_1 {
|
|
56
|
+
model: 'tripo3d_h3_1';
|
|
57
|
+
|
|
58
|
+
promptText: string;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Estimate the physical size of the object.
|
|
62
|
+
*/
|
|
63
|
+
autoSize?: boolean;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* The maximum number of faces in the generated mesh.
|
|
67
|
+
*/
|
|
68
|
+
faceLimit?: number;
|
|
69
|
+
|
|
70
|
+
geometryQuality?: 'standard' | 'detailed';
|
|
71
|
+
|
|
72
|
+
imageSeed?: number;
|
|
73
|
+
|
|
74
|
+
modelSeed?: number;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Generate physically based materials for the mesh.
|
|
78
|
+
*/
|
|
79
|
+
pbr?: boolean;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Generate textures for the mesh. PBR also enables textures.
|
|
83
|
+
*/
|
|
84
|
+
texture?: boolean;
|
|
85
|
+
|
|
86
|
+
textureQuality?: 'standard' | 'detailed';
|
|
87
|
+
|
|
88
|
+
textureSeed?: number;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export interface Hunyuan3d3_1Pro {
|
|
92
|
+
model: 'hunyuan_3d_3_1_pro';
|
|
93
|
+
|
|
94
|
+
promptText: string;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Generate physically based materials for a textured model.
|
|
98
|
+
*/
|
|
99
|
+
enablePbr?: boolean;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* The target number of faces in the generated mesh.
|
|
103
|
+
*/
|
|
104
|
+
faceCount?: number;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Generate a textured model or geometry without textures.
|
|
108
|
+
*/
|
|
109
|
+
generateType?: 'Normal' | 'Geometry';
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export declare namespace TextToMesh {
|
|
114
|
+
export {
|
|
115
|
+
type TextToMeshCreateResponse as TextToMeshCreateResponse,
|
|
116
|
+
type TextToMeshCreateParams as TextToMeshCreateParams,
|
|
117
|
+
};
|
|
118
|
+
}
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '4.
|
|
1
|
+
export const VERSION = '4.31.0'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "4.
|
|
1
|
+
export declare const VERSION = "4.31.0";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "4.
|
|
1
|
+
export declare const VERSION = "4.31.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|