Skip to content
This repository has been archived by the owner on Jan 5, 2025. It is now read-only.

Commit

Permalink
updated readme for users, moved environment files inside to avoid con…
Browse files Browse the repository at this point in the history
…fusion
  • Loading branch information
codebanesr authored and codebanesr committed Aug 19, 2023
1 parent b8a8a1d commit a13d547
Show file tree
Hide file tree
Showing 9 changed files with 66 additions and 8,719 deletions.
15 changes: 1 addition & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,4 @@ down:

exec-backend-server:
$(DOCKER_COMPOSE) exec backend-server bash
.PHONY: install down


# Makefile to Run docker-compose for Django App

.env.docker:
@echo "Error: The .env.docker file is missing. Please create it before proceeding. Refer readme"
@exit 1

install_django: .env.docker
@docker-compose -f docker-compose.django.yaml up -d

uninstall_django:
@docker-compose -f docker-compose.django.yaml down
.PHONY: install down
33 changes: 18 additions & 15 deletions common.env
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
# Required for openai azure ------------------------------------------------------------------
USE_AZURE_OPENAI=true
AZURE_OPENAI_API_KEY=
AZURE_OPENAI_API_INSTANCE_NAME=
AZURE_OPENAI_API_COMPLETIONS_DEPLOYMENT_NAME=
AZURE_OPENAI_API_EMBEDDINGS_DEPLOYMENT_NAME=
AZURE_OPENAI_API_VERSION=2023-03-15-preview
# --------------------------------------------------------------------------------------------

OPENAI_API_KEY=

STORE=pinecone
# pinecone | qdrant
STORE=qdrant
QDRANT_URL=http://qdrant:6333


PINECONE_API_KEY=
PINECONE_ENVIRONMENT=
VECTOR_STORE_INDEX_NAME=

# QDRANT_URL
QDRANT_URL=http://qdrant:6333
# --- if using pinecone ---
# PINECONE_API_KEY=
# PINECONE_ENV=
# VECTOR_STORE_INDEX_NAME=
# --- end pinecone ---

# Required for openai azure ------------------------------------------------------------------
# USE_AZURE_OPENAI=true
# AZURE_OPENAI_API_KEY=
# AZURE_OPENAI_API_INSTANCE_NAME=
# AZURE_OPENAI_API_COMPLETIONS_DEPLOYMENT_NAME=
# AZURE_OPENAI_API_EMBEDDINGS_DEPLOYMENT_NAME=
# AZURE_OPENAI_API_VERSION=2023-03-15-preview
# --------------------------------------------------------------------------------------------
23 changes: 23 additions & 0 deletions dj_backend_server/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Makefile to Run docker-compose for Django App

# Check if Docker is installed
DOCKER := $(shell command -v docker 2> /dev/null)
DOCKER_COMPOSE := $(shell command -v docker-compose 2> /dev/null)

ifndef DOCKER
$(error "Docker is not installed. Please install Docker before proceeding.")
endif

ifndef DOCKER_COMPOSE
$(error "Docker Compose is not installed. Please install Docker Compose before proceeding.")
endif

.env.docker:
@echo "Error: The .env.docker file is missing. Please create it before proceeding. Refer example.env.docker or readme file in dj_backend_server/readme.md"
exit 1

install: .env.docker
docker-compose up -d

down:
docker-compose down
28 changes: 16 additions & 12 deletions .env.docker → dj_backend_server/example.env.docker
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# For azure, can take either of azure or openai, for openai we will only need the key
OPENAI_API_TYPE=openai
AZURE_OPENAI_API_BASE=
AZURE_OPENAI_API_KEY=
AZURE_OPENAI_API_VERSION=2023-03-15-preview
AZURE_OPENAI_EMBEDDING_MODEL_NAME=
AZURE_OPENAI_DEPLOYMENT_NAME=
AZURE_OPENAI_COMPLETION_MODEL=gpt-35-turbo

# If using azure
# AZURE_OPENAI_API_BASE=
# AZURE_OPENAI_API_KEY=
# AZURE_OPENAI_API_VERSION=2023-03-15-preview
# AZURE_OPENAI_EMBEDDING_MODEL_NAME=
# AZURE_OPENAI_DEPLOYMENT_NAME=
# AZURE_OPENAI_COMPLETION_MODEL=gpt-35-turbo


# For openai
Expand All @@ -14,24 +16,24 @@ OPENAI_API_KEY=


# azure | openai
EMBEDDING_PROVIDER=azure
EMBEDDING_PROVIDER=openai

# Vector Store, PINECONE|QDRANT
STORE=QDRANT


# if using pinecone
PINECONE_API_KEY=
PINECONE_ENV=
VECTOR_STORE_INDEX_NAME=
# PINECONE_API_KEY=
# PINECONE_ENV=
# VECTOR_STORE_INDEX_NAME=


# if using qdrant
QDRANT_URL=http://qdrant:6333


# optional, defaults to 15
MAX_PAGES_CRAWL=1
MAX_PAGES_CRAWL=15

# --- these will change if you decide to start testing the software
CELERY_BROKER_URL=redis://redis:6379/0
Expand All @@ -40,4 +42,6 @@ DATABASE_NAME=openchat
DATABASE_USER=dbuser
DATABASE_PASSWORD=dbpass
DATABASE_HOST=mysql
DATABASE_PORT=3306
DATABASE_PORT=3306

# retrieval_qa | conversation_retrieval, retrieval_qa works better with azure openai
4 changes: 2 additions & 2 deletions dj_backend_server/web/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Generated by Django 4.2.3 on 2023-08-12 05:35
# Generated by Django 4.2.3 on 2023-08-19 19:06

from django.db import migrations, models
import django.db.models.deletion
Expand Down Expand Up @@ -36,7 +36,7 @@ class Migration(migrations.Migration):
migrations.CreateModel(
name='ChatbotSetting',
fields=[
('id', models.CharField(max_length=36, primary_key=True, serialize=False)),
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
('chatbot_id', models.CharField(max_length=36, null=True)),
('name', models.CharField(max_length=255)),
('value', models.CharField(max_length=255)),
Expand Down
93 changes: 0 additions & 93 deletions docker-compose.django.yaml

This file was deleted.

9 changes: 6 additions & 3 deletions docs/django_release.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,21 @@ Before you dive into the exciting world of our new application, there are a few
## Configuration
To ensure the application works seamlessly with your environment, you'll need to configure a few settings.

1. **Environment Configuration:** To run the app in Docker, open the `example.env` file in the root directory of the project. Update the required environment variables, such as database credentials, API keys, etc. After making the changes, rename the file to `.env.docker` and then run `make install_django`. To run the app in development environment, just rename example.env to .env
1. **Environment Configuration:** To run the app in Docker, open the `example.env` file in the root directory of the project. Update the required environment variables, such as database credentials, API keys, etc. After making the changes, rename the file to `.env.docker` and then run `make install`. To run the app in development environment, just rename example.env to .env

## Running the Application

**1. Launch the Backend Server as a Docker Container:**

1. switch to python directory, `cd dj_backend_server`
To initiate the app, execute the following command:
```bash
make install_django
make install
```

To stop the server, use:
```bash
make uninstall_django
make down
```

**Local Machine Deployment for Development:**
Expand Down Expand Up @@ -73,6 +74,8 @@ With these steps, you can make the most of hot reloading and enhance your develo
## Compatibility
We understand the importance of seamless integration with your existing databases. Our team has worked diligently to ensure compatibility so that you can continue to use and enjoy the chatbots you've created earlier.

If you're migrating from PHP to Python, it's important to handle volume mounting correctly. This ensures that your data remains accessible and functional. Additionally, you can opt for a migration script if that suits your needs better.

## Feedback and Support
Your feedback is incredibly important to us as a beta tester and developer. If you come across any problems, have ideas to share, or simply want to tell us about your experience, please don't hesitate to get in touch. You can use the GitHub issue tracker or join our community forum on Discord, named "Openchat".

Expand Down
46 changes: 0 additions & 46 deletions example.env

This file was deleted.

Loading

0 comments on commit a13d547

Please sign in to comment.