()
| 499 | return None |
| 500 | |
| 501 | def main(): |
| 502 | st.set_page_config(page_title="🛠️ PyGen", layout="wide") |
| 503 | st.title("🛠️ PyGen") |
| 504 | st.write("Generate a Python package structure using Groq or GEMINI models and download it as a ZIP file.") |
| 505 | |
| 506 | # API Configuration |
| 507 | st.header("🔑 API Configuration") |
| 508 | api_provider = st.selectbox("Select API Provider", ["Groq"], key="api_provider_select") |
| 509 | |
| 510 | if api_provider == "Groq": |
| 511 | api_key = st.text_input("🔐 Enter your Groq API Key", type="password", key="groq_api_key_input") |
| 512 | |
| 513 | # Define Groq models |
| 514 | groq_models = [ |
| 515 | 'llama3-8b-8192', |
| 516 | 'llama3-13b-8192', |
| 517 | 'llama3-70b-8192', |
| 518 | 'llama-3.1-70b-versatile', |
| 519 | 'llama3-groq-8b-8192-tool-use-preview', |
| 520 | 'llama3-groq-70b-8192-tool-use-preview', |
| 521 | 'gemma2-9b-it', |
| 522 | 'gemma-7b-it', |
| 523 | 'mixtral-8x7b-32768', |
| 524 | # Add more Groq models as needed |
| 525 | ] |
| 526 | model_list = groq_models |
| 527 | |
| 528 | # elif api_provider == "GEMINI": |
| 529 | # api_key = st.text_input("🔐 Enter your GEMINI API Key", type="password", key="gemini_api_key_input") |
| 530 | |
| 531 | # # Define GEMINI models |
| 532 | # gemini_models = [ |
| 533 | # 'gemini-1.5-pro-002', |
| 534 | # 'gemini-1.5-pro', |
| 535 | # 'gemini-1.5-flash', |
| 536 | # 'gemini-1.5-flash-002', |
| 537 | # 'gemini-1.5-flash-8b', |
| 538 | # # Add more GEMINI models as needed |
| 539 | # ] |
| 540 | # model_list = gemini_models |
| 541 | |
| 542 | else: |
| 543 | api_key = '' |
| 544 | model_list = [] |
| 545 | |
| 546 | # Model Selection |
| 547 | model_name = st.selectbox("Select Model", model_list, key="model_select") |
| 548 | |
| 549 | # User Inputs |
| 550 | st.header("📦 Package Details") |
| 551 | package_name = st.text_input("📝 Enter the name for your Python package:", "", key="package_name_input").strip() |
| 552 | package_description = st.text_area("📝 Enter a brief description of your package:", "", height=150, key="package_description_input").strip() |
| 553 | |
| 554 | # Features Input |
| 555 | st.subheader("✨ Features") |
| 556 | features_input = st.text_area("Enter features (one per line):", value="", height=150, key="features_input") |
| 557 | features = [f.strip() for f in features_input.split('\n') if f.strip()] |
| 558 |
no test coverage detected