Knowledge should outlive the conversation that created it.
StreamingResponse wraps an async generator. The key insight: you yield bytes, not strings...
async def generate(): async for chunk in llm.stream(prompt): yield f"data: {chunk}\n\n" return StreamingResponse(generate())