Skip to content

Commit

Permalink
feat: handle client disconnects (#814)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyphilemon authored Feb 20, 2025
1 parent 27ff566 commit ef7eb9d
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 20 deletions.
2 changes: 2 additions & 0 deletions app/(chat)/api/chat/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ export async function POST(request: Request) {
},
});

result.consumeStream();

result.mergeIntoDataStream(dataStream, {
sendReasoning: true,
});
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"@vercel/analytics": "^1.3.1",
"@vercel/blob": "^0.24.1",
"@vercel/postgres": "^0.10.0",
"ai": "4.1.17",
"ai": "4.1.44",
"bcrypt-ts": "^5.0.2",
"class-variance-authority": "^0.7.0",
"classnames": "^2.5.1",
Expand Down
64 changes: 45 additions & 19 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ef7eb9d

Please sign in to comment.