Mark which models are eligible for turbo edits (#172)

This commit is contained in:
Will Chen
2025-05-15 16:02:42 -07:00
committed by GitHub
parent 16e1dd7fc4
commit 09fc028f94
5 changed files with 38 additions and 22 deletions

View File

@@ -0,0 +1,22 @@
import { LargeLanguageModel } from "@/lib/schemas";
import { LanguageModel } from "../ipc_types";
import { getLanguageModels } from "../shared/language_model_helpers";
export async function findLanguageModel(
model: LargeLanguageModel,
): Promise<LanguageModel | undefined> {
const models = await getLanguageModels({
providerId: model.provider,
});
if (model.customModelId) {
const customModel = models.find(
(m) => m.type === "custom" && m.id === model.customModelId,
);
if (customModel) {
return customModel;
}
}
return models.find((m) => m.apiName === model.name);
}