Create a zip file from the package structure with a different but relevant name.
(package_structure: Dict[str, str], package_name: str)
| 433 | return valid |
| 434 | |
| 435 | def create_zip(package_structure: Dict[str, str], package_name: str) -> bytes: |
| 436 | """Create a zip file from the package structure with a different but relevant name.""" |
| 437 | # Generate a different zip file name by appending '_package' and current timestamp |
| 438 | timestamp = datetime.datetime.now().strftime("%Y%m%d%H%M%S") |
| 439 | zip_filename = f"{package_name}_package_{timestamp}.zip" |
| 440 | |
| 441 | zip_buffer = io.BytesIO() |
| 442 | with zipfile.ZipFile(zip_buffer, 'w', zipfile.ZIP_DEFLATED) as zipf: |
| 443 | for file_path, content in package_structure.items(): |
| 444 | zipf.writestr(file_path, content) |
| 445 | zip_buffer.seek(0) |
| 446 | return zip_buffer.getvalue() |
| 447 | |
| 448 | def generate_markdown_documentation(client: Groq, model_name: str, package_structure: Dict[str, str], package_name: str, max_retries: int = 5) -> Optional[str]: |
| 449 | """ |