Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/lib/utils/prompting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion src/routes/api/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions src/routes/api/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Loading