@neon/ai-sdk-provider 1.1.0 → 1.2.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 +10 -6
- package/dist/lib/neon-anthropic-language-model.d.ts.map +1 -1
- package/dist/lib/neon-chat-options.d.ts +1 -1
- package/dist/lib/neon-chat-options.d.ts.map +1 -1
- package/dist/lib/neon-chat-options.js +12 -1
- package/dist/lib/neon-chat-options.js.map +1 -1
- package/dist/lib/neon-decision-model.d.ts.map +1 -1
- package/dist/lib/neon-embedding-options.d.ts +1 -1
- package/dist/lib/neon-embedding-options.d.ts.map +1 -1
- package/dist/lib/neon-embedding-options.js +5 -1
- package/dist/lib/neon-embedding-options.js.map +1 -1
- package/dist/lib/neon-gateway-error.d.ts.map +1 -1
- package/dist/lib/neon-harmony-normalize.d.ts.map +1 -1
- package/dist/lib/neon-model-capabilities.d.ts.map +1 -1
- package/dist/lib/neon-model-capabilities.js +44 -7
- package/dist/lib/neon-model-capabilities.js.map +1 -1
- package/dist/lib/neon-openai-tools.d.ts.map +1 -1
- package/dist/lib/neon-responses-options.d.ts.map +1 -1
- package/dist/lib/neon-responses-options.js +5 -2
- package/dist/lib/neon-responses-options.js.map +1 -1
- package/dist/lib/provider.d.ts.map +1 -1
- package/dist/lib/version.d.ts.map +1 -1
- package/dist/package.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -69,20 +69,24 @@ Which ids your branch serves is account-specific during the beta; `GET $NEON_AI_
|
|
|
69
69
|
|
|
70
70
|
Upstream backends behind the gateway accept different subsets of the OpenAI-style parameters the AI SDK emits, and sending one an upstream rejects is a hard `400`. The provider drops those before the request and records a warning in `result.warnings`, so a call succeeds instead of failing on a parameter you passed in good faith.
|
|
71
71
|
|
|
72
|
-
These rules apply on the Anthropic Messages and Chat Completions routes. The Responses route (every `gpt-*` id) relies on the upstream OpenAI model's own stripping instead, so its behaviour and its warning wording are the AI SDK's rather than described here
|
|
72
|
+
These rules apply on the Anthropic Messages and Chat Completions routes. The Responses route (every `gpt-*` id) relies on the upstream OpenAI model's own stripping instead, so its behaviour and its warning wording are the AI SDK's rather than described here. `getNeonModelCapabilities` still answers for those ids, and the `gpt-5` and `gpt-6` rows below are what it reports rather than something this provider drops.
|
|
73
73
|
|
|
74
74
|
| Models | Dropped |
|
|
75
75
|
| --- | --- |
|
|
76
|
-
| Claude 4.7 and newer (`claude-opus-4-7`, `claude-opus-4-8`, `claude-opus-5`, `claude-sonnet-5`, `claude-fable-5`, `claude-fable-5-1`) | `temperature`, `topP` |
|
|
76
|
+
| Claude 4.7 and newer (`claude-opus-4-7`, `claude-opus-4-8`, `claude-opus-5`, `claude-sonnet-5`, `claude-fable-5`, `claude-fable-5-1`, `claude-haiku-5-5`, `claude-sonnet-5-5`) | `temperature`, `topP` |
|
|
77
77
|
| All Claude | `frequencyPenalty`, `presencePenalty`, `seed`, `reasoningEffort`, and `topP` when you set both `temperature` and `topP` (Anthropic accepts only one) |
|
|
78
78
|
| `gpt-oss` | `frequencyPenalty`, `presencePenalty`, `seed`, `stopSequences` |
|
|
79
79
|
| Qwen, Gemma | `frequencyPenalty`, `presencePenalty`, `seed` |
|
|
80
|
-
| `glm-5-2`, `glm-5-3-flash`, `inkling`, `kimi-k3` | `frequencyPenalty`, `presencePenalty` |
|
|
80
|
+
| `glm-5-2`, `glm-5-3`, `glm-5-3-flash`, `inkling`, `kimi-k3` | `frequencyPenalty`, `presencePenalty` |
|
|
81
|
+
| Grok, DeepSeek | `frequencyPenalty`, `presencePenalty` |
|
|
81
82
|
| Meta Llama | `frequencyPenalty`, `presencePenalty`, `seed` |
|
|
82
83
|
| `gemini-3-5-flash-lite` | `frequencyPenalty`, `presencePenalty` |
|
|
83
84
|
| `gemini-3-6-flash` | `temperature`, `topP`, `frequencyPenalty`, `presencePenalty` |
|
|
85
|
+
| `gemini-3-7-flash`, `gemini-3-8-flash`, `gemini-4-argon` | `temperature`, `topP`, `frequencyPenalty`, `presencePenalty` |
|
|
84
86
|
| Every other Gemini | nothing |
|
|
85
|
-
| `gpt-5`, `gpt-5-mini`, `gpt-5-nano`, `gpt-5-5-pro` (reported only
|
|
87
|
+
| `gpt-5`, `gpt-5-mini`, `gpt-5-nano`, `gpt-5-5`, `gpt-5-5-pro`, `gpt-5-6-luna`, `gpt-5-6-sol`, `gpt-5-6-terra`, `gpt-6-astra`, `gpt-6-sol`, `gpt-6-luna`, `gpt-6-1-sol` (reported only; Responses strips these upstream) | `temperature`, `topP` |
|
|
88
|
+
|
|
89
|
+
On the Responses API, the gateway accepts `temperature` and `topP` only when reasoning effort is `none`, so the `gpt-*` rows describe each model's default effort. `gpt-6-astra`, `gpt-6-1-sol`, `gpt-5`, and `gpt-5-5-pro` don't accept effort `none`, so they never accept either parameter. The upstream OpenAI model drops both for every `gpt-5*` and `gpt-6*` id, even when reasoning effort is `none`.
|
|
86
90
|
|
|
87
91
|
**`temperature` on a Claude 5 model therefore has no effect.** That is the gateway's behaviour, not a provider choice; sending it returns `does not support the temperature parameter`. Steer those models with Anthropic's own effort control instead — note that this is `effort`, not the OpenAI-style `reasoningEffort`, which every Claude id drops:
|
|
88
92
|
|
|
@@ -104,7 +108,7 @@ getNeonModelCapabilities('gpt-6-astra').supportsTemperature; // false
|
|
|
104
108
|
getNeonModelCapabilities('glm-5-2').supportsPenalties; // false
|
|
105
109
|
```
|
|
106
110
|
|
|
107
|
-
**The rules are per model, not per family.**
|
|
111
|
+
**The rules are per model, not per family.** Some Gemini ids reject penalties while their siblings accept them, and `gemini-3-6-flash`, `gemini-3-7-flash`, `gemini-3-8-flash`, and `gemini-4-argon` reject `temperature` and `topP` outright, so reading a row for "Gemini" is not enough; check the id. Every dropped-options table row was measured against the gateway rather than inherited from the upstream provider's own documentation, which disagrees in both directions.
|
|
108
112
|
|
|
109
113
|
A model none of these rules match is left untouched, so a brand-new id gets the gateway's own error rather than a guess. That is also why the table can lag: an id added since the last release inherits the permissive default until someone measures it.
|
|
110
114
|
|
|
@@ -128,7 +132,7 @@ const { embeddings } = await embedMany({
|
|
|
128
132
|
});
|
|
129
133
|
```
|
|
130
134
|
|
|
131
|
-
|
|
135
|
+
`qwen3-embedding-0-6b`, `gte-large-en`, and `bge-large-en` return 1024-dimensional vectors. `qwen3-embedding-0-6b` honors `providerOptions.neon.dimensions` for shorter vectors; `gte-large-en` and `bge-large-en` ignore it. The gateway accepts at most 150 inputs per request, so `embedMany()` splits larger lists into batches of 150. `NeonEmbeddingModelId` autocompletes the known ids; any other string is passed through to the gateway. `textEmbeddingModel()` is a deprecated alias.
|
|
132
136
|
|
|
133
137
|
## Decisions
|
|
134
138
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"neon-anthropic-language-model.d.ts","names":["AnthropicMessagesLanguageModel","LanguageModelV3","LanguageModelV3CallOptions","LanguageModelV3GenerateResult","LanguageModelV3StreamResult","NeonAnthropicLanguageModel","Promise","AnthropicMessagesLanguageModel","LanguageModelV3","LanguageModelV3CallOptions","LanguageModelV3GenerateResult","LanguageModelV3StreamResult","NeonAnthropicLanguageModel","withGatewayCompat","doGenerate","options","Promise","doStream"],"sources":["../../src/lib/neon-anthropic-language-model.ts"],"mappings":";;;;;;;AA+BA;AACC;AA6BUE;AACCC;AAARG;AASOJ;AACCE;AAARE;AAxCKN;AACGC;AAAe;;;;;;cAFdI,0BAAAA,SACJL,8BAAAA,YACGC;;
|
|
1
|
+
{"version":3,"file":"neon-anthropic-language-model.d.ts","names":["AnthropicMessagesLanguageModel","LanguageModelV3","LanguageModelV3CallOptions","LanguageModelV3GenerateResult","LanguageModelV3StreamResult","NeonAnthropicLanguageModel","Promise","AnthropicMessagesLanguageModel","LanguageModelV3","LanguageModelV3CallOptions","LanguageModelV3GenerateResult","LanguageModelV3StreamResult","NeonAnthropicLanguageModel","withGatewayCompat","doGenerate","options","Promise","doStream"],"sources":["../../src/lib/neon-anthropic-language-model.ts"],"mappings":";;;;;;;AA+BA;AACC;AA6BUE;AACCC;AAARG;AASOJ;AACCE;AAARE;AAxCKN;AACGC;AAAe;;;;;;A,cAFdI,0BAAAA,SACJL,8BAAAA,YACGC,e;;E,oBA4BDC,0B,GACPI,O,CAAQH,6B;E,kBASDD,0B,GACPI,O,CAAQF,2B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//#region src/lib/neon-chat-options.d.ts
|
|
2
2
|
/** Published catalog ids from https://neon.com/models.json (canonical, unprefixed). */
|
|
3
|
-
declare const NEON_MODELS_DEV_IDS: readonly ["claude-fable-5", "claude-fable-5-1", "claude-haiku-4-5", "claude-opus-4-1", "claude-opus-4-5", "claude-opus-4-6", "claude-opus-4-7", "claude-opus-4-8", "claude-opus-5", "claude-opus-5-5", "claude-sonnet-4-5", "claude-sonnet-4-6", "claude-sonnet-5", "gpt-5", "gpt-5-1", "gpt-5-2", "gpt-5-3-codex", "gpt-5-4", "gpt-5-4-mini", "gpt-5-4-nano", "gpt-5-5", "gpt-5-5-pro", "gpt-5-6-luna", "gpt-5-6-sol", "gpt-5-6-terra", "gpt-5-mini", "gpt-5-nano", "gpt-6-astra", "gpt-oss-120b", "gpt-oss-20b", "gemini-3-1-flash-lite", "gemini-3-1-pro", "gemini-3-5-flash", "gemini-3-5-flash-lite", "gemini-3-6-flash", "gemini-3-flash", "gemma-3-12b", "llama-4-maverick", "meta-llama-3-1-8b-instruct", "meta-llama-3-3-70b-instruct", "qwen3-next-80b-a3b-instruct", "qwen35-122b-a10b", "glm-5-2", "glm-5-3-flash", "grok-4-6", "inkling", "kimi-k3"];
|
|
3
|
+
declare const NEON_MODELS_DEV_IDS: readonly ["claude-fable-5", "claude-fable-5-1", "claude-haiku-4-5", "claude-haiku-5-5", "claude-opus-4-1", "claude-opus-4-5", "claude-opus-4-6", "claude-opus-4-7", "claude-opus-4-8", "claude-opus-5", "claude-opus-5-5", "claude-sonnet-4-5", "claude-sonnet-4-6", "claude-sonnet-5", "claude-sonnet-5-5", "gpt-5", "gpt-5-1", "gpt-5-2", "gpt-5-3-codex", "gpt-5-4", "gpt-5-4-mini", "gpt-5-4-nano", "gpt-5-5", "gpt-5-5-pro", "gpt-5-6-luna", "gpt-5-6-sol", "gpt-5-6-terra", "gpt-5-mini", "gpt-5-nano", "gpt-6-1-sol", "gpt-6-astra", "gpt-6-luna", "gpt-6-sol", "gpt-oss-120b", "gpt-oss-20b", "gemini-3-1-flash-lite", "gemini-3-1-pro", "gemini-3-5-flash", "gemini-3-5-flash-lite", "gemini-3-6-flash", "gemini-3-7-flash", "gemini-3-8-flash", "gemini-3-flash", "gemini-4-argon", "gemma-3-12b", "llama-4-maverick", "meta-llama-3-1-8b-instruct", "meta-llama-3-3-70b-instruct", "qwen3-next-80b-a3b-instruct", "qwen35-122b-a10b", "glm-5-2", "glm-5-3", "glm-5-3-flash", "grok-4-6", "grok-4-7", "inkling", "kimi-k3", "deepseek-v4-1-flash"];
|
|
4
4
|
/** A known Neon AI Gateway model id. */
|
|
5
5
|
type NeonKnownModelId = (typeof NEON_MODELS_DEV_IDS)[number];
|
|
6
6
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"neon-chat-options.d.ts","names":["NEON_MODELS_DEV_IDS","NeonKnownModelId","NeonChatModelId","NEON_MODELS_DEV_IDS","NeonKnownModelId","NeonChatModelId"],"sources":["../../src/lib/neon-chat-options.ts"],"mappings":";;AAiBaA,cAAAA,
|
|
1
|
+
{"version":3,"file":"neon-chat-options.d.ts","names":["NEON_MODELS_DEV_IDS","NeonKnownModelId","NeonChatModelId","NEON_MODELS_DEV_IDS","NeonKnownModelId","NeonChatModelId"],"sources":["../../src/lib/neon-chat-options.ts"],"mappings":";;AAiBaA,cAAAA,mBAsEH,EAAA,SAAA,CAAA,gBAAA,EAAA,kBAAA,EAAA,kBAAA,EAAA,kBAAA,EAAA,iBAAA,EAAA,iBAAA,EAAA,iBAAA,EAAA,iBAAA,EAAA,iBAAA,EAAA,eAAA,EAAA,iBAAA,EAAA,mBAAA,EAAA,mBAAA,EAAA,iBAAA,EAAA,mBAAA,EAAA,OAAA,EAAA,SAAA,EAAA,SAAA,EAAA,eAAA,EAAA,SAAA,EAAA,cAAA,EAAA,cAAA,EAAA,SAAA,EAAA,aAAA,EAAA,cAAA,EAAA,aAAA,EAAA,eAAA,EAAA,YAAA,EAAA,YAAA,EAAA,aAAA,EAAA,aAAA,EAAA,YAAA,EAAA,WAAA,EAAA,cAAA,EAAA,aAAA,EAAA,uBAAA,EAAA,gBAAA,EAAA,kBAAA,EAAA,uBAAA,EAAA,kBAAA,EAAA,kBAAA,EAAA,kBAAA,EAAA,gBAAA,EAAA,gBAAA,EAAA,aAAA,EAAA,kBAAA,EAAA,4BAAA,EAAA,6BAAA,EAAA,6BAAA,EAAA,kBAAA,EAAA,SAAA,EAAA,SAAA,EAAA,eAAA,EAAA,UAAA,EAAA,UAAA,EAAA,SAAA,EAAA,SAAA,EAAA,qBAAA,CAAA;AAGV;AAOYE,KAPAD,gBAAAA,GAOe,CAAGA,OAPSD,mBAOO,CAAA,CAAA,MAAA,CAAA;;;;;;A,KAAlCE,eAAAA,GAAkBD,gB"}
|
|
@@ -4,6 +4,7 @@ const NEON_MODELS_DEV_IDS = [
|
|
|
4
4
|
"claude-fable-5",
|
|
5
5
|
"claude-fable-5-1",
|
|
6
6
|
"claude-haiku-4-5",
|
|
7
|
+
"claude-haiku-5-5",
|
|
7
8
|
"claude-opus-4-1",
|
|
8
9
|
"claude-opus-4-5",
|
|
9
10
|
"claude-opus-4-6",
|
|
@@ -14,6 +15,7 @@ const NEON_MODELS_DEV_IDS = [
|
|
|
14
15
|
"claude-sonnet-4-5",
|
|
15
16
|
"claude-sonnet-4-6",
|
|
16
17
|
"claude-sonnet-5",
|
|
18
|
+
"claude-sonnet-5-5",
|
|
17
19
|
"gpt-5",
|
|
18
20
|
"gpt-5-1",
|
|
19
21
|
"gpt-5-2",
|
|
@@ -28,7 +30,10 @@ const NEON_MODELS_DEV_IDS = [
|
|
|
28
30
|
"gpt-5-6-terra",
|
|
29
31
|
"gpt-5-mini",
|
|
30
32
|
"gpt-5-nano",
|
|
33
|
+
"gpt-6-1-sol",
|
|
31
34
|
"gpt-6-astra",
|
|
35
|
+
"gpt-6-luna",
|
|
36
|
+
"gpt-6-sol",
|
|
32
37
|
"gpt-oss-120b",
|
|
33
38
|
"gpt-oss-20b",
|
|
34
39
|
"gemini-3-1-flash-lite",
|
|
@@ -36,7 +41,10 @@ const NEON_MODELS_DEV_IDS = [
|
|
|
36
41
|
"gemini-3-5-flash",
|
|
37
42
|
"gemini-3-5-flash-lite",
|
|
38
43
|
"gemini-3-6-flash",
|
|
44
|
+
"gemini-3-7-flash",
|
|
45
|
+
"gemini-3-8-flash",
|
|
39
46
|
"gemini-3-flash",
|
|
47
|
+
"gemini-4-argon",
|
|
40
48
|
"gemma-3-12b",
|
|
41
49
|
"llama-4-maverick",
|
|
42
50
|
"meta-llama-3-1-8b-instruct",
|
|
@@ -44,10 +52,13 @@ const NEON_MODELS_DEV_IDS = [
|
|
|
44
52
|
"qwen3-next-80b-a3b-instruct",
|
|
45
53
|
"qwen35-122b-a10b",
|
|
46
54
|
"glm-5-2",
|
|
55
|
+
"glm-5-3",
|
|
47
56
|
"glm-5-3-flash",
|
|
48
57
|
"grok-4-6",
|
|
58
|
+
"grok-4-7",
|
|
49
59
|
"inkling",
|
|
50
|
-
"kimi-k3"
|
|
60
|
+
"kimi-k3",
|
|
61
|
+
"deepseek-v4-1-flash"
|
|
51
62
|
];
|
|
52
63
|
//#endregion
|
|
53
64
|
export { NEON_MODELS_DEV_IDS };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"neon-chat-options.js","names":[],"sources":["../../src/lib/neon-chat-options.ts"],"sourcesContent":["// Models served by the Neon AI Gateway. Anthropic and OpenAI models are routed\n// to their provider-native endpoints; everything else uses the unified MLflow\n// (OpenAI-compatible) endpoint.\n//\n// Ids use the canonical Neon (unprefixed) form, matching\n// https://neon.com/models.json. The gateway also accepts the legacy\n// `databricks-` prefixed form, which still resolves via the `(string & {})`\n// fallback on `NeonChatModelId`.\n//\n// `NEON_MODELS_DEV_IDS` mirrors the `released: true` entries of\n// neon.com/models.json `neon.models` exactly — `neon-catalog-drift.test.ts`\n// fails if the two diverge. A branch's live list\n// is `GET $NEON_AI_GATEWAY_BASE_URL/v1/models`. There is deliberately no second\n// list for ids the gateway serves ahead of the published catalog: such an id\n// already works because `NeonChatModelId` accepts any string.\n\n/** Published catalog ids from https://neon.com/models.json (canonical, unprefixed). */\nexport const NEON_MODELS_DEV_IDS = [\n\t// Anthropic (native Messages API)\n\t\"claude-fable-5\",\n\t\"claude-fable-5-1\",\n\t\"claude-haiku-4-5\",\n\t\"claude-opus-4-1\",\n\t\"claude-opus-4-5\",\n\t\"claude-opus-4-6\",\n\t\"claude-opus-4-7\",\n\t\"claude-opus-4-8\",\n\t\"claude-opus-5\",\n\t\"claude-opus-5-5\",\n\t\"claude-sonnet-4-5\",\n\t\"claude-sonnet-4-6\",\n\t\"claude-sonnet-5\",\n\t// OpenAI (native Responses API)\n\t\"gpt-5\",\n\t\"gpt-5-1\",\n\t\"gpt-5-2\",\n\t\"gpt-5-3-codex\",\n\t\"gpt-5-4\",\n\t\"gpt-5-4-mini\",\n\t\"gpt-5-4-nano\",\n\t\"gpt-5-5\",\n\t\"gpt-5-5-pro\",\n\t\"gpt-5-6-luna\",\n\t\"gpt-5-6-sol\",\n\t\"gpt-5-6-terra\",\n\t\"gpt-5-mini\",\n\t\"gpt-5-nano\",\n\t\"gpt-6-astra\",\n\t// OpenAI open-weight (unified MLflow endpoint)\n\t\"gpt-oss-120b\",\n\t\"gpt-oss-20b\",\n\t// Google (unified MLflow endpoint)\n\t\"gemini-3-1-flash-lite\",\n\t\"gemini-3-1-pro\",\n\t\"gemini-3-5-flash\",\n\t\"gemini-3-5-flash-lite\",\n\t\"gemini-3-6-flash\",\n\t\"gemini-3-flash\",\n\t\"gemma-3-12b\",\n\t// Meta (unified MLflow endpoint)\n\t\"llama-4-maverick\",\n\t\"meta-llama-3-1-8b-instruct\",\n\t\"meta-llama-3-3-70b-instruct\",\n\t// Alibaba (unified MLflow endpoint)\n\t\"qwen3-next-80b-a3b-instruct\",\n\t\"qwen35-122b-a10b\",\n\t// Zhipu (unified MLflow endpoint)\n\t\"glm-5-2\",\n\t\"glm-5-3-flash\",\n\t// xAI (unified MLflow endpoint)\n\t\"grok-4-6\",\n\t// Thinking Machines (unified MLflow endpoint)\n\t\"inkling\",\n\t// Moonshot (unified MLflow endpoint)\n\t\"kimi-k3\",\n] as const;\n\n/** A known Neon AI Gateway model id. */\nexport type NeonKnownModelId = (typeof NEON_MODELS_DEV_IDS)[number];\n\n/**\n * A Neon AI Gateway model id. Known ids are listed for autocomplete; any other\n * id (e.g. a brand-new model, or the legacy `databricks-` prefixed form) is\n * accepted via the `(string & {})` fallback.\n */\nexport type NeonChatModelId = NeonKnownModelId | (string & {});\n"],"mappings":";;AAiBA,MAAa,sBAAsB;CAElC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAEA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAEA;CACA;CAEA;CACA;CACA;CACA;CACA;CACA;CACA;CAEA;CACA;CACA;CAEA;CACA;CAEA;CACA;CAEA;CAEA;CAEA;AACD"}
|
|
1
|
+
{"version":3,"file":"neon-chat-options.js","names":[],"sources":["../../src/lib/neon-chat-options.ts"],"sourcesContent":["// Models served by the Neon AI Gateway. Anthropic and OpenAI models are routed\n// to their provider-native endpoints; everything else uses the unified MLflow\n// (OpenAI-compatible) endpoint.\n//\n// Ids use the canonical Neon (unprefixed) form, matching\n// https://neon.com/models.json. The gateway also accepts the legacy\n// `databricks-` prefixed form, which still resolves via the `(string & {})`\n// fallback on `NeonChatModelId`.\n//\n// `NEON_MODELS_DEV_IDS` mirrors the `released: true` chat entries of\n// neon.com/models.json `neon.models` exactly — `neon-catalog-drift.test.ts`\n// fails if the two diverge. A branch's live list\n// is `GET $NEON_AI_GATEWAY_BASE_URL/v1/models`. There is deliberately no second\n// list for ids the gateway serves ahead of the published catalog: such an id\n// already works because `NeonChatModelId` accepts any string.\n\n/** Published catalog ids from https://neon.com/models.json (canonical, unprefixed). */\nexport const NEON_MODELS_DEV_IDS = [\n\t// Anthropic (native Messages API)\n\t\"claude-fable-5\",\n\t\"claude-fable-5-1\",\n\t\"claude-haiku-4-5\",\n\t\"claude-haiku-5-5\",\n\t\"claude-opus-4-1\",\n\t\"claude-opus-4-5\",\n\t\"claude-opus-4-6\",\n\t\"claude-opus-4-7\",\n\t\"claude-opus-4-8\",\n\t\"claude-opus-5\",\n\t\"claude-opus-5-5\",\n\t\"claude-sonnet-4-5\",\n\t\"claude-sonnet-4-6\",\n\t\"claude-sonnet-5\",\n\t\"claude-sonnet-5-5\",\n\t// OpenAI (native Responses API)\n\t\"gpt-5\",\n\t\"gpt-5-1\",\n\t\"gpt-5-2\",\n\t\"gpt-5-3-codex\",\n\t\"gpt-5-4\",\n\t\"gpt-5-4-mini\",\n\t\"gpt-5-4-nano\",\n\t\"gpt-5-5\",\n\t\"gpt-5-5-pro\",\n\t\"gpt-5-6-luna\",\n\t\"gpt-5-6-sol\",\n\t\"gpt-5-6-terra\",\n\t\"gpt-5-mini\",\n\t\"gpt-5-nano\",\n\t\"gpt-6-1-sol\",\n\t\"gpt-6-astra\",\n\t\"gpt-6-luna\",\n\t\"gpt-6-sol\",\n\t// OpenAI open-weight (unified MLflow endpoint)\n\t\"gpt-oss-120b\",\n\t\"gpt-oss-20b\",\n\t// Google (unified MLflow endpoint)\n\t\"gemini-3-1-flash-lite\",\n\t\"gemini-3-1-pro\",\n\t\"gemini-3-5-flash\",\n\t\"gemini-3-5-flash-lite\",\n\t\"gemini-3-6-flash\",\n\t\"gemini-3-7-flash\",\n\t\"gemini-3-8-flash\",\n\t\"gemini-3-flash\",\n\t\"gemini-4-argon\",\n\t\"gemma-3-12b\",\n\t// Meta (unified MLflow endpoint)\n\t\"llama-4-maverick\",\n\t\"meta-llama-3-1-8b-instruct\",\n\t\"meta-llama-3-3-70b-instruct\",\n\t// Alibaba (unified MLflow endpoint)\n\t\"qwen3-next-80b-a3b-instruct\",\n\t\"qwen35-122b-a10b\",\n\t// Zhipu (unified MLflow endpoint)\n\t\"glm-5-2\",\n\t\"glm-5-3\",\n\t\"glm-5-3-flash\",\n\t// xAI (unified MLflow endpoint)\n\t\"grok-4-6\",\n\t\"grok-4-7\",\n\t// Thinking Machines (unified MLflow endpoint)\n\t\"inkling\",\n\t// Moonshot (unified MLflow endpoint)\n\t\"kimi-k3\",\n\t// DeepSeek (unified MLflow endpoint)\n\t\"deepseek-v4-1-flash\",\n] as const;\n\n/** A known Neon AI Gateway model id. */\nexport type NeonKnownModelId = (typeof NEON_MODELS_DEV_IDS)[number];\n\n/**\n * A Neon AI Gateway model id. Known ids are listed for autocomplete; any other\n * id (e.g. a brand-new model, or the legacy `databricks-` prefixed form) is\n * accepted via the `(string & {})` fallback.\n */\nexport type NeonChatModelId = NeonKnownModelId | (string & {});\n"],"mappings":";;AAiBA,MAAa,sBAAsB;CAElC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAEA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAEA;CACA;CAEA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAEA;CACA;CACA;CAEA;CACA;CAEA;CACA;CACA;CAEA;CACA;CAEA;CAEA;CAEA;AACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"neon-decision-model.d.ts","names":["APICallError","SharedV3Headers","SharedV3ProviderMetadata","SharedV3Warning","FetchFunction","ResponseHandler","NeonDecisionModelId","NeonDecisionInput","Record","Readonly","NeonDecisionQuestion","NeonDecisionStatePart","NeonDecisionCallOptions","AbortSignal","NeonDecisionAnswer","NeonDecisionResult","NeonDecisionModelConfig","NeonDecisionModel","state","questions","abortSignal","headers","Promise","APICallError","SharedV3Headers","SharedV3ProviderMetadata","SharedV3Warning","FetchFunction","ResponseHandler","NeonDecisionModelId","NeonDecisionInput","Readonly","Record","NeonDecisionQuestion","type","instructions","criteria","true","false","NeonDecisionStatePart","text","mediaType","data","value","NeonDecisionCallOptions","state","questions","abortSignal","AbortSignal","headers","NeonDecisionAnswer","choice","probabilities","score","probability","NeonDecisionResult","answers","rounding","probabilityDecimals","scoreDecimals","usage","inputTokens","outputTokens","warnings","providerMetadata","response","modelId","body","NeonDecisionModelConfig","provider","url","fetch","failedResponseHandler","NeonDecisionModel","specificationVersion","supportedQuestionTypes","config","constructor","doDecide","Promise"],"sources":["../../src/lib/neon-decision-model.ts"],"mappings":";;;;;;;AAqBA;AAAyC;AAMnB;AAEVQ,KARAF,mBAAAA,GAQAE,MAAAA;AAATC,KAFEF,iBAAAA,GAEFE,MAAAA,GAAAA,QAAAA,CAASD,MAATC,CAAAA,MAAAA,EAAAA,OAAAA,CAAAA,CAAAA,GAAAA,SAAAA,OAAAA,EAAAA;AAAQ,KAGCC,oBAAAA,GAHD;EAGCA,SAAAA,IAAAA,EAAAA,QAAoB;EAAA,SAAAyB,YAAA,EAGN5B,iBAHM;EAGNA,SAAAA,QAAAA,EACJE,QADIF,CAEtBC,MAFsBD,CAAAA,MAAAA,EAEPA,iBAFOA,GAAAA,IAAAA,CAAAA,CAAAA;AAEPA,CAAAA,GAAAA;EAAfC,SAAAA,IAAAA,EAAAA,OAAAA;EADkBC,SAAAA,YAAAA,EAMIF,iBANJE;EAMIF,SAAAA,QAAAA,EAAAA,SAAAA,CACMA,iBADNA,GAAAA,IAAAA,CAAAA,EAAAA;AACMA,CAAAA,GAAAA;EAINA,SAAAA,IAAAA,EAAAA,SAAAA;EAENA,SAAAA,YAAAA,EAFMA,iBAENA;EACCA,SAAAA,QAAAA,CAAAA,EAAAA;IAAiB,SAAA8B,IAAA,CAAA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AC,mBAAAA,CAAAA,EAAAA,MAAAA;IACAC,aAAAA,CAAAA,EAAAA,MAAAA;EACET,CAAAA;EAAkCG,KAAAA,CAAAA,EAAAA;IAARO,WAAAA,CAAAA,EAAAA,MAAAA;IAAOwC,YAAA,CAAA,EAAA,MAAA;;
|
|
1
|
+
{"version":3,"file":"neon-decision-model.d.ts","names":["APICallError","SharedV3Headers","SharedV3ProviderMetadata","SharedV3Warning","FetchFunction","ResponseHandler","NeonDecisionModelId","NeonDecisionInput","Record","Readonly","NeonDecisionQuestion","NeonDecisionStatePart","NeonDecisionCallOptions","AbortSignal","NeonDecisionAnswer","NeonDecisionResult","NeonDecisionModelConfig","NeonDecisionModel","state","questions","abortSignal","headers","Promise","APICallError","SharedV3Headers","SharedV3ProviderMetadata","SharedV3Warning","FetchFunction","ResponseHandler","NeonDecisionModelId","NeonDecisionInput","Readonly","Record","NeonDecisionQuestion","type","instructions","criteria","true","false","NeonDecisionStatePart","text","mediaType","data","value","NeonDecisionCallOptions","state","questions","abortSignal","AbortSignal","headers","NeonDecisionAnswer","choice","probabilities","score","probability","NeonDecisionResult","answers","rounding","probabilityDecimals","scoreDecimals","usage","inputTokens","outputTokens","warnings","providerMetadata","response","modelId","body","NeonDecisionModelConfig","provider","url","fetch","failedResponseHandler","NeonDecisionModel","specificationVersion","supportedQuestionTypes","config","constructor","doDecide","Promise"],"sources":["../../src/lib/neon-decision-model.ts"],"mappings":";;;;;;;AAqBA;AAAyC;AAMnB;AAEVQ,KARAF,mBAAAA,GAQAE,MAAAA;AAATC,KAFEF,iBAAAA,GAEFE,MAAAA,GAAAA,QAAAA,CAASD,MAATC,CAAAA,MAAAA,EAAAA,OAAAA,CAAAA,CAAAA,GAAAA,SAAAA,OAAAA,EAAAA;AAAQ,KAGCC,oBAAAA,GAHD;EAGCA,SAAAA,IAAAA,EAAAA,QAAoB;EAAA,SAAAyB,YAAA,EAGN5B,iBAHM;EAGNA,SAAAA,QAAAA,EACJE,QADIF,CAEtBC,MA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J,KAAAA,EAAAA,MAAAA;EAC+BJ,aAAAA,CAAAA,EAlBWQ,MAkBXR,CAAAA,MAAAA,EAAAA,MAAAA,CAAAA;AAAhBK,CAAAA,GAAAA;EAAe6B,IAAA,EAAA,SAAA;EAoC1BjB,WAAAA,EAAAA,MAAAA;AAAiB,CAAA,GAAA;EAGXX,IAAAA,EAAAA,SAAAA;AAGGA,CAAAA;AAA6BU,UAxDlCD,kBAAAA,CAwDkCC;EAUjDE,OAAAA,EAjEQV,MAiERU,CAAAA,MAAAA,EAjEuBJ,kBAiEvBI,CAAAA;EACAC,QAAAA,CAAAA,EAAAA;IACAC,mBAAAA,CAAAA,EAAAA,MAAAA;IACAC,aAAAA,CAAAA,EAAAA,MAAAA;EACET,CAAAA;EAAkCG,KAAAA,CAAAA,EAAAA;IAARO,WAAAA,CAAAA,EAAAA,MAAAA;IAAOwC,YAAA,CAAA,EAAA,MAAA;;E,UAlE1B3D,e;E,mBACSD,wB;;;I,UACsBD,e;;;;A,UAGzBe,uBAAAA,C;;;E,eAGDR,M;E,QACPJ,a;E,uBACeC,e,CAAgBL,Y;;;A,cAoC3BiB,iBAAAA,C;;;E,kBAGMX,mB;;E,qBAGGA,mB,UAA6BU,uB;;;;;;;E,GAc/CJ,uB,GAA0BU,O,CAAQP,kB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//#region src/lib/neon-embedding-options.d.ts
|
|
2
2
|
/** Published embedding model ids from https://neon.com/models.json. */
|
|
3
|
-
declare const NEON_EMBEDDING_MODEL_IDS: readonly ["gte-large-en", "qwen3-embedding-0-6b"];
|
|
3
|
+
declare const NEON_EMBEDDING_MODEL_IDS: readonly ["bge-large-en", "gte-large-en", "qwen3-embedding-0-6b"];
|
|
4
4
|
/**
|
|
5
5
|
* A Neon AI Gateway embedding model id. Known ids are listed for autocomplete;
|
|
6
6
|
* any other id is accepted via the `(string & {})` fallback.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"neon-embedding-options.d.ts","names":["NEON_EMBEDDING_MODEL_IDS","NeonEmbeddingModelId","NEON_MAX_EMBEDDINGS_PER_CALL","NEON_EMBEDDING_MODEL_IDS","NeonEmbeddingModelId","NEON_MAX_EMBEDDINGS_PER_CALL"],"sources":["../../src/lib/neon-embedding-options.ts"],"mappings":";;AAMaA,cAAAA,
|
|
1
|
+
{"version":3,"file":"neon-embedding-options.d.ts","names":["NEON_EMBEDDING_MODEL_IDS","NeonEmbeddingModelId","NEON_MAX_EMBEDDINGS_PER_CALL","NEON_EMBEDDING_MODEL_IDS","NeonEmbeddingModelId","NEON_MAX_EMBEDDINGS_PER_CALL"],"sources":["../../src/lib/neon-embedding-options.ts"],"mappings":";;AAMaA,cAAAA,wBAIH,EAAA,SAAA,CAAA,cAAA,EAAA,cAAA,EAAA,sBAAA,CAAA;AAMV;AAKA;;;A,KALYC,oBAAAA,G,QACDD,wB;;A,cAIEE,4BAAAA,G"}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
//#region src/lib/neon-embedding-options.ts
|
|
2
2
|
/** Published embedding model ids from https://neon.com/models.json. */
|
|
3
|
-
const NEON_EMBEDDING_MODEL_IDS = [
|
|
3
|
+
const NEON_EMBEDDING_MODEL_IDS = [
|
|
4
|
+
"bge-large-en",
|
|
5
|
+
"gte-large-en",
|
|
6
|
+
"qwen3-embedding-0-6b"
|
|
7
|
+
];
|
|
4
8
|
/** The gateway rejects an embeddings request with more inputs than this. */
|
|
5
9
|
const NEON_MAX_EMBEDDINGS_PER_CALL = 150;
|
|
6
10
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"neon-embedding-options.js","names":[],"sources":["../../src/lib/neon-embedding-options.ts"],"sourcesContent":["// Embedding models served on the Neon AI Gateway's OpenAI-compatible\n// `/v1/embeddings` endpoint. Mirrors the released `\"type\": \"embedding\"` entries\n// of https://neon.com/models.json — `neon-catalog-drift.test.ts` fails if the\n// two diverge.\n\n/** Published embedding model ids from https://neon.com/models.json. */\nexport const NEON_EMBEDDING_MODEL_IDS = [\n\t\"gte-large-en\",\n\t\"qwen3-embedding-0-6b\",\n] as const;\n\n/**\n * A Neon AI Gateway embedding model id. Known ids are listed for autocomplete;\n * any other id is accepted via the `(string & {})` fallback.\n */\nexport type NeonEmbeddingModelId =\n\t| (typeof NEON_EMBEDDING_MODEL_IDS)[number]\n\t| (string & {});\n\n/** The gateway rejects an embeddings request with more inputs than this. */\nexport const NEON_MAX_EMBEDDINGS_PER_CALL = 150;\n"],"mappings":";;AAMA,MAAa,2BAA2B
|
|
1
|
+
{"version":3,"file":"neon-embedding-options.js","names":[],"sources":["../../src/lib/neon-embedding-options.ts"],"sourcesContent":["// Embedding models served on the Neon AI Gateway's OpenAI-compatible\n// `/v1/embeddings` endpoint. Mirrors the released `\"type\": \"embedding\"` entries\n// of https://neon.com/models.json — `neon-catalog-drift.test.ts` fails if the\n// two diverge.\n\n/** Published embedding model ids from https://neon.com/models.json. */\nexport const NEON_EMBEDDING_MODEL_IDS = [\n\t\"bge-large-en\",\n\t\"gte-large-en\",\n\t\"qwen3-embedding-0-6b\",\n] as const;\n\n/**\n * A Neon AI Gateway embedding model id. Known ids are listed for autocomplete;\n * any other id is accepted via the `(string & {})` fallback.\n */\nexport type NeonEmbeddingModelId =\n\t| (typeof NEON_EMBEDDING_MODEL_IDS)[number]\n\t| (string & {});\n\n/** The gateway rejects an embeddings request with more inputs than this. */\nexport const NEON_MAX_EMBEDDINGS_PER_CALL = 150;\n"],"mappings":";;AAMA,MAAa,2BAA2B;CACvC;CACA;CACA;AACD;;AAWA,MAAa,+BAA+B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"neon-gateway-error.d.ts","names":["FetchFunction","GatewayErrorDialect","normalizeGatewayErrorBody","wrapFetchWithGatewayErrorNormalization","FetchFunction","GatewayErrorDialect","normalizeGatewayErrorBody","body","dialect","wrapFetchWithGatewayErrorNormalization","baseFetch"],"sources":["../../src/lib/neon-gateway-error.ts"],"mappings":";;;;;;AA4CA;AAqHA;AAiBA;AAAsD;AAC1CA;AACFC;AACPD;AAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAzIJC,mBAAAA;;;;;iBAqHIC,yBAAAA,
|
|
1
|
+
{"version":3,"file":"neon-gateway-error.d.ts","names":["FetchFunction","GatewayErrorDialect","normalizeGatewayErrorBody","wrapFetchWithGatewayErrorNormalization","FetchFunction","GatewayErrorDialect","normalizeGatewayErrorBody","body","dialect","wrapFetchWithGatewayErrorNormalization","baseFetch"],"sources":["../../src/lib/neon-gateway-error.ts"],"mappings":";;;;;;AA4CA;AAqHA;AAiBA;AAAsD;AAC1CA;AACFC;AACPD;AAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;A,KAzIJC,mBAAAA,G;;;;;A,iBAqHIC,yBAAAA,C,wBAEND,mB;;A,iBAeME,sCAAAA,C,WACJH,a,uBACFC,mB,GACPD,a"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"neon-harmony-normalize.d.ts","names":["FetchFunction","ExtractedHarmony","NormalizeResult","extractHarmonyContent","normalizeCompletionBody","normalizeChunkBody","wrapFetchWithHarmonyNormalization","FetchFunction","ExtractedHarmony","text","reasoning","NormalizeResult","body","changed","extractHarmonyContent","content","normalizeCompletionBody","normalizeChunkBody","wrapFetchWithHarmonyNormalization","baseFetch"],"sources":["../../src/lib/neon-harmony-normalize.ts"],"mappings":";;;UAwCUC,gBAAAA;;EAAAA,SAAAA,EAAAA,MAAAA;AAAgB;AAgB1B;AAkDA,UA5DUC,eAAAA,CA4DME;EAkCAC,IAAAA,EAAAA,OAAAA;EAuGAC,OAAAA,EAAAA,OAAAA;AAAiC;AACpCN;AACVA;AAAa;;;iBA7LAG,qBAAAA,
|
|
1
|
+
{"version":3,"file":"neon-harmony-normalize.d.ts","names":["FetchFunction","ExtractedHarmony","NormalizeResult","extractHarmonyContent","normalizeCompletionBody","normalizeChunkBody","wrapFetchWithHarmonyNormalization","FetchFunction","ExtractedHarmony","text","reasoning","NormalizeResult","body","changed","extractHarmonyContent","content","normalizeCompletionBody","normalizeChunkBody","wrapFetchWithHarmonyNormalization","baseFetch"],"sources":["../../src/lib/neon-harmony-normalize.ts"],"mappings":";;;A,UAwCUC,gBAAAA,C;;EAAAA,SAAAA,EAAAA,MAAAA;AAAgB;AAgB1B;AAkDA,UA5DUC,eAAAA,CA4DME;EAkCAC,IAAAA,EAAAA,OAAAA;EAuGAC,OAAAA,EAAAA,OAAAA;AAAiC;AACpCN;AACVA;AAAa;;;A,iBA7LAG,qBAAAA,C,mBAEbF,gB;;;;;A,iBAgDaG,uBAAAA,C,gBAAwCF,e;;;;;A,iBAkCxCG,kBAAAA,C,gBAAmCH,e;;;;;;;;;;A,iBAuGnCI,iCAAAA,C,YACHN,a,GACVA,a"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"neon-model-capabilities.d.ts","names":["NeonModelFamily","NeonModelRoute","getNeonModelRoute","NeonModelCapabilities","getNeonModelCapabilities","NeonModelFamily","NeonModelRoute","getNeonModelRoute","modelId","NeonModelCapabilities","family","supportsTemperature","supportsTopP","temperatureTopPMutuallyExclusive","supportsPenalties","supportsSeed","supportsStopSequences","supportsReasoningEffort","claudeSamplingUnrecognized","getNeonModelCapabilities"],"sources":["../../src/lib/neon-model-capabilities.ts"],"mappings":";KAAYA,eAAAA;AAAZ;AAiBA;AAEA;AAiBA;
|
|
1
|
+
{"version":3,"file":"neon-model-capabilities.d.ts","names":["NeonModelFamily","NeonModelRoute","getNeonModelRoute","NeonModelCapabilities","getNeonModelCapabilities","NeonModelFamily","NeonModelRoute","getNeonModelRoute","modelId","NeonModelCapabilities","family","supportsTemperature","supportsTopP","temperatureTopPMutuallyExclusive","supportsPenalties","supportsSeed","supportsStopSequences","supportsReasoningEffort","claudeSamplingUnrecognized","getNeonModelCapabilities"],"sources":["../../src/lib/neon-model-capabilities.ts"],"mappings":";A,KAAYA,eAAAA,G;AAAZ;AAiBA;AAEA;AAiBA;AAoIA;;;;;;A,KAvJYC,cAAAA,G;A,iBAEIC,iBAAAA,C,kBAAoCD,c;A,UAiBnCE,qBAAAA,C;E,QACRH,e;;;;;;;;;;;;;;;;;;;;;;;;;;;;;A,iBAmIOI,wBAAAA,C,kBAEbD,qB"}
|
|
@@ -14,17 +14,54 @@ function getNeonModelRoute(modelId) {
|
|
|
14
14
|
* restriction on the strength of a shared prefix is how the Gemini rule was
|
|
15
15
|
* wrong for these two in the first place.
|
|
16
16
|
*/
|
|
17
|
-
const GEMINI_NO_PENALTIES = /* @__PURE__ */ new Set([
|
|
17
|
+
const GEMINI_NO_PENALTIES = /* @__PURE__ */ new Set([
|
|
18
|
+
"gemini-3-5-flash-lite",
|
|
19
|
+
"gemini-3-6-flash",
|
|
20
|
+
"gemini-3-7-flash",
|
|
21
|
+
"gemini-3-8-flash",
|
|
22
|
+
"gemini-4-argon"
|
|
23
|
+
]);
|
|
18
24
|
/** Gemini models that reject `temperature` and `topP` outright. */
|
|
19
|
-
const GEMINI_NO_SAMPLING = /* @__PURE__ */ new Set([
|
|
25
|
+
const GEMINI_NO_SAMPLING = /* @__PURE__ */ new Set([
|
|
26
|
+
"gemini-3-6-flash",
|
|
27
|
+
"gemini-3-7-flash",
|
|
28
|
+
"gemini-3-8-flash",
|
|
29
|
+
"gemini-4-argon"
|
|
30
|
+
]);
|
|
20
31
|
/**
|
|
21
32
|
* GPT-5 ids that reject `temperature` despite carrying a minor version.
|
|
22
33
|
*
|
|
23
34
|
* The version rule below reads `gpt-5-5-pro` as 5.5 and concludes it takes
|
|
24
35
|
* sampling parameters. It does not — the Responses API answers
|
|
25
|
-
* `Unsupported parameter: temperature`.
|
|
36
|
+
* `Unsupported parameter: temperature`. Measured the same for `top_p`, and for
|
|
37
|
+
* gpt-5.5 and the gpt-5.6 family at their default reasoning effort.
|
|
38
|
+
*
|
|
39
|
+
* The Responses API accepts `temperature` and `top_p` only when reasoning effort
|
|
40
|
+
* is `none`, so these values describe each model's default effort. gpt-5.1
|
|
41
|
+
* through gpt-5.4 default to `none` and accept both; with effort `low` they
|
|
42
|
+
* reject them too. gpt-5.5 and gpt-5.6 accept both when effort is `none`.
|
|
43
|
+
*/
|
|
44
|
+
const GPT5_NO_SAMPLING = /* @__PURE__ */ new Set([
|
|
45
|
+
"gpt-5-5",
|
|
46
|
+
"gpt-5-5-pro",
|
|
47
|
+
"gpt-5-6-luna",
|
|
48
|
+
"gpt-5-6-sol",
|
|
49
|
+
"gpt-5-6-terra"
|
|
50
|
+
]);
|
|
51
|
+
/**
|
|
52
|
+
* GPT-6 ids that reject `temperature` and `top_p` on the Responses API at their
|
|
53
|
+
* default reasoning effort
|
|
54
|
+
* (`Unsupported parameter: 'temperature' is not supported with this model`).
|
|
55
|
+
* gpt-6-sol and gpt-6-luna accept both when effort is `none`; gpt-6-astra and
|
|
56
|
+
* gpt-6-1-sol reject effort `none`, so they never accept them.
|
|
57
|
+
* Exact ids: a future gpt-6-* is unmeasured.
|
|
26
58
|
*/
|
|
27
|
-
const
|
|
59
|
+
const GPT6_NO_SAMPLING = /* @__PURE__ */ new Set([
|
|
60
|
+
"gpt-6-1-sol",
|
|
61
|
+
"gpt-6-astra",
|
|
62
|
+
"gpt-6-luna",
|
|
63
|
+
"gpt-6-sol"
|
|
64
|
+
]);
|
|
28
65
|
/**
|
|
29
66
|
* The gateway accepts an optional `databricks-` prefix on any id, so strip it
|
|
30
67
|
* before an exact-match lookup. Prefix rules elsewhere in this file tolerate it
|
|
@@ -106,10 +143,10 @@ function getNeonModelCapabilities(modelId) {
|
|
|
106
143
|
supportsReasoningEffort: true
|
|
107
144
|
};
|
|
108
145
|
}
|
|
109
|
-
if (canonicalId(id)
|
|
146
|
+
if (GPT6_NO_SAMPLING.has(canonicalId(id))) return {
|
|
110
147
|
family: "openai",
|
|
111
148
|
supportsTemperature: false,
|
|
112
|
-
supportsTopP:
|
|
149
|
+
supportsTopP: false,
|
|
113
150
|
temperatureTopPMutuallyExclusive: false,
|
|
114
151
|
supportsPenalties: true,
|
|
115
152
|
supportsSeed: true,
|
|
@@ -139,7 +176,7 @@ function getNeonModelCapabilities(modelId) {
|
|
|
139
176
|
supportsPenalties: false,
|
|
140
177
|
supportsSeed: false
|
|
141
178
|
};
|
|
142
|
-
if (id.includes("glm") || id.includes("inkling") || id.includes("kimi")) return {
|
|
179
|
+
if (id.includes("glm") || id.includes("inkling") || id.includes("kimi") || id.includes("grok") || id.includes("deepseek")) return {
|
|
143
180
|
family: "other",
|
|
144
181
|
...PERMISSIVE,
|
|
145
182
|
supportsPenalties: false
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"neon-model-capabilities.js","names":[],"sources":["../../src/lib/neon-model-capabilities.ts"],"sourcesContent":["export type NeonModelFamily =\n\t| \"anthropic\"\n\t| \"google\"\n\t| \"openai\"\n\t| \"meta\"\n\t| \"other\";\n\n/**\n * Which gateway endpoint a model should be routed to.\n *\n * - `anthropic`: native Messages API — streaming structured output + native reasoning.\n * - `openai`: native Responses API — models served only natively (e.g. Codex),\n * native reasoning, and the image-generation tool.\n * - `mlflow`: the unified, OpenAI-compatible endpoint (the fallback). Gemini is\n * routed here because the gateway's native Gemini endpoint does not support\n * streaming (`streamGenerateContent` is rejected).\n */\nexport type NeonModelRoute = \"anthropic\" | \"openai\" | \"mlflow\";\n\nexport function getNeonModelRoute(modelId: string): NeonModelRoute {\n\tconst id = modelId.toLowerCase();\n\tif (id.includes(\"claude\")) {\n\t\treturn \"anthropic\";\n\t}\n\t// OpenAI proprietary models (gpt-4/gpt-5 families, Codex) are served only via\n\t// the native Responses API. `gpt-oss` is open-weight and served on the\n\t// unified chat endpoint, so it is intentionally excluded here.\n\tif (\n\t\t(id.includes(\"gpt-\") && !id.includes(\"gpt-oss\")) ||\n\t\tid.includes(\"codex\")\n\t) {\n\t\treturn \"openai\";\n\t}\n\treturn \"mlflow\";\n}\n\nexport interface NeonModelCapabilities {\n\tfamily: NeonModelFamily;\n\tsupportsTemperature: boolean;\n\tsupportsTopP: boolean;\n\t/**\n\t * Whether `temperature` and `topP` may be sent together. Anthropic models\n\t * accept only one of the two.\n\t */\n\ttemperatureTopPMutuallyExclusive: boolean;\n\tsupportsPenalties: boolean;\n\tsupportsSeed: boolean;\n\tsupportsStopSequences: boolean;\n\tsupportsReasoningEffort: boolean;\n\t/**\n\t * True when a `claude-*` id could not be parsed into a version and was\n\t * assumed to be new. The sampling restriction is then a precaution rather\n\t * than something measured, and the warning says so instead of asserting a\n\t * capability nobody checked.\n\t */\n\tclaudeSamplingUnrecognized?: boolean;\n}\n\n/**\n * Gemini models the gateway rejects penalties on, by measurement. Their older\n * siblings accept them, so this cannot be derived from the id.\n *\n * Matched exactly rather than by substring: `gemini-3-6-flash` is a prefix of\n * any `gemini-3-6-flash-*` id Google may ship next, and inheriting a measured\n * restriction on the strength of a shared prefix is how the Gemini rule was\n * wrong for these two in the first place.\n */\nconst GEMINI_NO_PENALTIES = new Set([\n\t\"gemini-3-5-flash-lite\",\n\t\"gemini-3-6-flash\",\n]);\n\n/** Gemini models that reject `temperature` and `topP` outright. */\nconst GEMINI_NO_SAMPLING = new Set([\"gemini-3-6-flash\"]);\n\n/**\n * GPT-5 ids that reject `temperature` despite carrying a minor version.\n *\n * The version rule below reads `gpt-5-5-pro` as 5.5 and concludes it takes\n * sampling parameters. It does not — the Responses API answers\n * `Unsupported parameter: temperature`.\n */\nconst GPT5_NO_SAMPLING = new Set([\"gpt-5-5-pro\"]);\n\n/**\n * The gateway accepts an optional `databricks-` prefix on any id, so strip it\n * before an exact-match lookup. Prefix rules elsewhere in this file tolerate it\n * incidentally; exact matches do not.\n */\nfunction canonicalId(id: string): string {\n\treturn id.startsWith(\"databricks-\") ? id.slice(\"databricks-\".length) : id;\n}\n\nconst PERMISSIVE: Omit<NeonModelCapabilities, \"family\"> = {\n\tsupportsTemperature: true,\n\tsupportsTopP: true,\n\ttemperatureTopPMutuallyExclusive: false,\n\tsupportsPenalties: true,\n\tsupportsSeed: true,\n\tsupportsStopSequences: true,\n\tsupportsReasoningEffort: true,\n};\n\n/**\n * Whether a Claude id predates the 4.7 cutoff where the gateway stopped\n * accepting `temperature` and `top_p`. Ids look like `claude-<tier>-<major>` or\n * `claude-<tier>-<major>-<minor>`, optionally behind the legacy `databricks-`\n * prefix. An id we cannot parse is treated as new, which is the safe direction.\n */\nfunction claudeVersion(id: string): { major: number; minor: number } | null {\n\t// Anchored: `claude-opus-4-beta` and `claude-opus-4.7` must not match their\n\t// leading digits and be read as old models. A dated id such as\n\t// `claude-3-5-sonnet-20241022` does not parse either, and is reported as\n\t// unrecognised rather than silently classified.\n\tconst match = /^(?:databricks-)?claude-[a-z]+-(\\d+)(?:-(\\d+))?$/.exec(id);\n\tif (!match) {\n\t\treturn null;\n\t}\n\treturn {\n\t\tmajor: Number(match[1]),\n\t\tminor: match[2] === undefined ? 0 : Number(match[2]),\n\t};\n}\n\n/**\n * Heuristic, prefix-based capability detection for MLflow-routed Neon models.\n *\n * The unified endpoint proxies to heterogeneous upstream providers, each of\n * which accepts a different subset of the OpenAI-style parameters the AI SDK\n * emits. Sending a parameter an upstream rejects results in a hard `400`, so we\n * strip the parameters a family is known to reject and surface a warning\n * instead. Unknown/untested models stay permissive (passed through unchanged).\n */\nexport function getNeonModelCapabilities(\n\tmodelId: string,\n): NeonModelCapabilities {\n\tconst id = modelId.toLowerCase();\n\n\t// Anthropic (Claude): rejects penalties and seed, accepts only one of\n\t// temperature/topP, and rejects the OpenAI `reasoning_effort` field.\n\t//\n\t// From Claude 4.7 onward the gateway also rejects non-default sampling\n\t// entirely — `does not support the temperature parameter` /\n\t// `does not support sampling parameters: top_p` — because those models are\n\t// steered with `output_config.effort` instead. Measured: 4.1/4.5/4.6 accept\n\t// both, 4.7/4.8/5 reject both, and every id accepts the default\n\t// `temperature: 1.0`. A version comparison rather than a list of ids, so a\n\t// future Claude inherits the restriction: dropping a parameter the model\n\t// would have accepted costs a warning, claiming one it rejects costs a 400.\n\tif (id.includes(\"claude\")) {\n\t\tconst version = claudeVersion(id);\n\t\tconst sampling =\n\t\t\tversion !== null &&\n\t\t\t(version.major < 4 || (version.major === 4 && version.minor <= 6));\n\t\treturn {\n\t\t\tfamily: \"anthropic\",\n\t\t\tsupportsTemperature: sampling,\n\t\t\tsupportsTopP: sampling,\n\t\t\ttemperatureTopPMutuallyExclusive: true,\n\t\t\tsupportsPenalties: false,\n\t\t\tsupportsSeed: false,\n\t\t\tsupportsStopSequences: true,\n\t\t\tsupportsReasoningEffort: false,\n\t\t\t...(version === null ? { claudeSamplingUnrecognized: true } : {}),\n\t\t};\n\t}\n\n\t// Google (Gemini): accepts standard sampling params, and does take\n\t// `reasoning_effort` — the gateway maps it onto Gemini's thinking config.\n\t// Measured on gemini-3-6-flash: `minimal` produces 0 reasoning tokens and\n\t// `high` produces 310, against 130 with the field absent.\n\t//\n\t// Newer Gemini models are stricter, and not in a way the id predicts: the\n\t// gateway rejects penalties on `gemini-3-5-flash-lite` while accepting them\n\t// on `gemini-3-1-flash-lite`, so neither the version nor the `-lite` suffix\n\t// is the rule. `gemini-3-6-flash` refuses temperature and topP outright\n\t// (\"does not support the temperature parameter\"). Both are listed by id\n\t// because that is what was measured; a new Gemini model inherits the\n\t// permissive default until someone measures it.\n\tif (id.includes(\"gemini\")) {\n\t\tconst canonical = canonicalId(id);\n\t\tconst acceptsSampling = !GEMINI_NO_SAMPLING.has(canonical);\n\t\treturn {\n\t\t\tfamily: \"google\",\n\t\t\t...PERMISSIVE,\n\t\t\tsupportsTemperature: acceptsSampling,\n\t\t\tsupportsTopP: acceptsSampling,\n\t\t\tsupportsPenalties: !GEMINI_NO_PENALTIES.has(canonical),\n\t\t};\n\t}\n\n\t// OpenAI GPT-5 reasoning family (routed to the native Responses API). The\n\t// Responses model strips parameters the Responses API doesn't accept\n\t// (penalties, seed, stop), but its reasoning-model detection matches the bare\n\t// model id (`gpt-5`), which the gateway's optional `databricks-` prefix can\n\t// defeat. So we only handle the temperature/topP restriction here: the\n\t// original gpt-5 / gpt-5-mini / gpt-5-nano require the default temperature and\n\t// reject topP, while gpt-5.1+ (a minor version digit follows) accept them\n\t// again. The regex matches both prefixed and unprefixed ids.\n\tif (/gpt-5/.test(id)) {\n\t\tconst hasMinorVersion =\n\t\t\t/gpt-5[.-]\\d/.test(id) && !GPT5_NO_SAMPLING.has(canonicalId(id));\n\t\treturn {\n\t\t\tfamily: \"openai\",\n\t\t\tsupportsTemperature: hasMinorVersion,\n\t\t\tsupportsTopP: hasMinorVersion,\n\t\t\ttemperatureTopPMutuallyExclusive: false,\n\t\t\tsupportsPenalties: true,\n\t\t\tsupportsSeed: true,\n\t\t\tsupportsStopSequences: true,\n\t\t\tsupportsReasoningEffort: true,\n\t\t};\n\t}\n\n\t// Catalog `temperature: false` on gpt-6-astra; the gpt-5 minor-version rule\n\t// does not match gpt-6. Exact id: a future gpt-6-* is unmeasured.\n\tif (canonicalId(id) === \"gpt-6-astra\") {\n\t\treturn {\n\t\t\tfamily: \"openai\",\n\t\t\tsupportsTemperature: false,\n\t\t\tsupportsTopP: true,\n\t\t\ttemperatureTopPMutuallyExclusive: false,\n\t\t\tsupportsPenalties: true,\n\t\t\tsupportsSeed: true,\n\t\t\tsupportsStopSequences: true,\n\t\t\tsupportsReasoningEffort: true,\n\t\t};\n\t}\n\n\t// Meta (Llama): rejects penalties and seed; accepts sampling params and stop.\n\tif (id.includes(\"llama\")) {\n\t\treturn {\n\t\t\tfamily: \"meta\",\n\t\t\tsupportsTemperature: true,\n\t\t\tsupportsTopP: true,\n\t\t\ttemperatureTopPMutuallyExclusive: false,\n\t\t\tsupportsPenalties: false,\n\t\t\tsupportsSeed: false,\n\t\t\tsupportsStopSequences: true,\n\t\t\tsupportsReasoningEffort: true,\n\t\t};\n\t}\n\n\t// Everything else on the unified endpoint rejects penalties with\n\t// `parameter \"frequency_penalty\" must be equal to 0`. Only the older Gemini\n\t// models, handled above, accept them. Seed and stop vary, so each family\n\t// carries what was measured rather than inheriting a guess.\n\tif (id.includes(\"gpt-oss\")) {\n\t\treturn {\n\t\t\tfamily: \"other\",\n\t\t\t...PERMISSIVE,\n\t\t\tsupportsPenalties: false,\n\t\t\tsupportsSeed: false,\n\t\t\tsupportsStopSequences: false,\n\t\t};\n\t}\n\n\tif (id.includes(\"qwen\") || id.includes(\"gemma\")) {\n\t\treturn {\n\t\t\tfamily: \"other\",\n\t\t\t...PERMISSIVE,\n\t\t\tsupportsPenalties: false,\n\t\t\tsupportsSeed: false,\n\t\t};\n\t}\n\n\tif (id.includes(\"glm\") || id.includes(\"inkling\") || id.includes(\"kimi\")) {\n\t\treturn { family: \"other\", ...PERMISSIVE, supportsPenalties: false };\n\t}\n\n\treturn { family: \"other\", ...PERMISSIVE };\n}\n"],"mappings":";AAmBA,SAAgB,kBAAkB,SAAiC;CAClE,MAAM,KAAK,QAAQ,YAAY;CAC/B,IAAI,GAAG,SAAS,QAAQ,GACvB,OAAO;CAKR,IACE,GAAG,SAAS,MAAM,KAAK,CAAC,GAAG,SAAS,SAAS,KAC9C,GAAG,SAAS,OAAO,GAEnB,OAAO;CAER,OAAO;AACR;;;;;;;;;;AAiCA,MAAM,sCAAsB,IAAI,IAAI,CACnC,yBACA,kBACD,CAAC;;AAGD,MAAM,qCAAqB,IAAI,IAAI,CAAC,kBAAkB,CAAC;;;;;;;;AASvD,MAAM,mCAAmB,IAAI,IAAI,CAAC,aAAa,CAAC;;;;;;AAOhD,SAAS,YAAY,IAAoB;CACxC,OAAO,GAAG,WAAW,aAAa,IAAI,GAAG,MAAM,EAAoB,IAAI;AACxE;AAEA,MAAM,aAAoD;CACzD,qBAAqB;CACrB,cAAc;CACd,kCAAkC;CAClC,mBAAmB;CACnB,cAAc;CACd,uBAAuB;CACvB,yBAAyB;AAC1B;;;;;;;AAQA,SAAS,cAAc,IAAqD;CAK3E,MAAM,QAAQ,mDAAmD,KAAK,EAAE;CACxE,IAAI,CAAC,OACJ,OAAO;CAER,OAAO;EACN,OAAO,OAAO,MAAM,EAAE;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ACvB,yBAAyB;CAC1B;CAOD,IAAI,GAAG,SAAS,SAAS,GACxB,OAAO;EACN,QAAQ;EACR,GAAG;EACH,mBAAmB;EACnB,cAAc;EACd,uBAAuB;CACxB;CAGD,IAAI,GAAG,SAAS,MAAM,KAAK,GAAG,SAAS,OAAO,GAC7C,OAAO;EACN,QAAQ;EACR,GAAG;EACH,mBAAmB;EACnB,cAAc;CACf;CAGD,IAAI,GAAG,SAAS,KAAK,KAAK,GAAG,SAAS,SAAS,KAAK,GAAG,SAAS,MAAM,GACrE,OAAO;EAAE,QAAQ;EAAS,GAAG;EAAY,mBAAmB;CAAM;CAGnE,OAAO;EAAE,QAAQ;EAAS,GAAG;CAAW;AACzC"}
|
|
1
|
+
{"version":3,"file":"neon-model-capabilities.js","names":[],"sources":["../../src/lib/neon-model-capabilities.ts"],"sourcesContent":["export type NeonModelFamily =\n\t| \"anthropic\"\n\t| \"google\"\n\t| \"openai\"\n\t| \"meta\"\n\t| \"other\";\n\n/**\n * Which gateway endpoint a model should be routed to.\n *\n * - `anthropic`: native Messages API — streaming structured output + native reasoning.\n * - `openai`: native Responses API — models served only natively (e.g. Codex),\n * native reasoning, and the image-generation tool.\n * - `mlflow`: the unified, OpenAI-compatible endpoint (the fallback). Gemini is\n * routed here because the gateway's native Gemini endpoint does not support\n * streaming (`streamGenerateContent` is rejected).\n */\nexport type NeonModelRoute = \"anthropic\" | \"openai\" | \"mlflow\";\n\nexport function getNeonModelRoute(modelId: string): NeonModelRoute {\n\tconst id = modelId.toLowerCase();\n\tif (id.includes(\"claude\")) {\n\t\treturn \"anthropic\";\n\t}\n\t// OpenAI proprietary models (gpt-4/gpt-5 families, Codex) are served only via\n\t// the native Responses API. `gpt-oss` is open-weight and served on the\n\t// unified chat endpoint, so it is intentionally excluded here.\n\tif (\n\t\t(id.includes(\"gpt-\") && !id.includes(\"gpt-oss\")) ||\n\t\tid.includes(\"codex\")\n\t) {\n\t\treturn \"openai\";\n\t}\n\treturn \"mlflow\";\n}\n\nexport interface NeonModelCapabilities {\n\tfamily: NeonModelFamily;\n\tsupportsTemperature: boolean;\n\tsupportsTopP: boolean;\n\t/**\n\t * Whether `temperature` and `topP` may be sent together. Anthropic models\n\t * accept only one of the two.\n\t */\n\ttemperatureTopPMutuallyExclusive: boolean;\n\tsupportsPenalties: boolean;\n\tsupportsSeed: boolean;\n\tsupportsStopSequences: boolean;\n\tsupportsReasoningEffort: boolean;\n\t/**\n\t * True when a `claude-*` id could not be parsed into a version and was\n\t * assumed to be new. The sampling restriction is then a precaution rather\n\t * than something measured, and the warning says so instead of asserting a\n\t * capability nobody checked.\n\t */\n\tclaudeSamplingUnrecognized?: boolean;\n}\n\n/**\n * Gemini models the gateway rejects penalties on, by measurement. Their older\n * siblings accept them, so this cannot be derived from the id.\n *\n * Matched exactly rather than by substring: `gemini-3-6-flash` is a prefix of\n * any `gemini-3-6-flash-*` id Google may ship next, and inheriting a measured\n * restriction on the strength of a shared prefix is how the Gemini rule was\n * wrong for these two in the first place.\n */\nconst GEMINI_NO_PENALTIES = new Set([\n\t\"gemini-3-5-flash-lite\",\n\t\"gemini-3-6-flash\",\n\t\"gemini-3-7-flash\",\n\t\"gemini-3-8-flash\",\n\t\"gemini-4-argon\",\n]);\n\n/** Gemini models that reject `temperature` and `topP` outright. */\nconst GEMINI_NO_SAMPLING = new Set([\n\t\"gemini-3-6-flash\",\n\t\"gemini-3-7-flash\",\n\t\"gemini-3-8-flash\",\n\t\"gemini-4-argon\",\n]);\n\n/**\n * GPT-5 ids that reject `temperature` despite carrying a minor version.\n *\n * The version rule below reads `gpt-5-5-pro` as 5.5 and concludes it takes\n * sampling parameters. It does not — the Responses API answers\n * `Unsupported parameter: temperature`. Measured the same for `top_p`, and for\n * gpt-5.5 and the gpt-5.6 family at their default reasoning effort.\n *\n * The Responses API accepts `temperature` and `top_p` only when reasoning effort\n * is `none`, so these values describe each model's default effort. gpt-5.1\n * through gpt-5.4 default to `none` and accept both; with effort `low` they\n * reject them too. gpt-5.5 and gpt-5.6 accept both when effort is `none`.\n */\nconst GPT5_NO_SAMPLING = new Set([\n\t\"gpt-5-5\",\n\t\"gpt-5-5-pro\",\n\t\"gpt-5-6-luna\",\n\t\"gpt-5-6-sol\",\n\t\"gpt-5-6-terra\",\n]);\n\n/**\n * GPT-6 ids that reject `temperature` and `top_p` on the Responses API at their\n * default reasoning effort\n * (`Unsupported parameter: 'temperature' is not supported with this model`).\n * gpt-6-sol and gpt-6-luna accept both when effort is `none`; gpt-6-astra and\n * gpt-6-1-sol reject effort `none`, so they never accept them.\n * Exact ids: a future gpt-6-* is unmeasured.\n */\nconst GPT6_NO_SAMPLING = new Set([\n\t\"gpt-6-1-sol\",\n\t\"gpt-6-astra\",\n\t\"gpt-6-luna\",\n\t\"gpt-6-sol\",\n]);\n\n/**\n * The gateway accepts an optional `databricks-` prefix on any id, so strip it\n * before an exact-match lookup. Prefix rules elsewhere in this file tolerate it\n * incidentally; exact matches do not.\n */\nfunction canonicalId(id: string): string {\n\treturn id.startsWith(\"databricks-\") ? id.slice(\"databricks-\".length) : id;\n}\n\nconst PERMISSIVE: Omit<NeonModelCapabilities, \"family\"> = {\n\tsupportsTemperature: true,\n\tsupportsTopP: true,\n\ttemperatureTopPMutuallyExclusive: false,\n\tsupportsPenalties: true,\n\tsupportsSeed: true,\n\tsupportsStopSequences: true,\n\tsupportsReasoningEffort: true,\n};\n\n/**\n * Whether a Claude id predates the 4.7 cutoff where the gateway stopped\n * accepting `temperature` and `top_p`. Ids look like `claude-<tier>-<major>` or\n * `claude-<tier>-<major>-<minor>`, optionally behind the legacy `databricks-`\n * prefix. An id we cannot parse is treated as new, which is the safe direction.\n */\nfunction claudeVersion(id: string): { major: number; minor: number } | null {\n\t// Anchored: `claude-opus-4-beta` and `claude-opus-4.7` must not match their\n\t// leading digits and be read as old models. A dated id such as\n\t// `claude-3-5-sonnet-20241022` does not parse either, and is reported as\n\t// unrecognised rather than silently classified.\n\tconst match = /^(?:databricks-)?claude-[a-z]+-(\\d+)(?:-(\\d+))?$/.exec(id);\n\tif (!match) {\n\t\treturn null;\n\t}\n\treturn {\n\t\tmajor: Number(match[1]),\n\t\tminor: match[2] === undefined ? 0 : Number(match[2]),\n\t};\n}\n\n/**\n * Heuristic, prefix-based capability detection for MLflow-routed Neon models.\n *\n * The unified endpoint proxies to heterogeneous upstream providers, each of\n * which accepts a different subset of the OpenAI-style parameters the AI SDK\n * emits. Sending a parameter an upstream rejects results in a hard `400`, so we\n * strip the parameters a family is known to reject and surface a warning\n * instead. Unknown/untested models stay permissive (passed through unchanged).\n */\nexport function getNeonModelCapabilities(\n\tmodelId: string,\n): NeonModelCapabilities {\n\tconst id = modelId.toLowerCase();\n\n\t// Anthropic (Claude): rejects penalties and seed, accepts only one of\n\t// temperature/topP, and rejects the OpenAI `reasoning_effort` field.\n\t//\n\t// From Claude 4.7 onward the gateway also rejects non-default sampling\n\t// entirely — `does not support the temperature parameter` /\n\t// `does not support sampling parameters: top_p` — because those models are\n\t// steered with `output_config.effort` instead. Measured: 4.1/4.5/4.6 accept\n\t// both, 4.7/4.8/5 reject both, and every id accepts the default\n\t// `temperature: 1.0`. A version comparison rather than a list of ids, so a\n\t// future Claude inherits the restriction: dropping a parameter the model\n\t// would have accepted costs a warning, claiming one it rejects costs a 400.\n\tif (id.includes(\"claude\")) {\n\t\tconst version = claudeVersion(id);\n\t\tconst sampling =\n\t\t\tversion !== null &&\n\t\t\t(version.major < 4 || (version.major === 4 && version.minor <= 6));\n\t\treturn {\n\t\t\tfamily: \"anthropic\",\n\t\t\tsupportsTemperature: sampling,\n\t\t\tsupportsTopP: sampling,\n\t\t\ttemperatureTopPMutuallyExclusive: true,\n\t\t\tsupportsPenalties: false,\n\t\t\tsupportsSeed: false,\n\t\t\tsupportsStopSequences: true,\n\t\t\tsupportsReasoningEffort: false,\n\t\t\t...(version === null ? { claudeSamplingUnrecognized: true } : {}),\n\t\t};\n\t}\n\n\t// Google (Gemini): accepts standard sampling params, and does take\n\t// `reasoning_effort` — the gateway maps it onto Gemini's thinking config.\n\t// Measured on gemini-3-6-flash: `minimal` produces 0 reasoning tokens and\n\t// `high` produces 310, against 130 with the field absent.\n\t//\n\t// Newer Gemini models are stricter, and not in a way the id predicts: the\n\t// gateway rejects penalties on `gemini-3-5-flash-lite` while accepting them\n\t// on `gemini-3-1-flash-lite`, so neither the version nor the `-lite` suffix\n\t// is the rule. The `GEMINI_NO_SAMPLING` ids refuse temperature and topP\n\t// outright (\"does not support the temperature parameter\"). Both sets above\n\t// are listed by id because that is what was measured; a new Gemini model\n\t// inherits the permissive default until someone measures it.\n\tif (id.includes(\"gemini\")) {\n\t\tconst canonical = canonicalId(id);\n\t\tconst acceptsSampling = !GEMINI_NO_SAMPLING.has(canonical);\n\t\treturn {\n\t\t\tfamily: \"google\",\n\t\t\t...PERMISSIVE,\n\t\t\tsupportsTemperature: acceptsSampling,\n\t\t\tsupportsTopP: acceptsSampling,\n\t\t\tsupportsPenalties: !GEMINI_NO_PENALTIES.has(canonical),\n\t\t};\n\t}\n\n\t// OpenAI GPT-5 reasoning family (routed to the native Responses API). The\n\t// Responses model strips parameters the Responses API doesn't accept\n\t// (penalties, seed, stop), but its reasoning-model detection matches the bare\n\t// model id (`gpt-5`), which the gateway's optional `databricks-` prefix can\n\t// defeat. So we only handle the temperature/topP restriction here: the\n\t// original gpt-5 / gpt-5-mini / gpt-5-nano require the default temperature and\n\t// reject topP, while gpt-5.1+ (a minor version digit follows) accept them\n\t// again. The regex matches both prefixed and unprefixed ids.\n\tif (/gpt-5/.test(id)) {\n\t\tconst hasMinorVersion =\n\t\t\t/gpt-5[.-]\\d/.test(id) && !GPT5_NO_SAMPLING.has(canonicalId(id));\n\t\treturn {\n\t\t\tfamily: \"openai\",\n\t\t\tsupportsTemperature: hasMinorVersion,\n\t\t\tsupportsTopP: hasMinorVersion,\n\t\t\ttemperatureTopPMutuallyExclusive: false,\n\t\t\tsupportsPenalties: true,\n\t\t\tsupportsSeed: true,\n\t\t\tsupportsStopSequences: true,\n\t\t\tsupportsReasoningEffort: true,\n\t\t};\n\t}\n\n\t// The gpt-5 minor-version rule does not match gpt-6.\n\tif (GPT6_NO_SAMPLING.has(canonicalId(id))) {\n\t\treturn {\n\t\t\tfamily: \"openai\",\n\t\t\tsupportsTemperature: false,\n\t\t\tsupportsTopP: false,\n\t\t\ttemperatureTopPMutuallyExclusive: false,\n\t\t\tsupportsPenalties: true,\n\t\t\tsupportsSeed: true,\n\t\t\tsupportsStopSequences: true,\n\t\t\tsupportsReasoningEffort: true,\n\t\t};\n\t}\n\n\t// Meta (Llama): rejects penalties and seed; accepts sampling params and stop.\n\tif (id.includes(\"llama\")) {\n\t\treturn {\n\t\t\tfamily: \"meta\",\n\t\t\tsupportsTemperature: true,\n\t\t\tsupportsTopP: true,\n\t\t\ttemperatureTopPMutuallyExclusive: false,\n\t\t\tsupportsPenalties: false,\n\t\t\tsupportsSeed: false,\n\t\t\tsupportsStopSequences: true,\n\t\t\tsupportsReasoningEffort: true,\n\t\t};\n\t}\n\n\t// Everything else on the unified endpoint rejects penalties with\n\t// `parameter \"frequency_penalty\" must be equal to 0`. Only the older Gemini\n\t// models, handled above, accept them. Seed and stop vary, so each family\n\t// carries what was measured rather than inheriting a guess.\n\tif (id.includes(\"gpt-oss\")) {\n\t\treturn {\n\t\t\tfamily: \"other\",\n\t\t\t...PERMISSIVE,\n\t\t\tsupportsPenalties: false,\n\t\t\tsupportsSeed: false,\n\t\t\tsupportsStopSequences: false,\n\t\t};\n\t}\n\n\tif (id.includes(\"qwen\") || id.includes(\"gemma\")) {\n\t\treturn {\n\t\t\tfamily: \"other\",\n\t\t\t...PERMISSIVE,\n\t\t\tsupportsPenalties: false,\n\t\t\tsupportsSeed: false,\n\t\t};\n\t}\n\n\tif (\n\t\tid.includes(\"glm\") ||\n\t\tid.includes(\"inkling\") ||\n\t\tid.includes(\"kimi\") ||\n\t\tid.includes(\"grok\") ||\n\t\tid.includes(\"deepseek\")\n\t) {\n\t\treturn { family: \"other\", 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,IACC,GAAG,SAAS,KAAK,KACjB,GAAG,SAAS,SAAS,KACrB,GAAG,SAAS,MAAM,KAClB,GAAG,SAAS,MAAM,KAClB,GAAG,SAAS,UAAU,GAEtB,OAAO;EAAE,QAAQ;EAAS,GAAG;EAAY,mBAAmB;CAAM;CAGnE,OAAO;EAAE,QAAQ;EAAS,GAAG;CAAW;AACzC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"neon-openai-tools.d.ts","names":["openai","openaiProvider","z","NeonImageGenerationArgs","imageGeneration","core","$strip","ZodObject","ZodString","NeonOpenAITools","tools","Omit","neonOpenAITools","openaiProvider","z","openai","NeonImageGenerationArgs","background","inputFidelity","inputImageMask","fileId","imageUrl","model","moderation","outputCompression","outputFormat","partialImages","quality","size","imageGeneration","args","type","id","inputSchema","ZodObject","core","$strip","outputSchema","result","ZodString","isProviderExecuted","NeonOpenAITools","Omit","tools","neonOpenAITools"],"sources":["../../src/lib/neon-openai-tools.ts"],"mappings":";;;;KAGYG,uBAAAA;;EAAAA,aAAAA,CAAAA,EAAAA,KAAAA,GAAAA,MAAuB;EA2BnBC,cAAAA,CAAAA,EAAAA;IAAegB,MAAA,CAAA,EAAA,MAAA;IAAOjB,QAAAA,CAAAA,EAAAA,MAAAA;;;;;;;EAe1BM,OAAAA,CAAAA,EAAAA,MAAAA,GAAe,KAAA,GAAA,QAAA,GAAA,MAAA;EAAAmB,IAAA,CAAA,EAAA,MAAA,GAAA,WAAA,GAAA,WAAA,GAAA,WAAA;AACnB3B,CAAAA;AADsBU;AAILP;AAAe;AAGxC;;;;;iBAtBgBA,eAAAA,
|
|
1
|
+
{"version":3,"file":"neon-openai-tools.d.ts","names":["openai","openaiProvider","z","NeonImageGenerationArgs","imageGeneration","core","$strip","ZodObject","ZodString","NeonOpenAITools","tools","Omit","neonOpenAITools","openaiProvider","z","openai","NeonImageGenerationArgs","background","inputFidelity","inputImageMask","fileId","imageUrl","model","moderation","outputCompression","outputFormat","partialImages","quality","size","imageGeneration","args","type","id","inputSchema","ZodObject","core","$strip","outputSchema","result","ZodString","isProviderExecuted","NeonOpenAITools","Omit","tools","neonOpenAITools"],"sources":["../../src/lib/neon-openai-tools.ts"],"mappings":";;;;A,KAGYG,uBAAAA,G;;EAAAA,aAAAA,CAAAA,EAAAA,KAAAA,GAAAA,MAAuB;EA2BnBC,cAAAA,CAAAA,EAAAA;IAAegB,MAAA,CAAA,EAAA,MAAA;IAAOjB,QAAAA,CAAAA,EAAAA,MAAAA;;;;;;;EAe1BM,OAAAA,CAAAA,EAAAA,MAAAA,GAAe,KAAA,GAAA,QAAA,GAAA,MAAA;EAAAmB,IAAA,CAAA,EAAA,MAAA,GAAA,WAAA,GAAA,WAAA,GAAA,WAAA;AACnB3B,CAAAA;AADsBU;AAILP;AAAe;AAGxC;;;;;A,iBAtBgBA,eAAAA,C,OAAsBD,uB;;;;;;;;;;;;;;;;;;;;;;;;A,KAe1BM,eAAAA,GAAkBE,I,QACtBV,MAAAA,CAAeS,K;E,wBAGEN,e;;A,cAGZQ,e,EAAiBH,e"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"neon-responses-options.d.ts","names":["LanguageModelV3CallOptions","isReasoningModelId","withResponsesGatewayDefaults","LanguageModelV3CallOptions","isReasoningModelId","modelId","withResponsesGatewayDefaults","options"],"sources":["../../src/lib/neon-responses-options.ts"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"neon-responses-options.d.ts","names":["LanguageModelV3CallOptions","isReasoningModelId","withResponsesGatewayDefaults","LanguageModelV3CallOptions","isReasoningModelId","modelId","withResponsesGatewayDefaults","options"],"sources":["../../src/lib/neon-responses-options.ts"],"mappings":";;;;A,iBAsCgBC,kBAAAA,C;AAAhB;AASA;AAA4C;AAElCD;AACPA;AAA0B,iBAHbE,4BAAAA,CAGaG,OAAA,EAAA,MAAA,EAAAE,OAAA,EADnBP,0BACmB,CAAA,EAA1BA,0BAA0B"}
|
|
@@ -23,12 +23,15 @@ import { UnsupportedFunctionalityError } from "@ai-sdk/provider";
|
|
|
23
23
|
* `forceReasoning: true` covers a gap in the shared model's own detection,
|
|
24
24
|
* which matches a bare `gpt-5` prefix. The gateway also accepts the legacy
|
|
25
25
|
* `databricks-` form, and `databricks-gpt-5-2` fails that match while still
|
|
26
|
-
* being a reasoning model.
|
|
26
|
+
* being a reasoning model. The gpt-6 models are reasoning models too and fail
|
|
27
|
+
* that match entirely. Without it, the shared model does not send
|
|
28
|
+
* `reasoningEffort`, does not request `reasoning.encrypted_content`, and passes
|
|
29
|
+
* `temperature` and `topP` through to a route that rejects them.
|
|
27
30
|
*/
|
|
28
31
|
const STATELESS_HELP = "See https://github.com/neondatabase/neon-pkgs/tree/main/packages/ai-sdk-provider#errors";
|
|
29
32
|
/** Models the gateway serves as reasoning models on this route. */
|
|
30
33
|
function isReasoningModelId(modelId) {
|
|
31
|
-
return /gpt-
|
|
34
|
+
return /gpt-[56]/.test(modelId.toLowerCase());
|
|
32
35
|
}
|
|
33
36
|
/**
|
|
34
37
|
* Apply the route's defaults to one call, or throw when a caller asked for
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"neon-responses-options.js","names":[],"sources":["../../src/lib/neon-responses-options.ts"],"sourcesContent":["import {\n\ttype LanguageModelV3CallOptions,\n\tUnsupportedFunctionalityError,\n} from \"@ai-sdk/provider\";\n\n/**\n * Request defaults for the Neon AI Gateway's Responses route.\n *\n * `store: false` is the one value this gateway accepts, not a preference. It\n * serves the Responses API statelessly and keeps no items — a response comes\n * back with `\"store\": false` even when the request never set it. Left alone the\n * shared OpenAI model assumes stored-item semantics and replays earlier\n * reasoning as `{ type: \"item_reference\", id }`, which nothing upstream can\n * resolve; the gateway answers `502 INTERNAL_ERROR` on the second step of a\n * tool loop, after the first has already succeeded. Sending `false` makes the\n * model inline the encrypted reasoning instead.\n *\n * Since no other value can work, an explicit `store` that is not `false` is\n * refused rather than sent: the request would come back `400\n * INVALID_PARAMETER_VALUE` after a round trip, and quietly forcing it to\n * `false` would be the wrong kind of quiet for a data-retention flag. A\n * type-level constraint is not available — `providerOptions` is\n * `Record<string, JSONObject>`, so a provider cannot narrow it at the call\n * site.\n *\n * `forceReasoning: true` covers a gap in the shared model's own detection,\n * which matches a bare `gpt-5` prefix. The gateway also accepts the legacy\n * `databricks-` form, and `databricks-gpt-5-2` fails that match while still\n * being a reasoning model.\n */\n\nconst STATELESS_HELP =\n\t\"See https://github.com/neondatabase/neon-pkgs/tree/main/packages/ai-sdk-provider#errors\";\n\n/** Models the gateway serves as reasoning models on this route. */\nexport function isReasoningModelId(modelId: string): boolean {\n\treturn /gpt-
|
|
1
|
+
{"version":3,"file":"neon-responses-options.js","names":[],"sources":["../../src/lib/neon-responses-options.ts"],"sourcesContent":["import {\n\ttype LanguageModelV3CallOptions,\n\tUnsupportedFunctionalityError,\n} from \"@ai-sdk/provider\";\n\n/**\n * Request defaults for the Neon AI Gateway's Responses route.\n *\n * `store: false` is the one value this gateway accepts, not a preference. It\n * serves the Responses API statelessly and keeps no items — a response comes\n * back with `\"store\": false` even when the request never set it. Left alone the\n * shared OpenAI model assumes stored-item semantics and replays earlier\n * reasoning as `{ type: \"item_reference\", id }`, which nothing upstream can\n * resolve; the gateway answers `502 INTERNAL_ERROR` on the second step of a\n * tool loop, after the first has already succeeded. Sending `false` makes the\n * model inline the encrypted reasoning instead.\n *\n * Since no other value can work, an explicit `store` that is not `false` is\n * refused rather than sent: the request would come back `400\n * INVALID_PARAMETER_VALUE` after a round trip, and quietly forcing it to\n * `false` would be the wrong kind of quiet for a data-retention flag. A\n * type-level constraint is not available — `providerOptions` is\n * `Record<string, JSONObject>`, so a provider cannot narrow it at the call\n * site.\n *\n * `forceReasoning: true` covers a gap in the shared model's own detection,\n * which matches a bare `gpt-5` prefix. The gateway also accepts the legacy\n * `databricks-` form, and `databricks-gpt-5-2` fails that match while still\n * being a reasoning model. The gpt-6 models are reasoning models too and fail\n * that match entirely. Without it, the shared model does not send\n * `reasoningEffort`, does not request `reasoning.encrypted_content`, and passes\n * `temperature` and `topP` through to a route that rejects them.\n */\n\nconst STATELESS_HELP =\n\t\"See https://github.com/neondatabase/neon-pkgs/tree/main/packages/ai-sdk-provider#errors\";\n\n/** Models the gateway serves as reasoning models on this route. */\nexport function isReasoningModelId(modelId: string): boolean {\n\treturn /gpt-[56]/.test(modelId.toLowerCase());\n}\n\n/**\n * Apply the route's defaults to one call, or throw when a caller asked for\n * something the gateway cannot do. Returns the options unchanged when there is\n * nothing to add.\n */\nexport function withResponsesGatewayDefaults(\n\tmodelId: string,\n\toptions: LanguageModelV3CallOptions,\n): LanguageModelV3CallOptions {\n\tconst openai = options.providerOptions?.openai;\n\tconst defaults: Record<string, boolean> = {};\n\n\t// `undefined` counts as unset rather than as a choice: it serializes away,\n\t// so `{ store: undefined }` and `{}` are the same request on the wire.\n\tif (openai?.store === undefined) {\n\t\tdefaults.store = false;\n\t} else if (openai.store === true || openai.store === null) {\n\t\t// `null` reads as \"omitted\" but is not: the shared model resolves it\n\t\t// with `store ?? true`, so it asks for storage just as `true` does.\n\t\tthrow new UnsupportedFunctionalityError({\n\t\t\tfunctionality: \"storing responses (providerOptions.openai.store)\",\n\t\t\tmessage:\n\t\t\t\t`\\`store: ${String(openai.store)}\\` is not available on the Neon AI ` +\n\t\t\t\t\"Gateway, which serves the Responses API statelessly and never \" +\n\t\t\t\t\"persists response items. Remove `providerOptions.openai.store`, or \" +\n\t\t\t\t\"set it to `false`.\" +\n\t\t\t\t(openai.store === null\n\t\t\t\t\t? \" `null` is not the same as omitting it — the AI SDK reads a null\" +\n\t\t\t\t\t\t\" `store` as `true`.\"\n\t\t\t\t\t: \"\") +\n\t\t\t\t` ${STATELESS_HELP}`,\n\t\t});\n\t}\n\n\t// Any other type is left for the shared model's own provider-option schema\n\t// (`store: z.boolean().nullish()`), which rejects it locally with a type\n\t// error. Only `true` and `null` pass that schema and are refused by the\n\t// gateway, so only they need saying something about here.\n\n\t// The same statelessness rules these out, and they belong to the same set:\n\t// refusing one and forwarding the others would read as an oversight.\n\tfor (const option of [\"previousResponseId\", \"conversation\"] as const) {\n\t\tif (openai?.[option] != null) {\n\t\t\tthrow new UnsupportedFunctionalityError({\n\t\t\t\tfunctionality: `server-side conversation state (providerOptions.openai.${option})`,\n\t\t\t\tmessage:\n\t\t\t\t\t`\\`${option}\\` is not available on the Neon AI Gateway, which ` +\n\t\t\t\t\t\"serves the Responses API statelessly and never persists response \" +\n\t\t\t\t\t`items, so there is nothing for \\`${option}\\` to refer to. Send ` +\n\t\t\t\t\t`the full message history instead. ${STATELESS_HELP}`,\n\t\t\t});\n\t\t}\n\t}\n\n\tif (isReasoningModelId(modelId) && openai?.forceReasoning === undefined) {\n\t\tdefaults.forceReasoning = true;\n\t}\n\n\tif (Object.keys(defaults).length === 0) {\n\t\treturn options;\n\t}\n\treturn {\n\t\t...options,\n\t\tproviderOptions: {\n\t\t\t...options.providerOptions,\n\t\t\topenai: { ...openai, ...defaults },\n\t\t},\n\t};\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,MAAM,iBACL;;AAGD,SAAgB,mBAAmB,SAA0B;CAC5D,OAAO,WAAW,KAAK,QAAQ,YAAY,CAAC;AAC7C;;;;;;AAOA,SAAgB,6BACf,SACA,SAC6B;CAC7B,MAAM,SAAS,QAAQ,iBAAiB;CACxC,MAAM,WAAoC,CAAC;CAI3C,IAAI,QAAQ,UAAU,KAAA,GACrB,SAAS,QAAQ;MACX,IAAI,OAAO,UAAU,QAAQ,OAAO,UAAU,MAGpD,MAAM,IAAI,8BAA8B;EACvC,eAAe;EACf,SACC,YAAY,OAAO,OAAO,KAAK,EAAE,+LAIhC,OAAO,UAAU,OACf,wFAEA,MACH,IAAI;CACN,CAAC;CAUF,KAAK,MAAM,UAAU,CAAC,sBAAsB,cAAc,GACzD,IAAI,SAAS,WAAW,MACvB,MAAM,IAAI,8BAA8B;EACvC,eAAe,0DAA0D,OAAO;EAChF,SACC,KAAK,OAAO,sJAEwB,OAAO,yDACN;CACvC,CAAC;CAIH,IAAI,mBAAmB,OAAO,KAAK,QAAQ,mBAAmB,KAAA,GAC7D,SAAS,iBAAiB;CAG3B,IAAI,OAAO,KAAK,QAAQ,CAAC,CAAC,WAAW,GACpC,OAAO;CAER,OAAO;EACN,GAAG;EACH,iBAAiB;GAChB,GAAG,QAAQ;GACX,QAAQ;IAAE,GAAG;IAAQ,GAAG;GAAS;EAClC;CACD;AACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.d.ts","names":["EmbeddingModelV3","LanguageModelV3","ProviderV3","FetchFunction","z","NeonChatModelId","NeonDecisionModel","NeonDecisionModelId","NeonEmbeddingModelId","neonOpenAITools","neonErrorSchema","ZodString","ZodNullable","ZodOptional","ZodUnknown","core","$strip","ZodObject","NeonErrorData","infer","NeonProviderSettings","Record","NeonProvider","createNeon","neon","NeonChatModelId","NeonDecisionModel","NeonDecisionModelId","NeonEmbeddingModelId","neonOpenAITools","EmbeddingModelV3","LanguageModelV3","ProviderV3","FetchFunction","z","neonErrorSchema","ZodObject","error","message","ZodString","type","ZodOptional","ZodNullable","param","ZodUnknown","code","core","$strip","NeonErrorData","infer","NeonProviderSettings","baseURL","apiKey","headers","Record","fetch","NeonProvider","modelId","languageModel","chat","tools","embeddingModel","textEmbeddingModel","decisionModel","createNeon","options","neon"],"sources":["../../src/lib/provider.ts"],"mappings":";;;;;;;;;cAkDMU,
|
|
1
|
+
{"version":3,"file":"provider.d.ts","names":["EmbeddingModelV3","LanguageModelV3","ProviderV3","FetchFunction","z","NeonChatModelId","NeonDecisionModel","NeonDecisionModelId","NeonEmbeddingModelId","neonOpenAITools","neonErrorSchema","ZodString","ZodNullable","ZodOptional","ZodUnknown","core","$strip","ZodObject","NeonErrorData","infer","NeonProviderSettings","Record","NeonProvider","createNeon","neon","NeonChatModelId","NeonDecisionModel","NeonDecisionModelId","NeonEmbeddingModelId","neonOpenAITools","EmbeddingModelV3","LanguageModelV3","ProviderV3","FetchFunction","z","neonErrorSchema","ZodObject","error","message","ZodString","type","ZodOptional","ZodNullable","param","ZodUnknown","code","core","$strip","NeonErrorData","infer","NeonProviderSettings","baseURL","apiKey","headers","Record","fetch","NeonProvider","modelId","languageModel","chat","tools","embeddingModel","textEmbeddingModel","decisionModel","createNeon","options","neon"],"sources":["../../src/lib/provider.ts"],"mappings":";;;;;;;;;A,cAkDMU,e,EAAeN,CAAAA,CAAAa,S;;IAAfP,OAAAA,E,WAOJ;IAAA8B,IAAA,E,aAAA,C,aAAA,C,WAAA,CAAA,CAAA;;;;A,GAAApC,CAAAA,CAAAW,IAAAA,CAAAC,M;A,KAEUE,aAAAA,GAAgBd,CAAAA,CAAEe,K,QAAaT,e;A,UA4C1BU,oBAAAA,C;;;;;;;EA9CfhB;AAPmBA;AAAA;AASrB;EAAyBgD,MAAA,CAAA,EAAA,MAAA;EAAkB1C;EAAfN,OAAEe,CAAAA,EA2DnBE,MA3DmBF,CAAAA,MAAAA,EAAAA,MAAAA,CAAAA;EAAK;EA4ClBC,KAAAA,CAAAA,EAkBRjB,aAlBQiB;AAAoB;AAe1BC,UAMMC,YAAAA,SAAqBpB,UAN3BmB,CAAAA;EAGFlB;EAAa,CAAAsD,OAAA,EAKXpD,eALW,CAAA,EAKOJ,eALP;EAGLqB;EAAaoC,aAAA,CAAAD,OAAA,EAKNpD,eALM,CAAA,EAKYJ,eALZ;EAEnBI;EAAkBJ,IAAAA,CAAAA,OAAAA,EAMdI,eANcJ,CAAAA,EAMIA,eANJA;EAGLI;EAAkBJ,KAAAA,EAAAA,OAM3BQ,eAN2BR;EAG3BI;AAAkBJ;AAGlBQ;AAMUD;EAAuBR,cAAAA,CAAAA,OAAAA,EAAvBQ,oBAAuBR,CAAAA,EAAAA,gBAAAA;EAGnBQ;EAAuBR,kBAAAA,CAAAA,OAAAA,EAAvBQ,oBAAuBR,CAAAA,EAAAA,gBAAAA;EAM5BO;AAAsBD;AA1BRJ;AAAU;EA6BhCqB,aAAU,CAAAkC,OAAA,EAHFlD,mBAGE,CAAA,EAHoBD,iBAGpB;AAAA;AAAUc,iBAApBG,UAAAA,CAAoBH,OAAAA,CAAAA,EAAAA,oBAAAA,CAAAA,EAA4BE,YAA5BF;AAA4BE;AAAY,cA0I/DE,IA1I+D,EA0I3DF,YA1I2D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.d.ts","names":["VERSION","VERSION"],"sources":["../../src/lib/version.ts"],"mappings":";cAIaA"}
|
|
1
|
+
{"version":3,"file":"version.d.ts","names":["VERSION","VERSION"],"sources":["../../src/lib/version.ts"],"mappings":";A,cAIaA,O"}
|
package/dist/package.js
CHANGED