Skip to content

Commit b13ea13

Browse files
Yahiewibrichet
andauthored
Fix debug output (#22)
Co-authored-by: Nicolas Brichet <32258950+brichet@users.noreply.github.com>
1 parent 836d865 commit b13ea13

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎jupyter_ai_tutor/handlers.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ async def post(self):
101101
if debug_mode:
102102
accumulated_response += text
103103
self.write(f"data: {json.dumps({'text': text})}\n\n")
104-
self.flush()
104+
await self.flush()
105105

106106
if debug_mode and answer_file:
107107
try:
@@ -124,13 +124,13 @@ async def post(self):
124124
self.log.exception("Error during tutor LLM call")
125125
try:
126126
self.write(f"data: {json.dumps({'error': str(e)})}\n\n")
127-
self.flush()
127+
await self.flush()
128128
except StreamClosedError:
129129
return
130130

131131
try:
132132
self.write("data: [DONE]\n\n")
133-
self.flush()
133+
await self.flush()
134134
self.finish()
135135
except StreamClosedError:
136136
pass

0 commit comments

Comments
 (0)