Skip to content

Commit 790031c

Browse files
committed
wip
1 parent f2730a9 commit 790031c

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

apps/registry/app/api/chat/route.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export async function POST(req) {
2121
if (!process.env.OPENAI_API_KEY) {
2222
return NextResponse.json(
2323
{ message: 'API not available during build' },
24-
{ status: 503 },
24+
{ status: 503 }
2525
);
2626
}
2727

@@ -41,7 +41,7 @@ export async function POST(req) {
4141
content: `Current resume state: ${JSON.stringify(
4242
currentResume,
4343
null,
44-
2,
44+
2
4545
)}`,
4646
},
4747
...messages.map((msg) => ({
@@ -178,7 +178,7 @@ export async function POST(req) {
178178
if (toolCall.function.name === 'update_resume') {
179179
try {
180180
const { changes, explanation } = JSON.parse(
181-
toolCall.function.arguments,
181+
toolCall.function.arguments
182182
);
183183
return NextResponse.json({
184184
message: explanation,

apps/registry/app/api/transcribe/route.js

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,18 @@ import { writeFile } from 'fs/promises';
33
import { join } from 'path';
44
import fs from 'fs';
55

6-
const openai = new OpenAI({
7-
apiKey: process.env.OPENAI_API_KEY,
8-
});
9-
106
export async function POST(req) {
7+
if (!process.env.OPENAI_API_KEY) {
8+
return NextResponse.json(
9+
{ message: 'API not available during build' },
10+
{ status: 503 }
11+
);
12+
}
13+
14+
const openai = new OpenAI({
15+
apiKey: process.env.OPENAI_API_KEY,
16+
});
17+
1118
try {
1219
const formData = await req.formData();
1320
const audioFile = formData.get('audio');

0 commit comments

Comments
 (0)