Skip to content

Commit 2d4dc73

Browse files
committed
Merge remote-tracking branch 'origin' into 132-smart-memory-management
2 parents 2ef52f2 + 0d371ba commit 2d4dc73

18 files changed

+2441
-1490
lines changed

.env.template

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Supabase SQL
2+
SUPABASE_URL=
3+
SUPABASE_API_KEY=
4+
SUPABASE_READ_ONLY=
5+
SUPABASE_JWT_SECRET=
6+
7+
MATERIALS_SUPABASE_TABLE=uiuc_chatbot
8+
NEW_NEW_NEWNEW_MATERIALS_SUPABASE_TABLE=documents
9+
10+
# QDRANT
11+
QDRANT_COLLECTION_NAME=uiuc-chatbot
12+
DEV_QDRANT_COLLECTION_NAME=dev
13+
QDRANT_URL=
14+
QDRANT_API_KEY=
15+
16+
REFACTORED_MATERIALS_SUPABASE_TABLE=
17+
18+
# AWS
19+
S3_BUCKET_NAME=uiuc-chatbot
20+
AWS_ACCESS_KEY_ID=
21+
AWS_SECRET_ACCESS_KEY=
22+
23+
OPENAI_API_KEY=
24+
25+
NOMIC_API_KEY=
26+
LINTRULE_SECRET=
27+
28+
# Github Agent
29+
GITHUB_APP_ID=<OptionalForGithubApps>
30+
GITHUB_APP_PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----
31+
32+
-----END RSA PRIVATE KEY-----"
33+
34+
NUMEXPR_MAX_THREADS=2

.github/workflows/rules.yml

-25
Original file line numberDiff line numberDiff line change
@@ -1,25 +0,0 @@
1-
name: Rules Check
2-
3-
on:
4-
pull_request:
5-
branches:
6-
- main
7-
8-
jobs:
9-
rules:
10-
runs-on: ubuntu-latest
11-
environment: lintrule
12-
13-
steps:
14-
- name: Checkout code
15-
uses: actions/checkout@v2
16-
with:
17-
fetch-depth: 2 # this part is important!
18-
19-
- name: Install Lint Rules
20-
run: |
21-
curl -fsSL https://www.lintrule.com/install.sh | bash
22-
23-
- name: Run Lint Rules Check
24-
run: |
25-
rules check --secret "${{ secrets.LINTRULE_SECRET }}"

.github/workflows/yapf-format.yml

+7-5
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,23 @@ name: Format code
33
on:
44
push:
55
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
68

79
jobs:
810
format:
911
runs-on: ubuntu-latest
1012
steps:
1113
- uses: actions/checkout@v2
14+
- name: pip install yapf
15+
run: pip install yapf
1216
- name: Format code with yapf
13-
run: |
14-
pip install yapf
15-
yapf --in-place --recursive --parallel --style='{based_on_style: google, column_limit: 140, indent_width: 2}' --exclude '*.env' .
17+
run: yapf --in-place --recursive --parallel --style='{based_on_style: google, column_limit: 140, indent_width: 2}' --exclude '*.env' .
1618
- name: Commit changes
1719
uses: EndBug/add-and-commit@v4
1820
with:
1921
author_name: ${{ github.actor }}
2022
author_email: ${{ github.actor }}@users.noreply.github.com
21-
message: "Format code with Yapf & custom options"
23+
message: "Format code"
2224
add: "."
23-
branch: ${{ github.ref }}
25+
branch: ${{ github.ref }}

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# don't sync coursera docs
22
coursera-dl/
33
*parsed.json
4-
*wandb*
4+
wandb
55
*.ipynb
66
*.pem
77

.rules/no-bugs.md

-8
This file was deleted.

README.md

+16-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,22 @@ Automatic [API Reference](https://uiuc-chatbot.github.io/ai-ta-backend/reference
1313

1414
## 📣 Development
1515

16-
- Install Python requirements `pip install -r requirements.txt`
17-
- Start the server for development (with live reloads) `cd ai_ta_backend` then `flask --app ai_ta_backend.main:app --debug run --port 8000`
16+
1. Rename `.env.template` to `.env` and fill in the required variables
17+
2. Install Python requirements `pip install -r requirements.txt`
18+
3. Start the server for development (with live reloads) `cd ai_ta_backend` then `flask --app ai_ta_backend.main:app --debug run --port 8000`
1819

1920
The docs are auto-built and deployed to [our docs website](https://uiuc-chatbot.github.io/ai-ta-backend/) on every push. Or you can build the docs locally when writing:
2021
- `mkdocs serve`
22+
23+
24+
### Course metadata structure
25+
```
26+
'text': doc.page_content,
27+
'readable_filename': doc.metadata['readable_filename'],
28+
'course_name ': doc.metadata['course_name'],
29+
's3_path': doc.metadata['s3_path'],
30+
'pagenumber': doc.metadata['pagenumber_or_timestamp'], # this is the recent breaking change!!
31+
# OPTIONAL properties
32+
'url': doc.metadata.get('url'), # wouldn't this error out?
33+
'base_url': doc.metadata.get('base_url'),
34+
```

ai_ta_backend/arize_logging.py

-78
This file was deleted.

ai_ta_backend/aws.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,7 @@ def upload(myfile):
5151
pool.map(upload, filenames)
5252

5353
print("All data files uploaded to S3 successfully.")
54-
return s3_paths
54+
return s3_paths
55+
56+
if __name__ == '__main__':
57+
pass

0 commit comments

Comments
 (0)