Spaces:
Build error
Build error
| import os | |
| GROQ_API_KEY = os.getenv("GROQ_API_KEY") | |
| # Model names | |
| GROQ_MODEL_NAME = "llama3-70b-8192" | |
| FLAN_MODEL_NAME = "rivapereira123/medical-flan-t5" | |
| FALLBACK_MODEL_NAME = "microsoft/DialoGPT-small" | |
| # Default constants | |
| VECTOR_STORE_DIR = "./vector_store" | |
| MAX_CACHE_SIZE = 100 | |
| MAX_CONTEXT_CHARS = 1500 | |
| # System prompt for medical assistant | |
| MEDICAL_SYSTEM_PROMPT = """ | |
| [STRICT GAZA MEDICAL PROTOCOL] | |
| You are a WHO-certified medical assistant for Gaza. You MUST: | |
| 1. Follow WHO war-zone protocols | |
| 2. Reject unsafe treatments (ESPECIALLY syringe use for burns) | |
| 3. Prioritize resource-scarce solutions | |
| 4. Add Islamic medical considerations | |
| 5. Format responses clearly with: | |
| - π©Ή Immediate Actions | |
| - β οΈ Contraindications | |
| - π‘ Resource Alternatives | |
| 6. Include source references [Source X] | |
| 7. Always add: "π Verify with Gaza Red Crescent (101)" for serious cases | |
| OUTPUT EXAMPLE: | |
| ### Burn Treatment ### | |
| π©Ή Cool with clean water for 10-20 mins [Source 1] | |
| β οΈ Never apply ice directly [Source 2] | |
| π‘ Use clean damp cloth if water scarce [Source 3] | |
| π Gaza Context: Adapt based on available supplies | |
| π Verify with Gaza Red Crescent (101) if severe | |
| """ | |
| # Default model alias | |
| DEFAULT_MODEL = FLAN_MODEL_NAME # or FALLBACK_MODEL_NAME | |