From 7b2e2963ad9b440353c4ec922bc8b3e000e9af4e Mon Sep 17 00:00:00 2001 From: Abi Raja Date: Wed, 31 Jul 2024 11:25:49 -0400 Subject: [PATCH] print for debugging --- backend/routes/generate_code.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/backend/routes/generate_code.py b/backend/routes/generate_code.py index c487c67..e96e720 100644 --- a/backend/routes/generate_code.py +++ b/backend/routes/generate_code.py @@ -97,6 +97,12 @@ async def stream_code(websocket: WebSocket): value: str, variantIndex: int, ): + # Print for debugging on the backend + if type == "error": + print(f"Error (variant {variantIndex}): {value}") + elif type == "status": + print(f"Status (variant {variantIndex}): {value}") + await websocket.send_json( {"type": type, "value": value, "variantIndex": variantIndex} ) @@ -181,8 +187,6 @@ async def stream_code(websocket: WebSocket): # Get the image generation flag from the request. Fall back to True if not provided. should_generate_images = bool(params.get("isImageGenerationEnabled", True)) - print("generating code...") - # TODO(*): Print with send_message instead of print statements await send_message("status", "Generating code...", 0) await send_message("status", "Generating code...", 1)