Spaces:
Sleeping
Sleeping
|
Download README.md from abdullah9873/backend-rag-chatbot: direct link, hf CLI and curl.
- Browser
- Download file 1.34 kB
-
https://huggingface.co/spaces/abdullah9873/backend-rag-chatbot/resolve/main/README.md
- Command line
-
hf download hf://spaces/abdullah9873/backend-rag-chatbot/README.md
-
curl -L -o README.md https://huggingface.co/spaces/abdullah9873/backend-rag-chatbot/resolve/main/README.md
1.34 kB
metadata
title: Physical Ai Backend
emoji: 🤖
colorFrom: blue
colorTo: indigo
sdk: docker
pinned: false
app_port: 7860
Backend README
This is the README for the RAG Chatbot backend service.
Setup
Prerequisites:
- Python 3.11+ installed
requirements.txtfile with all necessary dependencies- Environment variables configured (
OPENAI_API_KEY,QDRANT_API_KEY,QDRANT_HOST,DATABASE_URL)
Installation:
pip install -r requirements.txtDatabase Setup: (Assuming Alembic is used for migrations)
alembic upgrade head(If not using Alembic, refer to
backend/src/database.pyfor connection details and manual setup if needed)Running the Server:
uvicorn backend.src.main:app --reload
Usage
- The API provides two main endpoints:
POST /query/general: For general questions about the book.POST /query/selected-text: For questions about specific text selections.
Data Ingestion
To populate the database and vector store, run the ingestion script:
python scripts/ingest_data.py
Note: Ensure your Docusaurus build output is accessible at the path specified in scripts/ingest_data.py or modify the script to point to the correct location.