Added support for Gemini models

This commit is contained in:
Badri Narayanan S
2025-12-27 14:09:20 +05:30
parent 9b7dcf3a6c
commit c1e1dbb0ef
13 changed files with 641 additions and 176 deletions

View File

@@ -147,6 +147,12 @@ function analyzeContent(content) {
const toolUse = content.filter(b => b.type === 'tool_use');
const text = content.filter(b => b.type === 'text');
// Check for signatures in thinking blocks (Claude style)
const thinkingHasSignature = thinking.some(t => t.signature && t.signature.length >= 50);
// Check for signatures in tool_use blocks (Gemini 3+ style)
const toolUseHasSignature = toolUse.some(t => t.thoughtSignature && t.thoughtSignature.length >= 50);
return {
thinking,
toolUse,
@@ -154,7 +160,10 @@ function analyzeContent(content) {
hasThinking: thinking.length > 0,
hasToolUse: toolUse.length > 0,
hasText: text.length > 0,
thinkingHasSignature: thinking.some(t => t.signature && t.signature.length >= 50)
thinkingHasSignature: thinkingHasSignature,
toolUseHasSignature: toolUseHasSignature,
// Combined check: signature exists somewhere (thinking or tool_use)
hasSignature: thinkingHasSignature || toolUseHasSignature
};
}

View File

@@ -0,0 +1,87 @@
/**
* Test Models Configuration
*
* Provides model configuration for parameterized testing across
* multiple model families (Claude and Gemini).
*/
// Default test models for each family
const TEST_MODELS = {
claude: 'claude-sonnet-4-5-thinking',
gemini: 'gemini-3-flash'
};
// Default thinking model for each family
const THINKING_MODELS = {
claude: 'claude-sonnet-4-5-thinking',
gemini: 'gemini-3-flash'
};
/**
* Get models to test, optionally excluding certain families.
* @param {string[]} excludeFamilies - Array of family names to exclude (e.g., ['gemini'])
* @returns {Array<{family: string, model: string}>} Array of model configs to test
*/
function getTestModels(excludeFamilies = []) {
const models = [];
for (const [family, model] of Object.entries(TEST_MODELS)) {
if (!excludeFamilies.includes(family)) {
models.push({ family, model });
}
}
return models;
}
/**
* Get thinking models to test, optionally excluding certain families.
* @param {string[]} excludeFamilies - Array of family names to exclude
* @returns {Array<{family: string, model: string}>} Array of thinking model configs
*/
function getThinkingModels(excludeFamilies = []) {
const models = [];
for (const [family, model] of Object.entries(THINKING_MODELS)) {
if (!excludeFamilies.includes(family)) {
models.push({ family, model });
}
}
return models;
}
/**
* Check if a model family requires thinking features.
* Both Claude thinking models and Gemini 3+ support thinking.
* @param {string} family - Model family name
* @returns {boolean} True if thinking is expected
*/
function familySupportsThinking(family) {
// Both Claude thinking models and Gemini 3+ support thinking
return family === 'claude' || family === 'gemini';
}
/**
* Get model-specific configuration overrides.
* @param {string} family - Model family name
* @returns {Object} Configuration overrides for the model family
*/
function getModelConfig(family) {
if (family === 'gemini') {
return {
// Gemini has lower max output tokens
max_tokens: 8000,
thinking: { type: 'enabled', budget_tokens: 10000 }
};
}
return {
max_tokens: 16000,
thinking: { type: 'enabled', budget_tokens: 10000 }
};
}
module.exports = {
TEST_MODELS,
THINKING_MODELS,
getTestModels,
getThinkingModels,
familySupportsThinking,
getModelConfig
};