We are developing a Scriptcase-based application that integrates AI APIs (e.g., DeepSeek/OpenAI) and requires a ChatGPT-like character-by-character streaming effect (text appears progressively instead of all at once). We face the following challenges and would appreciate insights from the community:
- Frontend Dynamic Rendering
How to implement character-by-character display in Scriptcase’s web interface? Is this achievable purely via JavaScript, or can Scriptcase’s native features be leveraged?
Are there recommended frontend libraries/code patterns (e.g., Typed.js for animation vs. SSE/WebSocket for real streaming)?
- Streaming API Integration
For AI APIs supporting streaming responses (e.g., stream: true), how to properly handle chunked data in the backend (PHP) and relay it to the frontend?
Are there successful cases using Scriptcase’s AJAX features or custom PHP scripts for streaming?
- Scriptcase Compatibility
Does Scriptcase natively support Server-Sent Events (SSE) or WebSocket? If not, what workarounds exist?
- Performance & Stability
How to ensure smooth rendering for long responses (>1000 characters)? Is a chunk buffering mechanism required?
Are there known limitations for streaming implementations in Scriptcase under high concurrency?