From 46c247149eb9d6f0eb4513cad0763ea8adf53965 Mon Sep 17 00:00:00 2001 From: Phantom <59059173+EurFelux@users.noreply.github.com> Date: Mon, 11 Aug 2025 14:08:04 +0800 Subject: [PATCH] fix(models): gpt-5 support (#9042) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix(models): 修正gpt-5模型ID的正则表达式匹配模式 更新gpt-5模型ID的正则表达式以支持数字和连字符的组合 --- src/renderer/src/config/models.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/renderer/src/config/models.ts b/src/renderer/src/config/models.ts index a7ea85c1f0..ad640a30b2 100644 --- a/src/renderer/src/config/models.ts +++ b/src/renderer/src/config/models.ts @@ -252,7 +252,7 @@ export const FUNCTION_CALLING_MODELS = [ 'gpt-4', 'gpt-4.5', 'gpt-oss(?:-[\\w-]+)', - 'gpt-5(?:-[\\w-]+)?', + 'gpt-5(?:-[0-9-]+)?', 'o(1|3|4)(?:-[\\w-]+)?', 'claude', 'qwen', @@ -392,7 +392,7 @@ export function getModelLogo(modelId: string) { 'gpt-image': ChatGPTImageModelLogo, 'gpt-3': isLight ? ChatGPT35ModelLogo : ChatGPT35ModelLogoDark, 'gpt-4': isLight ? ChatGPT4ModelLogo : ChatGPT4ModelLogoDark, - 'gpt-5$': GPT5ModelLogo, + 'gpt-5(?:-[0-9]+(?:-[0-9]+)*)?': GPT5ModelLogo, 'gpt-5-mini': GPT5MiniModelLogo, 'gpt-5-nano': GPT5NanoModelLogo, 'gpt-5-chat': GPT5ChatModelLogo,