Skip to content

Commit cb771d2

Browse files
committed
Formatting
1 parent 41cb436 commit cb771d2

File tree

2 files changed

+18
-12
lines changed

2 files changed

+18
-12
lines changed

core/views.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,10 @@ def chatbot(request):
133133
query = request.POST.get("q", "")
134134
if query == "":
135135
return redirect("chatbot")
136-
possibilities = ("PROGRAMMING LANGUAGES, and only PROGRAMMING LANGUAGES (not libraries)", "LIBRARIES/FRAMEWORKS")
136+
possibilities = (
137+
"PROGRAMMING LANGUAGES, and only PROGRAMMING LANGUAGES (not libraries)",
138+
"LIBRARIES/FRAMEWORKS",
139+
)
137140
x = possibilities[0 if request.POST.get("search_type") == "language" else 1]
138141
print(x)
139142
base = f"Only output in your following prompt a comma separated list of {x} for the following text, up to a max of 5 keywords: "
@@ -146,12 +149,18 @@ def chatbot(request):
146149
words = (json.loads(keywords.json())["message"]["content"]).split(", ")
147150

148151
print(words)
149-
data = find_near(words, 0.35, 1 if request.POST.get("search_type") == "language" else 2)
152+
data = find_near(
153+
words, 0.35, 1 if request.POST.get("search_type") == "language" else 2
154+
)
150155
return render(
151156
request,
152157
"result.html",
153-
context={"search": ", ".join(words), "distance": .35,
154-
"category": 1 if request.POST.get("search_type") == "language" else 2, "data": data},
158+
context={
159+
"search": ", ".join(words),
160+
"distance": 0.35,
161+
"category": 1 if request.POST.get("search_type") == "language" else 2,
162+
"data": data,
163+
},
155164
)
156165
return render(request, "chatbot.html")
157166

users/urls.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
from django.contrib.auth.views import (
2-
LoginView,
3-
LogoutView,
4-
PasswordChangeDoneView,
5-
PasswordChangeView,
6-
PasswordResetDoneView,
7-
PasswordResetView,
8-
)
1+
from django.contrib.auth.views import (LoginView, LogoutView,
2+
PasswordChangeDoneView,
3+
PasswordChangeView,
4+
PasswordResetDoneView,
5+
PasswordResetView)
96
from django.urls import path
107

118
import users.views as views

0 commit comments

Comments
 (0)