refactor: only handle test environments
This commit is contained in:
parent
e480bcf9d0
commit
51ef9a9ec7
1 changed files with 5 additions and 7 deletions
|
|
@ -1,15 +1,13 @@
|
|||
type NextEditModelName = "mercury-coder-nextedit";
|
||||
export function isNextEditTest(): boolean {
|
||||
const enabled = process.env.NEXT_EDIT_TEST_ENABLED;
|
||||
|
||||
export function isModelCapableOfNextEdit(modelName: string): boolean {
|
||||
// In test mode, we can control whether next edit is enabled via environment variable.
|
||||
if (process.env.NEXT_EDIT_TEST_ENABLED === "false") {
|
||||
if (enabled === "false") {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (process.env.NEXT_EDIT_TEST_ENABLED === "true") {
|
||||
if (enabled === "true") {
|
||||
return true;
|
||||
}
|
||||
|
||||
const supportedModels: NextEditModelName[] = ["mercury-coder-nextedit"];
|
||||
return supportedModels.some((supported) => modelName.includes(supported));
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue