diffio 0.1.49 → 0.1.51
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/README.md +10 -0
- package/dist/Client.d.ts +2 -0
- package/dist/Client.js +6 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -69,6 +69,16 @@ console.log(generation.generationId, generation.idempotentReplay ?? false);
|
|
|
69
69
|
Reuse the same `idempotencyKey` when retrying generation creation for a project. The API then
|
|
70
70
|
returns the existing generation with `idempotentReplay: true` instead of creating another generation.
|
|
71
71
|
|
|
72
|
+
Generation creation automatically retries only when you supply a nonblank `idempotencyKey`, reusing
|
|
73
|
+
the same key and request body for every attempt. Without a key, generation creation is attempted
|
|
74
|
+
once, including on network errors, even if client or request options enable retries. Other requests
|
|
75
|
+
retain their configured retry policy. Reuse your original key and request body when manually
|
|
76
|
+
retrying after an uncertain response.
|
|
77
|
+
|
|
78
|
+
`waitForGeneration` and `generations.waitForComplete` wait for the overall `status` to become
|
|
79
|
+
`complete`. Individual stages reaching 100% or `complete` do not end polling while video publication
|
|
80
|
+
or usage settlement is still pending.
|
|
81
|
+
|
|
72
82
|
## Audio isolation helper
|
|
73
83
|
|
|
74
84
|
```ts
|
package/dist/Client.d.ts
CHANGED
|
@@ -26,6 +26,7 @@ export declare class DiffioClient {
|
|
|
26
26
|
requestOptions?: DiffioClient.RequestOptions;
|
|
27
27
|
}): Promise<CreateProjectResponse>;
|
|
28
28
|
private _uploadFile;
|
|
29
|
+
/** Retries generation admission only when the caller supplies a nonblank idempotency key. */
|
|
29
30
|
createGeneration(options: {
|
|
30
31
|
apiProjectId: string;
|
|
31
32
|
model?: ModelKey;
|
|
@@ -46,6 +47,7 @@ export declare class DiffioClient {
|
|
|
46
47
|
apiProjectId?: string;
|
|
47
48
|
requestOptions?: DiffioClient.RequestOptions;
|
|
48
49
|
}): Promise<GenerationProgressResponse>;
|
|
50
|
+
/** Waits for the authoritative overall status, including artifact publication and settlement. */
|
|
49
51
|
waitForGeneration(options: {
|
|
50
52
|
generationId: string;
|
|
51
53
|
apiProjectId?: string;
|
package/dist/Client.js
CHANGED
|
@@ -138,6 +138,7 @@ class DiffioClient {
|
|
|
138
138
|
const bodyFactory = filePath ? () => createFileReadStream(filePath) : () => data;
|
|
139
139
|
await this._requestBinary(method, uploadUrl, bodyFactory, requestOptions, extraHeaders, true);
|
|
140
140
|
}
|
|
141
|
+
/** Retries generation admission only when the caller supplies a nonblank idempotency key. */
|
|
141
142
|
async createGeneration(options) {
|
|
142
143
|
const { apiProjectId, model = "diffio-2", sampling, params, idempotencyKey, requestOptions } = options;
|
|
143
144
|
const endpoint = MODEL_ENDPOINTS[model];
|
|
@@ -154,7 +155,10 @@ class DiffioClient {
|
|
|
154
155
|
if (idempotencyKey != null) {
|
|
155
156
|
payload.idempotencyKey = idempotencyKey;
|
|
156
157
|
}
|
|
157
|
-
const
|
|
158
|
+
const generationRequestOptions = idempotencyKey?.trim()
|
|
159
|
+
? requestOptions
|
|
160
|
+
: { ...requestOptions, maxRetries: 0 };
|
|
161
|
+
const response = await this._requestJson("POST", endpoint, payload, generationRequestOptions);
|
|
158
162
|
return (0, serialization_1.parseCreateGenerationResponse)(response);
|
|
159
163
|
}
|
|
160
164
|
async listProjects(options = {}) {
|
|
@@ -178,6 +182,7 @@ class DiffioClient {
|
|
|
178
182
|
const response = await this._requestJson("POST", "get_generation_progress", payload, requestOptions);
|
|
179
183
|
return (0, serialization_1.parseGenerationProgressResponse)(response);
|
|
180
184
|
}
|
|
185
|
+
/** Waits for the authoritative overall status, including artifact publication and settlement. */
|
|
181
186
|
async waitForGeneration(options) {
|
|
182
187
|
const { generationId, apiProjectId, pollInterval = 2, timeout, timeoutInSeconds, onProgress, showProgress, requestOptions } = options;
|
|
183
188
|
const timeoutSeconds = timeoutInSeconds ?? timeout ?? DEFAULT_TIMEOUT_SECONDS;
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const DIFFIO_SDK_VERSION = "0.1.
|
|
1
|
+
export declare const DIFFIO_SDK_VERSION = "0.1.51";
|
package/dist/version.js
CHANGED