Receive real-time updates as Wren AI processes your request.
The Streaming API allows you to receive real-time updates as Wren AI processes your request β from understanding the question, to generating SQL, running it, and optionally returning summaries.
These endpoints use Server-Sent Events (SSE) to deliver a continuous stream of structured events. This is ideal for interactive applications such as chat interfaces, notebooks, or dashboards where users benefit from step-by-step feedback.
Use Cases
- β Display live reasoning and SQL generation feedback in chatbots
- β Show SQL execution progress in real time
- β Render streaming text response
- β Improve perceived latency by showing intermediate steps
Available Streaming Endpoints
Endpoint | Description |
---|---|
POST /stream/ask | Full pipeline: generates SQL, executes it, and returns a summary |
POST /stream/generate_sql | Only generates the SQL based on a natural language question |