How as-aigc/as-aigfaq works
Project type and purpose
• This is a command-line Python toolkit that automates generation of FAQs from regulatory or service-context text.
• It is not a web app; rather it’s a pipeline of Python scripts that call external LLM APIs (OpenAI/ChatGPT or TAIDE) to:
1. generate candidate questions (AS-1 scripts),
2. answer them,
3. translate answers into multiple languages (AS-2 scripts),
4. package everything into static HTML (AS-3 scripts).
File structure
• Top-level scripts:
• AS-1-AIGFAQ.py / AS-1-AIGFAQ-TAIDE.py
→ prompts LLM to generate Q&A pairs.
• AS-2-AIGFAQ-to-i18n.py / AS-2-AIGFAQ-TAIDE-to-i18n.py
→ translates Q&A CSV into many languages via LLM.
• AS-3-AIGFAQ-to-HTML.py / AS-3-AIGFAQ-TAIDE-to-HTML.py
→ reads CSV(s) and emits static HTML pages.
• Config & dependencies:
• config.py.example – contains API keys, model settings.
• requirements.txt – Python dependencies (openai, requests, pandas, etc.).
• examples/ – directory of sample CSV and HTML outputs across domains and locales.
• Notebook:
• colab_notebook_AS_AIGFAQ.ipynb – interactive demo for ChatGPT variant.
Key insights from README
• The core “architecture” is a linear multi-stage pipeline:
Input text (legal/regulations) → Q-generation → Answering → Translation → HTML rendering.
• Two interchangeable backends: ChatGPT API or TAIDE API.
• No persistent database; outputs are flat files (CSV, HTML).
Detailed capture of essential elements
• Config.py feeding credentials/parameters into each stage
• Both CSV and HTML as output artifacts
• API calls with “HTTP POST /v1/chat/completions” or “TAIDE endpoint”
• Requirements.txt as build/deployment dependency