From f0715a4fbe51a259c434d902899e5a056b25f4a3 Mon Sep 17 00:00:00 2001 From: Mike Bybee Date: Mon, 19 Feb 2024 16:29:58 -0600 Subject: [PATCH] =?UTF-8?q?=F0=9F=A9=B9=20fix:=20apply=20settings.customUR?= =?UTF-8?q?L=20to=20initOpenAIClient?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/main.ts b/main.ts index b5194c5..59b8aa0 100644 --- a/main.ts +++ b/main.ts @@ -61,7 +61,11 @@ export default class Autogen extends Plugin { initOpenAIClient() { if (this.settings.openaiApiKey) { - this.openaiClient = getClient(this.settings.openaiApiKey,); + if (this.settings.customURL) { + this.openaiClient = getClient(this.settings.openaiApiKey, this.settings.customURL); + } else { + this.openaiClient = getClient(this.settings.openaiApiKey); + } } } @@ -334,7 +338,7 @@ class AutogenSettingTab extends PluginSettingTab { new Setting(containerEl) .setName("Custom URL") - .setDesc("Custom URL (e.g. for proxy or local models with OpenAI-compatible API)") + .setDesc("Set a custom URL (e.g. for proxy or local models with OpenAI-compatible API)") .addText((text) => text .setPlaceholder("Custom URL (leave blank for OpenAI default)")