@isaacthoman/pulpo 0.134.0 → 0.136.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/dist/index.js +46 -9
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -14532,6 +14532,18 @@ var imageGenerationPreferencesSchema = external_exports.object({
|
|
|
14532
14532
|
enabled: external_exports.boolean().default(false),
|
|
14533
14533
|
modelId: external_exports.string().max(120).nullable().default(null)
|
|
14534
14534
|
}).default(() => ({ enabled: false, modelId: null }));
|
|
14535
|
+
var price = external_exports.number().int().min(0).max(1e12);
|
|
14536
|
+
var imageTokenPricesSchema = external_exports.object({
|
|
14537
|
+
input: price.nullable().default(null),
|
|
14538
|
+
cachedInput: price.nullable().default(null),
|
|
14539
|
+
output: price.nullable().default(null),
|
|
14540
|
+
imageInput: price.nullable().default(null),
|
|
14541
|
+
cachedImageInput: price.nullable().default(null),
|
|
14542
|
+
imageOutput: price.nullable().default(null)
|
|
14543
|
+
});
|
|
14544
|
+
function imageTokenRateKeys(adapter) {
|
|
14545
|
+
return adapter === "openai-images" ? ["input", "cachedInput", "imageInput", "cachedImageInput", "output", "imageOutput"] : ["input", "cachedInput", "output"];
|
|
14546
|
+
}
|
|
14535
14547
|
var imageModelSchema = external_exports.object({
|
|
14536
14548
|
id: external_exports.string().regex(/^[a-z0-9][a-z0-9._-]{0,119}$/),
|
|
14537
14549
|
providerConnectionId: external_exports.uuid(),
|
|
@@ -14541,7 +14553,23 @@ var imageModelSchema = external_exports.object({
|
|
|
14541
14553
|
enabled: external_exports.boolean().default(false),
|
|
14542
14554
|
sortOrder: external_exports.number().int().min(0).default(0),
|
|
14543
14555
|
billUsers: external_exports.boolean().default(false),
|
|
14544
|
-
imagePriceMicros:
|
|
14556
|
+
imagePriceMicros: price.default(0),
|
|
14557
|
+
billingUnit: external_exports.enum(["images", "tokens"]).default("images"),
|
|
14558
|
+
tokenPrices: imageTokenPricesSchema.default(() => imageTokenPricesSchema.parse({})),
|
|
14559
|
+
reservationMicros: price.default(0)
|
|
14560
|
+
}).superRefine((model, ctx) => {
|
|
14561
|
+
if (model.billingUnit !== "tokens")
|
|
14562
|
+
return;
|
|
14563
|
+
if (model.adapter === "azure-mai")
|
|
14564
|
+
ctx.addIssue({ code: "custom", path: ["billingUnit"], message: "Azure MAI does not report token usage; use per-image pricing." });
|
|
14565
|
+
if (!model.billUsers)
|
|
14566
|
+
return;
|
|
14567
|
+
if (model.reservationMicros <= 0)
|
|
14568
|
+
ctx.addIssue({ code: "custom", path: ["reservationMicros"], message: "Enter a positive upfront reservation." });
|
|
14569
|
+
for (const key of imageTokenRateKeys(model.adapter)) {
|
|
14570
|
+
if (model.tokenPrices[key] === null)
|
|
14571
|
+
ctx.addIssue({ code: "custom", path: ["tokenPrices", key], message: "Enter a token rate (zero is allowed)." });
|
|
14572
|
+
}
|
|
14545
14573
|
});
|
|
14546
14574
|
var AZURE_MAI_IMAGE_PRESET = {
|
|
14547
14575
|
adapter: "azure-mai",
|
|
@@ -14550,7 +14578,10 @@ var AZURE_MAI_IMAGE_PRESET = {
|
|
|
14550
14578
|
enabled: false,
|
|
14551
14579
|
sortOrder: 0,
|
|
14552
14580
|
billUsers: false,
|
|
14553
|
-
imagePriceMicros: 0
|
|
14581
|
+
imagePriceMicros: 0,
|
|
14582
|
+
billingUnit: "images",
|
|
14583
|
+
tokenPrices: imageTokenPricesSchema.parse({}),
|
|
14584
|
+
reservationMicros: 0
|
|
14554
14585
|
};
|
|
14555
14586
|
var META_MUSE_IMAGE_PRESET = {
|
|
14556
14587
|
...AZURE_MAI_IMAGE_PRESET,
|
|
@@ -14562,7 +14593,9 @@ var OPENAI_IMAGE_PRESET = {
|
|
|
14562
14593
|
...AZURE_MAI_IMAGE_PRESET,
|
|
14563
14594
|
adapter: "openai-images",
|
|
14564
14595
|
name: "GPT Image 2.5 Flare",
|
|
14565
|
-
upstreamModelId: "gpt-image-2.5-flare"
|
|
14596
|
+
upstreamModelId: "gpt-image-2.5-flare",
|
|
14597
|
+
// Microdollars / 1M tokens, verified 2026-09-13: developers.openai.com/api/docs/models/gpt-image-2.5-flare
|
|
14598
|
+
tokenPrices: { input: 5e6, cachedInput: 125e4, imageInput: 8e6, cachedImageInput: 2e6, output: 0, imageOutput: 3e7 }
|
|
14566
14599
|
};
|
|
14567
14600
|
var IMAGE_GENERATION_MAX_BYTES = 20 * 1024 * 1024;
|
|
14568
14601
|
var imageGenerationInputSchema = external_exports.object({
|
|
@@ -14586,6 +14619,9 @@ var speechVoiceSchema = external_exports.object({
|
|
|
14586
14619
|
watermark: speechWatermarkSchema.optional()
|
|
14587
14620
|
});
|
|
14588
14621
|
var SPEECH_REQUEST_BODY_LIMIT = 6 * (SPEECH_REQUEST_MAX_INPUT_LENGTH + SPEECH_MAX_INSTRUCTIONS_LENGTH + 200 + 120) + 1024;
|
|
14622
|
+
var speechDefaultsSchema = external_exports.object({
|
|
14623
|
+
modelId: external_exports.string().regex(/^[a-z0-9][a-z0-9._-]{0,119}$/).nullable().default(null)
|
|
14624
|
+
});
|
|
14589
14625
|
var speechPreferencesSchema = external_exports.object({
|
|
14590
14626
|
modelId: external_exports.string().max(120).nullable().default(null),
|
|
14591
14627
|
models: external_exports.record(external_exports.string().max(120), external_exports.object({
|
|
@@ -14594,7 +14630,7 @@ var speechPreferencesSchema = external_exports.object({
|
|
|
14594
14630
|
speed: external_exports.number().min(0.25).max(4).default(1)
|
|
14595
14631
|
})).default({})
|
|
14596
14632
|
}).default(() => ({ modelId: null, models: {} }));
|
|
14597
|
-
var
|
|
14633
|
+
var price2 = external_exports.number().int().min(0).max(1e12);
|
|
14598
14634
|
var speechModelSchema = external_exports.object({
|
|
14599
14635
|
id: external_exports.string().regex(/^[a-z0-9][a-z0-9._-]{0,119}$/),
|
|
14600
14636
|
providerConnectionId: external_exports.string().uuid(),
|
|
@@ -14615,10 +14651,10 @@ var speechModelSchema = external_exports.object({
|
|
|
14615
14651
|
supportsSse: external_exports.boolean().default(false),
|
|
14616
14652
|
billUsers: external_exports.boolean().default(false),
|
|
14617
14653
|
billingUnit: external_exports.enum(["tokens", "characters", "duration"]).default("characters"),
|
|
14618
|
-
inputPriceMicros:
|
|
14619
|
-
outputPriceMicros:
|
|
14620
|
-
characterPriceMicros:
|
|
14621
|
-
minutePriceMicros:
|
|
14654
|
+
inputPriceMicros: price2.default(0),
|
|
14655
|
+
outputPriceMicros: price2.default(0),
|
|
14656
|
+
characterPriceMicros: price2.default(0),
|
|
14657
|
+
minutePriceMicros: price2.default(0)
|
|
14622
14658
|
}).superRefine((model, ctx) => {
|
|
14623
14659
|
if ((model.enabled || model.voices.length || model.defaultVoice) && !model.voices.some((v) => v.id === model.defaultVoice))
|
|
14624
14660
|
ctx.addIssue({ code: "custom", path: ["defaultVoice"], message: "Default voice must be in the voice list" });
|
|
@@ -17274,6 +17310,7 @@ var createModelSchema = external_exports.object({
|
|
|
17274
17310
|
agentEnabled: external_exports.boolean().default(false),
|
|
17275
17311
|
agentInstructions: external_exports.string().max(1e5).default(""),
|
|
17276
17312
|
defaultParameters: external_exports.record(external_exports.string(), external_exports.unknown()).default({}),
|
|
17313
|
+
promptCachingEnabled: external_exports.boolean().default(false),
|
|
17277
17314
|
interceptImagesWithOcr: external_exports.boolean().default(false),
|
|
17278
17315
|
contextWindow: external_exports.number().int().positive(),
|
|
17279
17316
|
maxOutputTokens: external_exports.number().int().positive(),
|
|
@@ -20755,7 +20792,7 @@ async function runModelTest(input) {
|
|
|
20755
20792
|
}
|
|
20756
20793
|
|
|
20757
20794
|
// src/index.ts
|
|
20758
|
-
var CLI_VERSION = true ? "0.
|
|
20795
|
+
var CLI_VERSION = true ? "0.136.0" : "0.1.0";
|
|
20759
20796
|
var CLI_BUNDLED = true;
|
|
20760
20797
|
var commandIo = /* @__PURE__ */ new WeakMap();
|
|
20761
20798
|
var commandClientFactory = /* @__PURE__ */ new WeakMap();
|