fix: enable strict tool parameter validation for Claude models
Set functionCallingConfig.mode = 'VALIDATED' when using Claude models to ensure strict parameter validation, matching opencode-antigravity-auth. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -226,6 +226,16 @@ export function convertAnthropicToGoogle(anthropicRequest) {
|
||||
|
||||
googleRequest.tools = [{ functionDeclarations }];
|
||||
logger.debug(`[RequestConverter] Tools: ${JSON.stringify(googleRequest.tools).substring(0, 300)}`);
|
||||
|
||||
// For Claude models, set functionCallingConfig.mode = "VALIDATED"
|
||||
// This ensures strict parameter validation (matches opencode-antigravity-auth)
|
||||
if (isClaudeModel) {
|
||||
googleRequest.toolConfig = {
|
||||
functionCallingConfig: {
|
||||
mode: 'VALIDATED'
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
// Cap max tokens for Gemini models
|
||||
|
||||
Reference in New Issue
Block a user