Update README.md
Browse files
README.md
CHANGED
|
@@ -10,3 +10,112 @@ pinned: false
|
|
| 10 |
---
|
| 11 |
|
| 12 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
---
|
| 11 |
|
| 12 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
| 13 |
+
|
| 14 |
+
# Project Story Interview Chatbot
|
| 15 |
+
|
| 16 |
+
A Gradio-based interview chatbot that collects project stories and automatically generates case study articles, submitting them to GitHub.
|
| 17 |
+
|
| 18 |
+
## Features
|
| 19 |
+
|
| 20 |
+
- **OpenAI-compatible interviewer LLM** - Conducts structured interviews about your project
|
| 21 |
+
- **Availability checking** - Shows whether the interviewer is available or quota exceeded
|
| 22 |
+
- **Browser-based persistence** - Chat history saved in localStorage
|
| 23 |
+
- **AI article generation** - Uses Google Gemini to transform interview into a structured article
|
| 24 |
+
- **GitHub integration** - Automatically commits articles to `_draft/` folder
|
| 25 |
+
- **Post-submission flow** - Option to clear history or continue
|
| 26 |
+
|
| 27 |
+
## Installation
|
| 28 |
+
|
| 29 |
+
```bash
|
| 30 |
+
pip install -r requirements.txt
|
| 31 |
+
```
|
| 32 |
+
|
| 33 |
+
## Configuration
|
| 34 |
+
|
| 35 |
+
Copy `.env.example` to `.env` and configure:
|
| 36 |
+
|
| 37 |
+
```bash
|
| 38 |
+
# Interviewer LLM (OpenAI-compatible API)
|
| 39 |
+
INTERVIEWER_BASE_URL=http://your-server.com/v1
|
| 40 |
+
INTERVIEWER_API_KEY=your-api-key
|
| 41 |
+
INTERVIEWER_MODEL=gpt-4
|
| 42 |
+
|
| 43 |
+
# Google Gemini for article generation
|
| 44 |
+
GEMINI_API_KEY=your-gemini-api-key
|
| 45 |
+
|
| 46 |
+
# GitHub repository for article submission
|
| 47 |
+
GITHUB_TOKEN=your-github-personal-access-token
|
| 48 |
+
GITHUB_REPO=owner/repository-name
|
| 49 |
+
GITHUB_BRANCH=main
|
| 50 |
+
```
|
| 51 |
+
|
| 52 |
+
### Getting API Keys
|
| 53 |
+
|
| 54 |
+
**OpenAI-compatible API:**
|
| 55 |
+
- Use your own server running an OpenAI-compatible API (e.g., vLLM, LocalAI)
|
| 56 |
+
- Or use OpenAI's API directly: `https://api.openai.com/v1`
|
| 57 |
+
|
| 58 |
+
**Google Gemini:**
|
| 59 |
+
- Get a free API key at [Google AI Studio](https://aistudio.google.com/app/apikey)
|
| 60 |
+
|
| 61 |
+
**GitHub Token:**
|
| 62 |
+
- Go to GitHub Settings → Developer settings → Personal access tokens → Tokens (classic)
|
| 63 |
+
- Generate new token with `repo` scope
|
| 64 |
+
- Or use fine-grained token with read/write access to Contents
|
| 65 |
+
|
| 66 |
+
## Running
|
| 67 |
+
|
| 68 |
+
```bash
|
| 69 |
+
python app.py
|
| 70 |
+
```
|
| 71 |
+
|
| 72 |
+
The application will be available at `http://localhost:7860`
|
| 73 |
+
|
| 74 |
+
## Customization
|
| 75 |
+
|
| 76 |
+
### Article Writing Style
|
| 77 |
+
|
| 78 |
+
Edit `article_instructions.md` to customize the writing style, structure, and guidelines for generated articles.
|
| 79 |
+
|
| 80 |
+
### Interview Topics
|
| 81 |
+
|
| 82 |
+
Modify the `SYSTEM_PROMPT` in `app.py` to change the interview focus areas.
|
| 83 |
+
|
| 84 |
+
## Usage Flow
|
| 85 |
+
|
| 86 |
+
1. **Start Interview** - Begins conversation with the interviewer AI
|
| 87 |
+
2. **Share your story** - Answer questions about your project journey
|
| 88 |
+
3. **Submit** - When complete, click "Generate & Submit Article"
|
| 89 |
+
4. **Review** - Preview the generated article
|
| 90 |
+
5. **Clear or Continue** - Choose to clear history or keep it for future editing
|
| 91 |
+
|
| 92 |
+
## Troubleshooting
|
| 93 |
+
|
| 94 |
+
**"Interviewer AI is off work now"**
|
| 95 |
+
- Your API has exceeded quota/rate limits
|
| 96 |
+
- Wait for quota to reset (usually daily)
|
| 97 |
+
- Check API status on your provider's dashboard
|
| 98 |
+
|
| 99 |
+
**"Gemini API key not configured"**
|
| 100 |
+
- Make sure `GEMINI_API_KEY` is set in environment variables
|
| 101 |
+
|
| 102 |
+
**"GitHub not configured"**
|
| 103 |
+
- Ensure `GITHUB_TOKEN` and `GITHUB_REPO` are properly set
|
| 104 |
+
- Verify token has write permissions to the repository
|
| 105 |
+
|
| 106 |
+
**Chat history not persisting**
|
| 107 |
+
- History is stored in browser localStorage
|
| 108 |
+
- Clearing browser data will erase history
|
| 109 |
+
- Use a consistent browser for continuity
|
| 110 |
+
|
| 111 |
+
## Technical Details
|
| 112 |
+
|
| 113 |
+
- Built with Gradio 6.x
|
| 114 |
+
- Uses OpenAI Python SDK for interviewer LLM
|
| 115 |
+
- Uses Google GenAI SDK for article generation
|
| 116 |
+
- PyGithub for repository operations
|
| 117 |
+
- LocalStorage for browser-side persistence
|
| 118 |
+
|
| 119 |
+
## License
|
| 120 |
+
|
| 121 |
+
MIT
|