mirror of
https://github.com/Yidadaa/ChatGPT-Next-Web.git
synced 2025-08-07 16:46:23 +08:00
feat: close #2192 use /list/models to get model ids
This commit is contained in:
@@ -42,12 +42,11 @@ import {
|
||||
Theme,
|
||||
useAppConfig,
|
||||
DEFAULT_TOPIC,
|
||||
ALL_MODELS,
|
||||
ModelType,
|
||||
} from "../store";
|
||||
|
||||
import {
|
||||
copyToClipboard,
|
||||
downloadAs,
|
||||
selectOrCopy,
|
||||
autoGrowTextArea,
|
||||
useMobileScreen,
|
||||
@@ -387,12 +386,12 @@ export function ChatActions(props: {
|
||||
// switch model
|
||||
const currentModel = chatStore.currentSession().mask.modelConfig.model;
|
||||
function nextModel() {
|
||||
const models = ALL_MODELS.filter((m) => m.available).map((m) => m.name);
|
||||
const models = config.models.filter((m) => m.available).map((m) => m.name);
|
||||
const modelIndex = models.indexOf(currentModel);
|
||||
const nextIndex = (modelIndex + 1) % models.length;
|
||||
const nextModel = models[nextIndex];
|
||||
chatStore.updateCurrentSession((session) => {
|
||||
session.mask.modelConfig.model = nextModel;
|
||||
session.mask.modelConfig.model = nextModel as ModelType;
|
||||
session.mask.syncGlobalConfig = false;
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user