Spaces:
Running
Running
| 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); | |
| }); | |