visual-ai-assertions 0.7.1 → 0.8.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 +14 -11
- package/dist/index.cjs +19 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +19 -7
- package/dist/index.js.map +1 -1
- package/package.json +12 -20
package/dist/index.d.cts
CHANGED
|
@@ -18,11 +18,13 @@ declare const Provider: {
|
|
|
18
18
|
/** Known model names grouped by provider. */
|
|
19
19
|
declare const Model: {
|
|
20
20
|
readonly Anthropic: {
|
|
21
|
+
readonly OPUS_4_7: "claude-opus-4-7";
|
|
21
22
|
readonly OPUS_4_6: "claude-opus-4-6";
|
|
22
23
|
readonly SONNET_4_6: "claude-sonnet-4-6";
|
|
23
24
|
readonly HAIKU_4_5: "claude-haiku-4-5";
|
|
24
25
|
};
|
|
25
26
|
readonly OpenAI: {
|
|
27
|
+
readonly GPT_5_5: "gpt-5.5";
|
|
26
28
|
readonly GPT_5_4: "gpt-5.4";
|
|
27
29
|
readonly GPT_5_4_PRO: "gpt-5.4-pro";
|
|
28
30
|
readonly GPT_5_4_MINI: "gpt-5.4-mini";
|
package/dist/index.d.ts
CHANGED
|
@@ -18,11 +18,13 @@ declare const Provider: {
|
|
|
18
18
|
/** Known model names grouped by provider. */
|
|
19
19
|
declare const Model: {
|
|
20
20
|
readonly Anthropic: {
|
|
21
|
+
readonly OPUS_4_7: "claude-opus-4-7";
|
|
21
22
|
readonly OPUS_4_6: "claude-opus-4-6";
|
|
22
23
|
readonly SONNET_4_6: "claude-sonnet-4-6";
|
|
23
24
|
readonly HAIKU_4_5: "claude-haiku-4-5";
|
|
24
25
|
};
|
|
25
26
|
readonly OpenAI: {
|
|
27
|
+
readonly GPT_5_5: "gpt-5.5";
|
|
26
28
|
readonly GPT_5_4: "gpt-5.4";
|
|
27
29
|
readonly GPT_5_4_PRO: "gpt-5.4-pro";
|
|
28
30
|
readonly GPT_5_4_MINI: "gpt-5.4-mini";
|
package/dist/index.js
CHANGED
|
@@ -12,11 +12,13 @@ var Provider = {
|
|
|
12
12
|
};
|
|
13
13
|
var Model = {
|
|
14
14
|
Anthropic: {
|
|
15
|
+
OPUS_4_7: "claude-opus-4-7",
|
|
15
16
|
OPUS_4_6: "claude-opus-4-6",
|
|
16
17
|
SONNET_4_6: "claude-sonnet-4-6",
|
|
17
18
|
HAIKU_4_5: "claude-haiku-4-5"
|
|
18
19
|
},
|
|
19
20
|
OpenAI: {
|
|
21
|
+
GPT_5_5: "gpt-5.5",
|
|
20
22
|
GPT_5_4: "gpt-5.4",
|
|
21
23
|
GPT_5_4_PRO: "gpt-5.4-pro",
|
|
22
24
|
GPT_5_4_MINI: "gpt-5.4-mini",
|
|
@@ -417,6 +419,10 @@ function parseRetryAfter(value) {
|
|
|
417
419
|
}
|
|
418
420
|
|
|
419
421
|
// src/providers/anthropic.ts
|
|
422
|
+
function mapEffort(level, model) {
|
|
423
|
+
if (level !== "xhigh") return level;
|
|
424
|
+
return model === Model.Anthropic.OPUS_4_7 ? "xhigh" : "max";
|
|
425
|
+
}
|
|
420
426
|
var AnthropicDriver = class {
|
|
421
427
|
client;
|
|
422
428
|
model;
|
|
@@ -474,7 +480,7 @@ var AnthropicDriver = class {
|
|
|
474
480
|
if (this.reasoningEffort) {
|
|
475
481
|
requestParams.thinking = { type: "adaptive" };
|
|
476
482
|
requestParams.output_config = {
|
|
477
|
-
effort: this.reasoningEffort
|
|
483
|
+
effort: mapEffort(this.reasoningEffort, this.model)
|
|
478
484
|
};
|
|
479
485
|
}
|
|
480
486
|
const message = await client.messages.create(requestParams);
|
|
@@ -672,12 +678,10 @@ var OpenAIDriver = class {
|
|
|
672
678
|
try {
|
|
673
679
|
const format = options?.responseSchema ? {
|
|
674
680
|
type: "json_schema",
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
}
|
|
680
|
-
} : { type: "json_object", name: "visual_ai_response" };
|
|
681
|
+
name: "visual_ai_response",
|
|
682
|
+
strict: true,
|
|
683
|
+
schema: options.responseSchema
|
|
684
|
+
} : { type: "json_object" };
|
|
681
685
|
const requestParams = {
|
|
682
686
|
model: this.model,
|
|
683
687
|
max_output_tokens: this.maxTokens,
|
|
@@ -800,6 +804,10 @@ function resolveConfig(config) {
|
|
|
800
804
|
// src/core/pricing.ts
|
|
801
805
|
var PER_MILLION = 1e6;
|
|
802
806
|
var PRICING_TABLE = {
|
|
807
|
+
[`${Provider.ANTHROPIC}:${Model.Anthropic.OPUS_4_7}`]: {
|
|
808
|
+
inputPricePerToken: 5 / PER_MILLION,
|
|
809
|
+
outputPricePerToken: 25 / PER_MILLION
|
|
810
|
+
},
|
|
803
811
|
[`${Provider.ANTHROPIC}:${Model.Anthropic.OPUS_4_6}`]: {
|
|
804
812
|
inputPricePerToken: 5 / PER_MILLION,
|
|
805
813
|
outputPricePerToken: 25 / PER_MILLION
|
|
@@ -812,6 +820,10 @@ var PRICING_TABLE = {
|
|
|
812
820
|
inputPricePerToken: 1 / PER_MILLION,
|
|
813
821
|
outputPricePerToken: 5 / PER_MILLION
|
|
814
822
|
},
|
|
823
|
+
[`${Provider.OPENAI}:${Model.OpenAI.GPT_5_5}`]: {
|
|
824
|
+
inputPricePerToken: 5 / PER_MILLION,
|
|
825
|
+
outputPricePerToken: 30 / PER_MILLION
|
|
826
|
+
},
|
|
815
827
|
[`${Provider.OPENAI}:${Model.OpenAI.GPT_5_4}`]: {
|
|
816
828
|
inputPricePerToken: 2.5 / PER_MILLION,
|
|
817
829
|
outputPricePerToken: 15 / PER_MILLION
|