Spaces:
Sleeping
Sleeping
Commit ·
07dd4e7
1
Parent(s): 29e3b57
Prepare backend for HF Spaces deployment
Browse files- Dockerfile +5 -6
- README.md +32 -1
Dockerfile
CHANGED
|
@@ -6,8 +6,7 @@ ENV PYTHONDONTWRITEBYTECODE=1 \
|
|
| 6 |
PYTHONUNBUFFERED=1
|
| 7 |
|
| 8 |
# Set the working directory in the container
|
| 9 |
-
|
| 10 |
-
WORKDIR /rag_agent_api
|
| 11 |
|
| 12 |
# Copy the requirements file into the container
|
| 13 |
COPY requirements.txt .
|
|
@@ -18,8 +17,8 @@ RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
|
| 18 |
# Copy the rest of the application code
|
| 19 |
COPY . .
|
| 20 |
|
| 21 |
-
# Expose the port the app runs on
|
| 22 |
-
EXPOSE
|
| 23 |
|
| 24 |
-
# Run the FastAPI application with uvicorn
|
| 25 |
-
CMD ["uvicorn", "rag_agent_api.main:app", "--host", "0.0.0.0", "--port", "
|
|
|
|
| 6 |
PYTHONUNBUFFERED=1
|
| 7 |
|
| 8 |
# Set the working directory in the container
|
| 9 |
+
WORKDIR /app
|
|
|
|
| 10 |
|
| 11 |
# Copy the requirements file into the container
|
| 12 |
COPY requirements.txt .
|
|
|
|
| 17 |
# Copy the rest of the application code
|
| 18 |
COPY . .
|
| 19 |
|
| 20 |
+
# Expose the port the app runs on for Hugging Face Spaces
|
| 21 |
+
EXPOSE 7860
|
| 22 |
|
| 23 |
+
# Run the FastAPI application with uvicorn for Hugging Face Spaces
|
| 24 |
+
CMD ["uvicorn", "rag_agent_api.main:app", "--host", "0.0.0.0", "--port", "7860"]
|
README.md
CHANGED
|
@@ -1 +1,32 @@
|
|
| 1 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: Backend Deploy
|
| 3 |
+
emoji: 🚀
|
| 4 |
+
colorFrom: blue
|
| 5 |
+
colorTo: purple
|
| 6 |
+
sdk: docker
|
| 7 |
+
pinned: false
|
| 8 |
+
---
|
| 9 |
+
|
| 10 |
+
# RAG Agent and API Layer
|
| 11 |
+
|
| 12 |
+
This is a FastAPI application that provides a question-answering API using Gemini agents and Qdrant retrieval for RAG (Retrieval Augmented Generation) functionality.
|
| 13 |
+
|
| 14 |
+
## API Endpoints
|
| 15 |
+
|
| 16 |
+
- `GET /` - Root endpoint with API information
|
| 17 |
+
- `POST /ask` - Main question-answering endpoint
|
| 18 |
+
- `GET /health` - Health check endpoint
|
| 19 |
+
- `GET /ready` - Readiness check endpoint
|
| 20 |
+
- `/docs` - API documentation (Swagger UI)
|
| 21 |
+
- `/redoc` - API documentation (Redoc)
|
| 22 |
+
|
| 23 |
+
## Configuration
|
| 24 |
+
|
| 25 |
+
The application requires the following environment variables:
|
| 26 |
+
- `GEMINI_API_KEY` - API key for Google Gemini
|
| 27 |
+
- `QDRANT_URL` - URL for Qdrant vector database
|
| 28 |
+
- `QDRANT_API_KEY` - API key for Qdrant database
|
| 29 |
+
|
| 30 |
+
## Deployment
|
| 31 |
+
|
| 32 |
+
This application is configured for deployment on Hugging Face Spaces using Docker.
|