Scenario
Your app asks the model for structured JSON and parses it as the response streams in, so the UI can update progressively. It works in demos, but in production users sometimes see a blank result or a crash.
stream_response is a mock that yields a JSON reply in small chunks, the way a real streaming API does. Chunk boundaries fall wherever they fall, including in the middle of a word or a string. parse_stream is the consumer someone wrote.
Run the code as-is. The parse fails even though the model's complete output is perfectly valid JSON.
Your task: fix parse_stream so it produces the correct result no matter where the chunk boundaries fall. Do not change stream_response.
This tests whether you understand that streamed text arrives in arbitrary pieces, and that a partial JSON document is not valid JSON.