refactor: Decouple model from provider

This commit is contained in:
2026-07-09 19:02:42 +05:30
parent acd62bdb65
commit 053748564f
5 changed files with 45 additions and 17 deletions

View File

@@ -43,4 +43,5 @@ export interface LLMProviderInstance {
providerName: string;
apiKey: string;
isActive: boolean;
modelName?: string;
}

View File

@@ -8,14 +8,14 @@ export class GeminiProvider implements ILLMProvider {
private model: ChatGoogleGenerativeAI;
lastCalls: LLMCallRecord[] = [];
constructor(apiKey?: string) {
constructor(apiKey?: string, modelName?: string) {
const key = apiKey || llmConfig.GOOGLE_API_KEY;
if (!key) {
throw new Error("GOOGLE_API_KEY is required to initialize GeminiProvider");
}
this.model = new ChatGoogleGenerativeAI({
apiKey: key,
model: "gemini-2.5-flash",
model: modelName || "gemini-2.5-flash",
});
}