gravityyy-proxyyy / tests /migration /request-converter-tools.test.js
bardd's picture
Fix gemini-3.1-pro-high by routing to pro-low with thinkingLevel high.
4badc3b
Raw
History Blame Contribute Delete
914 Bytes
import test from 'node:test';
import assert from 'node:assert/strict';
import { convertAnthropicToGoogle } from '../../src/format/request-converter.js';
test('googleSearch is a built-in tool, not a function declaration', () => {
const google = convertAnthropicToGoogle({
model: 'gemini-3.5-flash-low',
messages: [{ role: 'user', content: 'latest news' }],
tools: [
{ googleSearch: {} },
{
name: 'lookup_record',
description: 'Look up a record',
input_schema: { type: 'object', properties: { id: { type: 'string' } } }
}
]
});
assert.equal(google.tools.some(tool => tool.googleSearch), true);
const declarations = google.tools.find(tool => tool.functionDeclarations)?.functionDeclarations || [];
assert.deepEqual(declarations.map(item => item.name), ['lookup_record']);
});