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

Commit 59d9ab7

Browse files
authored
Merge pull request #143 from codebanesr/fix/readme
updated readme for users, moved environment files inside to avoid con…
2 parents b8a8a1d + a13d547 commit 59d9ab7

File tree

9 files changed

+66
-8719
lines changed

9 files changed

+66
-8719
lines changed

Makefile

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -60,17 +60,4 @@ down:
6060

6161
exec-backend-server:
6262
$(DOCKER_COMPOSE) exec backend-server bash
63-
.PHONY: install down
64-
65-
66-
# Makefile to Run docker-compose for Django App
67-
68-
.env.docker:
69-
@echo "Error: The .env.docker file is missing. Please create it before proceeding. Refer readme"
70-
@exit 1
71-
72-
install_django: .env.docker
73-
@docker-compose -f docker-compose.django.yaml up -d
74-
75-
uninstall_django:
76-
@docker-compose -f docker-compose.django.yaml down
63+
.PHONY: install down

common.env

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
1-
# Required for openai azure ------------------------------------------------------------------
2-
USE_AZURE_OPENAI=true
3-
AZURE_OPENAI_API_KEY=
4-
AZURE_OPENAI_API_INSTANCE_NAME=
5-
AZURE_OPENAI_API_COMPLETIONS_DEPLOYMENT_NAME=
6-
AZURE_OPENAI_API_EMBEDDINGS_DEPLOYMENT_NAME=
7-
AZURE_OPENAI_API_VERSION=2023-03-15-preview
8-
# --------------------------------------------------------------------------------------------
9-
101
OPENAI_API_KEY=
112

12-
STORE=pinecone
3+
# pinecone | qdrant
4+
STORE=qdrant
5+
QDRANT_URL=http://qdrant:6333
6+
137

14-
PINECONE_API_KEY=
15-
PINECONE_ENVIRONMENT=
16-
VECTOR_STORE_INDEX_NAME=
178

18-
# QDRANT_URL
19-
QDRANT_URL=http://qdrant:6333
9+
# --- if using pinecone ---
10+
# PINECONE_API_KEY=
11+
# PINECONE_ENV=
12+
# VECTOR_STORE_INDEX_NAME=
13+
# --- end pinecone ---
14+
15+
# Required for openai azure ------------------------------------------------------------------
16+
# USE_AZURE_OPENAI=true
17+
# AZURE_OPENAI_API_KEY=
18+
# AZURE_OPENAI_API_INSTANCE_NAME=
19+
# AZURE_OPENAI_API_COMPLETIONS_DEPLOYMENT_NAME=
20+
# AZURE_OPENAI_API_EMBEDDINGS_DEPLOYMENT_NAME=
21+
# AZURE_OPENAI_API_VERSION=2023-03-15-preview
22+
# --------------------------------------------------------------------------------------------

dj_backend_server/Makefile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Makefile to Run docker-compose for Django App
2+
3+
# Check if Docker is installed
4+
DOCKER := $(shell command -v docker 2> /dev/null)
5+
DOCKER_COMPOSE := $(shell command -v docker-compose 2> /dev/null)
6+
7+
ifndef DOCKER
8+
$(error "Docker is not installed. Please install Docker before proceeding.")
9+
endif
10+
11+
ifndef DOCKER_COMPOSE
12+
$(error "Docker Compose is not installed. Please install Docker Compose before proceeding.")
13+
endif
14+
15+
.env.docker:
16+
@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"
17+
exit 1
18+
19+
install: .env.docker
20+
docker-compose up -d
21+
22+
down:
23+
docker-compose down
Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
# For azure, can take either of azure or openai, for openai we will only need the key
22
OPENAI_API_TYPE=openai
3-
AZURE_OPENAI_API_BASE=
4-
AZURE_OPENAI_API_KEY=
5-
AZURE_OPENAI_API_VERSION=2023-03-15-preview
6-
AZURE_OPENAI_EMBEDDING_MODEL_NAME=
7-
AZURE_OPENAI_DEPLOYMENT_NAME=
8-
AZURE_OPENAI_COMPLETION_MODEL=gpt-35-turbo
3+
4+
# If using azure
5+
# AZURE_OPENAI_API_BASE=
6+
# AZURE_OPENAI_API_KEY=
7+
# AZURE_OPENAI_API_VERSION=2023-03-15-preview
8+
# AZURE_OPENAI_EMBEDDING_MODEL_NAME=
9+
# AZURE_OPENAI_DEPLOYMENT_NAME=
10+
# AZURE_OPENAI_COMPLETION_MODEL=gpt-35-turbo
911

1012

1113
# For openai
@@ -14,24 +16,24 @@ OPENAI_API_KEY=
1416

1517

1618
# azure | openai
17-
EMBEDDING_PROVIDER=azure
19+
EMBEDDING_PROVIDER=openai
1820

1921
# Vector Store, PINECONE|QDRANT
2022
STORE=QDRANT
2123

2224

2325
# if using pinecone
24-
PINECONE_API_KEY=
25-
PINECONE_ENV=
26-
VECTOR_STORE_INDEX_NAME=
26+
# PINECONE_API_KEY=
27+
# PINECONE_ENV=
28+
# VECTOR_STORE_INDEX_NAME=
2729

2830

2931
# if using qdrant
3032
QDRANT_URL=http://qdrant:6333
3133

3234

3335
# optional, defaults to 15
34-
MAX_PAGES_CRAWL=1
36+
MAX_PAGES_CRAWL=15
3537

3638
# --- these will change if you decide to start testing the software
3739
CELERY_BROKER_URL=redis://redis:6379/0
@@ -40,4 +42,6 @@ DATABASE_NAME=openchat
4042
DATABASE_USER=dbuser
4143
DATABASE_PASSWORD=dbpass
4244
DATABASE_HOST=mysql
43-
DATABASE_PORT=3306
45+
DATABASE_PORT=3306
46+
47+
# retrieval_qa | conversation_retrieval, retrieval_qa works better with azure openai

dj_backend_server/web/migrations/0001_initial.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Generated by Django 4.2.3 on 2023-08-12 05:35
1+
# Generated by Django 4.2.3 on 2023-08-19 19:06
22

33
from django.db import migrations, models
44
import django.db.models.deletion
@@ -36,7 +36,7 @@ class Migration(migrations.Migration):
3636
migrations.CreateModel(
3737
name='ChatbotSetting',
3838
fields=[
39-
('id', models.CharField(max_length=36, primary_key=True, serialize=False)),
39+
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
4040
('chatbot_id', models.CharField(max_length=36, null=True)),
4141
('name', models.CharField(max_length=255)),
4242
('value', models.CharField(max_length=255)),

docker-compose.django.yaml

Lines changed: 0 additions & 93 deletions
This file was deleted.

docs/django_release.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,21 @@ Before you dive into the exciting world of our new application, there are a few
1919
## Configuration
2020
To ensure the application works seamlessly with your environment, you'll need to configure a few settings.
2121

22-
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
22+
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
2323

2424
## Running the Application
2525

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

28+
1. switch to python directory, `cd dj_backend_server`
2829
To initiate the app, execute the following command:
2930
```bash
30-
make install_django
31+
make install
3132
```
3233

3334
To stop the server, use:
3435
```bash
35-
make uninstall_django
36+
make down
3637
```
3738

3839
**Local Machine Deployment for Development:**
@@ -73,6 +74,8 @@ With these steps, you can make the most of hot reloading and enhance your develo
7374
## Compatibility
7475
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.
7576

77+
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.
78+
7679
## Feedback and Support
7780
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".
7881

example.env

Lines changed: 0 additions & 46 deletions
This file was deleted.

0 commit comments

Comments
 (0)