visual-ai-assertions 0.11.0 → 0.12.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 +3 -1
- package/dist/index.cjs +11 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +11 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -205,7 +205,8 @@ const result = await ai.compare(before, after, {
|
|
|
205
205
|
instructions: ["Ignore date/time differences"],
|
|
206
206
|
});
|
|
207
207
|
|
|
208
|
-
// With AI-generated diff image (supported
|
|
208
|
+
// With AI-generated diff image (supported by gemini-3-flash-preview and gemini-3.5-flash;
|
|
209
|
+
// only gemini-3-flash-preview auto-enables it — pass diffImage: true explicitly for 3.5-flash)
|
|
209
210
|
const result = await ai.compare(before, after, {
|
|
210
211
|
diffImage: true,
|
|
211
212
|
});
|
|
@@ -526,6 +527,7 @@ All listed models support image/vision input. Pass any model ID to the `model` c
|
|
|
526
527
|
|
|
527
528
|
| Model | Model ID | Input $/MTok | Output $/MTok | Notes |
|
|
528
529
|
| --------------------- | ------------------------------- | ------------ | ------------- | --------------------------------- |
|
|
530
|
+
| Gemini 3.5 Flash | `gemini-3.5-flash` | $1.50 | $9 | Strongest agentic & coding model |
|
|
529
531
|
| Gemini 3.1 Pro | `gemini-3.1-pro-preview` | $2 | $12 | Preview — most advanced reasoning |
|
|
530
532
|
| Gemini 3.1 Flash Lite | `gemini-3.1-flash-lite-preview` | $0.25 | $1.50 | Preview — lightweight and cheap |
|
|
531
533
|
| Gemini 3 Flash | `gemini-3-flash-preview` | $0.50 | $3 | **Default** — fast and capable |
|
package/dist/index.cjs
CHANGED
|
@@ -95,6 +95,7 @@ var Model = {
|
|
|
95
95
|
GPT_5_MINI: "gpt-5-mini"
|
|
96
96
|
},
|
|
97
97
|
Google: {
|
|
98
|
+
GEMINI_3_5_FLASH: "gemini-3.5-flash",
|
|
98
99
|
GEMINI_3_1_PRO_PREVIEW: "gemini-3.1-pro-preview",
|
|
99
100
|
GEMINI_3_1_FLASH_LITE_PREVIEW: "gemini-3.1-flash-lite-preview",
|
|
100
101
|
GEMINI_3_FLASH_PREVIEW: "gemini-3-flash-preview"
|
|
@@ -1001,6 +1002,10 @@ var PRICING_TABLE = {
|
|
|
1001
1002
|
inputPricePerToken: 0.25 / PER_MILLION,
|
|
1002
1003
|
outputPricePerToken: 2 / PER_MILLION
|
|
1003
1004
|
},
|
|
1005
|
+
[`${Provider.GOOGLE}:${Model.Google.GEMINI_3_5_FLASH}`]: {
|
|
1006
|
+
inputPricePerToken: 1.5 / PER_MILLION,
|
|
1007
|
+
outputPricePerToken: 9 / PER_MILLION
|
|
1008
|
+
},
|
|
1004
1009
|
[`${Provider.GOOGLE}:${Model.Google.GEMINI_3_1_PRO_PREVIEW}`]: {
|
|
1005
1010
|
inputPricePerToken: 2 / PER_MILLION,
|
|
1006
1011
|
outputPricePerToken: 12 / PER_MILLION
|
|
@@ -1087,15 +1092,19 @@ async function timedSendMessage(driver, images, prompt, options) {
|
|
|
1087
1092
|
|
|
1088
1093
|
// src/core/diff.ts
|
|
1089
1094
|
var import_sharp = __toESM(require("sharp"), 1);
|
|
1095
|
+
var DIFF_ALLOWED_MODELS = /* @__PURE__ */ new Set([
|
|
1096
|
+
Model.Google.GEMINI_3_FLASH_PREVIEW,
|
|
1097
|
+
Model.Google.GEMINI_3_5_FLASH
|
|
1098
|
+
]);
|
|
1090
1099
|
async function generateAiDiff(imgA, imgB, model, driver) {
|
|
1091
1100
|
if (!driver.generateImage) {
|
|
1092
1101
|
throw new VisualAIConfigError(
|
|
1093
1102
|
"AI-generated diff images require a provider that supports image generation. Currently only the Google (Gemini) provider supports this."
|
|
1094
1103
|
);
|
|
1095
1104
|
}
|
|
1096
|
-
if (model
|
|
1105
|
+
if (!DIFF_ALLOWED_MODELS.has(model)) {
|
|
1097
1106
|
throw new VisualAIConfigError(
|
|
1098
|
-
|
|
1107
|
+
`Annotated diff images are only supported with these Google models: ${[...DIFF_ALLOWED_MODELS].join(", ")}.`
|
|
1099
1108
|
);
|
|
1100
1109
|
}
|
|
1101
1110
|
const response = await driver.generateImage([imgA, imgB], buildAiDiffPrompt(), {
|