Spaces:
Sleeping
Sleeping
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,107 +1,15 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji: π
|
| 4 |
-
colorFrom: blue
|
| 5 |
-
colorTo: purple
|
| 6 |
sdk: docker
|
| 7 |
-
app_file: app.py
|
| 8 |
-
pinned: false
|
| 9 |
---
|
| 10 |
|
| 11 |
-
#
|
| 12 |
|
| 13 |
-
|
|
|
|
| 14 |
|
| 15 |
-
##
|
| 16 |
-
|
| 17 |
-
-
|
| 18 |
-
-
|
| 19 |
-
-
|
| 20 |
-
- π¨ **Clean UI**: Professional Gradio interface
|
| 21 |
-
- βοΈ **Cloud Ready**: Deployed on Hugging Face Spaces
|
| 22 |
-
|
| 23 |
-
## Setup Instructions
|
| 24 |
-
|
| 25 |
-
### 1. Get Your LlamaCloud Information
|
| 26 |
-
|
| 27 |
-
From your LlamaCloud dashboard:
|
| 28 |
-
- Copy your API key
|
| 29 |
-
- Copy your index/pipeline ID (from the URL or dashboard)
|
| 30 |
-
|
| 31 |
-
### 2. Configure Environment Variables
|
| 32 |
-
|
| 33 |
-
In your Hugging Face Space, go to Settings β Variables and Secrets, and add:
|
| 34 |
-
|
| 35 |
-
```
|
| 36 |
-
LLAMA_CLOUD_API_KEY=your_api_key_here
|
| 37 |
-
LLAMA_CLOUD_INDEX_ID=your_index_id_here
|
| 38 |
-
OPENAI_API_KEY=your_openai_key_here
|
| 39 |
-
```
|
| 40 |
-
|
| 41 |
-
### 3. Deploy to Hugging Face Spaces
|
| 42 |
-
|
| 43 |
-
1. Create a new Space with **Docker SDK**
|
| 44 |
-
2. Upload all the files from this repository
|
| 45 |
-
3. The Space will automatically build and deploy
|
| 46 |
-
|
| 47 |
-
### 4. Local Development (Optional)
|
| 48 |
-
|
| 49 |
-
```bash
|
| 50 |
-
# Clone the repository
|
| 51 |
-
git clone <your-repo>
|
| 52 |
-
cd <your-repo>
|
| 53 |
-
|
| 54 |
-
# Install dependencies
|
| 55 |
-
pip install -r requirements.txt
|
| 56 |
-
|
| 57 |
-
# Copy environment variables
|
| 58 |
-
cp .env.example .env
|
| 59 |
-
# Edit .env with your actual keys
|
| 60 |
-
|
| 61 |
-
# Run locally
|
| 62 |
-
python app.py
|
| 63 |
-
```
|
| 64 |
-
|
| 65 |
-
## Usage
|
| 66 |
-
|
| 67 |
-
1. Open the deployed Hugging Face Space
|
| 68 |
-
2. Type questions about your documents in natural language
|
| 69 |
-
3. Get AI-powered answers with source attribution
|
| 70 |
-
4. Use example questions to get started
|
| 71 |
-
|
| 72 |
-
## Example Questions
|
| 73 |
-
|
| 74 |
-
- "What are the main topics covered in the documents?"
|
| 75 |
-
- "Summarize the key findings"
|
| 76 |
-
- "What does the document say about [specific topic]?"
|
| 77 |
-
- "Can you provide details about the methodology?"
|
| 78 |
-
|
| 79 |
-
## Troubleshooting
|
| 80 |
-
|
| 81 |
-
### Common Issues
|
| 82 |
-
|
| 83 |
-
1. **"Could not connect to document index"**
|
| 84 |
-
- Check your `LLAMA_CLOUD_API_KEY` and `LLAMA_CLOUD_INDEX_ID`
|
| 85 |
-
- Ensure your LlamaCloud index is active and accessible
|
| 86 |
-
|
| 87 |
-
2. **OpenAI API errors**
|
| 88 |
-
- Verify your `OPENAI_API_KEY` is valid and has credits
|
| 89 |
-
- Check if you have access to GPT-5
|
| 90 |
-
|
| 91 |
-
3. **Build failures**
|
| 92 |
-
- Check that all files are uploaded correctly
|
| 93 |
-
- Verify requirements.txt has correct versions
|
| 94 |
-
|
| 95 |
-
### Getting Help
|
| 96 |
-
|
| 97 |
-
- Check Hugging Face Spaces logs for detailed error messages
|
| 98 |
-
- Ensure your LlamaCloud index is working in the playground first
|
| 99 |
-
- Verify all environment variables are set correctly
|
| 100 |
-
|
| 101 |
-
## Architecture
|
| 102 |
-
|
| 103 |
-
```
|
| 104 |
-
User Question β Gradio Interface β LlamaIndex β LlamaCloud Index β OpenAI LLM β Response with Sources
|
| 105 |
-
```
|
| 106 |
-
|
| 107 |
-
The app connects to your existing LlamaCloud index and uses OpenAI's GPT-5 for generating responses based on retrieved document chunks.
|
|
|
|
| 1 |
---
|
| 2 |
+
title: LlamaIndex Cloud Chat (SDK)
|
|
|
|
|
|
|
|
|
|
| 3 |
sdk: docker
|
|
|
|
|
|
|
| 4 |
---
|
| 5 |
|
| 6 |
+
# LlamaIndex Cloud Chat (SDK)
|
| 7 |
|
| 8 |
+
Streamlit UI that connects to a LlamaIndex **LlamaCloud** pipeline using the official
|
| 9 |
+
LlamaIndex SDK (`LlamaCloudIndex` + `as_chat_engine()`), with sources/citations.
|
| 10 |
|
| 11 |
+
## Setup
|
| 12 |
+
- Add Space **Secrets**:
|
| 13 |
+
- `LLAMA_CLOUD_API_KEY` β your LlamaCloud API key (llx_...)
|
| 14 |
+
- `PIPELINE_ID` β your pipeline (index) UUID from cloud.llamaindex.ai
|
| 15 |
+
- Files are at repo root: `Dockerfile`, `requirements.txt`, `app.py`, `README.md`.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|