Conceptual Overview
- C1 API supports
stream
mode which allows the backend to get the response in chunks. - Backend forwards the API stream to the frontend in a
text/event-stream
format. - C1 React component handles the streaming response and displays it to the user.
Implementation
1
Add streaming to the backend
src/api/route.ts
2
Setup helpers to stream the response
src/app/page.tsx
3
Pass the streaming response to the C1 component
src/app/page.tsx