Add OPENAI_BASE_URL configuration option

This commit is contained in:
ckt1031 2024-05-02 18:48:32 +08:00
parent 408abd24ea
commit 57ee62f3af
5 changed files with 74 additions and 23 deletions

View file

@ -7,6 +7,7 @@ interface SettingsType {
[key: string]: string[];
};
openaiApiKey: string;
openaiBaseUrl: string;
groqApiKey: string;
ollamaApiUrl: string;
}
@ -183,6 +184,21 @@ const SettingsDialog = ({
className="bg-[#111111] px-3 py-2 flex items-center overflow-hidden border border-[#1C1C1C] text-white rounded-lg text-sm"
/>
</div>
<div className="flex flex-col space-y-1">
<p className="text-white/70 text-sm">OpenAI Base URL</p>
<input
type="text"
placeholder="OpenAI Base URL"
defaultValue={config.openaiBaseUrl}
onChange={(e) =>
setConfig({
...config,
openaiBaseUrl: e.target.value,
})
}
className="bg-[#111111] px-3 py-2 flex items-center overflow-hidden border border-[#1C1C1C] text-white rounded-lg text-sm"
/>
</div>
<div className="flex flex-col space-y-1">
<p className="text-white/70 text-sm">Ollama API URL</p>
<input