diff --git a/src/lib/utils/prompting.ts b/src/lib/utils/prompting.ts index 5c85579..41033fd 100644 --- a/src/lib/utils/prompting.ts +++ b/src/lib/utils/prompting.ts @@ -39,6 +39,12 @@ Only use the code interpreter tool when it's actually needed for calculations or */ export const CODE_INTERPRETER_SUPPORTED_MODELS = Object.freeze( new Set([ + 'gpt-5', + 'gpt-5-2025-08-07', + 'gpt-5-mini', + 'gpt-5-mini-2025-08-07', + 'gpt-5-nano', + 'gpt-5-nano-2025-08-07', 'gpt-4o', 'gpt-4.1', 'gpt-4', @@ -64,6 +70,12 @@ export function isCodeInterpreterSupported(model: string): boolean { */ export const WEB_SEARCH_SUPPORTED_MODELS = Object.freeze( new Set([ + 'gpt-5', + 'gpt-5-2025-08-07', + 'gpt-5-mini', + 'gpt-5-mini-2025-08-07', + 'gpt-5-nano', + 'gpt-5-nano-2025-08-07', 'gpt-4o', 'gpt-4.1', 'gpt-4', diff --git a/src/routes/api/chat.ts b/src/routes/api/chat.ts index 791d475..6745950 100644 --- a/src/routes/api/chat.ts +++ b/src/routes/api/chat.ts @@ -53,7 +53,7 @@ export const ServerRoute = createServerFileRoute('/api/chat').methods({ if (codeInterpreter && !isCodeInterpreterSupported(model)) { return new Response( JSON.stringify({ - error: `Code interpreter is not supported for model: ${model}. Please use a supported model like GPT-4o or o3-series.`, + error: `Code interpreter is not supported for model: ${model}. Please use a supported model like GPT-5, GPT-4o, or the o3-series.`, }), { status: 400, diff --git a/src/routes/api/models.ts b/src/routes/api/models.ts index dddfdbe..1cef582 100644 --- a/src/routes/api/models.ts +++ b/src/routes/api/models.ts @@ -2,6 +2,7 @@ import { createServerFileRoute } from '@tanstack/react-start/server' import OpenAI from 'openai' const SUPPORTED_MODEL_PREFIXES = [ + 'gpt-5', 'gpt-4o', 'chatgpt-4o', 'gpt-4.1',