@@ -133,7 +133,10 @@ def chatbot(request):
133
133
query = request .POST .get ("q" , "" )
134
134
if query == "" :
135
135
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
+ )
137
140
x = possibilities [0 if request .POST .get ("search_type" ) == "language" else 1 ]
138
141
print (x )
139
142
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):
146
149
words = (json .loads (keywords .json ())["message" ]["content" ]).split (", " )
147
150
148
151
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
+ )
150
155
return render (
151
156
request ,
152
157
"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
+ },
155
164
)
156
165
return render (request , "chatbot.html" )
157
166
0 commit comments