mirror of
				https://github.com/Yidadaa/ChatGPT-Next-Web.git
				synced 2025-11-04 16:57:27 +08:00 
			
		
		
		
	Merge branch 'ChatGPTNextWeb:main' into main
This commit is contained in:
		@@ -155,6 +155,7 @@ const openaiModels = [
 | 
			
		||||
const googleModels = [
 | 
			
		||||
  "gemini-1.0-pro",
 | 
			
		||||
  "gemini-1.5-pro-latest",
 | 
			
		||||
  "gemini-1.5-flash-latest",
 | 
			
		||||
  "gemini-pro-vision",
 | 
			
		||||
];
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										11
									
								
								app/utils.ts
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								app/utils.ts
									
									
									
									
									
								
							@@ -290,17 +290,18 @@ export function getMessageImages(message: RequestMessage): string[] {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export function isVisionModel(model: string) {
 | 
			
		||||
  // Note: This is a better way using the TypeScript feature instead of `&&` or `||` (ts v5.5.0-dev.20240314 I've been using)
 | 
			
		||||
 | 
			
		||||
  const visionKeywords = [
 | 
			
		||||
    "vision",
 | 
			
		||||
    "claude-3",
 | 
			
		||||
    "gemini-1.5-pro",
 | 
			
		||||
    "gpt-4-turbo",
 | 
			
		||||
    "gpt-4o",
 | 
			
		||||
    "gemini-1.5-flash",
 | 
			
		||||
  ];
 | 
			
		||||
  const isGpt4TurboPreview = model === "gpt-4-turbo-preview";
 | 
			
		||||
  const isGpt4Turbo =
 | 
			
		||||
    model.includes("gpt-4-turbo") && !model.includes("preview");
 | 
			
		||||
 | 
			
		||||
  return (
 | 
			
		||||
    visionKeywords.some((keyword) => model.includes(keyword)) &&
 | 
			
		||||
    !isGpt4TurboPreview
 | 
			
		||||
    visionKeywords.some((keyword) => model.includes(keyword)) || isGpt4Turbo
 | 
			
		||||
  );
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user