quantum-cli-core
Version:
Quantum CLI Core - Multi-LLM Collaboration System
32 lines • 1.04 kB
JavaScript
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
export function isThinkingSupported(model) {
if (model.startsWith('gemini-2.5'))
return true;
return false;
}
/**
* Returns the index of the content after the fraction of the total characters in the history.
*
* Exported for testing purposes.
*/
export function findIndexAfterFraction(history, fraction) {
if (fraction <= 0 || fraction >= 1) {
throw new Error('Fraction must be between 0 and 1');
}
const contentLengths = history.map((content) => JSON.stringify(content).length);
const totalCharacters = contentLengths.reduce((sum, length) => sum + length, 0);
const targetCharacters = totalCharacters * fraction;
let charactersSoFar = 0;
for (let i = 0; i < contentLengths.length; i++) {
charactersSoFar += contentLengths[i];
if (charactersSoFar >= targetCharacters) {
return i;
}
}
return contentLengths.length;
}
//# sourceMappingURL=model-utils.js.map