@juspay/neurolink 8.5.0 → 8.5.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/CHANGELOG.md +6 -0
- package/dist/adapters/providerImageAdapter.js +56 -9
- package/dist/config/conversationMemory.d.ts +6 -0
- package/dist/config/conversationMemory.js +14 -0
- package/dist/constants/enums.d.ts +23 -3
- package/dist/constants/enums.js +30 -4
- package/dist/constants/tokens.d.ts +27 -12
- package/dist/constants/tokens.js +46 -12
- package/dist/core/modules/GenerationHandler.js +20 -5
- package/dist/core/modules/MessageBuilder.js +4 -0
- package/dist/lib/adapters/providerImageAdapter.js +56 -9
- package/dist/lib/config/conversationMemory.d.ts +6 -0
- package/dist/lib/config/conversationMemory.js +14 -0
- package/dist/lib/constants/enums.d.ts +23 -3
- package/dist/lib/constants/enums.js +30 -4
- package/dist/lib/constants/tokens.d.ts +27 -12
- package/dist/lib/constants/tokens.js +46 -12
- package/dist/lib/core/modules/GenerationHandler.js +20 -5
- package/dist/lib/core/modules/MessageBuilder.js +4 -0
- package/dist/lib/models/modelRegistry.js +93 -0
- package/dist/lib/providers/googleAiStudio.d.ts +27 -0
- package/dist/lib/providers/googleAiStudio.js +27 -0
- package/dist/lib/providers/googleVertex.d.ts +35 -0
- package/dist/lib/providers/googleVertex.js +38 -0
- package/dist/lib/types/generateTypes.d.ts +49 -0
- package/dist/lib/utils/messageBuilder.js +18 -1
- package/dist/models/modelRegistry.js +93 -0
- package/dist/providers/googleAiStudio.d.ts +27 -0
- package/dist/providers/googleAiStudio.js +27 -0
- package/dist/providers/googleVertex.d.ts +35 -0
- package/dist/providers/googleVertex.js +38 -0
- package/dist/types/generateTypes.d.ts +49 -0
- package/dist/utils/messageBuilder.js +18 -1
- package/package.json +1 -1
|
@@ -44,16 +44,34 @@ const VISION_CAPABILITIES = {
|
|
|
44
44
|
"gpt-4-vision-preview",
|
|
45
45
|
],
|
|
46
46
|
"google-ai": [
|
|
47
|
+
// Gemini 3 Series (Preview - November 2025)
|
|
48
|
+
"gemini-3-pro-preview",
|
|
49
|
+
"gemini-3-pro-preview-11-2025",
|
|
50
|
+
"gemini-3-pro-latest",
|
|
51
|
+
// Gemini 2.5 Series
|
|
47
52
|
"gemini-2.5-pro",
|
|
48
53
|
"gemini-2.5-flash",
|
|
54
|
+
// Gemini 2.0 Series
|
|
55
|
+
"gemini-2.0-flash",
|
|
56
|
+
"gemini-2.0-flash-lite",
|
|
57
|
+
// Gemini 1.5 Series (Legacy)
|
|
49
58
|
"gemini-1.5-pro",
|
|
50
59
|
"gemini-1.5-flash",
|
|
51
60
|
"gemini-pro-vision",
|
|
52
61
|
],
|
|
53
62
|
anthropic: [
|
|
63
|
+
// Claude 4.5 Series (September-November 2025)
|
|
64
|
+
"claude-sonnet-4-5",
|
|
65
|
+
"claude-sonnet-4-5-20250929",
|
|
66
|
+
"claude-opus-4-5",
|
|
67
|
+
"claude-opus-4-5-20251101",
|
|
68
|
+
"claude-haiku-4-5",
|
|
69
|
+
"claude-haiku-4-5-20251001",
|
|
70
|
+
// Claude 3.7 Series
|
|
54
71
|
"claude-3-7-sonnet",
|
|
72
|
+
// Claude 3.5 Series
|
|
55
73
|
"claude-3-5-sonnet",
|
|
56
|
-
|
|
74
|
+
// Claude 3 Series
|
|
57
75
|
"claude-3-opus",
|
|
58
76
|
"claude-3-sonnet",
|
|
59
77
|
"claude-3-haiku",
|
|
@@ -75,18 +93,30 @@ const VISION_CAPABILITIES = {
|
|
|
75
93
|
"gpt-4",
|
|
76
94
|
],
|
|
77
95
|
vertex: [
|
|
78
|
-
// Gemini models on Vertex AI
|
|
96
|
+
// Gemini 3.x models on Vertex AI (Preview)
|
|
97
|
+
"gemini-3-pro-preview-11-2025",
|
|
98
|
+
"gemini-3-pro-latest",
|
|
99
|
+
"gemini-3-pro-preview",
|
|
100
|
+
// Gemini 2.5 models on Vertex AI
|
|
79
101
|
"gemini-2.5-pro",
|
|
80
102
|
"gemini-2.5-flash",
|
|
103
|
+
"gemini-2.5-flash-lite",
|
|
104
|
+
// Gemini 2.0 models on Vertex AI
|
|
105
|
+
"gemini-2.0-flash-001",
|
|
106
|
+
"gemini-2.0-flash-lite",
|
|
81
107
|
"gemini-2.0-flash",
|
|
108
|
+
// Gemini 1.5 models on Vertex AI
|
|
82
109
|
"gemini-1.5-pro",
|
|
83
110
|
"gemini-1.5-flash",
|
|
84
|
-
// Claude 4.
|
|
111
|
+
// Claude 4.5 models (versioned format - September-November 2025)
|
|
85
112
|
"claude-sonnet-4-5@",
|
|
113
|
+
"claude-opus-4-5@",
|
|
114
|
+
"claude-haiku-4-5@",
|
|
86
115
|
"claude-haiku-4-5",
|
|
116
|
+
// Claude 4 models (versioned format - May 2025)
|
|
87
117
|
"claude-sonnet-4@",
|
|
88
|
-
"claude-opus-4-1@",
|
|
89
118
|
"claude-opus-4@",
|
|
119
|
+
"claude-opus-4-1@",
|
|
90
120
|
// Claude 3.x models (versioned format)
|
|
91
121
|
"claude-3-7-sonnet@",
|
|
92
122
|
"claude-3-5-sonnet@",
|
|
@@ -106,6 +136,8 @@ const VISION_CAPABILITIES = {
|
|
|
106
136
|
// Additional patterns for compatibility
|
|
107
137
|
"claude-3.5-sonnet",
|
|
108
138
|
"claude-3.5-haiku",
|
|
139
|
+
"claude-4.5-sonnet",
|
|
140
|
+
"claude-4.5-opus",
|
|
109
141
|
"claude-4.5-haiku",
|
|
110
142
|
"claude-haiku-4-5",
|
|
111
143
|
"claude-3.0-sonnet",
|
|
@@ -114,11 +146,22 @@ const VISION_CAPABILITIES = {
|
|
|
114
146
|
litellm: [
|
|
115
147
|
// LiteLLM proxies to underlying providers
|
|
116
148
|
// List models that support vision when going through the proxy
|
|
149
|
+
// Gemini models
|
|
150
|
+
"gemini-3-pro-preview",
|
|
151
|
+
"gemini-3-pro-latest",
|
|
117
152
|
"gemini-2.5-pro",
|
|
118
153
|
"gemini-2.5-flash",
|
|
119
|
-
"
|
|
154
|
+
"gemini-2.0-flash-lite",
|
|
155
|
+
// Claude 4.5 models
|
|
120
156
|
"claude-sonnet-4-5",
|
|
157
|
+
"claude-sonnet-4-5-20250929",
|
|
158
|
+
"claude-opus-4-5",
|
|
159
|
+
"claude-opus-4-5-20251101",
|
|
160
|
+
"claude-haiku-4-5-20251001",
|
|
161
|
+
// Claude 4 models
|
|
162
|
+
"claude-sonnet-4",
|
|
121
163
|
"claude-opus-4-1",
|
|
164
|
+
// OpenAI models
|
|
122
165
|
"gpt-4o",
|
|
123
166
|
"gpt-4.1",
|
|
124
167
|
"gpt-5",
|
|
@@ -162,19 +205,23 @@ const VISION_CAPABILITIES = {
|
|
|
162
205
|
"llava",
|
|
163
206
|
],
|
|
164
207
|
bedrock: [
|
|
165
|
-
// Claude
|
|
208
|
+
// Claude 4.5 family (supports vision, PDFs, images - September-November 2025)
|
|
166
209
|
"claude-sonnet-4-5",
|
|
167
210
|
"claude-sonnet-4.5",
|
|
168
211
|
"anthropic.claude-sonnet-4-5",
|
|
169
|
-
|
|
212
|
+
"anthropic.claude-sonnet-4-5-20250929-v1:0",
|
|
213
|
+
"claude-opus-4-5",
|
|
214
|
+
"claude-opus-4.5",
|
|
215
|
+
"anthropic.claude-opus-4-5",
|
|
216
|
+
"anthropic.claude-opus-4-5-20251101-v1:0",
|
|
170
217
|
"claude-haiku-4-5",
|
|
171
218
|
"claude-haiku-4.5",
|
|
172
219
|
"anthropic.claude-haiku-4-5",
|
|
173
|
-
|
|
220
|
+
"anthropic.claude-haiku-4-5-20251001-v1:0",
|
|
221
|
+
// Claude 4 family (May 2025)
|
|
174
222
|
"claude-sonnet-4",
|
|
175
223
|
"claude-sonnet-4@",
|
|
176
224
|
"anthropic.claude-sonnet-4",
|
|
177
|
-
// Claude Opus 4 family
|
|
178
225
|
"claude-opus-4",
|
|
179
226
|
"claude-opus-4-1",
|
|
180
227
|
"claude-opus-4@",
|
|
@@ -20,6 +20,12 @@ export declare const MESSAGES_PER_TURN = 2;
|
|
|
20
20
|
* Used to enhance system prompts when conversation history exists
|
|
21
21
|
*/
|
|
22
22
|
export declare const CONVERSATION_INSTRUCTIONS = "\n\nIMPORTANT: You are continuing an ongoing conversation. The previous messages in this conversation contain important context including:\n- Names, personal information, and preferences shared by the user\n- Projects, tasks, and topics discussed previously \n- Any decisions, agreements, or conclusions reached\n\nAlways reference and build upon this conversation history when relevant. If the user asks about information mentioned earlier in the conversation, refer to those previous messages to provide accurate, contextual responses.";
|
|
23
|
+
/**
|
|
24
|
+
* Structured output instructions for JSON/structured output mode
|
|
25
|
+
* Used to ensure AI providers output only valid JSON without conversational filler
|
|
26
|
+
* This addresses the issue where models add text like "Excellent!" before JSON output
|
|
27
|
+
*/
|
|
28
|
+
export declare const STRUCTURED_OUTPUT_INSTRUCTIONS = "\n\nSTRUCTURED OUTPUT REQUIREMENT:\nYou MUST respond with ONLY a valid JSON object that matches the provided schema.\n- Do NOT include any text before the JSON (no greetings, acknowledgments, or preamble like \"Excellent!\", \"Sure!\", \"Here is the result:\", etc.)\n- Do NOT include any text after the JSON (no explanations, summaries, or follow-up comments)\n- Do NOT wrap the JSON in markdown code blocks\n- Output ONLY the raw JSON object, starting with { and ending with }\n- Ensure the JSON is valid and parseable";
|
|
23
29
|
/**
|
|
24
30
|
* Get default configuration values for conversation memory
|
|
25
31
|
* Reads environment variables when called (not at module load time)
|
|
@@ -26,6 +26,20 @@ IMPORTANT: You are continuing an ongoing conversation. The previous messages in
|
|
|
26
26
|
- Any decisions, agreements, or conclusions reached
|
|
27
27
|
|
|
28
28
|
Always reference and build upon this conversation history when relevant. If the user asks about information mentioned earlier in the conversation, refer to those previous messages to provide accurate, contextual responses.`;
|
|
29
|
+
/**
|
|
30
|
+
* Structured output instructions for JSON/structured output mode
|
|
31
|
+
* Used to ensure AI providers output only valid JSON without conversational filler
|
|
32
|
+
* This addresses the issue where models add text like "Excellent!" before JSON output
|
|
33
|
+
*/
|
|
34
|
+
export const STRUCTURED_OUTPUT_INSTRUCTIONS = `
|
|
35
|
+
|
|
36
|
+
STRUCTURED OUTPUT REQUIREMENT:
|
|
37
|
+
You MUST respond with ONLY a valid JSON object that matches the provided schema.
|
|
38
|
+
- Do NOT include any text before the JSON (no greetings, acknowledgments, or preamble like "Excellent!", "Sure!", "Here is the result:", etc.)
|
|
39
|
+
- Do NOT include any text after the JSON (no explanations, summaries, or follow-up comments)
|
|
40
|
+
- Do NOT wrap the JSON in markdown code blocks
|
|
41
|
+
- Output ONLY the raw JSON object, starting with { and ending with }
|
|
42
|
+
- Ensure the JSON is valid and parseable`;
|
|
29
43
|
/**
|
|
30
44
|
* Get default configuration values for conversation memory
|
|
31
45
|
* Reads environment variables when called (not at module load time)
|
|
@@ -20,10 +20,13 @@ export declare enum AIProviderName {
|
|
|
20
20
|
* Supported Models for Amazon Bedrock
|
|
21
21
|
*/
|
|
22
22
|
export declare enum BedrockModels {
|
|
23
|
+
CLAUDE_4_5_SONNET = "anthropic.claude-sonnet-4-5-20250929-v1:0",
|
|
24
|
+
CLAUDE_4_5_OPUS = "anthropic.claude-opus-4-5-20251124-v1:0",
|
|
25
|
+
CLAUDE_4_5_HAIKU = "anthropic.claude-haiku-4-5-20251001-v1:0",
|
|
26
|
+
CLAUDE_3_7_SONNET = "anthropic.claude-3-7-sonnet-20250219-v1:0",
|
|
27
|
+
CLAUDE_3_5_SONNET = "anthropic.claude-3-5-sonnet-20241022-v1:0",
|
|
23
28
|
CLAUDE_3_SONNET = "anthropic.claude-3-sonnet-20240229-v1:0",
|
|
24
|
-
CLAUDE_3_HAIKU = "anthropic.claude-3-haiku-20240307-v1:0"
|
|
25
|
-
CLAUDE_3_5_SONNET = "anthropic.claude-3-5-sonnet-20240620-v1:0",
|
|
26
|
-
CLAUDE_3_7_SONNET = "arn:aws:bedrock:us-east-2:225681119357:inference-profile/us.anthropic.claude-3-7-sonnet-20250219-v1:0"
|
|
29
|
+
CLAUDE_3_HAIKU = "anthropic.claude-3-haiku-20240307-v1:0"
|
|
27
30
|
}
|
|
28
31
|
/**
|
|
29
32
|
* Supported Models for OpenAI
|
|
@@ -41,6 +44,8 @@ export declare enum OpenAIModels {
|
|
|
41
44
|
* Supported Models for Google Vertex AI
|
|
42
45
|
*/
|
|
43
46
|
export declare enum VertexModels {
|
|
47
|
+
CLAUDE_4_5_SONNET = "claude-sonnet-4-5@20250929",
|
|
48
|
+
CLAUDE_4_5_OPUS = "claude-opus-4-5@20251124",
|
|
44
49
|
CLAUDE_4_0_SONNET = "claude-sonnet-4@20250514",
|
|
45
50
|
CLAUDE_4_0_OPUS = "claude-opus-4@20250514",
|
|
46
51
|
CLAUDE_3_5_SONNET = "claude-3-5-sonnet-20241022",
|
|
@@ -48,11 +53,18 @@ export declare enum VertexModels {
|
|
|
48
53
|
CLAUDE_3_SONNET = "claude-3-sonnet-20240229",
|
|
49
54
|
CLAUDE_3_OPUS = "claude-3-opus-20240229",
|
|
50
55
|
CLAUDE_3_HAIKU = "claude-3-haiku-20240307",
|
|
56
|
+
/** Gemini 3 Pro Preview - Versioned preview (November 2025) */
|
|
57
|
+
GEMINI_3_PRO_PREVIEW_11_2025 = "gemini-3-pro-preview-11-2025",
|
|
58
|
+
/** Gemini 3 Pro Latest - Auto-updated alias (always points to latest preview) */
|
|
59
|
+
GEMINI_3_PRO_LATEST = "gemini-3-pro-latest",
|
|
60
|
+
/** Gemini 3 Pro Preview - Generic preview (legacy) */
|
|
51
61
|
GEMINI_3_PRO_PREVIEW = "gemini-3-pro-preview",
|
|
52
62
|
GEMINI_2_5_PRO = "gemini-2.5-pro",
|
|
53
63
|
GEMINI_2_5_FLASH = "gemini-2.5-flash",
|
|
54
64
|
GEMINI_2_5_FLASH_LITE = "gemini-2.5-flash-lite",
|
|
55
65
|
GEMINI_2_0_FLASH_001 = "gemini-2.0-flash-001",
|
|
66
|
+
/** Gemini 2.0 Flash Lite - GA, production-ready, cost-optimized */
|
|
67
|
+
GEMINI_2_0_FLASH_LITE = "gemini-2.0-flash-lite",
|
|
56
68
|
GEMINI_1_5_PRO = "gemini-1.5-pro",
|
|
57
69
|
GEMINI_1_5_FLASH = "gemini-1.5-flash"
|
|
58
70
|
}
|
|
@@ -60,10 +72,16 @@ export declare enum VertexModels {
|
|
|
60
72
|
* Supported Models for Google AI Studio
|
|
61
73
|
*/
|
|
62
74
|
export declare enum GoogleAIModels {
|
|
75
|
+
/** Gemini 3 Pro Preview - Versioned preview (November 2025) */
|
|
76
|
+
GEMINI_3_PRO_PREVIEW_11_2025 = "gemini-3-pro-preview-11-2025",
|
|
77
|
+
/** Gemini 3 Pro Latest - Auto-updated alias (always points to latest preview) */
|
|
78
|
+
GEMINI_3_PRO_LATEST = "gemini-3-pro-latest",
|
|
63
79
|
GEMINI_2_5_PRO = "gemini-2.5-pro",
|
|
64
80
|
GEMINI_2_5_FLASH = "gemini-2.5-flash",
|
|
65
81
|
GEMINI_2_5_FLASH_LITE = "gemini-2.5-flash-lite",
|
|
66
82
|
GEMINI_2_0_FLASH_001 = "gemini-2.0-flash-001",
|
|
83
|
+
/** Gemini 2.0 Flash Lite - GA, production-ready, cost-optimized */
|
|
84
|
+
GEMINI_2_0_FLASH_LITE = "gemini-2.0-flash-lite",
|
|
67
85
|
GEMINI_1_5_PRO = "gemini-1.5-pro",
|
|
68
86
|
GEMINI_1_5_FLASH = "gemini-1.5-flash",
|
|
69
87
|
GEMINI_1_5_FLASH_LITE = "gemini-1.5-flash-lite"
|
|
@@ -72,6 +90,8 @@ export declare enum GoogleAIModels {
|
|
|
72
90
|
* Supported Models for Anthropic (Direct API)
|
|
73
91
|
*/
|
|
74
92
|
export declare enum AnthropicModels {
|
|
93
|
+
CLAUDE_SONNET_4_5 = "claude-sonnet-4-5-20250929",
|
|
94
|
+
CLAUDE_OPUS_4_5 = "claude-opus-4-5-20251124",
|
|
75
95
|
CLAUDE_4_5_HAIKU = "claude-haiku-4-5-20251001",
|
|
76
96
|
CLAUDE_3_5_SONNET = "claude-3-5-sonnet-20241022",
|
|
77
97
|
CLAUDE_3_5_HAIKU = "claude-3-5-haiku-20241022",
|
|
@@ -25,10 +25,17 @@ export var AIProviderName;
|
|
|
25
25
|
*/
|
|
26
26
|
export var BedrockModels;
|
|
27
27
|
(function (BedrockModels) {
|
|
28
|
+
// Claude 4.5 Series (Latest - September-November 2025)
|
|
29
|
+
BedrockModels["CLAUDE_4_5_SONNET"] = "anthropic.claude-sonnet-4-5-20250929-v1:0";
|
|
30
|
+
BedrockModels["CLAUDE_4_5_OPUS"] = "anthropic.claude-opus-4-5-20251124-v1:0";
|
|
31
|
+
BedrockModels["CLAUDE_4_5_HAIKU"] = "anthropic.claude-haiku-4-5-20251001-v1:0";
|
|
32
|
+
// Claude 3.7 Series
|
|
33
|
+
BedrockModels["CLAUDE_3_7_SONNET"] = "anthropic.claude-3-7-sonnet-20250219-v1:0";
|
|
34
|
+
// Claude 3.5 Series
|
|
35
|
+
BedrockModels["CLAUDE_3_5_SONNET"] = "anthropic.claude-3-5-sonnet-20241022-v1:0";
|
|
36
|
+
// Claude 3 Series (Legacy support)
|
|
28
37
|
BedrockModels["CLAUDE_3_SONNET"] = "anthropic.claude-3-sonnet-20240229-v1:0";
|
|
29
38
|
BedrockModels["CLAUDE_3_HAIKU"] = "anthropic.claude-3-haiku-20240307-v1:0";
|
|
30
|
-
BedrockModels["CLAUDE_3_5_SONNET"] = "anthropic.claude-3-5-sonnet-20240620-v1:0";
|
|
31
|
-
BedrockModels["CLAUDE_3_7_SONNET"] = "arn:aws:bedrock:us-east-2:225681119357:inference-profile/us.anthropic.claude-3-7-sonnet-20250219-v1:0";
|
|
32
39
|
})(BedrockModels || (BedrockModels = {}));
|
|
33
40
|
/**
|
|
34
41
|
* Supported Models for OpenAI
|
|
@@ -48,7 +55,10 @@ export var OpenAIModels;
|
|
|
48
55
|
*/
|
|
49
56
|
export var VertexModels;
|
|
50
57
|
(function (VertexModels) {
|
|
51
|
-
// Claude 4 Series (Latest -
|
|
58
|
+
// Claude 4.5 Series (Latest - December 2025)
|
|
59
|
+
VertexModels["CLAUDE_4_5_SONNET"] = "claude-sonnet-4-5@20250929";
|
|
60
|
+
VertexModels["CLAUDE_4_5_OPUS"] = "claude-opus-4-5@20251124";
|
|
61
|
+
// Claude 4 Series (May 2025)
|
|
52
62
|
VertexModels["CLAUDE_4_0_SONNET"] = "claude-sonnet-4@20250514";
|
|
53
63
|
VertexModels["CLAUDE_4_0_OPUS"] = "claude-opus-4@20250514";
|
|
54
64
|
// Claude 3.5 Series (Still supported)
|
|
@@ -59,6 +69,11 @@ export var VertexModels;
|
|
|
59
69
|
VertexModels["CLAUDE_3_OPUS"] = "claude-3-opus-20240229";
|
|
60
70
|
VertexModels["CLAUDE_3_HAIKU"] = "claude-3-haiku-20240307";
|
|
61
71
|
// Gemini 3 Series (Preview)
|
|
72
|
+
/** Gemini 3 Pro Preview - Versioned preview (November 2025) */
|
|
73
|
+
VertexModels["GEMINI_3_PRO_PREVIEW_11_2025"] = "gemini-3-pro-preview-11-2025";
|
|
74
|
+
/** Gemini 3 Pro Latest - Auto-updated alias (always points to latest preview) */
|
|
75
|
+
VertexModels["GEMINI_3_PRO_LATEST"] = "gemini-3-pro-latest";
|
|
76
|
+
/** Gemini 3 Pro Preview - Generic preview (legacy) */
|
|
62
77
|
VertexModels["GEMINI_3_PRO_PREVIEW"] = "gemini-3-pro-preview";
|
|
63
78
|
// Gemini 2.5 Series (Latest - 2025)
|
|
64
79
|
VertexModels["GEMINI_2_5_PRO"] = "gemini-2.5-pro";
|
|
@@ -66,6 +81,8 @@ export var VertexModels;
|
|
|
66
81
|
VertexModels["GEMINI_2_5_FLASH_LITE"] = "gemini-2.5-flash-lite";
|
|
67
82
|
// Gemini 2.0 Series
|
|
68
83
|
VertexModels["GEMINI_2_0_FLASH_001"] = "gemini-2.0-flash-001";
|
|
84
|
+
/** Gemini 2.0 Flash Lite - GA, production-ready, cost-optimized */
|
|
85
|
+
VertexModels["GEMINI_2_0_FLASH_LITE"] = "gemini-2.0-flash-lite";
|
|
69
86
|
// Gemini 1.5 Series (Legacy support)
|
|
70
87
|
VertexModels["GEMINI_1_5_PRO"] = "gemini-1.5-pro";
|
|
71
88
|
VertexModels["GEMINI_1_5_FLASH"] = "gemini-1.5-flash";
|
|
@@ -75,12 +92,19 @@ export var VertexModels;
|
|
|
75
92
|
*/
|
|
76
93
|
export var GoogleAIModels;
|
|
77
94
|
(function (GoogleAIModels) {
|
|
95
|
+
// Gemini 3 Series (Preview)
|
|
96
|
+
/** Gemini 3 Pro Preview - Versioned preview (November 2025) */
|
|
97
|
+
GoogleAIModels["GEMINI_3_PRO_PREVIEW_11_2025"] = "gemini-3-pro-preview-11-2025";
|
|
98
|
+
/** Gemini 3 Pro Latest - Auto-updated alias (always points to latest preview) */
|
|
99
|
+
GoogleAIModels["GEMINI_3_PRO_LATEST"] = "gemini-3-pro-latest";
|
|
78
100
|
// Gemini 2.5 Series (Latest - 2025)
|
|
79
101
|
GoogleAIModels["GEMINI_2_5_PRO"] = "gemini-2.5-pro";
|
|
80
102
|
GoogleAIModels["GEMINI_2_5_FLASH"] = "gemini-2.5-flash";
|
|
81
103
|
GoogleAIModels["GEMINI_2_5_FLASH_LITE"] = "gemini-2.5-flash-lite";
|
|
82
104
|
// Gemini 2.0 Series
|
|
83
105
|
GoogleAIModels["GEMINI_2_0_FLASH_001"] = "gemini-2.0-flash-001";
|
|
106
|
+
/** Gemini 2.0 Flash Lite - GA, production-ready, cost-optimized */
|
|
107
|
+
GoogleAIModels["GEMINI_2_0_FLASH_LITE"] = "gemini-2.0-flash-lite";
|
|
84
108
|
// Gemini 1.5 Series (Legacy support)
|
|
85
109
|
GoogleAIModels["GEMINI_1_5_PRO"] = "gemini-1.5-pro";
|
|
86
110
|
GoogleAIModels["GEMINI_1_5_FLASH"] = "gemini-1.5-flash";
|
|
@@ -91,7 +115,9 @@ export var GoogleAIModels;
|
|
|
91
115
|
*/
|
|
92
116
|
export var AnthropicModels;
|
|
93
117
|
(function (AnthropicModels) {
|
|
94
|
-
// Claude 4.5 Series (Latest -
|
|
118
|
+
// Claude 4.5 Series (Latest - September-November 2025)
|
|
119
|
+
AnthropicModels["CLAUDE_SONNET_4_5"] = "claude-sonnet-4-5-20250929";
|
|
120
|
+
AnthropicModels["CLAUDE_OPUS_4_5"] = "claude-opus-4-5-20251124";
|
|
95
121
|
AnthropicModels["CLAUDE_4_5_HAIKU"] = "claude-haiku-4-5-20251001";
|
|
96
122
|
// Claude 3.5 Series
|
|
97
123
|
AnthropicModels["CLAUDE_3_5_SONNET"] = "claude-3-5-sonnet-20241022";
|
|
@@ -59,11 +59,13 @@ export declare const USE_CASE_TOKENS: {
|
|
|
59
59
|
export declare const PROVIDER_TOKEN_LIMITS: {
|
|
60
60
|
/** Anthropic model limits */
|
|
61
61
|
readonly ANTHROPIC: {
|
|
62
|
-
readonly "claude-
|
|
62
|
+
readonly "claude-sonnet-4-5-20250929": 8192;
|
|
63
|
+
readonly "claude-opus-4-5-20251101": 8192;
|
|
64
|
+
readonly "claude-haiku-4-5-20251001": 8192;
|
|
63
65
|
readonly "claude-3-5-sonnet-20241022": 4096;
|
|
64
|
-
readonly "claude-3-opus-20240229": 4096;
|
|
65
66
|
readonly "claude-3-5-haiku-20241022": 4096;
|
|
66
|
-
readonly "claude-haiku-
|
|
67
|
+
readonly "claude-3-haiku-20240307": 4096;
|
|
68
|
+
readonly "claude-3-opus-20240229": 4096;
|
|
67
69
|
readonly "claude-3-sonnet-20240229": 4096;
|
|
68
70
|
readonly default: 4096;
|
|
69
71
|
};
|
|
@@ -80,28 +82,38 @@ export declare const PROVIDER_TOKEN_LIMITS: {
|
|
|
80
82
|
};
|
|
81
83
|
/** Google AI model limits */
|
|
82
84
|
readonly GOOGLE_AI: {
|
|
83
|
-
readonly "gemini-
|
|
84
|
-
readonly "gemini-
|
|
85
|
-
readonly "gemini-
|
|
85
|
+
readonly "gemini-3-pro-preview": 8192;
|
|
86
|
+
readonly "gemini-3-pro-preview-11-2025": 8192;
|
|
87
|
+
readonly "gemini-3-pro-latest": 8192;
|
|
86
88
|
readonly "gemini-2.5-pro": 8192;
|
|
87
89
|
readonly "gemini-2.5-flash": 8192;
|
|
88
90
|
readonly "gemini-2.5-flash-lite": 8192;
|
|
89
91
|
readonly "gemini-2.0-flash-001": 8192;
|
|
92
|
+
readonly "gemini-2.0-flash-lite": 8192;
|
|
93
|
+
readonly "gemini-1.5-pro": 8192;
|
|
94
|
+
readonly "gemini-1.5-flash": 8192;
|
|
95
|
+
readonly "gemini-1.5-flash-lite": 8192;
|
|
90
96
|
readonly default: 4096;
|
|
91
97
|
};
|
|
92
98
|
/** Google Vertex AI model limits */
|
|
93
99
|
readonly VERTEX: {
|
|
94
|
-
readonly "gemini-
|
|
95
|
-
readonly "gemini-
|
|
100
|
+
readonly "gemini-3-pro-preview": 8192;
|
|
101
|
+
readonly "gemini-3-pro-preview-11-2025": 8192;
|
|
102
|
+
readonly "gemini-3-pro-latest": 8192;
|
|
96
103
|
readonly "gemini-2.5-pro": 8192;
|
|
97
104
|
readonly "gemini-2.5-flash": 8192;
|
|
98
105
|
readonly "gemini-2.5-flash-lite": 8192;
|
|
99
106
|
readonly "gemini-2.0-flash-001": 8192;
|
|
107
|
+
readonly "gemini-2.0-flash-lite": 8192;
|
|
108
|
+
readonly "gemini-1.5-pro": 8192;
|
|
109
|
+
readonly "gemini-1.5-flash": 8192;
|
|
110
|
+
readonly "claude-sonnet-4-5@20250929": 8192;
|
|
111
|
+
readonly "claude-opus-4-5@20251124": 8192;
|
|
112
|
+
readonly "claude-haiku-4-5@20251001": 8192;
|
|
100
113
|
readonly "claude-sonnet-4@20250514": 4096;
|
|
101
114
|
readonly "claude-opus-4@20250514": 4096;
|
|
102
115
|
readonly "claude-3-5-sonnet-20241022": 4096;
|
|
103
116
|
readonly "claude-3-5-haiku-20241022": 4096;
|
|
104
|
-
readonly "claude-haiku-4-5-20251001": 8192;
|
|
105
117
|
readonly "claude-3-sonnet-20240229": 4096;
|
|
106
118
|
readonly "claude-3-haiku-20240307": 4096;
|
|
107
119
|
readonly "claude-3-opus-20240229": 4096;
|
|
@@ -109,12 +121,15 @@ export declare const PROVIDER_TOKEN_LIMITS: {
|
|
|
109
121
|
};
|
|
110
122
|
/** AWS Bedrock model limits */
|
|
111
123
|
readonly BEDROCK: {
|
|
124
|
+
readonly "anthropic.claude-sonnet-4-5-20250929-v1:0": 8192;
|
|
125
|
+
readonly "anthropic.claude-opus-4-5-20251101-v1:0": 8192;
|
|
126
|
+
readonly "anthropic.claude-haiku-4-5-20251001-v1:0": 8192;
|
|
127
|
+
readonly "us.anthropic.claude-3-7-sonnet-20250219-v1:0": 4096;
|
|
128
|
+
readonly "anthropic.claude-3-5-sonnet-20241022-v1:0": 4096;
|
|
129
|
+
readonly "anthropic.claude-3-5-haiku-20241022-v1:0": 4096;
|
|
112
130
|
readonly "anthropic.claude-3-sonnet-20240229-v1:0": 4096;
|
|
113
131
|
readonly "anthropic.claude-3-haiku-20240307-v1:0": 4096;
|
|
114
|
-
readonly "anthropic.claude-3-5-sonnet-20240620-v1:0": 4096;
|
|
115
132
|
readonly "anthropic.claude-3-opus-20240229-v1:0": 4096;
|
|
116
|
-
readonly "anthropic.claude-haiku-4-5-20251001-v1:0": 8192;
|
|
117
|
-
readonly "arn:aws:bedrock:us-east-2:225681119357:inference-profile/us.anthropic.claude-3-7-sonnet-20250219-v1:0": 4096;
|
|
118
133
|
readonly default: 4096;
|
|
119
134
|
};
|
|
120
135
|
/** Azure OpenAI model limits */
|
|
@@ -59,11 +59,16 @@ export const USE_CASE_TOKENS = {
|
|
|
59
59
|
export const PROVIDER_TOKEN_LIMITS = {
|
|
60
60
|
/** Anthropic model limits */
|
|
61
61
|
ANTHROPIC: {
|
|
62
|
-
|
|
62
|
+
// Claude 4.5 Series (September-November 2025)
|
|
63
|
+
"claude-sonnet-4-5-20250929": 8192,
|
|
64
|
+
"claude-opus-4-5-20251101": 8192,
|
|
65
|
+
"claude-haiku-4-5-20251001": 8192,
|
|
66
|
+
// Claude 3.5 Series
|
|
63
67
|
"claude-3-5-sonnet-20241022": 4096,
|
|
64
|
-
"claude-3-opus-20240229": 4096,
|
|
65
68
|
"claude-3-5-haiku-20241022": 4096,
|
|
66
|
-
|
|
69
|
+
// Claude 3 Series
|
|
70
|
+
"claude-3-haiku-20240307": 4096,
|
|
71
|
+
"claude-3-opus-20240229": 4096,
|
|
67
72
|
"claude-3-sonnet-20240229": 4096,
|
|
68
73
|
default: 4096, // Conservative default for Anthropic
|
|
69
74
|
},
|
|
@@ -80,28 +85,50 @@ export const PROVIDER_TOKEN_LIMITS = {
|
|
|
80
85
|
},
|
|
81
86
|
/** Google AI model limits */
|
|
82
87
|
GOOGLE_AI: {
|
|
83
|
-
|
|
84
|
-
"gemini-
|
|
85
|
-
"gemini-
|
|
88
|
+
// Gemini 3 Series (Preview - November 2025)
|
|
89
|
+
"gemini-3-pro-preview": 8192,
|
|
90
|
+
"gemini-3-pro-preview-11-2025": 8192,
|
|
91
|
+
"gemini-3-pro-latest": 8192,
|
|
92
|
+
// Gemini 2.5 Series
|
|
86
93
|
"gemini-2.5-pro": 8192,
|
|
87
94
|
"gemini-2.5-flash": 8192,
|
|
88
95
|
"gemini-2.5-flash-lite": 8192,
|
|
96
|
+
// Gemini 2.0 Series
|
|
89
97
|
"gemini-2.0-flash-001": 8192,
|
|
98
|
+
"gemini-2.0-flash-lite": 8192,
|
|
99
|
+
// Gemini 1.5 Series (Legacy)
|
|
100
|
+
"gemini-1.5-pro": 8192,
|
|
101
|
+
"gemini-1.5-flash": 8192,
|
|
102
|
+
"gemini-1.5-flash-lite": 8192,
|
|
90
103
|
default: 4096, // Conservative default due to 500 errors at high limits
|
|
91
104
|
},
|
|
92
105
|
/** Google Vertex AI model limits */
|
|
93
106
|
VERTEX: {
|
|
94
|
-
|
|
95
|
-
"gemini-
|
|
107
|
+
// Gemini 3 Series (Preview - November 2025)
|
|
108
|
+
"gemini-3-pro-preview": 8192,
|
|
109
|
+
"gemini-3-pro-preview-11-2025": 8192,
|
|
110
|
+
"gemini-3-pro-latest": 8192,
|
|
111
|
+
// Gemini 2.5 Series
|
|
96
112
|
"gemini-2.5-pro": 8192,
|
|
97
113
|
"gemini-2.5-flash": 8192,
|
|
98
114
|
"gemini-2.5-flash-lite": 8192,
|
|
115
|
+
// Gemini 2.0 Series
|
|
99
116
|
"gemini-2.0-flash-001": 8192,
|
|
117
|
+
"gemini-2.0-flash-lite": 8192,
|
|
118
|
+
// Gemini 1.5 Series (Legacy)
|
|
119
|
+
"gemini-1.5-pro": 8192,
|
|
120
|
+
"gemini-1.5-flash": 8192,
|
|
121
|
+
// Claude 4.5 Series (September-November 2025)
|
|
122
|
+
"claude-sonnet-4-5@20250929": 8192,
|
|
123
|
+
"claude-opus-4-5@20251124": 8192,
|
|
124
|
+
"claude-haiku-4-5@20251001": 8192,
|
|
125
|
+
// Claude 4 Series (May 2025)
|
|
100
126
|
"claude-sonnet-4@20250514": 4096,
|
|
101
127
|
"claude-opus-4@20250514": 4096,
|
|
128
|
+
// Claude 3.5 Series
|
|
102
129
|
"claude-3-5-sonnet-20241022": 4096,
|
|
103
130
|
"claude-3-5-haiku-20241022": 4096,
|
|
104
|
-
|
|
131
|
+
// Claude 3 Series
|
|
105
132
|
"claude-3-sonnet-20240229": 4096,
|
|
106
133
|
"claude-3-haiku-20240307": 4096,
|
|
107
134
|
"claude-3-opus-20240229": 4096,
|
|
@@ -109,12 +136,19 @@ export const PROVIDER_TOKEN_LIMITS = {
|
|
|
109
136
|
},
|
|
110
137
|
/** AWS Bedrock model limits */
|
|
111
138
|
BEDROCK: {
|
|
139
|
+
// Claude 4.5 Series (September-November 2025)
|
|
140
|
+
"anthropic.claude-sonnet-4-5-20250929-v1:0": 8192,
|
|
141
|
+
"anthropic.claude-opus-4-5-20251101-v1:0": 8192,
|
|
142
|
+
"anthropic.claude-haiku-4-5-20251001-v1:0": 8192,
|
|
143
|
+
// Claude 3.7 Series
|
|
144
|
+
"us.anthropic.claude-3-7-sonnet-20250219-v1:0": 4096,
|
|
145
|
+
// Claude 3.5 Series
|
|
146
|
+
"anthropic.claude-3-5-sonnet-20241022-v1:0": 4096,
|
|
147
|
+
"anthropic.claude-3-5-haiku-20241022-v1:0": 4096,
|
|
148
|
+
// Claude 3 Series
|
|
112
149
|
"anthropic.claude-3-sonnet-20240229-v1:0": 4096,
|
|
113
150
|
"anthropic.claude-3-haiku-20240307-v1:0": 4096,
|
|
114
|
-
"anthropic.claude-3-5-sonnet-20240620-v1:0": 4096,
|
|
115
151
|
"anthropic.claude-3-opus-20240229-v1:0": 4096,
|
|
116
|
-
"anthropic.claude-haiku-4-5-20251001-v1:0": 8192,
|
|
117
|
-
"arn:aws:bedrock:us-east-2:225681119357:inference-profile/us.anthropic.claude-3-7-sonnet-20250219-v1:0": 4096,
|
|
118
152
|
default: 4096,
|
|
119
153
|
},
|
|
120
154
|
/** Azure OpenAI model limits */
|
|
@@ -42,9 +42,9 @@ export class GenerationHandler {
|
|
|
42
42
|
return await generateText({
|
|
43
43
|
model,
|
|
44
44
|
messages,
|
|
45
|
-
tools,
|
|
45
|
+
...(shouldUseTools && Object.keys(tools).length > 0 && { tools }),
|
|
46
46
|
maxSteps: options.maxSteps || DEFAULT_MAX_STEPS,
|
|
47
|
-
|
|
47
|
+
...(shouldUseTools && { toolChoice: "auto" }),
|
|
48
48
|
temperature: options.temperature,
|
|
49
49
|
maxTokens: options.maxTokens,
|
|
50
50
|
...(useStructuredOutput &&
|
|
@@ -162,9 +162,24 @@ export class GenerationHandler {
|
|
|
162
162
|
const useStructuredOutput = !!options.schema &&
|
|
163
163
|
(options.output?.format === "json" ||
|
|
164
164
|
options.output?.format === "structured");
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
165
|
+
let content;
|
|
166
|
+
if (useStructuredOutput) {
|
|
167
|
+
if (generateResult.experimental_output !== undefined) {
|
|
168
|
+
content = JSON.stringify(generateResult.experimental_output);
|
|
169
|
+
}
|
|
170
|
+
else {
|
|
171
|
+
logger.debug("[GenerationHandler] experimental_output not available, falling back to text parsing");
|
|
172
|
+
const rawText = generateResult.text || "";
|
|
173
|
+
const strippedText = rawText
|
|
174
|
+
.replace(/^```(?:json)?\s*\n?/i, "")
|
|
175
|
+
.replace(/\n?```\s*$/i, "")
|
|
176
|
+
.trim();
|
|
177
|
+
content = strippedText;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
else {
|
|
181
|
+
content = generateResult.text;
|
|
182
|
+
}
|
|
168
183
|
return {
|
|
169
184
|
content,
|
|
170
185
|
usage: {
|
|
@@ -63,6 +63,8 @@ export class MessageBuilder {
|
|
|
63
63
|
enableEvaluation: options.enableEvaluation,
|
|
64
64
|
context: options.context,
|
|
65
65
|
conversationHistory: options.conversationMessages,
|
|
66
|
+
schema: options.schema,
|
|
67
|
+
output: options.output,
|
|
66
68
|
};
|
|
67
69
|
messages = await buildMultimodalMessagesArray(multimodalOptions, this.providerName, this.modelName);
|
|
68
70
|
}
|
|
@@ -143,6 +145,8 @@ export class MessageBuilder {
|
|
|
143
145
|
context: options.context,
|
|
144
146
|
conversationHistory: options
|
|
145
147
|
.conversationMessages,
|
|
148
|
+
schema: options.schema,
|
|
149
|
+
output: options.output,
|
|
146
150
|
};
|
|
147
151
|
messages = await buildMultimodalMessagesArray(multimodalOptions, this.providerName, this.modelName);
|
|
148
152
|
}
|
|
@@ -188,6 +188,99 @@ export const MODEL_REGISTRY = {
|
|
|
188
188
|
category: "general",
|
|
189
189
|
},
|
|
190
190
|
// Anthropic Models
|
|
191
|
+
[AnthropicModels.CLAUDE_OPUS_4_5]: {
|
|
192
|
+
id: AnthropicModels.CLAUDE_OPUS_4_5,
|
|
193
|
+
name: "Claude Opus 4.5",
|
|
194
|
+
provider: AIProviderName.ANTHROPIC,
|
|
195
|
+
description: "Anthropic's most capable model with exceptional reasoning, coding, and multimodal capabilities",
|
|
196
|
+
capabilities: {
|
|
197
|
+
vision: true,
|
|
198
|
+
functionCalling: true,
|
|
199
|
+
codeGeneration: true,
|
|
200
|
+
reasoning: true,
|
|
201
|
+
multimodal: true,
|
|
202
|
+
streaming: true,
|
|
203
|
+
jsonMode: false,
|
|
204
|
+
},
|
|
205
|
+
pricing: {
|
|
206
|
+
inputCostPer1K: 0.015,
|
|
207
|
+
outputCostPer1K: 0.075,
|
|
208
|
+
currency: "USD",
|
|
209
|
+
},
|
|
210
|
+
performance: {
|
|
211
|
+
speed: "medium",
|
|
212
|
+
quality: "high",
|
|
213
|
+
accuracy: "high",
|
|
214
|
+
},
|
|
215
|
+
limits: {
|
|
216
|
+
maxContextTokens: 200000,
|
|
217
|
+
maxOutputTokens: 64000,
|
|
218
|
+
maxRequestsPerMinute: 50,
|
|
219
|
+
},
|
|
220
|
+
useCases: {
|
|
221
|
+
coding: 10,
|
|
222
|
+
creative: 10,
|
|
223
|
+
analysis: 10,
|
|
224
|
+
conversation: 9,
|
|
225
|
+
reasoning: 10,
|
|
226
|
+
translation: 9,
|
|
227
|
+
summarization: 9,
|
|
228
|
+
},
|
|
229
|
+
aliases: [
|
|
230
|
+
"claude-4.5-opus",
|
|
231
|
+
"claude-opus-latest",
|
|
232
|
+
"opus-4.5",
|
|
233
|
+
"anthropic-flagship",
|
|
234
|
+
],
|
|
235
|
+
deprecated: false,
|
|
236
|
+
isLocal: false,
|
|
237
|
+
releaseDate: "2025-11-24",
|
|
238
|
+
category: "reasoning",
|
|
239
|
+
},
|
|
240
|
+
[AnthropicModels.CLAUDE_SONNET_4_5]: {
|
|
241
|
+
id: AnthropicModels.CLAUDE_SONNET_4_5,
|
|
242
|
+
name: "Claude Sonnet 4.5",
|
|
243
|
+
provider: AIProviderName.ANTHROPIC,
|
|
244
|
+
description: "Balanced Claude model with excellent performance across all tasks including vision and reasoning",
|
|
245
|
+
capabilities: {
|
|
246
|
+
vision: true,
|
|
247
|
+
functionCalling: true,
|
|
248
|
+
codeGeneration: true,
|
|
249
|
+
reasoning: true,
|
|
250
|
+
multimodal: true,
|
|
251
|
+
streaming: true,
|
|
252
|
+
jsonMode: false,
|
|
253
|
+
},
|
|
254
|
+
pricing: {
|
|
255
|
+
inputCostPer1K: 0.003,
|
|
256
|
+
outputCostPer1K: 0.015,
|
|
257
|
+
currency: "USD",
|
|
258
|
+
},
|
|
259
|
+
performance: {
|
|
260
|
+
speed: "medium",
|
|
261
|
+
quality: "high",
|
|
262
|
+
accuracy: "high",
|
|
263
|
+
},
|
|
264
|
+
limits: {
|
|
265
|
+
maxContextTokens: 200000,
|
|
266
|
+
maxOutputTokens: 64000,
|
|
267
|
+
maxRequestsPerMinute: 100,
|
|
268
|
+
},
|
|
269
|
+
useCases: {
|
|
270
|
+
coding: 10,
|
|
271
|
+
creative: 9,
|
|
272
|
+
analysis: 9,
|
|
273
|
+
conversation: 9,
|
|
274
|
+
reasoning: 10,
|
|
275
|
+
translation: 8,
|
|
276
|
+
summarization: 8,
|
|
277
|
+
},
|
|
278
|
+
aliases: ["claude-4.5-sonnet", "claude-sonnet-latest", "sonnet-4.5"],
|
|
279
|
+
deprecated: false,
|
|
280
|
+
isLocal: false,
|
|
281
|
+
releaseDate: "2025-09-29",
|
|
282
|
+
category: "coding",
|
|
283
|
+
},
|
|
191
284
|
[AnthropicModels.CLAUDE_4_5_HAIKU]: {
|
|
192
285
|
id: AnthropicModels.CLAUDE_4_5_HAIKU,
|
|
193
286
|
name: "Claude 4.5 Haiku",
|