Merge pull request #5769 from ryanhex53/fix-model-multi@

Custom model names can include the `@` symbol by itself.
This commit is contained in:
Dogtiti
2024-11-06 10:49:28 +08:00
committed by GitHub
6 changed files with 60 additions and 11 deletions

View File

@@ -120,6 +120,7 @@ import { createTTSPlayer } from "../utils/audio";
import { MsEdgeTTS, OUTPUT_FORMAT } from "../utils/ms_edge_tts";
import { isEmpty } from "lodash-es";
import { getModelProvider } from "../utils/model";
const localStorage = safeLocalStorage();
@@ -645,7 +646,7 @@ export function ChatActions(props: {
onClose={() => setShowModelSelector(false)}
onSelection={(s) => {
if (s.length === 0) return;
const [model, providerName] = s[0].split("@");
const [model, providerName] = getModelProvider(s[0]);
chatStore.updateCurrentSession((session) => {
session.mask.modelConfig.model = model as ModelType;
session.mask.modelConfig.providerName =