visual-ai-assertions 0.12.0 → 0.13.1

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 CHANGED
@@ -491,12 +491,12 @@ const ai = visualAI({
491
491
 
492
492
  When omitted, each provider uses its default behavior. The `"xhigh"` level enables maximum reasoning depth.
493
493
 
494
- | Provider | Native Parameter | `"xhigh"` maps to |
495
- | ------------------ | ----------------------------------------------------- | -------------------- |
496
- | Anthropic Opus 4.7 | `thinking.type: "adaptive"` + `output_config.effort` | `effort: "xhigh"` |
497
- | Anthropic (other) | `thinking.type: "adaptive"` + `output_config.effort` | `effort: "max"` |
498
- | OpenAI | `reasoning.effort` (Responses API) | `effort: "xhigh"` |
499
- | Google | `thinkingConfig.thinkingBudget` (1024 / 8192 / 24576) | `24576` (max budget) |
494
+ | Provider | Native Parameter | `"xhigh"` maps to |
495
+ | ----------------------------------------- | ----------------------------------------------------- | -------------------- |
496
+ | Anthropic (Fable 5/Opus 4.8/4.7/Sonnet 5) | `thinking.type: "adaptive"` + `output_config.effort` | `effort: "xhigh"` |
497
+ | Anthropic (other) | `thinking.type: "adaptive"` + `output_config.effort` | `effort: "max"` |
498
+ | OpenAI | `reasoning.effort` (Responses API) | `effort: "xhigh"` |
499
+ | Google | `thinkingConfig.thinkingBudget` (1024 / 8192 / 24576) | `24576` (max budget) |
500
500
 
501
501
  ## Supported Models
502
502
 
@@ -504,33 +504,39 @@ All listed models support image/vision input. Pass any model ID to the `model` c
504
504
 
505
505
  ### Anthropic
506
506
 
507
- | Model | Model ID | Input $/MTok | Output $/MTok | Notes |
508
- | ----------------- | ------------------- | ------------ | ------------- | ------------------------------------------ |
509
- | Claude Opus 4.7 | `claude-opus-4-7` | $5 | $25 | Most capable; supports `xhigh` effort tier |
510
- | Claude Opus 4.6 | `claude-opus-4-6` | $5 | $25 | Previous flagship, 128K max output |
511
- | Claude Sonnet 4.6 | `claude-sonnet-4-6` | $3 | $15 | **Default** — best value |
512
- | Claude Haiku 4.5 | `claude-haiku-4-5` | $1 | $5 | Fastest, budget-friendly |
507
+ | Model | Model ID | Input $/MTok | Output $/MTok | Notes |
508
+ | ----------------- | ------------------- | ------------ | ------------- | ------------------------------------------- |
509
+ | Claude Fable 5 | `claude-fable-5` | $10 | $50 | Most capable; long-horizon agentic work |
510
+ | Claude Opus 4.8 | `claude-opus-4-8` | $5 | $25 | Most capable Opus tier; supports `xhigh` |
511
+ | Claude Opus 4.7 | `claude-opus-4-7` | $5 | $25 | Previous Opus; supports `xhigh` effort tier |
512
+ | Claude Opus 4.6 | `claude-opus-4-6` | $5 | $25 | Previous flagship, 128K max output |
513
+ | Claude Sonnet 5 | `claude-sonnet-5` | $3 | $15 | Near-Opus quality on coding/agentic work |
514
+ | Claude Sonnet 4.6 | `claude-sonnet-4-6` | $3 | $15 | **Default** — best value |
515
+ | Claude Haiku 4.5 | `claude-haiku-4-5` | $1 | $5 | Fastest, budget-friendly |
513
516
 
514
517
  ### OpenAI
515
518
 
516
- | Model | Model ID | Input $/MTok | Output $/MTok | Notes |
517
- | ------------ | -------------- | ------------ | ------------- | ------------------------------ |
518
- | GPT-5.5 | `gpt-5.5` | $5 | $30 | Newest flagship, 1M context |
519
- | GPT-5.4 Pro | `gpt-5.4-pro` | $30 | $180 | Most capable, extended context |
520
- | GPT-5.4 | `gpt-5.4` | $2.50 | $15 | Best vision quality |
521
- | GPT-5.2 | `gpt-5.2` | $1.75 | $14 | Balanced quality and cost |
522
- | GPT-5.4 mini | `gpt-5.4-mini` | $0.75 | $4.50 | Fast and affordable |
523
- | GPT-5.4 nano | `gpt-5.4-nano` | $0.20 | $1.25 | Cheapest OpenAI option |
524
- | GPT-5 mini | `gpt-5-mini` | $0.25 | $2 | **Default** — fast and cheap |
519
+ | Model | Model ID | Input $/MTok | Output $/MTok | Notes |
520
+ | ------------- | --------------- | ------------ | ------------- | --------------------------------- |
521
+ | GPT-5.6 Sol | `gpt-5.6-sol` | $5 | $30 | Newest flagship, frontier tier |
522
+ | GPT-5.6 Terra | `gpt-5.6-terra` | $2.50 | $15 | Newest balanced, everyday tier |
523
+ | GPT-5.6 Luna | `gpt-5.6-luna` | $1 | $6 | Newest, fastest/cheapest tier |
524
+ | GPT-5.5 | `gpt-5.5` | $5 | $30 | Previous flagship, 1M context |
525
+ | GPT-5.4 Pro | `gpt-5.4-pro` | $30 | $180 | Most capable, extended context |
526
+ | GPT-5.4 | `gpt-5.4` | $2.50 | $15 | Best vision quality |
527
+ | GPT-5.2 | `gpt-5.2` | $1.75 | $14 | Balanced quality and cost |
528
+ | GPT-5.4 mini | `gpt-5.4-mini` | $0.75 | $4.50 | **Default** — fast and affordable |
529
+ | GPT-5.4 nano | `gpt-5.4-nano` | $0.20 | $1.25 | Cheapest older-generation option |
530
+ | GPT-5 mini | `gpt-5-mini` | $0.25 | $2 | Fast and cheap |
525
531
 
526
532
  ### Google
527
533
 
528
- | Model | Model ID | Input $/MTok | Output $/MTok | Notes |
529
- | --------------------- | ------------------------------- | ------------ | ------------- | --------------------------------- |
530
- | Gemini 3.5 Flash | `gemini-3.5-flash` | $1.50 | $9 | Strongest agentic & coding model |
531
- | Gemini 3.1 Pro | `gemini-3.1-pro-preview` | $2 | $12 | Preview — most advanced reasoning |
532
- | Gemini 3.1 Flash Lite | `gemini-3.1-flash-lite-preview` | $0.25 | $1.50 | Preview — lightweight and cheap |
533
- | Gemini 3 Flash | `gemini-3-flash-preview` | $0.50 | $3 | **Default** — fast and capable |
534
+ | Model | Model ID | Input $/MTok | Output $/MTok | Notes |
535
+ | --------------------- | ------------------------ | ------------ | ------------- | --------------------------------- |
536
+ | Gemini 3.5 Flash | `gemini-3.5-flash` | $1.50 | $9 | Strongest agentic & coding model |
537
+ | Gemini 3.1 Pro | `gemini-3.1-pro-preview` | $2 | $12 | Preview — most advanced reasoning |
538
+ | Gemini 3.1 Flash Lite | `gemini-3.1-flash-lite` | $0.25 | $1.50 | GA — lightweight and cheap |
539
+ | Gemini 3 Flash | `gemini-3-flash-preview` | $0.50 | $3 | **Default** — fast and capable |
534
540
 
535
541
  ## License
536
542
 
package/dist/index.cjs CHANGED
@@ -80,12 +80,18 @@ var Provider = {
80
80
  };
81
81
  var Model = {
82
82
  Anthropic: {
83
+ FABLE_5: "claude-fable-5",
84
+ OPUS_4_8: "claude-opus-4-8",
83
85
  OPUS_4_7: "claude-opus-4-7",
84
86
  OPUS_4_6: "claude-opus-4-6",
87
+ SONNET_5: "claude-sonnet-5",
85
88
  SONNET_4_6: "claude-sonnet-4-6",
86
89
  HAIKU_4_5: "claude-haiku-4-5"
87
90
  },
88
91
  OpenAI: {
92
+ GPT_5_6_SOL: "gpt-5.6-sol",
93
+ GPT_5_6_TERRA: "gpt-5.6-terra",
94
+ GPT_5_6_LUNA: "gpt-5.6-luna",
89
95
  GPT_5_5: "gpt-5.5",
90
96
  GPT_5_4: "gpt-5.4",
91
97
  GPT_5_4_PRO: "gpt-5.4-pro",
@@ -97,7 +103,7 @@ var Model = {
97
103
  Google: {
98
104
  GEMINI_3_5_FLASH: "gemini-3.5-flash",
99
105
  GEMINI_3_1_PRO_PREVIEW: "gemini-3.1-pro-preview",
100
- GEMINI_3_1_FLASH_LITE_PREVIEW: "gemini-3.1-flash-lite-preview",
106
+ GEMINI_3_1_FLASH_LITE: "gemini-3.1-flash-lite",
101
107
  GEMINI_3_FLASH_PREVIEW: "gemini-3-flash-preview"
102
108
  }
103
109
  };
@@ -573,9 +579,15 @@ function parseRetryAfter(value) {
573
579
  }
574
580
 
575
581
  // src/providers/anthropic.ts
582
+ var XHIGH_CAPABLE_MODELS = /* @__PURE__ */ new Set([
583
+ Model.Anthropic.FABLE_5,
584
+ Model.Anthropic.OPUS_4_8,
585
+ Model.Anthropic.OPUS_4_7,
586
+ Model.Anthropic.SONNET_5
587
+ ]);
576
588
  function mapEffort(level, model) {
577
589
  if (level !== "xhigh") return level;
578
- return model === Model.Anthropic.OPUS_4_7 ? "xhigh" : "max";
590
+ return XHIGH_CAPABLE_MODELS.has(model) ? "xhigh" : "max";
579
591
  }
580
592
  var AnthropicDriver = class {
581
593
  client;
@@ -958,6 +970,18 @@ function resolveConfig(config) {
958
970
  // src/core/pricing.ts
959
971
  var PER_MILLION = 1e6;
960
972
  var PRICING_TABLE = {
973
+ [`${Provider.ANTHROPIC}:${Model.Anthropic.FABLE_5}`]: {
974
+ inputPricePerToken: 10 / PER_MILLION,
975
+ outputPricePerToken: 50 / PER_MILLION
976
+ },
977
+ [`${Provider.ANTHROPIC}:${Model.Anthropic.OPUS_4_8}`]: {
978
+ inputPricePerToken: 5 / PER_MILLION,
979
+ outputPricePerToken: 25 / PER_MILLION
980
+ },
981
+ [`${Provider.ANTHROPIC}:${Model.Anthropic.SONNET_5}`]: {
982
+ inputPricePerToken: 3 / PER_MILLION,
983
+ outputPricePerToken: 15 / PER_MILLION
984
+ },
961
985
  [`${Provider.ANTHROPIC}:${Model.Anthropic.OPUS_4_7}`]: {
962
986
  inputPricePerToken: 5 / PER_MILLION,
963
987
  outputPricePerToken: 25 / PER_MILLION
@@ -974,6 +998,18 @@ var PRICING_TABLE = {
974
998
  inputPricePerToken: 1 / PER_MILLION,
975
999
  outputPricePerToken: 5 / PER_MILLION
976
1000
  },
1001
+ [`${Provider.OPENAI}:${Model.OpenAI.GPT_5_6_SOL}`]: {
1002
+ inputPricePerToken: 5 / PER_MILLION,
1003
+ outputPricePerToken: 30 / PER_MILLION
1004
+ },
1005
+ [`${Provider.OPENAI}:${Model.OpenAI.GPT_5_6_TERRA}`]: {
1006
+ inputPricePerToken: 2.5 / PER_MILLION,
1007
+ outputPricePerToken: 15 / PER_MILLION
1008
+ },
1009
+ [`${Provider.OPENAI}:${Model.OpenAI.GPT_5_6_LUNA}`]: {
1010
+ inputPricePerToken: 1 / PER_MILLION,
1011
+ outputPricePerToken: 6 / PER_MILLION
1012
+ },
977
1013
  [`${Provider.OPENAI}:${Model.OpenAI.GPT_5_5}`]: {
978
1014
  inputPricePerToken: 5 / PER_MILLION,
979
1015
  outputPricePerToken: 30 / PER_MILLION
@@ -1010,7 +1046,7 @@ var PRICING_TABLE = {
1010
1046
  inputPricePerToken: 2 / PER_MILLION,
1011
1047
  outputPricePerToken: 12 / PER_MILLION
1012
1048
  },
1013
- [`${Provider.GOOGLE}:${Model.Google.GEMINI_3_1_FLASH_LITE_PREVIEW}`]: {
1049
+ [`${Provider.GOOGLE}:${Model.Google.GEMINI_3_1_FLASH_LITE}`]: {
1014
1050
  inputPricePerToken: 0.25 / PER_MILLION,
1015
1051
  outputPricePerToken: 1.5 / PER_MILLION
1016
1052
  },
@@ -1817,8 +1853,12 @@ var AskResultSchema = import_zod.z.object({
1817
1853
  /**
1818
1854
  * For video inputs, the indices of frames the model relied on to answer.
1819
1855
  * Indices are 0-based and refer to entries in `frames.timestampsSeconds`.
1856
+ *
1857
+ * Nullable because providers with strict structured-output schemas (e.g. OpenAI)
1858
+ * must mark every field required and represent "no value" as `null` rather than
1859
+ * omitting the key, even for image inputs that were never asked to populate it.
1820
1860
  */
1821
- frameReferences: import_zod.z.array(import_zod.z.number().int().nonnegative()).optional(),
1861
+ frameReferences: import_zod.z.array(import_zod.z.number().int().nonnegative()).nullable().optional(),
1822
1862
  usage: UsageInfoSchema.optional()
1823
1863
  });
1824
1864
 
@@ -1870,7 +1910,11 @@ function parseCheckResponse(raw) {
1870
1910
  return reconcileCheckResult(result);
1871
1911
  }
1872
1912
  function parseAskResponse(raw) {
1873
- return parseResponse(raw, AskResponseSchema);
1913
+ const result = parseResponse(raw, AskResponseSchema);
1914
+ return {
1915
+ ...result,
1916
+ frameReferences: result.frameReferences ?? void 0
1917
+ };
1874
1918
  }
1875
1919
  function parseCompareResponse(raw) {
1876
1920
  return parseResponse(raw, CompareResponseSchema);