Spaces:
Runtime error
FastAPI for interacting with langchain and GPT-3.5 based chatbot, with Redis database as the vector store-backed retriever memory.
How to run
Using virtual environment:
Set up a virtual environment:
python -m venv myenv
Create a .env file and add 'OPENAI_API_KEY', 'REDIS_URL', and 'HUGGINGFACEHUB_API_TOKEN as variables
Navigate to the app directory:
cd app
Install the required dependencies:
pip install -r requirements.txt
Run the FastAPI server with uvicorn:
uvicorn main:app --reload --port=8000 --host=0.0.0.0
Using Docker Compose:
Build the Docker images:
docker-compose build
Start the Docker containers:
docker-compose up
API Documentation
Changing User for Redis Vector Store
To change the Redis vector store retriever memory to a specific user, send a request to the following endpoint:
localhost:8000/api/{username}
Replace {username}
with the desired username. This action ensures that the chatbot will only retrieve data from the Redis database specific to that user.
Accessing API Documentation
For detailed documentation on how to interact with the APIs in the application, visit:
localhost:8000/docs
This endpoint provides comprehensive guidance on utilizing the APIs effectively.
You can seamlessly integrate this backend into your existing application, providing your users with access to a dedicated vector-based database chatbot. Remember to generate the repsective API keys.