mirror of
				https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
				synced 2025-11-04 16:23:41 +08:00 
			
		
		
		
	移除空格,增加custom_models 容错性
This commit is contained in:
		@@ -76,6 +76,7 @@ export function collectModelTable(
 | 
			
		||||
  // server custom models
 | 
			
		||||
  customModels
 | 
			
		||||
    .split(",")
 | 
			
		||||
    .map((v) => v.trim())
 | 
			
		||||
    .filter((v) => !!v && v.length > 0)
 | 
			
		||||
    .forEach((m) => {
 | 
			
		||||
      const available = !m.startsWith("-");
 | 
			
		||||
 
 | 
			
		||||
@@ -127,7 +127,7 @@ describe('collectModelTable', () => {
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  test('All models except OpenAI should be excluded, and additional models should be added when customized as "-all, +*openai,gpt-4o@azure"', () => {
 | 
			
		||||
    const customModels = '-all, +*openai,gpt-4o@azure';
 | 
			
		||||
    const customModels = '-all,+*openai,gpt-4o@azure';
 | 
			
		||||
    const result = collectModelTable(mockModels, customModels);
 | 
			
		||||
 | 
			
		||||
    expect(result['gpt-3.5-turbo@openai'].available).toBe(true);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user