Skip to content

Commit

Permalink
Fix more linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
KastanDay committed Dec 8, 2023
1 parent 93a8c24 commit 9c264f2
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 7 deletions.
7 changes: 7 additions & 0 deletions .trunk/trunk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ lint:
- [email protected]
- [email protected]
- [email protected]
ignore:
- linters: [ALL]
paths:
- .github/**/*
- .trunk/**/*
- mkdocs.yml
- .DS_Store
actions:
enabled:
- trunk-announce
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## AI TA Backend for UIUC's Course Assistant Chatbot
# AI TA Backend for UIUC's Course Assistant Chatbot

A Flask application hosting endpoints for AI TA backend.

Expand Down Expand Up @@ -26,7 +26,7 @@ The docs are auto-built and deployed to [our docs website](https://uiuc-chatbot.

### Course metadata structure

```
```text
'text': doc.page_content,
'readable_filename': doc.metadata['readable_filename'],
'course_name ': doc.metadata['course_name'],
Expand Down
2 changes: 1 addition & 1 deletion ai_ta_backend/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -497,4 +497,4 @@ def export_convo_history():


if __name__ == '__main__':
app.run(debug=True, port=int(os.getenv("PORT", default=8000)))
app.run(debug=True, port=int(os.getenv("PORT", default=8000))) # nosec -- reasonable bandit error suppression
2 changes: 1 addition & 1 deletion ai_ta_backend/vector_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -1027,7 +1027,7 @@ def get_context_stuffed_prompt(self, user_question: str, course_name: str, top_n
)

requests = []
for i, doc in enumerate(found_docs):
for doc in found_docs:
print("doc", doc)
dictionary = {
"model": "gpt-3.5-turbo",
Expand Down
8 changes: 5 additions & 3 deletions ai_ta_backend/web_scrape.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import shutil
import time
from tempfile import NamedTemporaryFile
from typing import List, Optional
from zipfile import ZipFile

import boto3 # type: ignore
Expand Down Expand Up @@ -131,7 +132,8 @@ def base_requirements(self, url: str, base: str):

return False

def find_urls(self, soup: BeautifulSoup, site: str, urls: list = []):
def find_urls(self, soup: BeautifulSoup, site: str, urls: Optional[List] = None):
urls = urls if urls is not None else []
try:
for i in soup.find_all("a"): # type: ignore
try:
Expand Down Expand Up @@ -597,9 +599,9 @@ def is_github_repo(url):


def mit_course_download(url: str, course_name: str, local_dir: str):
'''
"""
Download an MIT course using its url
'''
"""
ingester = Ingest()
if url.endswith("download"):
pass
Expand Down

0 comments on commit 9c264f2

Please sign in to comment.