mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-11-30 21:36:06 +08:00
use regex to split modelName and providerName to process multi '@' symbols
This commit is contained in:
@@ -612,7 +612,7 @@ export function ChatActions(props: {
|
||||
onClose={() => setShowModelSelector(false)}
|
||||
onSelection={(s) => {
|
||||
if (s.length === 0) return;
|
||||
const [model, providerName] = s[0].split("@");
|
||||
const [model, providerName] = s[0].split(/@(?=[^@]*$)/);
|
||||
chatStore.updateCurrentSession((session) => {
|
||||
session.mask.modelConfig.model = model as ModelType;
|
||||
session.mask.modelConfig.providerName =
|
||||
|
||||
@@ -20,7 +20,7 @@ export function ModelConfigList(props: {
|
||||
aria-label={Locale.Settings.Model}
|
||||
value={value}
|
||||
onChange={(e) => {
|
||||
const [model, providerName] = e.currentTarget.value.split("@");
|
||||
const [model, providerName] = e.currentTarget.value.split(/@(?=[^@]*$)/);
|
||||
props.updateConfig((config) => {
|
||||
config.model = ModalConfigValidator.model(model);
|
||||
config.providerName = providerName as ServiceProvider;
|
||||
|
||||
Reference in New Issue
Block a user