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/README.md
CHANGED
|
@@ -445,13 +445,14 @@ const ai = visualAI({
|
|
|
445
445
|
});
|
|
446
446
|
```
|
|
447
447
|
|
|
448
|
-
When omitted, each provider uses its default behavior. The `"xhigh"` level enables maximum reasoning depth
|
|
448
|
+
When omitted, each provider uses its default behavior. The `"xhigh"` level enables maximum reasoning depth.
|
|
449
449
|
|
|
450
|
-
| Provider
|
|
451
|
-
|
|
|
452
|
-
| Anthropic | `thinking.type: "adaptive"` + `output_config.effort` | `effort: "
|
|
453
|
-
|
|
|
454
|
-
|
|
|
450
|
+
| Provider | Native Parameter | `"xhigh"` maps to |
|
|
451
|
+
| ------------------ | ----------------------------------------------------- | -------------------- |
|
|
452
|
+
| Anthropic Opus 4.7 | `thinking.type: "adaptive"` + `output_config.effort` | `effort: "xhigh"` |
|
|
453
|
+
| Anthropic (other) | `thinking.type: "adaptive"` + `output_config.effort` | `effort: "max"` |
|
|
454
|
+
| OpenAI | `reasoning.effort` (Responses API) | `effort: "xhigh"` |
|
|
455
|
+
| Google | `thinkingConfig.thinkingBudget` (1024 / 8192 / 24576) | `24576` (max budget) |
|
|
455
456
|
|
|
456
457
|
## Supported Models
|
|
457
458
|
|
|
@@ -459,16 +460,18 @@ All listed models support image/vision input. Pass any model ID to the `model` c
|
|
|
459
460
|
|
|
460
461
|
### Anthropic
|
|
461
462
|
|
|
462
|
-
| Model | Model ID | Input $/MTok | Output $/MTok | Notes
|
|
463
|
-
| ----------------- | ------------------- | ------------ | ------------- |
|
|
464
|
-
| Claude Opus 4.
|
|
465
|
-
| Claude
|
|
466
|
-
| Claude
|
|
463
|
+
| Model | Model ID | Input $/MTok | Output $/MTok | Notes |
|
|
464
|
+
| ----------------- | ------------------- | ------------ | ------------- | ------------------------------------------ |
|
|
465
|
+
| Claude Opus 4.7 | `claude-opus-4-7` | $5 | $25 | Most capable; supports `xhigh` effort tier |
|
|
466
|
+
| Claude Opus 4.6 | `claude-opus-4-6` | $5 | $25 | Previous flagship, 128K max output |
|
|
467
|
+
| Claude Sonnet 4.6 | `claude-sonnet-4-6` | $3 | $15 | **Default** — best value |
|
|
468
|
+
| Claude Haiku 4.5 | `claude-haiku-4-5` | $1 | $5 | Fastest, budget-friendly |
|
|
467
469
|
|
|
468
470
|
### OpenAI
|
|
469
471
|
|
|
470
472
|
| Model | Model ID | Input $/MTok | Output $/MTok | Notes |
|
|
471
473
|
| ------------ | -------------- | ------------ | ------------- | ------------------------------ |
|
|
474
|
+
| GPT-5.5 | `gpt-5.5` | $5 | $30 | Newest flagship, 1M context |
|
|
472
475
|
| GPT-5.4 Pro | `gpt-5.4-pro` | $30 | $180 | Most capable, extended context |
|
|
473
476
|
| GPT-5.4 | `gpt-5.4` | $2.50 | $15 | Best vision quality |
|
|
474
477
|
| GPT-5.2 | `gpt-5.2` | $1.75 | $14 | Balanced quality and cost |
|
package/dist/index.cjs
CHANGED
|
@@ -79,11 +79,13 @@ var Provider = {
|
|
|
79
79
|
};
|
|
80
80
|
var Model = {
|
|
81
81
|
Anthropic: {
|
|
82
|
+
OPUS_4_7: "claude-opus-4-7",
|
|
82
83
|
OPUS_4_6: "claude-opus-4-6",
|
|
83
84
|
SONNET_4_6: "claude-sonnet-4-6",
|
|
84
85
|
HAIKU_4_5: "claude-haiku-4-5"
|
|
85
86
|
},
|
|
86
87
|
OpenAI: {
|
|
88
|
+
GPT_5_5: "gpt-5.5",
|
|
87
89
|
GPT_5_4: "gpt-5.4",
|
|
88
90
|
GPT_5_4_PRO: "gpt-5.4-pro",
|
|
89
91
|
GPT_5_4_MINI: "gpt-5.4-mini",
|
|
@@ -484,6 +486,10 @@ function parseRetryAfter(value) {
|
|
|
484
486
|
}
|
|
485
487
|
|
|
486
488
|
// src/providers/anthropic.ts
|
|
489
|
+
function mapEffort(level, model) {
|
|
490
|
+
if (level !== "xhigh") return level;
|
|
491
|
+
return model === Model.Anthropic.OPUS_4_7 ? "xhigh" : "max";
|
|
492
|
+
}
|
|
487
493
|
var AnthropicDriver = class {
|
|
488
494
|
client;
|
|
489
495
|
model;
|
|
@@ -541,7 +547,7 @@ var AnthropicDriver = class {
|
|
|
541
547
|
if (this.reasoningEffort) {
|
|
542
548
|
requestParams.thinking = { type: "adaptive" };
|
|
543
549
|
requestParams.output_config = {
|
|
544
|
-
effort: this.reasoningEffort
|
|
550
|
+
effort: mapEffort(this.reasoningEffort, this.model)
|
|
545
551
|
};
|
|
546
552
|
}
|
|
547
553
|
const message = await client.messages.create(requestParams);
|
|
@@ -739,12 +745,10 @@ var OpenAIDriver = class {
|
|
|
739
745
|
try {
|
|
740
746
|
const format = options?.responseSchema ? {
|
|
741
747
|
type: "json_schema",
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
}
|
|
747
|
-
} : { type: "json_object", name: "visual_ai_response" };
|
|
748
|
+
name: "visual_ai_response",
|
|
749
|
+
strict: true,
|
|
750
|
+
schema: options.responseSchema
|
|
751
|
+
} : { type: "json_object" };
|
|
748
752
|
const requestParams = {
|
|
749
753
|
model: this.model,
|
|
750
754
|
max_output_tokens: this.maxTokens,
|
|
@@ -867,6 +871,10 @@ function resolveConfig(config) {
|
|
|
867
871
|
// src/core/pricing.ts
|
|
868
872
|
var PER_MILLION = 1e6;
|
|
869
873
|
var PRICING_TABLE = {
|
|
874
|
+
[`${Provider.ANTHROPIC}:${Model.Anthropic.OPUS_4_7}`]: {
|
|
875
|
+
inputPricePerToken: 5 / PER_MILLION,
|
|
876
|
+
outputPricePerToken: 25 / PER_MILLION
|
|
877
|
+
},
|
|
870
878
|
[`${Provider.ANTHROPIC}:${Model.Anthropic.OPUS_4_6}`]: {
|
|
871
879
|
inputPricePerToken: 5 / PER_MILLION,
|
|
872
880
|
outputPricePerToken: 25 / PER_MILLION
|
|
@@ -879,6 +887,10 @@ var PRICING_TABLE = {
|
|
|
879
887
|
inputPricePerToken: 1 / PER_MILLION,
|
|
880
888
|
outputPricePerToken: 5 / PER_MILLION
|
|
881
889
|
},
|
|
890
|
+
[`${Provider.OPENAI}:${Model.OpenAI.GPT_5_5}`]: {
|
|
891
|
+
inputPricePerToken: 5 / PER_MILLION,
|
|
892
|
+
outputPricePerToken: 30 / PER_MILLION
|
|
893
|
+
},
|
|
882
894
|
[`${Provider.OPENAI}:${Model.OpenAI.GPT_5_4}`]: {
|
|
883
895
|
inputPricePerToken: 2.5 / PER_MILLION,
|
|
884
896
|
outputPricePerToken: 15 / PER_MILLION
|