Skip to content

Commit e900e7c

Browse files
committed
refactor(route.ts): update method call to openaiProvider.responses closes #1082
feat(route.ts): add compatibility option to OpenAI settings for stricter API usage chore(next.config.ts): add allowedDevOrigins for development environment configuration chore(package.json): update dependencies
1 parent c7c8717 commit e900e7c

File tree

4 files changed

+473
-458
lines changed

4 files changed

+473
-458
lines changed

app/api/completion/route.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import { auth } from '@/lib/auth';
44
import { prisma } from '@/lib/db';
5-
import { createOpenAI } from '@ai-sdk/openai';
5+
import { type OpenAIProviderSettings, createOpenAI } from '@ai-sdk/openai';
66
import { CoreMessage, streamText } from 'ai';
77

88
export const dynamic = 'force-dynamic';
@@ -54,13 +54,14 @@ export async function POST(request: Request) {
5454
},
5555
];
5656

57-
const openAISettings = {
57+
const openAISettings: OpenAIProviderSettings = {
5858
apiKey: process.env.AIRBROKE_OPENAI_API_KEY ?? '',
59+
compatibility: 'strict',
5960
...(process.env.AIRBROKE_OPENAI_ORGANIZATION ? { organization: process.env.AIRBROKE_OPENAI_ORGANIZATION } : {}),
6061
};
6162

6263
const openaiProvider = createOpenAI(openAISettings);
63-
const model = openaiProvider(process.env.AIRBROKE_OPENAI_ENGINE || 'gpt-4o');
64+
const model = openaiProvider.responses(process.env.AIRBROKE_OPENAI_ENGINE || 'gpt-4o');
6465

6566
// Stream the AI's response using streamText
6667
const result = streamText({

next.config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
import type { NextConfig } from 'next';
44

55
const nextConfig: NextConfig = {
6-
reactStrictMode: true,
76
output: 'standalone',
7+
allowedDevOrigins: ['airbroke-dev.icorete.ch'],
88
serverExternalPackages: ['@airbrake/node'],
99
experimental: {
1010
dynamicIO: true,

package.json

+13-13
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,16 @@
2222
"@airbrake/node": "2.1.9",
2323
"@auth/prisma-adapter": "2.7.4",
2424
"@headlessui/react": "2.2.0",
25-
"@microlink/react-json-view": "^1.26.0",
25+
"@microlink/react-json-view": "1.26.1",
2626
"@prisma/client": "6.5.0",
27-
"ai": "4.1.54",
27+
"ai": "4.1.61",
2828
"chart.js": "4.4.8",
29-
"clsx": "^2.1.1",
30-
"date-fns": "^4.1.0",
31-
"nanoid": "5.1.3",
32-
"next": "15.2.0-canary.76",
29+
"clsx": "2.1.1",
30+
"date-fns": "4.1.0",
31+
"nanoid": "5.1.4",
32+
"next": "15.3.0-canary.12",
3333
"next-auth": "5.0.0-beta.25",
34-
"numbro": "^2.5.0",
34+
"numbro": "2.5.0",
3535
"react": "19.0.0",
3636
"react-chartjs-2": "5.3.0",
3737
"react-dom": "19.0.0",
@@ -50,21 +50,21 @@
5050
"@types/react-dom": "19.0.4",
5151
"@types/react-syntax-highlighter": "^15.5.13",
5252
"@vitejs/plugin-react": "4.3.4",
53-
"babel-plugin-react-compiler": "19.0.0-beta-e552027-20250112",
53+
"babel-plugin-react-compiler": "19.0.0-beta-3229e95-20250315",
5454
"chokidar-cli": "^3.0.0",
5555
"eslint": "9.22.0",
56-
"eslint-config-next": "15.2.0-canary.76",
57-
"eslint-config-prettier": "9.1.0",
58-
"eslint-plugin-react-compiler": "19.0.0-beta-e552027-20250112",
59-
"jsdom": "^26.0.0",
56+
"eslint-config-next": "15.3.0-canary.12",
57+
"eslint-config-prettier": "10.1.1",
58+
"eslint-plugin-react-compiler": "19.0.0-beta-3229e95-20250315",
59+
"jsdom": "26.0.0",
6060
"postcss": "8.5.3",
6161
"prettier": "3.5.3",
6262
"prettier-plugin-tailwindcss": "0.6.11",
6363
"prisma": "6.5.0",
6464
"tailwindcss": "3.4.17",
6565
"typescript": "5.8.2",
6666
"vite-tsconfig-paths": "5.1.4",
67-
"vitest": "^2.1.8"
67+
"vitest": "3.0.9"
6868
},
6969
"prisma": {
7070
"seed": "node --experimental-strip-types prisma/seed.ts"

0 commit comments

Comments
 (0)