mirror of
				https://github.com/Yidadaa/ChatGPT-Next-Web.git
				synced 2025-11-04 16:57:27 +08:00 
			
		
		
		
	include providerId in fullName
This commit is contained in:
		@@ -116,12 +116,12 @@ export const useAppConfig = createPersistStore(
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
      for (const model of oldModels) {
 | 
					      for (const model of oldModels) {
 | 
				
			||||||
        model.available = false;
 | 
					        model.available = false;
 | 
				
			||||||
        modelMap[`${model.name}@${model?.provider?.name}`] = model;
 | 
					        modelMap[`${model.name}@${model?.provider?.id}`] = model;
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      for (const model of newModels) {
 | 
					      for (const model of newModels) {
 | 
				
			||||||
        model.available = true;
 | 
					        model.available = true;
 | 
				
			||||||
        modelMap[`${model.name}@${model?.provider?.name}`] = model;
 | 
					        modelMap[`${model.name}@${model?.provider?.id}`] = model;
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      set(() => ({
 | 
					      set(() => ({
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -24,8 +24,8 @@ export function collectModelTable(
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  // default models
 | 
					  // default models
 | 
				
			||||||
  models.forEach((m) => {
 | 
					  models.forEach((m) => {
 | 
				
			||||||
    // using <modelName>@<providerName> as fullName
 | 
					    // using <modelName>@<providerId> as fullName
 | 
				
			||||||
    modelTable[`${m.name}@${m?.provider?.name}`] = {
 | 
					    modelTable[`${m.name}@${m?.provider?.id}`] = {
 | 
				
			||||||
      ...m,
 | 
					      ...m,
 | 
				
			||||||
      displayName: m.name, // 'provider' is copied over if it exists
 | 
					      displayName: m.name, // 'provider' is copied over if it exists
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
@@ -61,7 +61,7 @@ export function collectModelTable(
 | 
				
			|||||||
        // 2. if model not exists, create new model with available value
 | 
					        // 2. if model not exists, create new model with available value
 | 
				
			||||||
        if (count === 0) {
 | 
					        if (count === 0) {
 | 
				
			||||||
          const provider = customProvider(name);
 | 
					          const provider = customProvider(name);
 | 
				
			||||||
          modelTable[`${name}@${provider.name}`] = {
 | 
					          modelTable[`${name}@${provider?.id}`] = {
 | 
				
			||||||
            name,
 | 
					            name,
 | 
				
			||||||
            displayName: displayName || name,
 | 
					            displayName: displayName || name,
 | 
				
			||||||
            available,
 | 
					            available,
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user