@slopmachine/core 0.1.26 → 0.2.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 +7 -0
- package/README.md +22 -3
- package/dist/index.d.mts +169 -5
- package/dist/index.d.ts +169 -5
- package/dist/index.js +156 -12
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +154 -12
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/index.ts +361 -24
package/CHANGELOG.md
ADDED
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @slopmachine/core
|
|
2
2
|
|
|
3
|
-
The core logic
|
|
3
|
+
The core logic, URL builders, preloader utilities, and type definitions for the Slop Machine SDK.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -12,9 +12,28 @@ yarn add @slopmachine/core
|
|
|
12
12
|
pnpm add @slopmachine/core
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
##
|
|
15
|
+
## Features
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
- **URL Builders**: `buildImageUrl`, `buildVideoUrl`, `buildTextUrl`, and `buildPipelineUrl` for safe, deterministic API URL generation.
|
|
18
|
+
- **Preloaders**: `preloadImage`, `preloadVideo`, and `preloadText` to cache assets ahead of time in client applications.
|
|
19
|
+
- **Multi-Step Pipelines**: Programmatic execution via `executePipeline({ pipelineId, prompt, variables, metadata })`.
|
|
20
|
+
- **Buckets & Pipelines Support**: Seamlessly switch between pre-templated Buckets and dynamic runtime Pipelines.
|
|
21
|
+
|
|
22
|
+
## Programmatic Pipeline Execution
|
|
23
|
+
|
|
24
|
+
```typescript
|
|
25
|
+
import { executePipeline } from "@slopmachine/core";
|
|
26
|
+
|
|
27
|
+
const result = await executePipeline({
|
|
28
|
+
pipelineId: "pipe_live_abc123",
|
|
29
|
+
prompt: "A cinematic tracking shot through a cyberpunk alleyway",
|
|
30
|
+
metadata: { userId: "usr_42" },
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
console.log("Output URL:", result.url);
|
|
34
|
+
console.log("Fuel Cost:", result.totalFuelCost);
|
|
35
|
+
console.log("Steps executed:", result.stepResults.length);
|
|
36
|
+
```
|
|
18
37
|
|
|
19
38
|
## License
|
|
20
39
|
|
package/dist/index.d.mts
CHANGED
|
@@ -1,11 +1,120 @@
|
|
|
1
1
|
import { AspectRatio, VideoAspectRatio } from '@pixerate/schemas';
|
|
2
2
|
export { AspectRatio as ImageAspectRatio, VideoAspectRatio } from '@pixerate/schemas';
|
|
3
3
|
|
|
4
|
+
interface PipelineStepResult {
|
|
5
|
+
stepId: string;
|
|
6
|
+
stepName?: string;
|
|
7
|
+
type: string;
|
|
8
|
+
outputUrl?: string;
|
|
9
|
+
outputText?: string;
|
|
10
|
+
outputData?: any;
|
|
11
|
+
computeTimeMs?: number;
|
|
12
|
+
fuelCost?: number;
|
|
13
|
+
error?: string;
|
|
14
|
+
}
|
|
15
|
+
interface PipelineResult {
|
|
16
|
+
id: string;
|
|
17
|
+
pipelineId: string;
|
|
18
|
+
siloId: string;
|
|
19
|
+
url?: string;
|
|
20
|
+
text?: string;
|
|
21
|
+
data?: any;
|
|
22
|
+
resultType: string;
|
|
23
|
+
status: "completed" | "failed" | "pending";
|
|
24
|
+
stepResults: PipelineStepResult[];
|
|
25
|
+
totalComputeTimeMs: number;
|
|
26
|
+
totalFuelCost: number;
|
|
27
|
+
metadata?: Record<string, any>;
|
|
28
|
+
timestamp: any;
|
|
29
|
+
error?: string;
|
|
30
|
+
}
|
|
31
|
+
interface SlopPipelineOptions {
|
|
32
|
+
/**
|
|
33
|
+
* The unique identifier of the pipeline to execute.
|
|
34
|
+
*/
|
|
35
|
+
pipelineId: string;
|
|
36
|
+
/**
|
|
37
|
+
* Optional silo identifier for direct pipeline path resolution.
|
|
38
|
+
*/
|
|
39
|
+
siloId?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Dynamic runtime prompt to feed into the pipeline.
|
|
42
|
+
*/
|
|
43
|
+
prompt?: string;
|
|
44
|
+
/**
|
|
45
|
+
* Variables to interpolate into prompt or step configs.
|
|
46
|
+
*/
|
|
47
|
+
variables?: Record<string, string | number | undefined | null>;
|
|
48
|
+
/**
|
|
49
|
+
* Arbitrary user metadata to attach to the pipeline result document.
|
|
50
|
+
*/
|
|
51
|
+
metadata?: Record<string, any>;
|
|
52
|
+
/**
|
|
53
|
+
* Whether to wait for full execution (default true) or return a job ID immediately.
|
|
54
|
+
*/
|
|
55
|
+
sync?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Whether to redirect to the primary media output URL upon completion.
|
|
58
|
+
*/
|
|
59
|
+
redirect?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Result ID to retrieve a specific previously generated result.
|
|
62
|
+
*/
|
|
63
|
+
resultId?: string;
|
|
64
|
+
/**
|
|
65
|
+
* Base URL for the renderPipeline cloud function endpoint.
|
|
66
|
+
*/
|
|
67
|
+
baseUrl?: string;
|
|
68
|
+
}
|
|
69
|
+
interface ExecutePipelineOptions {
|
|
70
|
+
/**
|
|
71
|
+
* The unique identifier of the pipeline to execute.
|
|
72
|
+
*/
|
|
73
|
+
pipelineId: string;
|
|
74
|
+
/**
|
|
75
|
+
* Optional silo identifier for direct pipeline path resolution.
|
|
76
|
+
*/
|
|
77
|
+
siloId?: string;
|
|
78
|
+
/**
|
|
79
|
+
* Dynamic runtime prompt to feed into the pipeline.
|
|
80
|
+
*/
|
|
81
|
+
prompt?: string;
|
|
82
|
+
/**
|
|
83
|
+
* Variables to interpolate into prompt or step configs.
|
|
84
|
+
*/
|
|
85
|
+
variables?: Record<string, string | number | undefined | null>;
|
|
86
|
+
/**
|
|
87
|
+
* Arbitrary user metadata to attach to the pipeline result document.
|
|
88
|
+
*/
|
|
89
|
+
metadata?: Record<string, any>;
|
|
90
|
+
/**
|
|
91
|
+
* Base URL for the renderPipeline cloud function endpoint.
|
|
92
|
+
*/
|
|
93
|
+
baseUrl?: string;
|
|
94
|
+
}
|
|
4
95
|
interface SlopImageOptions {
|
|
5
96
|
/**
|
|
6
97
|
* The unique identifier of your Slop Machine bucket.
|
|
98
|
+
* Required when using a bucket unless pipelineId is provided.
|
|
99
|
+
*/
|
|
100
|
+
bucketId?: string;
|
|
101
|
+
/**
|
|
102
|
+
* The unique identifier of your Slop Machine pipeline.
|
|
103
|
+
* Required when targeting a pipeline instead of a bucket.
|
|
104
|
+
*/
|
|
105
|
+
pipelineId?: string;
|
|
106
|
+
/**
|
|
107
|
+
* Optional silo identifier.
|
|
108
|
+
*/
|
|
109
|
+
siloId?: string;
|
|
110
|
+
/**
|
|
111
|
+
* Dynamic runtime prompt (used when targeting a pipeline).
|
|
112
|
+
*/
|
|
113
|
+
prompt?: string;
|
|
114
|
+
/**
|
|
115
|
+
* Arbitrary user metadata to attach to the generation request / result document.
|
|
7
116
|
*/
|
|
8
|
-
|
|
117
|
+
metadata?: Record<string, any>;
|
|
9
118
|
/**
|
|
10
119
|
* The specific version of the prompt/settings to use.
|
|
11
120
|
* If omitted, the latest version will be used.
|
|
@@ -51,6 +160,8 @@ declare function interpolatePrompt(prompt?: string, variables?: Record<string, s
|
|
|
51
160
|
/**
|
|
52
161
|
* Builds a URL to render or retrieve an image from Slop Machine.
|
|
53
162
|
*
|
|
163
|
+
* Supports both standard Buckets (via `bucketId`) and multi-step Pipelines (via `pipelineId`).
|
|
164
|
+
*
|
|
54
165
|
* @param options - Configuration options for the image generation.
|
|
55
166
|
* @returns A string containing the fully constructed URL.
|
|
56
167
|
*/
|
|
@@ -63,12 +174,29 @@ declare function buildImageUrl(options: SlopImageOptions): string;
|
|
|
63
174
|
* @returns A promise that resolves when the image has been loaded.
|
|
64
175
|
*/
|
|
65
176
|
declare function preloadImage(options: SlopImageOptions): Promise<void>;
|
|
66
|
-
|
|
67
177
|
interface SlopVideoOptions {
|
|
68
178
|
/**
|
|
69
179
|
* The unique identifier of your Slop Machine bucket.
|
|
180
|
+
* Required when using a bucket unless pipelineId is provided.
|
|
70
181
|
*/
|
|
71
|
-
bucketId
|
|
182
|
+
bucketId?: string;
|
|
183
|
+
/**
|
|
184
|
+
* The unique identifier of your Slop Machine pipeline.
|
|
185
|
+
* Required when targeting a pipeline instead of a bucket.
|
|
186
|
+
*/
|
|
187
|
+
pipelineId?: string;
|
|
188
|
+
/**
|
|
189
|
+
* Optional silo identifier.
|
|
190
|
+
*/
|
|
191
|
+
siloId?: string;
|
|
192
|
+
/**
|
|
193
|
+
* Dynamic runtime prompt (used when targeting a pipeline).
|
|
194
|
+
*/
|
|
195
|
+
prompt?: string;
|
|
196
|
+
/**
|
|
197
|
+
* Arbitrary user metadata to attach to the generation request / result document.
|
|
198
|
+
*/
|
|
199
|
+
metadata?: Record<string, any>;
|
|
72
200
|
/**
|
|
73
201
|
* The specific version of the prompt/settings to use.
|
|
74
202
|
* If omitted, the latest version will be used.
|
|
@@ -118,6 +246,8 @@ interface SlopVideoOptions {
|
|
|
118
246
|
/**
|
|
119
247
|
* Builds a URL to render or retrieve a video from Slop Machine.
|
|
120
248
|
*
|
|
249
|
+
* Supports both standard Buckets (via `bucketId`) and multi-step Pipelines (via `pipelineId`).
|
|
250
|
+
*
|
|
121
251
|
* @param options - Configuration options for the video generation.
|
|
122
252
|
* @returns A string containing the fully constructed URL.
|
|
123
253
|
*/
|
|
@@ -133,8 +263,26 @@ declare function preloadVideo(options: SlopVideoOptions): Promise<void>;
|
|
|
133
263
|
interface SlopTextOptions {
|
|
134
264
|
/**
|
|
135
265
|
* The unique identifier of your Slop Machine bucket.
|
|
266
|
+
* Required when using a bucket unless pipelineId is provided.
|
|
267
|
+
*/
|
|
268
|
+
bucketId?: string;
|
|
269
|
+
/**
|
|
270
|
+
* The unique identifier of your Slop Machine pipeline.
|
|
271
|
+
* Required when targeting a pipeline instead of a bucket.
|
|
272
|
+
*/
|
|
273
|
+
pipelineId?: string;
|
|
274
|
+
/**
|
|
275
|
+
* Optional silo identifier.
|
|
276
|
+
*/
|
|
277
|
+
siloId?: string;
|
|
278
|
+
/**
|
|
279
|
+
* Dynamic runtime prompt (used when targeting a pipeline).
|
|
280
|
+
*/
|
|
281
|
+
prompt?: string;
|
|
282
|
+
/**
|
|
283
|
+
* Arbitrary user metadata to attach to the generation request / result document.
|
|
136
284
|
*/
|
|
137
|
-
|
|
285
|
+
metadata?: Record<string, any>;
|
|
138
286
|
/**
|
|
139
287
|
* The specific version of the prompt/settings to use.
|
|
140
288
|
* If omitted, the latest version will be used.
|
|
@@ -163,6 +311,8 @@ interface SlopTextOptions {
|
|
|
163
311
|
/**
|
|
164
312
|
* Builds a URL to render or retrieve text from Slop Machine.
|
|
165
313
|
*
|
|
314
|
+
* Supports both standard Buckets (via `bucketId`) and multi-step Pipelines (via `pipelineId`).
|
|
315
|
+
*
|
|
166
316
|
* @param options - Configuration options for the text generation.
|
|
167
317
|
* @returns A string containing the fully constructed URL.
|
|
168
318
|
*/
|
|
@@ -175,6 +325,20 @@ declare function buildTextUrl(options: SlopTextOptions): string;
|
|
|
175
325
|
* @returns A promise that resolves when the text preload request has been initiated.
|
|
176
326
|
*/
|
|
177
327
|
declare function preloadText(options: SlopTextOptions): Promise<void>;
|
|
328
|
+
/**
|
|
329
|
+
* Builds a URL to execute or inspect a multi-step Pipeline from Slop Machine.
|
|
330
|
+
*
|
|
331
|
+
* @param options - Configuration options for the pipeline execution.
|
|
332
|
+
* @returns A string containing the fully constructed URL.
|
|
333
|
+
*/
|
|
334
|
+
declare function buildPipelineUrl(options: SlopPipelineOptions): string;
|
|
335
|
+
/**
|
|
336
|
+
* Executes a Slop Machine multi-step Pipeline programmatically and returns the full typed result payload.
|
|
337
|
+
*
|
|
338
|
+
* @param options - Execution parameters including the pipelineId and runtime prompt/variables/metadata.
|
|
339
|
+
* @returns A promise resolving to the completed PipelineResult document.
|
|
340
|
+
*/
|
|
341
|
+
declare function executePipeline(options: ExecutePipelineOptions): Promise<PipelineResult>;
|
|
178
342
|
/**
|
|
179
343
|
* Uploads a base64 encoded file as a temporary attachment to be used in generation requests.
|
|
180
344
|
*
|
|
@@ -186,4 +350,4 @@ declare function uploadTempAttachment(base64: string, mimeType: string): Promise
|
|
|
186
350
|
url: string;
|
|
187
351
|
}>;
|
|
188
352
|
|
|
189
|
-
export { type SlopImageOptions, type SlopTextOptions, type SlopVideoOptions, buildImageUrl, buildTextUrl, buildVideoUrl, interpolatePrompt, preloadImage, preloadText, preloadVideo, uploadTempAttachment };
|
|
353
|
+
export { type ExecutePipelineOptions, type PipelineResult, type PipelineStepResult, type SlopImageOptions, type SlopPipelineOptions, type SlopTextOptions, type SlopVideoOptions, buildImageUrl, buildPipelineUrl, buildTextUrl, buildVideoUrl, executePipeline, interpolatePrompt, preloadImage, preloadText, preloadVideo, uploadTempAttachment };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,120 @@
|
|
|
1
1
|
import { AspectRatio, VideoAspectRatio } from '@pixerate/schemas';
|
|
2
2
|
export { AspectRatio as ImageAspectRatio, VideoAspectRatio } from '@pixerate/schemas';
|
|
3
3
|
|
|
4
|
+
interface PipelineStepResult {
|
|
5
|
+
stepId: string;
|
|
6
|
+
stepName?: string;
|
|
7
|
+
type: string;
|
|
8
|
+
outputUrl?: string;
|
|
9
|
+
outputText?: string;
|
|
10
|
+
outputData?: any;
|
|
11
|
+
computeTimeMs?: number;
|
|
12
|
+
fuelCost?: number;
|
|
13
|
+
error?: string;
|
|
14
|
+
}
|
|
15
|
+
interface PipelineResult {
|
|
16
|
+
id: string;
|
|
17
|
+
pipelineId: string;
|
|
18
|
+
siloId: string;
|
|
19
|
+
url?: string;
|
|
20
|
+
text?: string;
|
|
21
|
+
data?: any;
|
|
22
|
+
resultType: string;
|
|
23
|
+
status: "completed" | "failed" | "pending";
|
|
24
|
+
stepResults: PipelineStepResult[];
|
|
25
|
+
totalComputeTimeMs: number;
|
|
26
|
+
totalFuelCost: number;
|
|
27
|
+
metadata?: Record<string, any>;
|
|
28
|
+
timestamp: any;
|
|
29
|
+
error?: string;
|
|
30
|
+
}
|
|
31
|
+
interface SlopPipelineOptions {
|
|
32
|
+
/**
|
|
33
|
+
* The unique identifier of the pipeline to execute.
|
|
34
|
+
*/
|
|
35
|
+
pipelineId: string;
|
|
36
|
+
/**
|
|
37
|
+
* Optional silo identifier for direct pipeline path resolution.
|
|
38
|
+
*/
|
|
39
|
+
siloId?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Dynamic runtime prompt to feed into the pipeline.
|
|
42
|
+
*/
|
|
43
|
+
prompt?: string;
|
|
44
|
+
/**
|
|
45
|
+
* Variables to interpolate into prompt or step configs.
|
|
46
|
+
*/
|
|
47
|
+
variables?: Record<string, string | number | undefined | null>;
|
|
48
|
+
/**
|
|
49
|
+
* Arbitrary user metadata to attach to the pipeline result document.
|
|
50
|
+
*/
|
|
51
|
+
metadata?: Record<string, any>;
|
|
52
|
+
/**
|
|
53
|
+
* Whether to wait for full execution (default true) or return a job ID immediately.
|
|
54
|
+
*/
|
|
55
|
+
sync?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Whether to redirect to the primary media output URL upon completion.
|
|
58
|
+
*/
|
|
59
|
+
redirect?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Result ID to retrieve a specific previously generated result.
|
|
62
|
+
*/
|
|
63
|
+
resultId?: string;
|
|
64
|
+
/**
|
|
65
|
+
* Base URL for the renderPipeline cloud function endpoint.
|
|
66
|
+
*/
|
|
67
|
+
baseUrl?: string;
|
|
68
|
+
}
|
|
69
|
+
interface ExecutePipelineOptions {
|
|
70
|
+
/**
|
|
71
|
+
* The unique identifier of the pipeline to execute.
|
|
72
|
+
*/
|
|
73
|
+
pipelineId: string;
|
|
74
|
+
/**
|
|
75
|
+
* Optional silo identifier for direct pipeline path resolution.
|
|
76
|
+
*/
|
|
77
|
+
siloId?: string;
|
|
78
|
+
/**
|
|
79
|
+
* Dynamic runtime prompt to feed into the pipeline.
|
|
80
|
+
*/
|
|
81
|
+
prompt?: string;
|
|
82
|
+
/**
|
|
83
|
+
* Variables to interpolate into prompt or step configs.
|
|
84
|
+
*/
|
|
85
|
+
variables?: Record<string, string | number | undefined | null>;
|
|
86
|
+
/**
|
|
87
|
+
* Arbitrary user metadata to attach to the pipeline result document.
|
|
88
|
+
*/
|
|
89
|
+
metadata?: Record<string, any>;
|
|
90
|
+
/**
|
|
91
|
+
* Base URL for the renderPipeline cloud function endpoint.
|
|
92
|
+
*/
|
|
93
|
+
baseUrl?: string;
|
|
94
|
+
}
|
|
4
95
|
interface SlopImageOptions {
|
|
5
96
|
/**
|
|
6
97
|
* The unique identifier of your Slop Machine bucket.
|
|
98
|
+
* Required when using a bucket unless pipelineId is provided.
|
|
99
|
+
*/
|
|
100
|
+
bucketId?: string;
|
|
101
|
+
/**
|
|
102
|
+
* The unique identifier of your Slop Machine pipeline.
|
|
103
|
+
* Required when targeting a pipeline instead of a bucket.
|
|
104
|
+
*/
|
|
105
|
+
pipelineId?: string;
|
|
106
|
+
/**
|
|
107
|
+
* Optional silo identifier.
|
|
108
|
+
*/
|
|
109
|
+
siloId?: string;
|
|
110
|
+
/**
|
|
111
|
+
* Dynamic runtime prompt (used when targeting a pipeline).
|
|
112
|
+
*/
|
|
113
|
+
prompt?: string;
|
|
114
|
+
/**
|
|
115
|
+
* Arbitrary user metadata to attach to the generation request / result document.
|
|
7
116
|
*/
|
|
8
|
-
|
|
117
|
+
metadata?: Record<string, any>;
|
|
9
118
|
/**
|
|
10
119
|
* The specific version of the prompt/settings to use.
|
|
11
120
|
* If omitted, the latest version will be used.
|
|
@@ -51,6 +160,8 @@ declare function interpolatePrompt(prompt?: string, variables?: Record<string, s
|
|
|
51
160
|
/**
|
|
52
161
|
* Builds a URL to render or retrieve an image from Slop Machine.
|
|
53
162
|
*
|
|
163
|
+
* Supports both standard Buckets (via `bucketId`) and multi-step Pipelines (via `pipelineId`).
|
|
164
|
+
*
|
|
54
165
|
* @param options - Configuration options for the image generation.
|
|
55
166
|
* @returns A string containing the fully constructed URL.
|
|
56
167
|
*/
|
|
@@ -63,12 +174,29 @@ declare function buildImageUrl(options: SlopImageOptions): string;
|
|
|
63
174
|
* @returns A promise that resolves when the image has been loaded.
|
|
64
175
|
*/
|
|
65
176
|
declare function preloadImage(options: SlopImageOptions): Promise<void>;
|
|
66
|
-
|
|
67
177
|
interface SlopVideoOptions {
|
|
68
178
|
/**
|
|
69
179
|
* The unique identifier of your Slop Machine bucket.
|
|
180
|
+
* Required when using a bucket unless pipelineId is provided.
|
|
70
181
|
*/
|
|
71
|
-
bucketId
|
|
182
|
+
bucketId?: string;
|
|
183
|
+
/**
|
|
184
|
+
* The unique identifier of your Slop Machine pipeline.
|
|
185
|
+
* Required when targeting a pipeline instead of a bucket.
|
|
186
|
+
*/
|
|
187
|
+
pipelineId?: string;
|
|
188
|
+
/**
|
|
189
|
+
* Optional silo identifier.
|
|
190
|
+
*/
|
|
191
|
+
siloId?: string;
|
|
192
|
+
/**
|
|
193
|
+
* Dynamic runtime prompt (used when targeting a pipeline).
|
|
194
|
+
*/
|
|
195
|
+
prompt?: string;
|
|
196
|
+
/**
|
|
197
|
+
* Arbitrary user metadata to attach to the generation request / result document.
|
|
198
|
+
*/
|
|
199
|
+
metadata?: Record<string, any>;
|
|
72
200
|
/**
|
|
73
201
|
* The specific version of the prompt/settings to use.
|
|
74
202
|
* If omitted, the latest version will be used.
|
|
@@ -118,6 +246,8 @@ interface SlopVideoOptions {
|
|
|
118
246
|
/**
|
|
119
247
|
* Builds a URL to render or retrieve a video from Slop Machine.
|
|
120
248
|
*
|
|
249
|
+
* Supports both standard Buckets (via `bucketId`) and multi-step Pipelines (via `pipelineId`).
|
|
250
|
+
*
|
|
121
251
|
* @param options - Configuration options for the video generation.
|
|
122
252
|
* @returns A string containing the fully constructed URL.
|
|
123
253
|
*/
|
|
@@ -133,8 +263,26 @@ declare function preloadVideo(options: SlopVideoOptions): Promise<void>;
|
|
|
133
263
|
interface SlopTextOptions {
|
|
134
264
|
/**
|
|
135
265
|
* The unique identifier of your Slop Machine bucket.
|
|
266
|
+
* Required when using a bucket unless pipelineId is provided.
|
|
267
|
+
*/
|
|
268
|
+
bucketId?: string;
|
|
269
|
+
/**
|
|
270
|
+
* The unique identifier of your Slop Machine pipeline.
|
|
271
|
+
* Required when targeting a pipeline instead of a bucket.
|
|
272
|
+
*/
|
|
273
|
+
pipelineId?: string;
|
|
274
|
+
/**
|
|
275
|
+
* Optional silo identifier.
|
|
276
|
+
*/
|
|
277
|
+
siloId?: string;
|
|
278
|
+
/**
|
|
279
|
+
* Dynamic runtime prompt (used when targeting a pipeline).
|
|
280
|
+
*/
|
|
281
|
+
prompt?: string;
|
|
282
|
+
/**
|
|
283
|
+
* Arbitrary user metadata to attach to the generation request / result document.
|
|
136
284
|
*/
|
|
137
|
-
|
|
285
|
+
metadata?: Record<string, any>;
|
|
138
286
|
/**
|
|
139
287
|
* The specific version of the prompt/settings to use.
|
|
140
288
|
* If omitted, the latest version will be used.
|
|
@@ -163,6 +311,8 @@ interface SlopTextOptions {
|
|
|
163
311
|
/**
|
|
164
312
|
* Builds a URL to render or retrieve text from Slop Machine.
|
|
165
313
|
*
|
|
314
|
+
* Supports both standard Buckets (via `bucketId`) and multi-step Pipelines (via `pipelineId`).
|
|
315
|
+
*
|
|
166
316
|
* @param options - Configuration options for the text generation.
|
|
167
317
|
* @returns A string containing the fully constructed URL.
|
|
168
318
|
*/
|
|
@@ -175,6 +325,20 @@ declare function buildTextUrl(options: SlopTextOptions): string;
|
|
|
175
325
|
* @returns A promise that resolves when the text preload request has been initiated.
|
|
176
326
|
*/
|
|
177
327
|
declare function preloadText(options: SlopTextOptions): Promise<void>;
|
|
328
|
+
/**
|
|
329
|
+
* Builds a URL to execute or inspect a multi-step Pipeline from Slop Machine.
|
|
330
|
+
*
|
|
331
|
+
* @param options - Configuration options for the pipeline execution.
|
|
332
|
+
* @returns A string containing the fully constructed URL.
|
|
333
|
+
*/
|
|
334
|
+
declare function buildPipelineUrl(options: SlopPipelineOptions): string;
|
|
335
|
+
/**
|
|
336
|
+
* Executes a Slop Machine multi-step Pipeline programmatically and returns the full typed result payload.
|
|
337
|
+
*
|
|
338
|
+
* @param options - Execution parameters including the pipelineId and runtime prompt/variables/metadata.
|
|
339
|
+
* @returns A promise resolving to the completed PipelineResult document.
|
|
340
|
+
*/
|
|
341
|
+
declare function executePipeline(options: ExecutePipelineOptions): Promise<PipelineResult>;
|
|
178
342
|
/**
|
|
179
343
|
* Uploads a base64 encoded file as a temporary attachment to be used in generation requests.
|
|
180
344
|
*
|
|
@@ -186,4 +350,4 @@ declare function uploadTempAttachment(base64: string, mimeType: string): Promise
|
|
|
186
350
|
url: string;
|
|
187
351
|
}>;
|
|
188
352
|
|
|
189
|
-
export { type SlopImageOptions, type SlopTextOptions, type SlopVideoOptions, buildImageUrl, buildTextUrl, buildVideoUrl, interpolatePrompt, preloadImage, preloadText, preloadVideo, uploadTempAttachment };
|
|
353
|
+
export { type ExecutePipelineOptions, type PipelineResult, type PipelineStepResult, type SlopImageOptions, type SlopPipelineOptions, type SlopTextOptions, type SlopVideoOptions, buildImageUrl, buildPipelineUrl, buildTextUrl, buildVideoUrl, executePipeline, interpolatePrompt, preloadImage, preloadText, preloadVideo, uploadTempAttachment };
|