-
AI Prativa – Smart Farming Assistant – API Call Code Understanding
FastAPI Call Code Understanding @router.post("/api/chat") async def chat( request: Request, audio: Optional[UploadFile] = File(None), text: Optional[str] = Form(None) ): """ Handle chat requests – supports both audio and text input """ try: # Handle audio input if audio: # Validate file extension file_extension = audio.filename.split('.')[-1].lower() if file_extension not in settings.ALLOWED_EXTENSIONS: raise HTTPException( status_code=400, detail=f"File type not allowed. Allowed types: {settings.ALLOWED_EXTENSIONS}" ) # Save uploaded audio file file_path = os.path.join(settings.UPLOAD_FOLDER, audio.filename) os.makedirs(settings.UPLOAD_FOLDER, exist_ok=True) with open(file_path, "wb") as f: content = await audio.read() f.write(content) # Transcribe audio to text transcription = await speech_service.transcribe_audio(file_path) # Clean up uploaded file if os.path.exists(file_path): os.remove(file_path) return
-
OPSC – Indian Polity – Understanding The Structure Of Indian Constitution
Understanding The Structure Of Indian Constitution CONSTITUTION OF INDIA │ ├── PREAMBLE │ └── Philosophy & Objectives of the Constitution │ ├── PARTS → 25 Parts │ │ │ ├── Part I to Part XXII (Original Parts) │ ├── Part IVA – Fundamental Duties │ ├── Part IXA – Municipalities │ ├── Part IXB – Cooperative Societies │ └── Part XIV-A – Tribunals │ │ └── ARTICLES → ~470 Articles (commonly accepted exam figure) │ │ │ ├── Originally (1950): 395 Articles │ ├── Added via amendments: A, B, C, AA… (e.g., 21A, 243ZA) │ └── Articles contain: │ ├──
