CoolFace
Apppublic

malepati/custom_template_working

sourceHugging Faceupdated 8mo agoView on Hugging Face
0likes
LOCAL_SETUP_GUIDE.md158 linesDownload Raw Back to root
1# Running the Application Locally2 3## ✅ Implementation Complete4 5The per-query slide generation system has been successfully implemented:6- Backend processes each query separately7- Extracts `<analysis>` and `<datastory_chart>` XML tags8- LLM determines slides needed per query (1-3 slides each)9- Slide/language dropdowns removed from frontend UI10 11---12 13## Prerequisites14 151. **Python 3.10+** installed162. **Node.js** installed173. **LLM API keys** configured (OpenAI, Google, Anthropic, etc.)18 19---20 21## Step 1: Start the Backend Server22 23Open a **NEW terminal** and run:24 25```bash26cd c:\Users\DELL\Documents\upgrading\Accusaga_slides_presentation\servers\fastapi27python server.py --port 8000 --reload28```29 30**Wait for this message:**31```32INFO:     Application startup complete.33```34 35✅ Backend will be running at http://127.0.0.1:800036 37---38 39## Step 2: Start the Frontend Server40 41Open **ANOTHER NEW terminal** and run:42 43```bash44cd c:\Users\DELL\Documents\upgrading\Accusaga_slides_presentation\servers\nextjs45npm run dev46```47 48**Wait for this message:**49```50✓ Ready in X.Xs51- Local: http://localhost:300052```53 54✅ Frontend will be running at http://localhost:300055 56---57 58## Step 3: Test Your Payload59 601. **Open browser:** http://localhost:3000/upload61 622. **Paste this JSON** in the text area:63 64```json65{66  "language": "English",67  "list_of_queries": [68    "4d143989-19fe-4d33-a4f3-7a1c63662ddd",69    "83d4af3b-99ae-4a1b-bffc-8e1a82f02bdd",70    "59c9ee36-d9b6-4dcb-afa5-9605d8d695dd",71    "6195937b-4a31-4ce1-bf00-741f3a2743dd"72  ],73  "org_id": "f9209852-7de2-49b3-9190-2a52b3250428",74  "presenter_name": "Venkat",75  "report_name": "report on HU Dataset",76  "user_id": "eb4193aa-1f25-422c-9b33-2a5f41989891"77}78```79 803. **Click "Next"**81 824. **Watch the backend terminal** - you should see:83   ```84   Processing 4 queries for user: eb4193aa-1f25-422c-9b33-2a5f4198989185   Query: 'give me the pie chart...' → 2 slide(s)86   Query: 'What are the comorbid...' → 2 slide(s)87   Total slides across all queries: 888   Successfully processed all queries89   ```90 91---92 93## Expected UI Changes94 95✅ **NO slide count dropdown** (removed)  96✅ **NO language dropdown** (removed)  97✅ **Only "Advanced Settings" button** visible  98✅ **Web search defaulted to `false`**99 100---101 102## Troubleshooting103 104### Backend not starting?105- Check if another process is using port 8000106- Verify Python dependencies are installed: `pip install -r requirements.txt`107 108### Frontend errors?109- Run `npm install` in the nextjs directory110- Clear Next.js cache: delete `.next` folder and rebuild111 112### Request timeout?113- The external API (`fetch_all`) or LLM calls may be slow114- Check your LLM API keys are configured115- Verify internet connection for external API calls116 117---118 119## What Happens Behind the Scenes120 1211. **Backend receives JSON** with `list_of_queries`1222. **Fetches conversation data** for each query ID from external API1233. **Extracts XML tags:**124   - `<analysis>` - Key findings and insights125   - `<datastory_chart>` - Visualization data (vega specs)1264. **LLM determines slides** for each query individually (1-3 slides)1275. **Sums total slides** across all queries1286. **Generates presentation** with calculated slide count129 130---131 132## Files Modified133 134**Backend:**135- `api/v1/ppt/endpoints/presentation.py` - Updated `/create` endpoint136- `utils/extract_response_data.py` - NEW - XML tag extraction137- `utils/llm_calls/determine_slides_per_query.py` - NEW - Per-query slide determination138 139**Frontend:**140- `app/(presentation-generator)/upload/components/UploadPage.tsx` - Removed slide/language config141- `app/(presentation-generator)/upload/components/ConfigurationSelects.tsx` - Removed dropdowns142- `app/(presentation-generator)/upload/type.ts` - Updated interface143- `app/(presentation-generator)/services/api/presentation-generation.ts` - Updated API call144 145---146 147## Next Steps After Testing148 149If everything works:150- ✅ The system is ready to use!151- Create presentations with automatic slide count determination152- LLM analyzes each query's data complexity153 154If you encounter issues:155- Check backend logs for errors156- Check frontend console (F12) for network errors157- Verify LLM API credentials158