Skip to content

Commit f9ac41f

Browse files
committed
Refactor project generation response to ensure proper formatting and return response within context manager
1 parent 701bc7c commit f9ac41f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app/main.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ async def generate_project_sync(request: ProjectRequest):
612612
fix_examples = "Here are some examples of similar errors and their fixes:\n\n"
613613
for i, err in enumerate(similar_errors):
614614
fix_examples += f"Example {i+1}:\n{err['error']}\nFix: {err['solution']}\n\n"
615-
615+
616616
fix_prompt = f"""
617617
Here is a Rust project that failed to compile. Help me fix the compilation errors.
618618
@@ -672,6 +672,8 @@ async def generate_project_sync(request: ProjectRequest):
672672
all_files_content += "\n# Build failed\n"
673673

674674
save_status(temp_dir, status)
675+
676+
# Return the response while still inside the with block
675677
return PlainTextResponse(content=all_files_content)
676678

677679
except Exception as e:

0 commit comments

Comments
 (0)