Spaces:
Sleeping
Sleeping
Download generator.py from offerpk3/auto-app-builder: direct link, hf CLI and curl.
- Browser
- Download file 714 Bytes
-
https://huggingface.co/spaces/offerpk3/auto-app-builder/resolve/main/generator.py
- Command line
-
hf download hf://spaces/offerpk3/auto-app-builder/generator.py
-
curl -L -o generator.py https://huggingface.co/spaces/offerpk3/auto-app-builder/resolve/main/generator.py
714 Bytes
| def generate_app(prompt: str): | |
| print("🧠 Simulating Gemini API call...") | |
| return { | |
| "full_code": f''' | |
| function App() {{ | |
| return <div>⚡ Hello, this is your generated app for: {prompt}</div>; | |
| }} | |
| export default App; | |
| ''', | |
| "files": { | |
| "App.jsx": f''' | |
| function App() {{ | |
| return <div>⚡ Hello, this is your generated app for: {prompt}</div>; | |
| }} | |
| export default App; | |
| ''' | |
| } | |
| } | |
| def enhance_app(existing_bundle: dict, enhancement_prompt: str): | |
| updated_code = existing_bundle["full_code"] + f"\n// Enhancement applied: {enhancement_prompt}" | |
| existing_bundle["full_code"] = updated_code | |
| existing_bundle["files"]["App.jsx"] = updated_code | |
| return existing_bundle | |