Spaces:
Paused
Paused
| import os, zipfile, json | |
| def ingest(rulebook_text, code_zip): | |
| os.makedirs("artifacts", exist_ok=True) | |
| with open("artifacts/rulebook_raw.txt", "w", encoding="utf-8") as f: | |
| f.write(rulebook_text) | |
| if code_zip: | |
| with zipfile.ZipFile(code_zip, "r") as z: | |
| z.extractall("artifacts/code") | |
| return "Ingestion complete" | |