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/dist/index.d.cts
CHANGED
|
@@ -33,6 +33,7 @@ declare const Model: {
|
|
|
33
33
|
readonly GPT_5_MINI: "gpt-5-mini";
|
|
34
34
|
};
|
|
35
35
|
readonly Google: {
|
|
36
|
+
readonly GEMINI_3_5_FLASH: "gemini-3.5-flash";
|
|
36
37
|
readonly GEMINI_3_1_PRO_PREVIEW: "gemini-3.1-pro-preview";
|
|
37
38
|
readonly GEMINI_3_1_FLASH_LITE_PREVIEW: "gemini-3.1-flash-lite-preview";
|
|
38
39
|
readonly GEMINI_3_FLASH_PREVIEW: "gemini-3-flash-preview";
|
package/dist/index.d.ts
CHANGED
|
@@ -33,6 +33,7 @@ declare const Model: {
|
|
|
33
33
|
readonly GPT_5_MINI: "gpt-5-mini";
|
|
34
34
|
};
|
|
35
35
|
readonly Google: {
|
|
36
|
+
readonly GEMINI_3_5_FLASH: "gemini-3.5-flash";
|
|
36
37
|
readonly GEMINI_3_1_PRO_PREVIEW: "gemini-3.1-pro-preview";
|
|
37
38
|
readonly GEMINI_3_1_FLASH_LITE_PREVIEW: "gemini-3.1-flash-lite-preview";
|
|
38
39
|
readonly GEMINI_3_FLASH_PREVIEW: "gemini-3-flash-preview";
|
package/dist/index.js
CHANGED
|
@@ -27,6 +27,7 @@ var Model = {
|
|
|
27
27
|
GPT_5_MINI: "gpt-5-mini"
|
|
28
28
|
},
|
|
29
29
|
Google: {
|
|
30
|
+
GEMINI_3_5_FLASH: "gemini-3.5-flash",
|
|
30
31
|
GEMINI_3_1_PRO_PREVIEW: "gemini-3.1-pro-preview",
|
|
31
32
|
GEMINI_3_1_FLASH_LITE_PREVIEW: "gemini-3.1-flash-lite-preview",
|
|
32
33
|
GEMINI_3_FLASH_PREVIEW: "gemini-3-flash-preview"
|
|
@@ -933,6 +934,10 @@ var PRICING_TABLE = {
|
|
|
933
934
|
inputPricePerToken: 0.25 / PER_MILLION,
|
|
934
935
|
outputPricePerToken: 2 / PER_MILLION
|
|
935
936
|
},
|
|
937
|
+
[`${Provider.GOOGLE}:${Model.Google.GEMINI_3_5_FLASH}`]: {
|
|
938
|
+
inputPricePerToken: 1.5 / PER_MILLION,
|
|
939
|
+
outputPricePerToken: 9 / PER_MILLION
|
|
940
|
+
},
|
|
936
941
|
[`${Provider.GOOGLE}:${Model.Google.GEMINI_3_1_PRO_PREVIEW}`]: {
|
|
937
942
|
inputPricePerToken: 2 / PER_MILLION,
|
|
938
943
|
outputPricePerToken: 12 / PER_MILLION
|
|
@@ -1019,15 +1024,19 @@ async function timedSendMessage(driver, images, prompt, options) {
|
|
|
1019
1024
|
|
|
1020
1025
|
// src/core/diff.ts
|
|
1021
1026
|
import sharp from "sharp";
|
|
1027
|
+
var DIFF_ALLOWED_MODELS = /* @__PURE__ */ new Set([
|
|
1028
|
+
Model.Google.GEMINI_3_FLASH_PREVIEW,
|
|
1029
|
+
Model.Google.GEMINI_3_5_FLASH
|
|
1030
|
+
]);
|
|
1022
1031
|
async function generateAiDiff(imgA, imgB, model, driver) {
|
|
1023
1032
|
if (!driver.generateImage) {
|
|
1024
1033
|
throw new VisualAIConfigError(
|
|
1025
1034
|
"AI-generated diff images require a provider that supports image generation. Currently only the Google (Gemini) provider supports this."
|
|
1026
1035
|
);
|
|
1027
1036
|
}
|
|
1028
|
-
if (model
|
|
1037
|
+
if (!DIFF_ALLOWED_MODELS.has(model)) {
|
|
1029
1038
|
throw new VisualAIConfigError(
|
|
1030
|
-
|
|
1039
|
+
`Annotated diff images are only supported with these Google models: ${[...DIFF_ALLOWED_MODELS].join(", ")}.`
|
|
1031
1040
|
);
|
|
1032
1041
|
}
|
|
1033
1042
|
const response = await driver.generateImage([imgA, imgB], buildAiDiffPrompt(), {
|