feat: settings command dev done
This commit is contained in:
parent
cdf0311d27
commit
15e595837b
|
@ -979,6 +979,7 @@ function _Chat() {
|
|||
}
|
||||
});
|
||||
},
|
||||
// set openai key & endpoint url
|
||||
settings: (text) => {
|
||||
try {
|
||||
const payload = JSON.parse(text) as {
|
||||
|
@ -996,9 +997,17 @@ function _Chat() {
|
|||
if (!res) return;
|
||||
if (payload.key) {
|
||||
// TODO: auto-fill openai api key here, must specific provider type
|
||||
config.update(
|
||||
(config) =>
|
||||
(config.providerConfig.openai.apiKey = payload.key!),
|
||||
);
|
||||
}
|
||||
if (payload.url) {
|
||||
// TODO: auto-fill openai url here, must specific provider type
|
||||
config.update(
|
||||
(config) =>
|
||||
(config.providerConfig.openai.endpoint = payload.url!),
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -4,8 +4,6 @@ import EmojiPicker, {
|
|||
Theme as EmojiTheme,
|
||||
} from "emoji-picker-react";
|
||||
|
||||
import { ModelType } from "../store";
|
||||
|
||||
import BotIcon from "../icons/bot.svg";
|
||||
import BlackBotIcon from "../icons/black-bot.svg";
|
||||
|
||||
|
|
Loading…
Reference in New Issue