mirror of
https://github.com/aidantilgner/AutogenObsidianPlugin.git
synced 2026-07-22 09:20:32 +00:00
🩹 fix: apply settings.customURL to initOpenAIClient
This commit is contained in:
parent
3a610fe447
commit
f0715a4fbe
1 changed files with 6 additions and 2 deletions
8
main.ts
8
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)")
|
||||
|
|
|
|||
Loading…
Reference in a new issue