@picsart/ai-sdk 6.18.0 → 6.18.1

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 CHANGED
@@ -177,6 +177,16 @@ await ai.drive.save({
177
177
  const saveParams = ai.drive.buildSaveParams(generatedUrl, modelId, modelName, 'video', originalGenerationParams)
178
178
  ```
179
179
 
180
+ When the request you submit is not the record you want kept (a render that sends
181
+ only a reference to an earlier job, say), pass the inputs to record as
182
+ `drive.generation`. Custom `attributes` still cannot replace them:
183
+
184
+ ```typescript
185
+ await ai.submit(modelId, finalRequest, {
186
+ drive: { name: 'final.mp4', generation: { modelId, params: originalGenerationParams } },
187
+ })
188
+ ```
189
+
180
190
  Legacy `model`/`prompt`/`textScript` saves are normalized at write time. URL-only
181
191
  uploads remain ordinary uploads: without generation context the SDK cannot infer
182
192
  model, prompt or settings. Existing Drive files are not backfilled. The backend preserves SDK-supplied metadata; it cannot reconstruct SDK input
package/index.d.ts CHANGED
@@ -2779,6 +2779,13 @@ interface PayloadDriveOptions {
2779
2779
  attributes?: DriveAttributes;
2780
2780
  /** Target folder in Picsart Drive. */
2781
2781
  folder?: PayloadDriveFolderOptions;
2782
+ /**
2783
+ * Inputs to record as the file's provenance when they differ from the
2784
+ * submitted request, e.g. a render that sends only a reference to an earlier
2785
+ * job. Defaults to the model and params being generated. Never sent to the
2786
+ * workflow; it only shapes `attributes`.
2787
+ */
2788
+ generation?: GenerationProvenance;
2782
2789
  }
2783
2790
  /**
2784
2791
  * Drive operations surface — returned by {@link createDriveClient} and exposed
package/index.js CHANGED
@@ -13084,11 +13084,8 @@ function createClient(config) {
13084
13084
  function buildDrivePayloadOptions(model, params2, options) {
13085
13085
  const explicit = options?.drive;
13086
13086
  if (!driveConfig && !explicit) return void 0;
13087
- const attributes = buildGenerationAttributes({
13088
- modelId: model.id,
13089
- params: params2,
13090
- app: options?.app
13091
- });
13087
+ const generation = explicit?.generation;
13088
+ const attributes = buildGenerationAttributes(generation ? { ...generation, app: generation.app ?? options?.app } : { modelId: model.id, params: params2, app: options?.app });
13092
13089
  const folderPath = options?.folder?.name ?? driveConfig?.folder;
13093
13090
  return {
13094
13091
  // Named before the job runs, so the requested/declared format is the best hint.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@picsart/ai-sdk",
3
- "version": "6.18.0",
3
+ "version": "6.18.1",
4
4
  "type": "module",
5
5
  "description": "Type-safe SDK for 100+ AI models — image, video, audio, and text generation with Picsart",
6
6
  "license": "MIT",