Added a feature to switch API service providers, enabling users to easily toggle between providers as needed.

Added a feature to switch API service providers to the project. Introduced an input field for API providers in the settings interface and included the OPENAI_URL parameter in the config file.
This commit is contained in:
Github-CJX 2024-05-02 11:43:24 +08:00
parent f21f5c9611
commit 1ebe69ec94
5 changed files with 35 additions and 2 deletions

View file

@ -8,6 +8,7 @@ interface SettingsType {
};
selectedProvider: string;
selectedChatModel: string;
openaiUrl: string;
openeaiApiKey: string;
groqApiKey: string;
ollamaApiUrl: string;
@ -165,6 +166,21 @@ const SettingsDialog = ({
</select>
</div>
)}
<div className="flex flex-col space-y-1">
<p className="text-white/70 text-sm">OpenAI Url</p>
<input
type="text"
placeholder="OpenAI Url"
defaultValue={config.openaiUrl}
onChange={(e) =>
setConfig({
...config,
openaiUrl: 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">OpenAI API Key</p>
<input