{"message":"Vocabulary Processing API","version":"1.0.0","structure":"Refactored with clean handler separation","deployment":"Designed for Lambda container deployment","endpoints":{"POST /vocabulary/generate":"Generate vocabulary content (returns immediately with tracking ID)","POST /vocabulary/edit":"Edit vocabulary JSON using AI (synchronous - accepts word JSON and editPrompt)","POST /vocabulary/generate/bulk":"Generate vocabulary content for multiple words with word-level context and meaning support (bulk processing)","GET /vocabulary/status/{tracking_id}":"Check processing status (for debugging - use AppSync subscriptions in frontend)","GET /vocabulary/llms/available":"Get available LLM models for generation and validation","GET /vocabulary/queue/status":"Get queue status for throttled bulk processing","GET /vocabulary/batch/status/{batch_id}":"Get status of a specific batch by batch_id","POST /generate/image":"Generate standalone image with custom prompt (no database updates)","POST /generate/audio":"Generate standalone audio for Tamil text (no database updates)","GET /tamil/dictionary/{word}":"Get Tamil word summary from LLM (single word)","POST /tamil/dictionary/bulk":"Get Tamil word summaries from LLM in bulk (supports batching and parallel processing)","POST /tamil/dictionary":"Create a new Tamil word in the dictionary","PUT /tamil/dictionary/{word}":"Update an existing Tamil word in the dictionary","DELETE /tamil/dictionary/{word}":"Delete a Tamil word from the dictionary","POST /vaani/correct-text":"Correct Tamil grammar in a single text string","POST /vaani/correct-text/batch":"Correct Tamil grammar in multiple sentences at once (parallel processing)","POST /vaani/correct-json":"Correct Tamil grammar in vocabulary JSON structure (example sentences only)","POST /pdf/extract-tamil-words":"Extract and stem Tamil words from PDF (OCR → word_candidates → noise_filter → lexical_classifier → bridge → variant_grouping_manual; returns merged result)","POST /pdf/process-pdf-store-roots":"Process a PDF and store extracted Tamil root words per page in S3 by grade, lesson, and page (writes to pdf_root_words bucket only)","POST /pdf/upload-book":"Upload a textbook PDF to S3 under Text_books/{BookID}.pdf. Send file, grade (kg | grade_1_part_1..grade_9_part_2 | hscp1_sem1..hscp4_sem2), and lesson (0 for grades, 1-99 for KG/HSCP); API encodes to book ID and stores. Same bucket as pdf_root_words.","GET /pdf/load-stored-words":"Load previously stored root words from S3 by grade and lesson (optional page range; no PDF processing). Grades: grade_X_part_Y + lesson=0. KG: kg + lesson=week. HSCP: hscpX_semY + lesson=N.","GET /health":"Health check","GET /debug/api-keys":"Debug API key status","GET /debug/gemini-test":"Test Gemini API directly","GET /test/background":"Test background processing","GET /test/structure":"Test handler structure"},"vaani_grammar_correction":{"description":"Vaani Editor Tamil Grammar Correction API","service":"Vaanieditor.com Tamil SpellCheck API","status":"available","configuration":{"api_key_source":"AWS Secrets Manager (VAANI_SECRET_NAME)","api_url":"https://vaanieditor.com/SpellCheck.asmx/TamilSpellCheck","timeout":"5s"},"endpoints":{"POST /vaani/correct-text":{"description":"Correct Tamil grammar in a single text string","request":{"text":"str - Tamil text to correct"},"response":{"corrected_text":"str - Corrected Tamil text","has_wrong_words":"bool - Whether any corrections were made","wrong_words":"List[Dict] - Details of each wrong word (original, corrected, position, suggestions)","corrections_made":"int - Number of words corrected","original_text":"str - Original input text","suggestions":"List[List[str]] - Suggestions for each word","llm_summary":"str - Human-readable summary of corrections"}},"POST /vaani/correct-text/batch":{"description":"Correct Tamil grammar in multiple sentences at once with parallel processing","request":{"sentences":"List[str] - Array of Tamil sentences to correct"},"response":{"results":"List[Dict] - Array of correction results (one per sentence)","total_sentences":"int - Total number of sentences processed","total_corrections":"int - Total number of corrections across all sentences"},"performance":"Processes all sentences in parallel using asyncio.gather for optimal performance"},"POST /vaani/correct-json":{"description":"Correct Tamil grammar in vocabulary JSON structure (example sentences only)","request":{"data":"Dict - Vocabulary JSON with senses array containing 'ex' (example sentences) field"},"response":{"corrected_json":"Dict - Same JSON structure with corrected example sentences"},"note":"Only corrects example sentences in the 'ex' array within each sense. Other fields remain unchanged."}},"features":{"sandhi_correction":"Enabled - Corrects sandhi (word joins)","colloquial_handling":"Enabled - Handles colloquial Tamil words","unicode_error_fixing":"Disabled - Set to false by default","translated_word_handling":"Disabled - Set to false by default"},"usage_examples":{"single_text":{"method":"POST","endpoint":"/vaani/correct-text","body":{"text":"அவன் பள்ளி சென்றான்"}},"batch":{"method":"POST","endpoint":"/vaani/correct-text/batch","body":{"sentences":["அவன் பள்ளி சென்றான்","நான் வீட்டில் இருக்கிறேன்"]}},"json_structure":{"method":"POST","endpoint":"/vaani/correct-json","body":{"data":{"s":[{"ex":[["அவன் பள்ளி சென்றான்","eng"],["நான் வீட்டில்","eng"]]}]}}}}},"integration":{"real_time_updates":"AppSync subscriptions on VocabularyGenerationTask","flow":"POST → immediate response → AppSync subscription → real-time progress → COMPLETED status"}}