@juspay/neurolink 13.8.18 → 13.8.20

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.
@@ -1,3 +1,10 @@
1
+ /**
2
+ * Retrieves a header value case-insensitively from either a Headers object or a plain record.
3
+ *
4
+ * @param headers - The HTTP headers object or record
5
+ * @param headerName - The case-insensitive name of the header to retrieve
6
+ * @returns The header value, or null if not found
7
+ */
1
8
  function getHeader(headers, headerName) {
2
9
  if ("get" in headers && typeof headers.get === "function") {
3
10
  return headers.get(headerName);
@@ -10,6 +17,128 @@ function getHeader(headers, headerName) {
10
17
  }
11
18
  return null;
12
19
  }
20
+ /**
21
+ * Parses a duration string (e.g., "6m0s", "30s", "1h30m", "500ms") into milliseconds.
22
+ *
23
+ * @param raw - The raw duration string
24
+ * @returns Duration in milliseconds, or undefined if invalid
25
+ */
26
+ export function parseDurationMs(raw) {
27
+ const trimmed = raw.trim();
28
+ if (!trimmed) {
29
+ return undefined;
30
+ }
31
+ // Must consist of one or more [number][unit] components
32
+ const durationPattern = /^(\d+(?:\.\d+)?(?:ms|s|m|h))+$/i;
33
+ if (!durationPattern.test(trimmed)) {
34
+ return undefined;
35
+ }
36
+ const tokenRegex = /(\d+(?:\.\d+)?)(ms|s|m|h)/gi;
37
+ let totalMs = 0;
38
+ let match;
39
+ let matchedLength = 0;
40
+ while ((match = tokenRegex.exec(trimmed)) !== null) {
41
+ matchedLength += match[0].length;
42
+ const num = parseFloat(match[1]);
43
+ const unit = match[2].toLowerCase();
44
+ switch (unit) {
45
+ case "h":
46
+ totalMs += num * 3600 * 1000;
47
+ break;
48
+ case "m":
49
+ totalMs += num * 60 * 1000;
50
+ break;
51
+ case "s":
52
+ totalMs += num * 1000;
53
+ break;
54
+ case "ms":
55
+ totalMs += num;
56
+ break;
57
+ }
58
+ }
59
+ return matchedLength === trimmed.length ? Math.round(totalMs) : undefined;
60
+ }
61
+ /**
62
+ * Parses a single Retry-After header value into milliseconds.
63
+ *
64
+ * Checks in strict order:
65
+ * 1. Strict numeric seconds (e.g. "5", "120", "1.5") without truncation of dates or durations
66
+ * 2. HTTP-date or RFC 3339 / ISO 8601 date (e.g. "2026-10-18T12:00:00Z" or "Sun, 18 Oct 2026 12:00:00 GMT")
67
+ * 3. Duration string (e.g. "6m0s", "30s", "1h30m", "500ms")
68
+ *
69
+ * @param value - The header value string
70
+ * @returns Milliseconds to wait, or undefined if not parseable
71
+ */
72
+ export function parseRetryAfterHeaderValue(value) {
73
+ if (!value) {
74
+ return undefined;
75
+ }
76
+ const trimmed = value.trim();
77
+ if (!trimmed) {
78
+ return undefined;
79
+ }
80
+ // 1. Strict numeric representation (delta seconds)
81
+ // Note: Avoid parseInt, which reads leading digits from dates ("2026-10-13..." -> 2026) or durations ("6m0s" -> 6)
82
+ if (/^\d+(?:\.\d+)?$/.test(trimmed)) {
83
+ const seconds = Number(trimmed);
84
+ if (Number.isFinite(seconds) && seconds >= 0) {
85
+ return Math.round(seconds * 1000);
86
+ }
87
+ }
88
+ // 2. HTTP-date or RFC 3339 / ISO 8601 date
89
+ const parsedDate = Date.parse(trimmed);
90
+ if (Number.isFinite(parsedDate)) {
91
+ return Math.max(0, parsedDate - Date.now());
92
+ }
93
+ // 3. Duration string (e.g. "6m0s", "30s", "500ms")
94
+ const duration = parseDurationMs(trimmed);
95
+ if (duration !== undefined && duration >= 0) {
96
+ return duration;
97
+ }
98
+ return undefined;
99
+ }
100
+ /**
101
+ * Parses X-RateLimit-Reset header value into milliseconds until reset.
102
+ *
103
+ * Handles:
104
+ * - Delta seconds when value < 1e9 (e.g. "30", "60")
105
+ * - Epoch seconds when 1e9 <= value <= 1e12
106
+ * - Epoch milliseconds when value > 1e12
107
+ * - Fallback to date or duration strings
108
+ *
109
+ * @param value - The X-RateLimit-Reset header value
110
+ * @returns Milliseconds until reset, or undefined if not parseable
111
+ */
112
+ export function parseRateLimitResetValue(value) {
113
+ if (!value) {
114
+ return undefined;
115
+ }
116
+ const trimmed = value.trim();
117
+ if (!trimmed) {
118
+ return undefined;
119
+ }
120
+ if (/^\d+(?:\.\d+)?$/.test(trimmed)) {
121
+ const num = Number(trimmed);
122
+ if (Number.isFinite(num) && num >= 0) {
123
+ if (num < 1e9) {
124
+ // Delta seconds (e.g. 30, 60, 300)
125
+ return Math.round(num * 1000);
126
+ }
127
+ // Unix epoch timestamp
128
+ const resetTime = num > 1e12 ? num : num * 1000;
129
+ return Math.max(0, Math.round(resetTime - Date.now()));
130
+ }
131
+ }
132
+ const parsedDate = Date.parse(trimmed);
133
+ if (Number.isFinite(parsedDate)) {
134
+ return Math.max(0, parsedDate - Date.now());
135
+ }
136
+ const duration = parseDurationMs(trimmed);
137
+ if (duration !== undefined && duration >= 0) {
138
+ return duration;
139
+ }
140
+ return undefined;
141
+ }
13
142
  /**
14
143
  * Parse standard and commonly used rate-limit response headers.
15
144
  *
@@ -19,21 +148,16 @@ function getHeader(headers, headerName) {
19
148
  export function parseRetryAfterMs(headers) {
20
149
  const retryAfter = getHeader(headers, "Retry-After");
21
150
  if (retryAfter) {
22
- const seconds = parseInt(retryAfter, 10);
23
- if (!Number.isNaN(seconds)) {
24
- return Math.max(0, seconds * 1000);
25
- }
26
- const retryDate = new Date(retryAfter);
27
- if (!Number.isNaN(retryDate.getTime())) {
28
- return Math.max(0, retryDate.getTime() - Date.now());
151
+ const delay = parseRetryAfterHeaderValue(retryAfter);
152
+ if (delay !== undefined) {
153
+ return delay;
29
154
  }
30
155
  }
31
156
  const rateLimitReset = getHeader(headers, "X-RateLimit-Reset");
32
157
  if (rateLimitReset) {
33
- const resetTimestamp = parseInt(rateLimitReset, 10);
34
- if (!Number.isNaN(resetTimestamp)) {
35
- const resetTime = resetTimestamp > 1e12 ? resetTimestamp : resetTimestamp * 1000;
36
- return Math.max(0, resetTime - Date.now());
158
+ const delay = parseRateLimitResetValue(rateLimitReset);
159
+ if (delay !== undefined) {
160
+ return delay;
37
161
  }
38
162
  }
39
163
  if (getHeader(headers, "X-RateLimit-Remaining") === "0") {
@@ -42,7 +42,7 @@ export declare const QUALITY_MAX_WORKFLOW: WorkflowConfig;
42
42
  *
43
43
  * Optimizes for speed with quality fallback:
44
44
  * 1. Fast tier: Single fast model (GPT-4o-mini)
45
- * 2. Balanced tier: If fast fails, use Gemini 2.0
45
+ * 2. Balanced tier: If fast fails, use Gemini 3.8 Flash
46
46
  * 3. Quality tier: If both fail, use GPT-4o
47
47
  */
48
48
  export declare const SPEED_FIRST_WORKFLOW: WorkflowConfig;
@@ -51,7 +51,7 @@ export declare const SPEED_FIRST_WORKFLOW: WorkflowConfig;
51
51
  *
52
52
  * Balances speed, cost, and quality:
53
53
  * 1. Standard tier (parallel): GPT-4o-mini + Gemini Flash
54
- * 2. Premium tier (parallel): GPT-4o + Claude 3.5 if standard uncertain
54
+ * 2. Premium tier (parallel): GPT-4o + Claude Sonnet 4.6 if standard uncertain
55
55
  */
56
56
  export declare const BALANCED_ADAPTIVE_WORKFLOW: WorkflowConfig;
57
57
  /**
@@ -67,7 +67,7 @@ export const QUALITY_MAX_WORKFLOW = {
67
67
  },
68
68
  {
69
69
  provider: AIProviderName.GOOGLE_AI,
70
- model: "gemini-2.0-flash",
70
+ model: "gemini-3.8-flash",
71
71
  label: "Gemini Flash",
72
72
  temperature: 0.7,
73
73
  timeout: 10000,
@@ -93,8 +93,8 @@ export const QUALITY_MAX_WORKFLOW = {
93
93
  },
94
94
  {
95
95
  provider: AIProviderName.ANTHROPIC,
96
- model: "claude-3-5-sonnet-20241022",
97
- label: "Claude 3.5 Sonnet",
96
+ model: "claude-sonnet-4-6",
97
+ label: "Claude Sonnet 4.6",
98
98
  temperature: 0.7,
99
99
  systemPrompt: "Think deeply and provide nuanced, well-reasoned responses.",
100
100
  timeout: 20000,
@@ -112,8 +112,8 @@ export const QUALITY_MAX_WORKFLOW = {
112
112
  models: [
113
113
  {
114
114
  provider: AIProviderName.ANTHROPIC,
115
- model: "claude-3-5-sonnet-20241022",
116
- label: "Claude 3.5 Sonnet Expert",
115
+ model: "claude-sonnet-4-6",
116
+ label: "Claude Sonnet 4.6 Expert",
117
117
  temperature: 0.6, // Lower temp for consistency
118
118
  systemPrompt: "You are an expert. Provide the highest quality, most accurate response possible. Be thorough, precise, and authoritative.",
119
119
  timeout: 30000,
@@ -161,7 +161,7 @@ export const QUALITY_MAX_WORKFLOW = {
161
161
  *
162
162
  * Optimizes for speed with quality fallback:
163
163
  * 1. Fast tier: Single fast model (GPT-4o-mini)
164
- * 2. Balanced tier: If fast fails, use Gemini 2.0
164
+ * 2. Balanced tier: If fast fails, use Gemini 3.8 Flash
165
165
  * 3. Quality tier: If both fail, use GPT-4o
166
166
  */
167
167
  export const SPEED_FIRST_WORKFLOW = {
@@ -198,7 +198,7 @@ export const SPEED_FIRST_WORKFLOW = {
198
198
  models: [
199
199
  {
200
200
  provider: AIProviderName.GOOGLE_AI,
201
- model: "gemini-2.0-flash",
201
+ model: "gemini-3.8-flash",
202
202
  temperature: 0.7,
203
203
  timeout: 10000,
204
204
  },
@@ -251,7 +251,7 @@ export const SPEED_FIRST_WORKFLOW = {
251
251
  *
252
252
  * Balances speed, cost, and quality:
253
253
  * 1. Standard tier (parallel): GPT-4o-mini + Gemini Flash
254
- * 2. Premium tier (parallel): GPT-4o + Claude 3.5 if standard uncertain
254
+ * 2. Premium tier (parallel): GPT-4o + Claude Sonnet 4.6 if standard uncertain
255
255
  */
256
256
  export const BALANCED_ADAPTIVE_WORKFLOW = {
257
257
  id: "balanced-adaptive",
@@ -278,7 +278,7 @@ export const BALANCED_ADAPTIVE_WORKFLOW = {
278
278
  },
279
279
  {
280
280
  provider: AIProviderName.GOOGLE_AI,
281
- model: "gemini-2.0-flash",
281
+ model: "gemini-3.8-flash",
282
282
  temperature: 0.7,
283
283
  },
284
284
  ],
@@ -299,7 +299,7 @@ export const BALANCED_ADAPTIVE_WORKFLOW = {
299
299
  },
300
300
  {
301
301
  provider: AIProviderName.ANTHROPIC,
302
- model: "claude-3-5-sonnet-20241022",
302
+ model: "claude-sonnet-4-6",
303
303
  temperature: 0.7,
304
304
  },
305
305
  ],
@@ -17,8 +17,8 @@ import type { WorkflowConfig } from "../../types/index.js";
17
17
  *
18
18
  * Uses 3 high-quality models in parallel:
19
19
  * - GPT-4o (OpenAI) - Strong reasoning
20
- * - Claude 3.5 Sonnet (Anthropic) - Thoughtful analysis
21
- * - Gemini 2.0 Flash (Google) - Fast and capable
20
+ * - Claude Sonnet 4.6 (Anthropic) - Thoughtful analysis
21
+ * - Gemini 3.8 Flash (Google) - Fast and capable
22
22
  *
23
23
  * Judge: GPT-4o evaluates on accuracy, clarity, and completeness
24
24
  *
@@ -63,7 +63,7 @@ export declare function createConsensus3WithPrompt(systemPrompt: string): Workfl
63
63
  *
64
64
  * Uses faster/cheaper models with same consensus approach:
65
65
  * - GPT-4o-mini
66
- * - Claude 3 Haiku
67
- * - Gemini 2.0 Flash
66
+ * - Claude Haiku 4.5
67
+ * - Gemini 3.8 Flash
68
68
  */
69
69
  export declare const CONSENSUS_3_FAST_WORKFLOW: WorkflowConfig;
@@ -18,8 +18,8 @@ import { WORKFLOW_CREATION_DATE } from "../config.js";
18
18
  *
19
19
  * Uses 3 high-quality models in parallel:
20
20
  * - GPT-4o (OpenAI) - Strong reasoning
21
- * - Claude 3.5 Sonnet (Anthropic) - Thoughtful analysis
22
- * - Gemini 2.0 Flash (Google) - Fast and capable
21
+ * - Claude Sonnet 4.6 (Anthropic) - Thoughtful analysis
22
+ * - Gemini 3.8 Flash (Google) - Fast and capable
23
23
  *
24
24
  * Judge: GPT-4o evaluates on accuracy, clarity, and completeness
25
25
  *
@@ -55,15 +55,15 @@ export const CONSENSUS_3_WORKFLOW = {
55
55
  },
56
56
  {
57
57
  provider: AIProviderName.ANTHROPIC,
58
- model: "claude-3-5-sonnet-20241022",
59
- label: "Claude 3.5 Sonnet",
58
+ model: "claude-sonnet-4-6",
59
+ label: "Claude Sonnet 4.6",
60
60
  weight: 1.0,
61
61
  temperature: 0.7,
62
62
  },
63
63
  {
64
64
  provider: AIProviderName.GOOGLE_AI,
65
- model: "gemini-2.0-flash",
66
- label: "Gemini 2.0 Flash",
65
+ model: "gemini-3.8-flash",
66
+ label: "Gemini 3.8 Flash",
67
67
  weight: 1.0,
68
68
  temperature: 0.7,
69
69
  },
@@ -130,8 +130,8 @@ export function createConsensus3WithPrompt(systemPrompt) {
130
130
  *
131
131
  * Uses faster/cheaper models with same consensus approach:
132
132
  * - GPT-4o-mini
133
- * - Claude 3 Haiku
134
- * - Gemini 2.0 Flash
133
+ * - Claude Haiku 4.5
134
+ * - Gemini 3.8 Flash
135
135
  */
136
136
  export const CONSENSUS_3_FAST_WORKFLOW = {
137
137
  id: "consensus-3-fast",
@@ -149,15 +149,15 @@ export const CONSENSUS_3_FAST_WORKFLOW = {
149
149
  },
150
150
  {
151
151
  provider: AIProviderName.ANTHROPIC,
152
- model: "claude-3-haiku-20240307",
153
- label: "Claude 3 Haiku",
152
+ model: "claude-haiku-4-5-20251001",
153
+ label: "Claude Haiku 4.5",
154
154
  weight: 1.0,
155
155
  temperature: 0.7,
156
156
  },
157
157
  {
158
158
  provider: AIProviderName.GOOGLE_AI,
159
- model: "gemini-2.0-flash",
160
- label: "Gemini 2.0 Flash",
159
+ model: "gemini-3.8-flash",
160
+ label: "Gemini 3.8 Flash",
161
161
  weight: 1.0,
162
162
  temperature: 0.7,
163
163
  },
@@ -17,8 +17,8 @@ import type { WorkflowConfig } from "../../types/index.js";
17
17
  *
18
18
  * Uses layer-based execution with sequential groups:
19
19
  * 1. Fast tier: GPT-4o-mini (try first)
20
- * 2. Mid tier: Gemini 2.0 Flash (if fast fails)
21
- * 3. Premium tier: GPT-4o or Claude 3.5 Sonnet (last resort)
20
+ * 2. Mid tier: Gemini 3.8 Flash (if fast fails)
21
+ * 3. Premium tier: GPT-4o or Claude Sonnet 4.6 (last resort)
22
22
  *
23
23
  * Each group runs sequentially - only proceeds if previous fails
24
24
  *
@@ -42,7 +42,7 @@ export declare const FAST_FALLBACK_WORKFLOW: WorkflowConfig;
42
42
  *
43
43
  * More aggressive fallback with parallel premium tier:
44
44
  * 1. Fast tier: GPT-4o-mini (sequential)
45
- * 2. Premium tier: GPT-4o + Claude 3.5 (parallel, both execute)
45
+ * 2. Premium tier: GPT-4o + Claude Sonnet 4.6 (parallel, both execute)
46
46
  *
47
47
  * Guarantees high quality if fast tier fails
48
48
  */
@@ -18,8 +18,8 @@ import { WORKFLOW_CREATION_DATE } from "../config.js";
18
18
  *
19
19
  * Uses layer-based execution with sequential groups:
20
20
  * 1. Fast tier: GPT-4o-mini (try first)
21
- * 2. Mid tier: Gemini 2.0 Flash (if fast fails)
22
- * 3. Premium tier: GPT-4o or Claude 3.5 Sonnet (last resort)
21
+ * 2. Mid tier: Gemini 3.8 Flash (if fast fails)
22
+ * 3. Premium tier: GPT-4o or Claude Sonnet 4.6 (last resort)
23
23
  *
24
24
  * Each group runs sequentially - only proceeds if previous fails
25
25
  *
@@ -76,8 +76,8 @@ export const FAST_FALLBACK_WORKFLOW = {
76
76
  models: [
77
77
  {
78
78
  provider: AIProviderName.GOOGLE_AI,
79
- model: "gemini-2.0-flash",
80
- label: "Gemini 2.0 Flash",
79
+ model: "gemini-3.8-flash",
80
+ label: "Gemini 3.8 Flash",
81
81
  temperature: 0.7,
82
82
  timeout: 15000, // 15 second timeout
83
83
  },
@@ -141,7 +141,7 @@ export const FAST_FALLBACK_WORKFLOW = {
141
141
  *
142
142
  * More aggressive fallback with parallel premium tier:
143
143
  * 1. Fast tier: GPT-4o-mini (sequential)
144
- * 2. Premium tier: GPT-4o + Claude 3.5 (parallel, both execute)
144
+ * 2. Premium tier: GPT-4o + Claude Sonnet 4.6 (parallel, both execute)
145
145
  *
146
146
  * Guarantees high quality if fast tier fails
147
147
  */
@@ -186,8 +186,8 @@ export const AGGRESSIVE_FALLBACK_WORKFLOW = {
186
186
  },
187
187
  {
188
188
  provider: AIProviderName.ANTHROPIC,
189
- model: "claude-3-5-sonnet-20241022",
190
- label: "Claude 3.5 Sonnet",
189
+ model: "claude-sonnet-4-6",
190
+ label: "Claude Sonnet 4.6",
191
191
  temperature: 0.7,
192
192
  },
193
193
  ],
@@ -18,14 +18,14 @@ import type { WorkflowConfig } from "../../types/index.js";
18
18
  * Uses 5 models across different providers:
19
19
  * - GPT-4o (OpenAI)
20
20
  * - GPT-4o-mini (OpenAI)
21
- * - Claude 3.5 Sonnet (Anthropic)
22
- * - Claude 3 Haiku (Anthropic)
23
- * - Gemini 2.0 Flash (Google)
21
+ * - Claude Sonnet 4.6 (Anthropic)
22
+ * - Claude Haiku 4.5 (Anthropic)
23
+ * - Gemini 3.8 Flash (Google)
24
24
  *
25
25
  * 3 independent judges vote:
26
26
  * - GPT-4o evaluates accuracy & clarity
27
- * - Claude 3.5 Sonnet evaluates reasoning & depth
28
- * - Gemini 2.0 Flash evaluates completeness & coherence
27
+ * - Claude Sonnet 4.6 evaluates reasoning & depth
28
+ * - Gemini 3.8 Flash evaluates completeness & coherence
29
29
  *
30
30
  * Scores are averaged across all judges for final selection
31
31
  *
@@ -48,8 +48,8 @@ export declare const MULTI_JUDGE_5_WORKFLOW: WorkflowConfig;
48
48
  * Multi-Judge-3 Workflow (Lighter Version)
49
49
  *
50
50
  * 3 models with 2 judges (more cost-effective):
51
- * - GPT-4o, Claude 3.5, Gemini 2.0
52
- * - Judged by GPT-4o and Claude 3.5
51
+ * - GPT-4o, Claude Sonnet 4.6, Gemini 3.8
52
+ * - Judged by GPT-4o and Claude Sonnet 4.6
53
53
  */
54
54
  export declare const MULTI_JUDGE_3_WORKFLOW: WorkflowConfig;
55
55
  /**
@@ -19,14 +19,14 @@ import { WORKFLOW_CREATION_DATE } from "../config.js";
19
19
  * Uses 5 models across different providers:
20
20
  * - GPT-4o (OpenAI)
21
21
  * - GPT-4o-mini (OpenAI)
22
- * - Claude 3.5 Sonnet (Anthropic)
23
- * - Claude 3 Haiku (Anthropic)
24
- * - Gemini 2.0 Flash (Google)
22
+ * - Claude Sonnet 4.6 (Anthropic)
23
+ * - Claude Haiku 4.5 (Anthropic)
24
+ * - Gemini 3.8 Flash (Google)
25
25
  *
26
26
  * 3 independent judges vote:
27
27
  * - GPT-4o evaluates accuracy & clarity
28
- * - Claude 3.5 Sonnet evaluates reasoning & depth
29
- * - Gemini 2.0 Flash evaluates completeness & coherence
28
+ * - Claude Sonnet 4.6 evaluates reasoning & depth
29
+ * - Gemini 3.8 Flash evaluates completeness & coherence
30
30
  *
31
31
  * Scores are averaged across all judges for final selection
32
32
  *
@@ -68,22 +68,22 @@ export const MULTI_JUDGE_5_WORKFLOW = {
68
68
  },
69
69
  {
70
70
  provider: AIProviderName.ANTHROPIC,
71
- model: "claude-3-5-sonnet-20241022",
72
- label: "Claude 3.5 Sonnet",
71
+ model: "claude-sonnet-4-6",
72
+ label: "Claude Sonnet 4.6",
73
73
  weight: 1.0,
74
74
  temperature: 0.7,
75
75
  },
76
76
  {
77
77
  provider: AIProviderName.ANTHROPIC,
78
- model: "claude-3-haiku-20240307",
79
- label: "Claude 3 Haiku",
78
+ model: "claude-haiku-4-5-20251001",
79
+ label: "Claude Haiku 4.5",
80
80
  weight: 0.7, // Lower weight for faster model
81
81
  temperature: 0.7,
82
82
  },
83
83
  {
84
84
  provider: AIProviderName.GOOGLE_AI,
85
- model: "gemini-2.0-flash",
86
- label: "Gemini 2 Flash",
85
+ model: "gemini-3.8-flash",
86
+ label: "Gemini 3.8 Flash",
87
87
  weight: 0.9,
88
88
  temperature: 0.7,
89
89
  },
@@ -102,7 +102,7 @@ export const MULTI_JUDGE_5_WORKFLOW = {
102
102
  },
103
103
  {
104
104
  provider: AIProviderName.ANTHROPIC,
105
- model: "claude-3-5-sonnet-20241022",
105
+ model: "claude-sonnet-4-6",
106
106
  criteria: ["reasoning_quality", "depth", "nuance"],
107
107
  outputFormat: "detailed",
108
108
  includeReasoning: true,
@@ -112,7 +112,7 @@ export const MULTI_JUDGE_5_WORKFLOW = {
112
112
  },
113
113
  {
114
114
  provider: AIProviderName.GOOGLE_AI,
115
- model: "gemini-2.0-flash",
115
+ model: "gemini-3.8-flash",
116
116
  criteria: ["completeness", "coherence", "relevance"],
117
117
  outputFormat: "detailed",
118
118
  includeReasoning: true,
@@ -149,8 +149,8 @@ export const MULTI_JUDGE_5_WORKFLOW = {
149
149
  * Multi-Judge-3 Workflow (Lighter Version)
150
150
  *
151
151
  * 3 models with 2 judges (more cost-effective):
152
- * - GPT-4o, Claude 3.5, Gemini 2.0
153
- * - Judged by GPT-4o and Claude 3.5
152
+ * - GPT-4o, Claude Sonnet 4.6, Gemini 3.8
153
+ * - Judged by GPT-4o and Claude Sonnet 4.6
154
154
  */
155
155
  export const MULTI_JUDGE_3_WORKFLOW = {
156
156
  id: "multi-judge-3",
@@ -168,15 +168,15 @@ export const MULTI_JUDGE_3_WORKFLOW = {
168
168
  },
169
169
  {
170
170
  provider: AIProviderName.ANTHROPIC,
171
- model: "claude-3-5-sonnet-20241022",
172
- label: "Claude 3.5 Sonnet",
171
+ model: "claude-sonnet-4-6",
172
+ label: "Claude Sonnet 4.6",
173
173
  weight: 1.0,
174
174
  temperature: 0.7,
175
175
  },
176
176
  {
177
177
  provider: AIProviderName.GOOGLE_AI,
178
- model: "gemini-2.0-flash",
179
- label: "Gemini 2.0 Flash",
178
+ model: "gemini-3.8-flash",
179
+ label: "Gemini 3.8 Flash",
180
180
  weight: 1.0,
181
181
  temperature: 0.7,
182
182
  },
@@ -194,7 +194,7 @@ export const MULTI_JUDGE_3_WORKFLOW = {
194
194
  },
195
195
  {
196
196
  provider: AIProviderName.ANTHROPIC,
197
- model: "claude-3-5-sonnet-20241022",
197
+ model: "claude-sonnet-4-6",
198
198
  criteria: ["reasoning", "depth", "coherence"],
199
199
  outputFormat: "detailed",
200
200
  includeReasoning: true,
@@ -246,15 +246,15 @@ export function createMultiJudgeWorkflow(modelCount, judgeCount) {
246
246
  },
247
247
  {
248
248
  provider: AIProviderName.ANTHROPIC,
249
- model: "claude-3-5-sonnet-20241022",
250
- label: "Claude 3.5 Sonnet",
249
+ model: "claude-sonnet-4-6",
250
+ label: "Claude Sonnet 4.6",
251
251
  weight: 1.0,
252
252
  temperature: 0.7,
253
253
  },
254
254
  {
255
255
  provider: AIProviderName.GOOGLE_AI,
256
- model: "gemini-2.0-flash",
257
- label: "Gemini 2.0 Flash",
256
+ model: "gemini-3.8-flash",
257
+ label: "Gemini 3.8 Flash",
258
258
  weight: 1.0,
259
259
  temperature: 0.7,
260
260
  },
@@ -270,8 +270,8 @@ export function createMultiJudgeWorkflow(modelCount, judgeCount) {
270
270
  },
271
271
  {
272
272
  provider: AIProviderName.ANTHROPIC,
273
- model: "claude-3-haiku-20240307",
274
- label: "Claude 3 Haiku",
273
+ model: "claude-haiku-4-5-20251001",
274
+ label: "Claude Haiku 4.5",
275
275
  weight: 0.7,
276
276
  temperature: 0.7,
277
277
  },
@@ -284,10 +284,10 @@ export function createMultiJudgeWorkflow(modelCount, judgeCount) {
284
284
  },
285
285
  {
286
286
  provider: AIProviderName.OPENAI,
287
- model: "gpt-3.5-turbo",
288
- label: "GPT-3.5 Turbo",
287
+ model: "gpt-5.6-terra",
288
+ label: "GPT-5.6 Terra",
289
289
  weight: 0.6,
290
- temperature: 0.7,
290
+ // No temperature: gpt-5.6 models reject non-default sampling values.
291
291
  },
292
292
  ];
293
293
  const models = [...baseModels, ...additionalModels.slice(0, modelCount - 3)];
@@ -305,7 +305,7 @@ export function createMultiJudgeWorkflow(modelCount, judgeCount) {
305
305
  },
306
306
  {
307
307
  provider: AIProviderName.ANTHROPIC,
308
- model: "claude-3-5-sonnet-20241022",
308
+ model: "claude-sonnet-4-6",
309
309
  criteria: ["reasoning", "depth", "coherence"],
310
310
  outputFormat: "detailed",
311
311
  includeReasoning: true,
@@ -316,7 +316,7 @@ export function createMultiJudgeWorkflow(modelCount, judgeCount) {
316
316
  ];
317
317
  const thirdJudge = {
318
318
  provider: AIProviderName.GOOGLE_AI,
319
- model: "gemini-2.0-flash",
319
+ model: "gemini-3.8-flash",
320
320
  criteria: ["relevance", "factual_accuracy", "structure"],
321
321
  outputFormat: "detailed",
322
322
  includeReasoning: true,