@magichourhq/ai-sdk-provider 0.2.0 → 0.3.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/README.md CHANGED
@@ -71,7 +71,7 @@ Every generation is a paid job. The provider submits it once, waits for it to fi
71
71
  - **If a submission's outcome is unknown**, for example after a dropped connection, the error says so and has no `projectId`. Check your account history before submitting again.
72
72
  - **Aborting stops waiting.** It doesn't cancel the job on Magic Hour.
73
73
 
74
- The project ID and the credits charged are in `providerMetadata.magichour`.
74
+ Each job's project ID and credits charged are in `providerMetadata.magichour.images` or `providerMetadata.magichour.videos`, one entry per image or video.
75
75
 
76
76
  ## Development
77
77
 
package/dist/index.js CHANGED
@@ -128,12 +128,9 @@ export function createMagicHour(settings = {}) {
128
128
  warnings: [],
129
129
  isRetryable: false,
130
130
  response: { timestamp, modelId, headers: undefined },
131
+ // The AI SDK keeps only this list, and joins it across calls.
131
132
  providerMetadata: {
132
- magichour: {
133
- projectId: id,
134
- creditsCharged: project.credits_charged,
135
- images: [{ projectId: id, creditsCharged: project.credits_charged }],
136
- },
133
+ magichour: { images: [{ projectId: id, creditsCharged: project.credits_charged }] },
137
134
  },
138
135
  };
139
136
  }
@@ -237,8 +234,9 @@ export function createMagicHour(settings = {}) {
237
234
  videos: [{ type: "binary", data, mediaType: "video/mp4" }],
238
235
  warnings: [],
239
236
  response: { timestamp, modelId, headers: undefined },
237
+ // A list, because the AI SDK joins only `videos` across calls and overwrites the rest.
240
238
  providerMetadata: {
241
- magichour: { projectId: id, creditsCharged: project.credits_charged },
239
+ magichour: { videos: [{ projectId: id, creditsCharged: project.credits_charged }] },
242
240
  },
243
241
  };
244
242
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magichourhq/ai-sdk-provider",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "packageManager": "yarn@4.18.0",
5
5
  "description": "Magic Hour image and video provider for the AI SDK",
6
6
  "type": "module",