File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -490,12 +490,34 @@ async def download_project(project_id: str):
490490 media_type = "application/zip"
491491 )
492492
493+ USE_MOCK_LLM = os .getenv ("USE_MOCK_LLM" , "" ).lower () == "true"
494+
493495@app .post ("/generate-sync" )
494496async def generate_project_sync (request : ProjectRequest ):
495497 """
496498 Generate a Rust project synchronously and return all files in text format.
497499 This endpoint will wait for the full generation process to complete.
498500 """
501+ if USE_MOCK_LLM :
502+ # Return mock response
503+ return """[filename: Cargo.toml]
504+ [package]
505+ name = "hello_world"
506+ version = "0.1.0"
507+ edition = "2021"
508+
509+ [dependencies]
510+
511+ [filename: src/main.rs]
512+ fn main() {
513+ println!("Hello, World!");
514+ }
515+
516+ [filename: README.md]
517+ # Hello World
518+
519+ This is a simple Rust program that prints "Hello, World!".
520+ """
499521 try :
500522 # Create temporary directory for generation
501523 with tempfile .TemporaryDirectory () as temp_dir :
You can’t perform that action at this time.
0 commit comments