gravityyy-proxyyy / tests /migration /request-converter-thinking.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
971 Bytes
import test from 'node:test';
import assert from 'node:assert/strict';
import { convertAnthropicToGoogle } from '../../src/format/request-converter.js';
test('OpenAI Flash high reaches Google as thinkingLevel high', () => {
const google = convertAnthropicToGoogle({
model: 'gemini-3.5-flash-low',
messages: [{ role: 'user', content: 'hello' }],
max_tokens: 1024,
reasoning_effort: 'high'
});
assert.deepEqual(google.generationConfig.thinkingConfig, {
includeThoughts: true,
thinkingLevel: 'high'
});
assert.equal('thinkingBudget' in google.generationConfig.thinkingConfig, false);
});
test('Gemini 2.5 uses thinkingBudget', () => {
const google = convertAnthropicToGoogle({
model: 'gemini-2.5-flash',
messages: [{ role: 'user', content: 'hello' }],
reasoning_effort: 'medium'
});
assert.equal(google.generationConfig.thinkingConfig.thinkingBudget, 12288);
});