@aeye/models 0.3.8 → 0.3.9
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/aeye-models.md +265 -0
- package/dist/scripts/_regen.d.ts +2 -0
- package/dist/scripts/_regen.d.ts.map +1 -0
- package/dist/scripts/_regen.js +13 -0
- package/dist/scripts/_regen.js.map +1 -0
- package/dist/scripts/codegen.d.ts.map +1 -1
- package/dist/scripts/codegen.js +5 -1
- package/dist/scripts/codegen.js.map +1 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +1 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/models/openrouter.d.ts.map +1 -1
- package/dist/src/models/openrouter.js +4148 -5232
- package/dist/src/models/openrouter.js.map +1 -1
- package/dist/src/strict-support.d.ts +44 -0
- package/dist/src/strict-support.d.ts.map +1 -0
- package/dist/src/strict-support.js +107 -0
- package/dist/src/strict-support.js.map +1 -0
- package/package.json +5 -5
- package/scripts/codegen.ts +5 -2
- package/src/index.ts +13 -12
- package/src/models/openrouter.ts +8990 -10074
- package/src/strict-support.ts +111 -0
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Curated strict-mode support table.
|
|
3
|
+
*
|
|
4
|
+
* HUMAN-CURATED. NOT auto-generated. Edit by hand as new models ship or
|
|
5
|
+
* provider docs change. The auto-generated model files (`openai.ts`,
|
|
6
|
+
* `aws.ts`, etc.) are scraped from provider listings and don't track
|
|
7
|
+
* strict-mode capability on their own — strict support is a separate axis
|
|
8
|
+
* sourced here.
|
|
9
|
+
*
|
|
10
|
+
* Splat into your `AI` config:
|
|
11
|
+
*
|
|
12
|
+
* ```ts
|
|
13
|
+
* import { models, strictSupport } from '@aeye/models';
|
|
14
|
+
*
|
|
15
|
+
* const ai = new AI({
|
|
16
|
+
* providers: { ... },
|
|
17
|
+
* models,
|
|
18
|
+
* modelOverrides: [...strictSupport, ...myOwnOverrides],
|
|
19
|
+
* });
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* Setting `strictFormat: '<family>'` does two things:
|
|
23
|
+
* 1. Auto-derives the `'toolsStrict'` capability for selection.
|
|
24
|
+
* 2. Pins the JSON-Schema dialect that providers will emit.
|
|
25
|
+
*
|
|
26
|
+
* The dialect could often be left implicit and resolved via
|
|
27
|
+
* `resolveStrictFormat(model)`'s fallback chain (provider name → `[family]/`
|
|
28
|
+
* id prefix), but we set it explicitly here so the curated table is
|
|
29
|
+
* self-documenting and so the provider doesn't have to recompute it for
|
|
30
|
+
* every request.
|
|
31
|
+
*
|
|
32
|
+
* `strictFormat: 'none'` is a hard opt-out — used when an upstream source
|
|
33
|
+
* (a scraper, a future provider plug-in) has incorrectly marked a model
|
|
34
|
+
* strict-capable.
|
|
35
|
+
*
|
|
36
|
+
* References:
|
|
37
|
+
* - https://platform.openai.com/docs/guides/structured-outputs
|
|
38
|
+
* - https://platform.claude.com/docs/en/agents-and-tools/tool-use/strict-tool-use
|
|
39
|
+
* - https://platform.claude.com/docs/en/build-with-claude/structured-outputs
|
|
40
|
+
* - https://ai.google.dev/gemini-api/docs/structured-output
|
|
41
|
+
*/
|
|
42
|
+
|
|
43
|
+
import type { ModelOverride } from '@aeye/ai';
|
|
44
|
+
|
|
45
|
+
export const strictSupport: ModelOverride[] = [
|
|
46
|
+
// ---------------------------------------------------------------------------
|
|
47
|
+
// OpenAI direct — gpt-4o, gpt-4.1, gpt-5, o-series support strict tools +
|
|
48
|
+
// outputs. gpt-realtime supports function calling (no documented support
|
|
49
|
+
// for structured output, gated by the `'structured'` capability — which
|
|
50
|
+
// the scraper doesn't add for realtime models). Legacy gpt-4 / gpt-3.5
|
|
51
|
+
// are not listed: they don't get the cap, so they stay lenient.
|
|
52
|
+
// ---------------------------------------------------------------------------
|
|
53
|
+
{
|
|
54
|
+
provider: 'openai',
|
|
55
|
+
modelPattern: /^gpt-4o(\b|[-_])/,
|
|
56
|
+
overrides: { strictFormat: 'openai' },
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
provider: 'openai',
|
|
60
|
+
modelPattern: /^gpt-4\.1(\b|[-_])/,
|
|
61
|
+
overrides: { strictFormat: 'openai' },
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
provider: 'openai',
|
|
65
|
+
modelPattern: /^gpt-5(\b|[-_])/,
|
|
66
|
+
overrides: { strictFormat: 'openai' },
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
provider: 'openai',
|
|
70
|
+
modelPattern: /^o[1-9](-mini|-preview|-pro)?(\b|[-_])/,
|
|
71
|
+
overrides: { strictFormat: 'openai' },
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
provider: 'openai',
|
|
75
|
+
modelPattern: /^gpt-realtime/,
|
|
76
|
+
overrides: { strictFormat: 'openai' },
|
|
77
|
+
},
|
|
78
|
+
|
|
79
|
+
// ---------------------------------------------------------------------------
|
|
80
|
+
// AWS Bedrock — Anthropic-family Claude 4.5+ only. provider='aws' doesn't
|
|
81
|
+
// resolve and the id uses '.' separators rather than '/', so the dialect
|
|
82
|
+
// must be set explicitly here. Earlier Claude versions (3.5/3.7) don't
|
|
83
|
+
// support strict per Anthropic docs and are deliberately not listed.
|
|
84
|
+
// ---------------------------------------------------------------------------
|
|
85
|
+
{
|
|
86
|
+
provider: 'aws',
|
|
87
|
+
modelPattern: /anthropic\.claude-(opus-4|sonnet-4|haiku-4)/,
|
|
88
|
+
overrides: { strictFormat: 'anthropic' },
|
|
89
|
+
},
|
|
90
|
+
|
|
91
|
+
// ---------------------------------------------------------------------------
|
|
92
|
+
// OpenRouter — keyed off the `[family]/...` id prefix. Listed here both
|
|
93
|
+
// to add the `'toolsStrict'` capability (which the OpenRouter scraper
|
|
94
|
+
// doesn't currently set) and to pin the dialect explicitly.
|
|
95
|
+
// ---------------------------------------------------------------------------
|
|
96
|
+
{
|
|
97
|
+
provider: 'openrouter',
|
|
98
|
+
modelPattern: /^openai\/(gpt-4o|gpt-4\.1|gpt-5|o[1-9])/,
|
|
99
|
+
overrides: { strictFormat: 'openai' },
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
provider: 'openrouter',
|
|
103
|
+
modelPattern: /^anthropic\/claude-(opus-4|sonnet-4|haiku-4|4)/,
|
|
104
|
+
overrides: { strictFormat: 'anthropic' },
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
provider: 'openrouter',
|
|
108
|
+
modelPattern: /^google\/gemini-(2\.0|2\.5|3|3\.1)/,
|
|
109
|
+
overrides: { strictFormat: 'google' },
|
|
110
|
+
},
|
|
111
|
+
];
|