ai
ai copied to clipboard
useObject now implements the onChunk callback option.
Background
Although onFinish is executed after all chunks have been read, there are cases where we want it to be executed every time a chunk is read.
Summary
Implemented onChunk callback on useObject and ran the test.
Verification
Tasks
- [x] Tests have been added / updated (for bug fixes / features)
- [x] Documentation has been added / updated (for bug fixes / features)
- [ ] A patch changeset for relevant packages has been added (for bug fixes / features - run
pnpm changesetin the project root) - [x] Formatting issues have been fixed (run
pnpm prettier-fixin the project root)
Future Work
Related Issues
https://github.com/vercel/ai/issues/5965