removing restcting of available models, fixing max tokens issues in test

This commit is contained in:
Badri Narayanan S
2025-12-27 12:17:45 +05:30
parent f86c4f4d32
commit 9b7dcf3a6c
10 changed files with 63 additions and 93 deletions

View File

@@ -9,20 +9,9 @@
import crypto from 'crypto';
import {
MODEL_MAPPINGS,
CLAUDE_THINKING_MAX_OUTPUT_TOKENS,
MIN_SIGNATURE_LENGTH
} from './constants.js';
/**
* Map Anthropic model name to Antigravity model name
* @param {string} anthropicModel - Anthropic format model name (e.g., 'claude-3-5-sonnet-20241022')
* @returns {string} Antigravity format model name (e.g., 'claude-sonnet-4-5')
*/
export function mapModelName(anthropicModel) {
return MODEL_MAPPINGS[anthropicModel] || anthropicModel;
}
/**
* Check if a part is a thinking block
* @param {Object} part - Content part to check
@@ -509,13 +498,6 @@ export function convertAnthropicToGoogle(anthropicRequest) {
const thinkingBudget = thinking?.budget_tokens;
if (thinkingBudget) {
thinkingConfig.thinking_budget = thinkingBudget;
// Ensure maxOutputTokens is large enough when budget is specified
if (!googleRequest.generationConfig.maxOutputTokens ||
googleRequest.generationConfig.maxOutputTokens <= thinkingBudget) {
googleRequest.generationConfig.maxOutputTokens = CLAUDE_THINKING_MAX_OUTPUT_TOKENS;
}
console.log('[FormatConverter] Thinking enabled with budget:', thinkingBudget);
} else {
console.log('[FormatConverter] Thinking enabled (no budget specified)');
@@ -725,7 +707,6 @@ export function convertGoogleToAnthropic(googleResponse, model) {
}
export default {
mapModelName,
convertAnthropicToGoogle,
convertGoogleToAnthropic
};