converse-mcp-server 1.9.1 → 1.10.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/.env.example +25 -11
- package/README.md +26 -6
- package/bin/converse.js +1 -1
- package/package.json +1 -1
- package/src/config.js +35 -5
- package/src/providers/google.js +63 -12
- package/src/tools/chat.js +2 -2
- package/src/tools/consensus.js +48 -9
package/.env.example
CHANGED
|
@@ -1,18 +1,32 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Converse MCP Server Environment Configuration
|
|
2
2
|
# Copy this file to .env and fill in your values
|
|
3
3
|
|
|
4
|
-
#
|
|
5
|
-
#
|
|
6
|
-
#
|
|
7
|
-
#
|
|
8
|
-
|
|
9
|
-
#
|
|
10
|
-
#
|
|
11
|
-
#
|
|
12
|
-
|
|
13
|
-
#
|
|
4
|
+
# ============================================
|
|
5
|
+
# Google/Gemini Configuration Options
|
|
6
|
+
# ============================================
|
|
7
|
+
# You can use EITHER Gemini Developer API OR Vertex AI
|
|
8
|
+
|
|
9
|
+
# Option 1: Gemini Developer API (simpler setup)
|
|
10
|
+
# Get your API key from: https://makersuite.google.com/app/apikey
|
|
11
|
+
# You can use either GOOGLE_API_KEY or GEMINI_API_KEY (GOOGLE_API_KEY takes priority)
|
|
12
|
+
GOOGLE_API_KEY=your_google_api_key_here
|
|
13
|
+
# or
|
|
14
14
|
GEMINI_API_KEY=your_gemini_api_key_here
|
|
15
15
|
|
|
16
|
+
# Option 2: Google Vertex AI (enterprise/production)
|
|
17
|
+
# Requires Google Cloud project with billing and Vertex AI API enabled
|
|
18
|
+
# Set these THREE variables together:
|
|
19
|
+
# GOOGLE_GENAI_USE_VERTEXAI=true
|
|
20
|
+
# GOOGLE_CLOUD_PROJECT=your-project-id
|
|
21
|
+
# GOOGLE_CLOUD_LOCATION=us-central1
|
|
22
|
+
|
|
23
|
+
# Optional: API version (v1, v1beta, v1alpha) - defaults to v1beta
|
|
24
|
+
# GOOGLE_API_VERSION=v1beta
|
|
25
|
+
|
|
26
|
+
# ============================================
|
|
27
|
+
# Other Provider API Keys
|
|
28
|
+
# ============================================
|
|
29
|
+
|
|
16
30
|
# Get your OpenAI API key from: https://platform.openai.com/api-keys
|
|
17
31
|
OPENAI_API_KEY=your_openai_api_key_here
|
|
18
32
|
|
package/README.md
CHANGED
|
@@ -19,7 +19,7 @@ You need at least one API key from these providers:
|
|
|
19
19
|
| Provider | Where to Get | Example Format |
|
|
20
20
|
|----------|-------------|----------------|
|
|
21
21
|
| **OpenAI** | [platform.openai.com/api-keys](https://platform.openai.com/api-keys) | `sk-proj-...` |
|
|
22
|
-
| **Google** | [makersuite.google.com/app/apikey](https://makersuite.google.com/app/apikey) | `AIzaSy...` |
|
|
22
|
+
| **Google/Gemini** | [makersuite.google.com/app/apikey](https://makersuite.google.com/app/apikey) | `AIzaSy...` |
|
|
23
23
|
| **X.AI** | [console.x.ai](https://console.x.ai/) | `xai-...` |
|
|
24
24
|
| **Anthropic** | [console.anthropic.com](https://console.anthropic.com/) | `sk-ant-...` |
|
|
25
25
|
| **Mistral** | [console.mistral.ai](https://console.mistral.ai/) | `wfBMkWL0...` |
|
|
@@ -33,7 +33,7 @@ You need at least one API key from these providers:
|
|
|
33
33
|
# Add the server with your API keys
|
|
34
34
|
claude mcp add converse \
|
|
35
35
|
-e OPENAI_API_KEY=your_key_here \
|
|
36
|
-
-e
|
|
36
|
+
-e GEMINI_API_KEY=your_key_here \
|
|
37
37
|
-e XAI_API_KEY=your_key_here \
|
|
38
38
|
-e ANTHROPIC_API_KEY=your_key_here \
|
|
39
39
|
-e MISTRAL_API_KEY=your_key_here \
|
|
@@ -55,7 +55,7 @@ Add this configuration to your Claude Desktop settings:
|
|
|
55
55
|
"args": ["converse-mcp-server"],
|
|
56
56
|
"env": {
|
|
57
57
|
"OPENAI_API_KEY": "your_key_here",
|
|
58
|
-
"
|
|
58
|
+
"GEMINI_API_KEY": "your_key_here",
|
|
59
59
|
"XAI_API_KEY": "your_key_here",
|
|
60
60
|
"ANTHROPIC_API_KEY": "your_key_here",
|
|
61
61
|
"MISTRAL_API_KEY": "your_key_here",
|
|
@@ -140,6 +140,11 @@ Get multiple AI models to analyze the same question simultaneously. Each model c
|
|
|
140
140
|
- **gpt-4o-mini**: Fast multimodal (128K context)
|
|
141
141
|
|
|
142
142
|
### Google/Gemini Models
|
|
143
|
+
|
|
144
|
+
**API Key Options**:
|
|
145
|
+
- **GEMINI_API_KEY**: For Gemini Developer API (recommended)
|
|
146
|
+
- **GOOGLE_API_KEY**: Alternative name (GEMINI_API_KEY takes priority)
|
|
147
|
+
- **Vertex AI**: Use `GOOGLE_GENAI_USE_VERTEXAI=true` with project/location settings
|
|
143
148
|
- **gemini-2.5-flash** (alias: `flash`): Ultra-fast (1M context)
|
|
144
149
|
- **gemini-2.5-pro** (alias: `pro`): Deep reasoning (1M context)
|
|
145
150
|
- **gemini-2.0-flash**: Latest with experimental thinking
|
|
@@ -195,7 +200,7 @@ Create a `.env` file in your project root:
|
|
|
195
200
|
```bash
|
|
196
201
|
# Required: At least one API key
|
|
197
202
|
OPENAI_API_KEY=sk-proj-your_openai_key_here
|
|
198
|
-
|
|
203
|
+
GEMINI_API_KEY=your_gemini_api_key_here # Or GOOGLE_API_KEY (GEMINI_API_KEY takes priority)
|
|
199
204
|
XAI_API_KEY=xai-your_xai_key_here
|
|
200
205
|
ANTHROPIC_API_KEY=sk-ant-your_anthropic_key_here
|
|
201
206
|
MISTRAL_API_KEY=your_mistral_key_here
|
|
@@ -245,7 +250,7 @@ Use `"auto"` for automatic model selection, or specify exact models:
|
|
|
245
250
|
|
|
246
251
|
// Specific models
|
|
247
252
|
{ "model": "gemini-2.5-flash" }
|
|
248
|
-
{ "model": "
|
|
253
|
+
{ "model": "gpt-5" }
|
|
249
254
|
{ "model": "grok-4-0709" }
|
|
250
255
|
|
|
251
256
|
// Using aliases
|
|
@@ -254,6 +259,21 @@ Use `"auto"` for automatic model selection, or specify exact models:
|
|
|
254
259
|
{ "model": "grok" } // -> grok-4-0709
|
|
255
260
|
```
|
|
256
261
|
|
|
262
|
+
**Auto Model Behavior:**
|
|
263
|
+
- **Chat Tool**: Selects the first available provider and uses its default model
|
|
264
|
+
- **Consensus Tool**: When using `[{"model": "auto"}]`, automatically expands to the first 3 available providers
|
|
265
|
+
|
|
266
|
+
Provider priority order (requires corresponding API key):
|
|
267
|
+
1. OpenAI (`gpt-5`)
|
|
268
|
+
2. Google (`gemini-2.5-pro`)
|
|
269
|
+
3. XAI (`grok-4-0709`)
|
|
270
|
+
4. Anthropic (`claude-sonnet-4-20250514`)
|
|
271
|
+
5. Mistral (`magistral-medium-2506`)
|
|
272
|
+
6. DeepSeek (`deepseek-reasoner`)
|
|
273
|
+
7. OpenRouter (`qwen/qwen3-coder`)
|
|
274
|
+
|
|
275
|
+
The system will use the first 3 providers that have valid API keys configured. This enables automatic multi-model consensus without manually specifying models.
|
|
276
|
+
|
|
257
277
|
### Advanced Configuration
|
|
258
278
|
|
|
259
279
|
#### Manual Installation Options
|
|
@@ -272,7 +292,7 @@ If you've cloned the repository locally:
|
|
|
272
292
|
],
|
|
273
293
|
"env": {
|
|
274
294
|
"OPENAI_API_KEY": "your_key_here",
|
|
275
|
-
"
|
|
295
|
+
"GEMINI_API_KEY": "your_key_here",
|
|
276
296
|
"XAI_API_KEY": "your_key_here",
|
|
277
297
|
"ANTHROPIC_API_KEY": "your_key_here",
|
|
278
298
|
"MISTRAL_API_KEY": "your_key_here",
|
package/bin/converse.js
CHANGED
package/package.json
CHANGED
package/src/config.js
CHANGED
|
@@ -80,6 +80,7 @@ const CONFIG_SCHEMA = {
|
|
|
80
80
|
OPENAI_API_KEY: { type: 'string', required: false, secret: true, description: 'OpenAI API key' },
|
|
81
81
|
XAI_API_KEY: { type: 'string', required: false, secret: true, description: 'XAI API key' },
|
|
82
82
|
GOOGLE_API_KEY: { type: 'string', required: false, secret: true, description: 'Google API key' },
|
|
83
|
+
GEMINI_API_KEY: { type: 'string', required: false, secret: true, description: 'Gemini API key (alternative to GOOGLE_API_KEY)' },
|
|
83
84
|
ANTHROPIC_API_KEY: { type: 'string', required: false, secret: true, description: 'Anthropic API key' },
|
|
84
85
|
MISTRAL_API_KEY: { type: 'string', required: false, secret: true, description: 'Mistral API key' },
|
|
85
86
|
DEEPSEEK_API_KEY: { type: 'string', required: false, secret: true, description: 'DeepSeek API key' },
|
|
@@ -91,6 +92,12 @@ const CONFIG_SCHEMA = {
|
|
|
91
92
|
OPENROUTER_REFERER: { type: 'string', required: false, description: 'OpenRouter referer header for compliance' },
|
|
92
93
|
OPENROUTER_TITLE: { type: 'string', required: false, description: 'OpenRouter X-Title header for request tracking' },
|
|
93
94
|
OPENROUTER_DYNAMIC_MODELS: { type: 'boolean', default: false, description: 'Enable dynamic model discovery via OpenRouter endpoints API' },
|
|
95
|
+
|
|
96
|
+
// Google Vertex AI configuration
|
|
97
|
+
GOOGLE_GENAI_USE_VERTEXAI: { type: 'boolean', default: false, description: 'Use Google Vertex AI instead of Gemini Developer API' },
|
|
98
|
+
GOOGLE_CLOUD_PROJECT: { type: 'string', required: false, description: 'Google Cloud project ID for Vertex AI' },
|
|
99
|
+
GOOGLE_CLOUD_LOCATION: { type: 'string', required: false, description: 'Google Cloud location for Vertex AI (e.g., us-central1)' },
|
|
100
|
+
GOOGLE_API_VERSION: { type: 'string', default: 'v1beta', description: 'Google API version (v1, v1beta, v1alpha)' }
|
|
94
101
|
},
|
|
95
102
|
|
|
96
103
|
|
|
@@ -161,7 +168,10 @@ function validateApiKeyFormat(provider, apiKey) {
|
|
|
161
168
|
case 'xai':
|
|
162
169
|
return apiKey.startsWith('xai-') && apiKey.length > 20;
|
|
163
170
|
case 'google':
|
|
164
|
-
|
|
171
|
+
case 'gemini':
|
|
172
|
+
// Special case for Vertex AI marker
|
|
173
|
+
if (apiKey === 'VERTEX_AI') return true;
|
|
174
|
+
return apiKey.length > 20; // Google/Gemini keys vary in format
|
|
165
175
|
case 'anthropic':
|
|
166
176
|
return apiKey.startsWith('sk-ant-') && apiKey.length >= 30;
|
|
167
177
|
case 'mistral':
|
|
@@ -232,7 +242,15 @@ export async function loadConfig() {
|
|
|
232
242
|
const value = validateEnvVar(key, process.env[key], schema);
|
|
233
243
|
if (value) {
|
|
234
244
|
const providerName = key.replace('_API_KEY', '').toLowerCase();
|
|
235
|
-
|
|
245
|
+
// Map GEMINI_API_KEY to google provider
|
|
246
|
+
if (providerName === 'gemini') {
|
|
247
|
+
// Only use GEMINI_API_KEY if GOOGLE_API_KEY is not already set
|
|
248
|
+
if (!config.apiKeys.google) {
|
|
249
|
+
config.apiKeys.google = value;
|
|
250
|
+
}
|
|
251
|
+
} else {
|
|
252
|
+
config.apiKeys[providerName] = value;
|
|
253
|
+
}
|
|
236
254
|
}
|
|
237
255
|
} catch (error) {
|
|
238
256
|
errors.push(error.message);
|
|
@@ -285,14 +303,26 @@ export async function loadConfig() {
|
|
|
285
303
|
nodeEnv,
|
|
286
304
|
};
|
|
287
305
|
|
|
288
|
-
// Validate that at least one API key is present
|
|
306
|
+
// Validate that at least one API key is present OR Vertex AI is configured
|
|
289
307
|
const availableKeys = Object.keys(config.apiKeys);
|
|
290
|
-
|
|
308
|
+
const hasVertexAI = config.providers.googlegenaiusevertexai &&
|
|
309
|
+
config.providers.googlecloudproject &&
|
|
310
|
+
config.providers.googlecloudlocation;
|
|
311
|
+
|
|
312
|
+
if (availableKeys.length === 0 && !hasVertexAI) {
|
|
291
313
|
errors.push(
|
|
292
|
-
'At least one API key must be configured: OPENAI_API_KEY, XAI_API_KEY, GOOGLE_API_KEY, ANTHROPIC_API_KEY, MISTRAL_API_KEY, DEEPSEEK_API_KEY, or OPENROUTER_API_KEY'
|
|
314
|
+
'At least one API key must be configured: OPENAI_API_KEY, XAI_API_KEY, GOOGLE_API_KEY, GEMINI_API_KEY, ANTHROPIC_API_KEY, MISTRAL_API_KEY, DEEPSEEK_API_KEY, or OPENROUTER_API_KEY. Alternatively, configure Google Vertex AI with GOOGLE_GENAI_USE_VERTEXAI, GOOGLE_CLOUD_PROJECT, and GOOGLE_CLOUD_LOCATION.'
|
|
293
315
|
);
|
|
294
316
|
}
|
|
295
317
|
|
|
318
|
+
// If Vertex AI is enabled, add it as a special google provider config
|
|
319
|
+
if (hasVertexAI) {
|
|
320
|
+
// Mark google as available even without API key when using Vertex AI
|
|
321
|
+
if (!config.apiKeys.google) {
|
|
322
|
+
config.apiKeys.google = 'VERTEX_AI'; // Special marker for Vertex AI mode
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
|
|
296
326
|
// Validate API key formats
|
|
297
327
|
for (const [provider, apiKey] of Object.entries(config.apiKeys)) {
|
|
298
328
|
if (!validateApiKeyFormat(provider, apiKey)) {
|
package/src/providers/google.js
CHANGED
|
@@ -122,13 +122,18 @@ function resolveModelName(modelName) {
|
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
/**
|
|
125
|
-
* Validate Google API key format
|
|
125
|
+
* Validate Google API key format or Vertex AI marker
|
|
126
126
|
*/
|
|
127
127
|
function validateApiKey(apiKey) {
|
|
128
128
|
if (!apiKey || typeof apiKey !== 'string') {
|
|
129
129
|
return false;
|
|
130
130
|
}
|
|
131
131
|
|
|
132
|
+
// Special marker for Vertex AI mode
|
|
133
|
+
if (apiKey === 'VERTEX_AI') {
|
|
134
|
+
return true;
|
|
135
|
+
}
|
|
136
|
+
|
|
132
137
|
// Google API keys are typically long strings, usually starting with specific patterns
|
|
133
138
|
// They are generally 39+ characters long
|
|
134
139
|
return apiKey.length >= 20;
|
|
@@ -333,20 +338,58 @@ export const googleProvider = {
|
|
|
333
338
|
reasoning_effort = 'medium',
|
|
334
339
|
use_websearch = false,
|
|
335
340
|
config,
|
|
336
|
-
...
|
|
341
|
+
..._otherOptions
|
|
337
342
|
} = options;
|
|
338
343
|
|
|
339
|
-
//
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
344
|
+
// Check if using Vertex AI or Gemini Developer API
|
|
345
|
+
const useVertexAI = config?.providers?.googlegenaiusevertexai;
|
|
346
|
+
const vertexProject = config?.providers?.googlecloudproject;
|
|
347
|
+
const vertexLocation = config?.providers?.googlecloudlocation;
|
|
348
|
+
const apiVersion = config?.providers?.googleapiversion || 'v1beta';
|
|
349
|
+
|
|
350
|
+
let genAI;
|
|
351
|
+
|
|
352
|
+
if (useVertexAI) {
|
|
353
|
+
// Validate Vertex AI configuration
|
|
354
|
+
if (!vertexProject || !vertexLocation) {
|
|
355
|
+
throw new GoogleProviderError(
|
|
356
|
+
'Vertex AI requires GOOGLE_CLOUD_PROJECT and GOOGLE_CLOUD_LOCATION',
|
|
357
|
+
'MISSING_VERTEX_CONFIG'
|
|
358
|
+
);
|
|
359
|
+
}
|
|
343
360
|
|
|
344
|
-
|
|
345
|
-
throw new GoogleProviderError('Invalid Google API key format', 'INVALID_API_KEY');
|
|
346
|
-
}
|
|
361
|
+
debugLog(`[Google] Using Vertex AI: project=${vertexProject}, location=${vertexLocation}, apiVersion=${apiVersion}`);
|
|
347
362
|
|
|
348
|
-
|
|
349
|
-
|
|
363
|
+
// Initialize with Vertex AI configuration
|
|
364
|
+
genAI = new GoogleGenAI({
|
|
365
|
+
vertexai: true,
|
|
366
|
+
project: vertexProject,
|
|
367
|
+
location: vertexLocation,
|
|
368
|
+
apiVersion
|
|
369
|
+
});
|
|
370
|
+
} else {
|
|
371
|
+
// Use Gemini Developer API with API key
|
|
372
|
+
const apiKey = config?.apiKeys?.google;
|
|
373
|
+
|
|
374
|
+
if (!apiKey || apiKey === 'VERTEX_AI') {
|
|
375
|
+
throw new GoogleProviderError(
|
|
376
|
+
'Google API key not configured. Set GOOGLE_API_KEY or GEMINI_API_KEY, or configure Vertex AI',
|
|
377
|
+
'MISSING_API_KEY'
|
|
378
|
+
);
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
if (!validateApiKey(apiKey)) {
|
|
382
|
+
throw new GoogleProviderError('Invalid Google API key format', 'INVALID_API_KEY');
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
debugLog(`[Google] Using Gemini Developer API with configured API key, apiVersion=${apiVersion}`);
|
|
386
|
+
|
|
387
|
+
// Initialize with API key - SDK will use GOOGLE_API_KEY as the actual key name
|
|
388
|
+
genAI = new GoogleGenAI({
|
|
389
|
+
apiKey,
|
|
390
|
+
apiVersion
|
|
391
|
+
});
|
|
392
|
+
}
|
|
350
393
|
|
|
351
394
|
// Resolve model name
|
|
352
395
|
const resolvedModel = resolveModelName(model);
|
|
@@ -466,7 +509,15 @@ export const googleProvider = {
|
|
|
466
509
|
* @returns {boolean} - True if configuration is valid
|
|
467
510
|
*/
|
|
468
511
|
validateConfig(config) {
|
|
469
|
-
|
|
512
|
+
// Check for Vertex AI configuration
|
|
513
|
+
const hasVertexAI = !!(config?.providers?.googlegenaiusevertexai &&
|
|
514
|
+
config?.providers?.googlecloudproject &&
|
|
515
|
+
config?.providers?.googlecloudlocation);
|
|
516
|
+
|
|
517
|
+
// Check for API key configuration
|
|
518
|
+
const hasApiKey = !!(config?.apiKeys?.google && validateApiKey(config.apiKeys.google));
|
|
519
|
+
|
|
520
|
+
return hasVertexAI || hasApiKey;
|
|
470
521
|
},
|
|
471
522
|
|
|
472
523
|
/**
|
package/src/tools/chat.js
CHANGED
|
@@ -272,7 +272,7 @@ function resolveAutoModel(model, providerName) {
|
|
|
272
272
|
}
|
|
273
273
|
|
|
274
274
|
const defaults = {
|
|
275
|
-
'openai': '
|
|
275
|
+
'openai': 'gpt-5',
|
|
276
276
|
'xai': 'grok-4-0709',
|
|
277
277
|
'google': 'gemini-2.5-pro',
|
|
278
278
|
'anthropic': 'claude-sonnet-4-20250514',
|
|
@@ -281,7 +281,7 @@ function resolveAutoModel(model, providerName) {
|
|
|
281
281
|
'openrouter': 'qwen/qwen3-coder'
|
|
282
282
|
};
|
|
283
283
|
|
|
284
|
-
return defaults[providerName] || 'gpt-
|
|
284
|
+
return defaults[providerName] || 'gpt-5';
|
|
285
285
|
}
|
|
286
286
|
|
|
287
287
|
function mapModelToProvider(model, providers) {
|
package/src/tools/consensus.js
CHANGED
|
@@ -143,7 +143,39 @@ export async function consensusTool(args, dependencies) {
|
|
|
143
143
|
const providerCalls = [];
|
|
144
144
|
const failedModels = [];
|
|
145
145
|
|
|
146
|
-
for
|
|
146
|
+
// Special handling for single "auto" model - expand to first 3 available providers
|
|
147
|
+
let modelsToProcess = models;
|
|
148
|
+
if (models.length === 1 && models[0].model && models[0].model.toLowerCase() === 'auto') {
|
|
149
|
+
// Find first 3 available providers
|
|
150
|
+
const availableProviders = [];
|
|
151
|
+
const providerOrder = ['openai', 'google', 'xai', 'anthropic', 'mistral', 'deepseek', 'openrouter'];
|
|
152
|
+
|
|
153
|
+
for (const providerName of providerOrder) {
|
|
154
|
+
if (availableProviders.length >= 3) break;
|
|
155
|
+
const provider = providers[providerName];
|
|
156
|
+
if (provider && provider.isAvailable(config)) {
|
|
157
|
+
availableProviders.push(providerName);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
if (availableProviders.length === 0) {
|
|
162
|
+
return createToolError('No providers available. Please configure at least one API key.');
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
// Create model specs for each available provider with their default model
|
|
166
|
+
modelsToProcess = availableProviders.map(providerName => ({
|
|
167
|
+
model: getDefaultModelForProvider(providerName)
|
|
168
|
+
}));
|
|
169
|
+
|
|
170
|
+
logger.debug('Auto-expanded to providers', {
|
|
171
|
+
data: {
|
|
172
|
+
providers: availableProviders,
|
|
173
|
+
models: modelsToProcess.map(m => m.model)
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
for (const modelSpec of modelsToProcess) {
|
|
147
179
|
if (!modelSpec.model || typeof modelSpec.model !== 'string') {
|
|
148
180
|
failedModels.push({
|
|
149
181
|
model: modelSpec.model || 'unknown',
|
|
@@ -406,15 +438,11 @@ Please provide your refined response:`;
|
|
|
406
438
|
* @returns {string} Provider name
|
|
407
439
|
*/
|
|
408
440
|
/**
|
|
409
|
-
*
|
|
441
|
+
* Get default model for a provider
|
|
410
442
|
*/
|
|
411
|
-
function
|
|
412
|
-
if (model.toLowerCase() !== 'auto') {
|
|
413
|
-
return model;
|
|
414
|
-
}
|
|
415
|
-
|
|
443
|
+
function getDefaultModelForProvider(providerName) {
|
|
416
444
|
const defaults = {
|
|
417
|
-
'openai': '
|
|
445
|
+
'openai': 'gpt-5',
|
|
418
446
|
'xai': 'grok-4-0709',
|
|
419
447
|
'google': 'gemini-2.5-pro',
|
|
420
448
|
'anthropic': 'claude-sonnet-4-20250514',
|
|
@@ -423,7 +451,18 @@ function resolveAutoModel(model, providerName) {
|
|
|
423
451
|
'openrouter': 'qwen/qwen3-coder'
|
|
424
452
|
};
|
|
425
453
|
|
|
426
|
-
return defaults[providerName] || '
|
|
454
|
+
return defaults[providerName] || 'gpt-5';
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
/**
|
|
458
|
+
* Resolve "auto" model to default model for the provider
|
|
459
|
+
*/
|
|
460
|
+
function resolveAutoModel(model, providerName) {
|
|
461
|
+
if (model.toLowerCase() !== 'auto') {
|
|
462
|
+
return model;
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
return getDefaultModelForProvider(providerName);
|
|
427
466
|
}
|
|
428
467
|
|
|
429
468
|
function mapModelToProvider(model, providers) {
|