diff --git a/app/client/platforms/openai.ts b/app/client/platforms/openai.ts index 15cfb7ca602..b7b37492c82 100644 --- a/app/client/platforms/openai.ts +++ b/app/client/platforms/openai.ts @@ -240,7 +240,7 @@ export class ChatGPTApi implements LLMApi { } // add max_tokens to vision model - if (visionModel) { + if (visionModel && modelConfig.model !== "glm-4v-flash") { requestPayload["max_tokens"] = Math.max(modelConfig.max_tokens, 4000); } } diff --git a/app/constant.ts b/app/constant.ts index 429d52b3db4..28700cb1439 100644 --- a/app/constant.ts +++ b/app/constant.ts @@ -325,6 +325,15 @@ const googleModels = [ "gemini-exp-1121", "learnlm-1.5-pro-experimental", "gemini-2.0-flash-exp", + "gemini-1.5-flash", + "gemini-1.5-flash-002", + "gemini-1.5-flash-8b", + "gemini-1.5-flash-exp-0827", + "gemini-1.5-pro", + "gemini-1.5-pro-002", + "gemini-1.5-pro-exp-0827", + "gemini-2.0-flash-thinking-exp-1219", + "gemini-exp-1206", ]; const anthropicModels = [ diff --git a/app/utils.ts b/app/utils.ts index 30f95fa02eb..169c6e182b2 100644 --- a/app/utils.ts +++ b/app/utils.ts @@ -265,6 +265,7 @@ export function isVisionModel(model: string) { "learnlm", "qwen-vl", "qwen2-vl", + "glm-4v", ]; const isGpt4Turbo = model.includes("gpt-4-turbo") && !model.includes("preview");