Skip to content

Commit 06beba1

Browse files
committed
Add OpenAI provider configuration
1 parent 3d571b9 commit 06beba1

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

src/views/pages/Config.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,13 +254,15 @@ const Config = function () {
254254
label={t("API Base of OpenAI")}
255255
withAsterisk
256256
description={t("the base URL for the API")}
257+
{...form.getInputProps("providers.openai.api_base")}
257258
/>
258259
<PasswordInput
259260
styles={commonInputStyle}
260261
withAsterisk
261262
label="Access Key of OpenAI"
262263
placeholder="Your Access Key"
263264
description="please keep this secret"
265+
{...form.getInputProps("providers.openai.api_key")}
264266
/>
265267
</Stack>
266268
</Tabs.Panel>

src/views/stores/ConfigStore.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@ export const ConfigStore = types
5151
};
5252
}
5353
});
54+
if (!newConfig.providers?.openai) {
55+
newConfig.providers.openai = {
56+
api_key: "",
57+
api_base: "",
58+
};
59+
}
5460
self.config = newConfig;
5561
self.settle = true;
5662
},

0 commit comments

Comments
 (0)