VishnuRamDebyez
commited on
Commit
•
7b5318b
1
Parent(s):
27054af
Update api_utils.py
Browse files- api_utils.py +3 -3
api_utils.py
CHANGED
@@ -14,7 +14,7 @@ def get_api_response(question, session_id, model):
|
|
14 |
data["session_id"] = session_id
|
15 |
|
16 |
try:
|
17 |
-
response = requests.post("
|
18 |
if response.status_code == 200:
|
19 |
return response.json()
|
20 |
else:
|
@@ -28,7 +28,7 @@ def upload_document(file):
|
|
28 |
print("Uploading file...")
|
29 |
try:
|
30 |
files = {"file": (file.name, file, file.type)}
|
31 |
-
response = requests.post("
|
32 |
if response.status_code == 200:
|
33 |
return response.json()
|
34 |
else:
|
@@ -58,7 +58,7 @@ def delete_document(file_id):
|
|
58 |
data = {"file_id": file_id}
|
59 |
|
60 |
try:
|
61 |
-
response = requests.post("
|
62 |
if response.status_code == 200:
|
63 |
return response.json()
|
64 |
else:
|
|
|
14 |
data["session_id"] = session_id
|
15 |
|
16 |
try:
|
17 |
+
response = requests.post("https://vishnuramdebyez-fastapi.hf.space/chat", headers=headers, json=data)
|
18 |
if response.status_code == 200:
|
19 |
return response.json()
|
20 |
else:
|
|
|
28 |
print("Uploading file...")
|
29 |
try:
|
30 |
files = {"file": (file.name, file, file.type)}
|
31 |
+
response = requests.post("https://vishnuramdebyez-fastapi.hf.space/upload-doc", files=files)
|
32 |
if response.status_code == 200:
|
33 |
return response.json()
|
34 |
else:
|
|
|
58 |
data = {"file_id": file_id}
|
59 |
|
60 |
try:
|
61 |
+
response = requests.post("https://vishnuramdebyez-fastapi.hf.space/delete-doc", headers=headers, json=data)
|
62 |
if response.status_code == 200:
|
63 |
return response.json()
|
64 |
else:
|