Exercise 01 — Streaming Chatbot¶
Timebox: 30-45 minutes
Goal¶
Turn chatbot.py into a multi-turn streaming chatbot that keeps history and behaves cleanly under transient failures.
Work in¶
chatbot.py
Tasks¶
- Replace the mock stream with a real provider call or keep the mock and improve the architecture first.
- Keep conversation history across turns.
- Allow a system prompt.
- Print token or usage information after each response.
- Retry on rate-limit or transient failures.
Done when¶
- The CLI supports multiple turns
- Responses stream instead of arriving all at once
- History is preserved across turns
- Failures retry before surfacing