@@ -277,7 +277,6 @@ def replace_path(match):
277
277
@router .post ("/stream" )
278
278
async def generate_stream (request : Request , body : ApiRequest ):
279
279
try :
280
- print ("generate_stream called!" )
281
280
# Initial validation checks
282
281
if len (body .instructions ) > 1000 :
283
282
return {"error" : "Instructions exceed maximum length of 1000 characters" }
@@ -291,12 +290,9 @@ async def generate_stream(request: Request, body: ApiRequest):
291
290
]:
292
291
return {"error" : "Example repos cannot be regenerated" }
293
292
294
- print ("initial validation checks passed" )
295
-
296
293
async def event_generator ():
297
294
try :
298
295
# Get cached github data
299
- print ("backend should be processing if you see this" )
300
296
github_data = get_cached_github_data (
301
297
body .username , body .repo , body .github_pat
302
298
)
@@ -350,6 +346,7 @@ async def event_generator():
350
346
reasoning_effort = "medium" ,
351
347
):
352
348
explanation += chunk
349
+ print ("sending explanation chunk" , chunk )
353
350
yield f"data: { json .dumps ({'status' : 'explanation_chunk' , 'chunk' : chunk })} \n \n "
354
351
355
352
if "BAD_INSTRUCTIONS" in explanation :
@@ -419,7 +416,6 @@ async def event_generator():
419
416
except Exception as e :
420
417
yield f"data: { json .dumps ({'error' : str (e )})} \n \n "
421
418
422
- print ("returning streaming response" )
423
419
return StreamingResponse (event_generator (), media_type = "text/event-stream" )
424
420
except Exception as e :
425
421
return {"error" : str (e )}
0 commit comments