Skip to content

Commit 30e8872

Browse files
author
RJ Beers
authored
Add GPT-5 support (#161)
1 parent 5250a77 commit 30e8872

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

src/lib/utils/prompting.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ Only use the code interpreter tool when it's actually needed for calculations or
3939
*/
4040
export const CODE_INTERPRETER_SUPPORTED_MODELS = Object.freeze(
4141
new Set([
42+
'gpt-5',
43+
'gpt-5-2025-08-07',
44+
'gpt-5-mini',
45+
'gpt-5-mini-2025-08-07',
46+
'gpt-5-nano',
47+
'gpt-5-nano-2025-08-07',
4248
'gpt-4o',
4349
'gpt-4.1',
4450
'gpt-4',
@@ -64,6 +70,12 @@ export function isCodeInterpreterSupported(model: string): boolean {
6470
*/
6571
export const WEB_SEARCH_SUPPORTED_MODELS = Object.freeze(
6672
new Set([
73+
'gpt-5',
74+
'gpt-5-2025-08-07',
75+
'gpt-5-mini',
76+
'gpt-5-mini-2025-08-07',
77+
'gpt-5-nano',
78+
'gpt-5-nano-2025-08-07',
6779
'gpt-4o',
6880
'gpt-4.1',
6981
'gpt-4',

src/routes/api/chat.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export const ServerRoute = createServerFileRoute('/api/chat').methods({
5353
if (codeInterpreter && !isCodeInterpreterSupported(model)) {
5454
return new Response(
5555
JSON.stringify({
56-
error: `Code interpreter is not supported for model: ${model}. Please use a supported model like GPT-4o or o3-series.`,
56+
error: `Code interpreter is not supported for model: ${model}. Please use a supported model like GPT-5, GPT-4o, or the o3-series.`,
5757
}),
5858
{
5959
status: 400,

src/routes/api/models.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { createServerFileRoute } from '@tanstack/react-start/server'
22
import OpenAI from 'openai'
33

44
const SUPPORTED_MODEL_PREFIXES = [
5+
'gpt-5',
56
'gpt-4o',
67
'chatgpt-4o',
78
'gpt-4.1',

0 commit comments

Comments
 (0)