Skip to content

Commit 158b4d9

Browse files
committed
fix: increase chat api maxDuration to 300s
1 parent a8c321d commit 158b4d9

1 file changed

Lines changed: 18 additions & 2 deletions

File tree

app/(chat)/api/chat/route.ts

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { generateUUID, getMostRecentUserMessage } from '@/lib/utils';
1212

1313
import { getOrCreateConversation } from '../../service';
1414

15-
export const maxDuration = 60;
15+
export const maxDuration = 300;
1616

1717
export async function POST(request: Request) {
1818
const { id, messages }: { id: string; messages: Array<Message> } =
@@ -62,13 +62,29 @@ export async function POST(request: Request) {
6262
projectId: session.projectId,
6363
},
6464
},
65+
onChunk: (chunk) => {
66+
console.warn('%%%%%%%%', chunk);
67+
},
68+
onError: (error) => {
69+
console.warn('$$$$$$', JSON.stringify(error), typeof error);
70+
},
71+
onStepFinish: (step) => {
72+
console.warn('^^^^^^^^', step);
73+
},
74+
onFinish: (finish) => {
75+
console.warn('********', finish);
76+
},
77+
// headers: {
78+
// 'Content-Encoding': 'none'
79+
// }
6580
});
6681

6782
result.consumeStream();
6883

6984
result.mergeIntoDataStream(dataStream);
7085
},
71-
onError: () => {
86+
onError: (error) => {
87+
console.warn('@@@@@@@@', error);
7288
return 'Oops, an error occured!';
7389
},
7490
});

0 commit comments

Comments
 (0)