Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -28,7 +28,7 @@ def create_workspace():
|
|
| 28 |
"""Create a new workspace and return its ID"""
|
| 29 |
ws_url = "https://api.botpress.cloud/v1/admin/workspaces"
|
| 30 |
headers = {
|
| 31 |
-
"
|
| 32 |
"Authorization": TOKEN
|
| 33 |
}
|
| 34 |
payload = {"name": generate_random_name()}
|
|
@@ -56,7 +56,6 @@ def create_bot(workspace_id):
|
|
| 56 |
|
| 57 |
bot_url = "https://api.botpress.cloud/v1/admin/bots"
|
| 58 |
headers = {
|
| 59 |
-
"User-Agent": "Mozilla/5.0",
|
| 60 |
"x-workspace-id": workspace_id,
|
| 61 |
"Authorization": TOKEN,
|
| 62 |
"Content-Type": "application/json"
|
|
@@ -98,7 +97,6 @@ def install_bot_integration(bot_id, workspace_id):
|
|
| 98 |
|
| 99 |
url = f"https://api.botpress.cloud/v1/admin/bots/{bot_id}"
|
| 100 |
headers = {
|
| 101 |
-
"User-Agent": "Mozilla/5.0",
|
| 102 |
"Authorization": TOKEN,
|
| 103 |
"Content-Type": "application/json",
|
| 104 |
"x-bot-id": bot_id,
|
|
@@ -134,7 +132,6 @@ def try_delete_bot(bot_id, workspace_id):
|
|
| 134 |
|
| 135 |
url = f"https://api.botpress.cloud/v1/admin/bots/{bot_id}"
|
| 136 |
headers = {
|
| 137 |
-
"User-Agent": "Mozilla/5.0",
|
| 138 |
"x-workspace-id": workspace_id,
|
| 139 |
"Authorization": TOKEN
|
| 140 |
}
|
|
@@ -160,7 +157,6 @@ def try_delete_workspace(workspace_id):
|
|
| 160 |
|
| 161 |
url = f"https://api.botpress.cloud/v1/admin/workspaces/{workspace_id}"
|
| 162 |
headers = {
|
| 163 |
-
"User-Agent": "Mozilla/5.0",
|
| 164 |
"Authorization": TOKEN
|
| 165 |
}
|
| 166 |
|
|
@@ -187,7 +183,6 @@ def chat_with_assistant(user_input, chat_history, bot_id, workspace_id, temperat
|
|
| 187 |
"""
|
| 188 |
# Prepare the headers
|
| 189 |
headers = {
|
| 190 |
-
"User-Agent": "Mozilla/5.0",
|
| 191 |
"x-bot-id": bot_id,
|
| 192 |
"Content-Type": "application/json",
|
| 193 |
"Authorization": TOKEN
|
|
|
|
| 28 |
"""Create a new workspace and return its ID"""
|
| 29 |
ws_url = "https://api.botpress.cloud/v1/admin/workspaces"
|
| 30 |
headers = {
|
| 31 |
+
"Content-Type": "application/json",
|
| 32 |
"Authorization": TOKEN
|
| 33 |
}
|
| 34 |
payload = {"name": generate_random_name()}
|
|
|
|
| 56 |
|
| 57 |
bot_url = "https://api.botpress.cloud/v1/admin/bots"
|
| 58 |
headers = {
|
|
|
|
| 59 |
"x-workspace-id": workspace_id,
|
| 60 |
"Authorization": TOKEN,
|
| 61 |
"Content-Type": "application/json"
|
|
|
|
| 97 |
|
| 98 |
url = f"https://api.botpress.cloud/v1/admin/bots/{bot_id}"
|
| 99 |
headers = {
|
|
|
|
| 100 |
"Authorization": TOKEN,
|
| 101 |
"Content-Type": "application/json",
|
| 102 |
"x-bot-id": bot_id,
|
|
|
|
| 132 |
|
| 133 |
url = f"https://api.botpress.cloud/v1/admin/bots/{bot_id}"
|
| 134 |
headers = {
|
|
|
|
| 135 |
"x-workspace-id": workspace_id,
|
| 136 |
"Authorization": TOKEN
|
| 137 |
}
|
|
|
|
| 157 |
|
| 158 |
url = f"https://api.botpress.cloud/v1/admin/workspaces/{workspace_id}"
|
| 159 |
headers = {
|
|
|
|
| 160 |
"Authorization": TOKEN
|
| 161 |
}
|
| 162 |
|
|
|
|
| 183 |
"""
|
| 184 |
# Prepare the headers
|
| 185 |
headers = {
|
|
|
|
| 186 |
"x-bot-id": bot_id,
|
| 187 |
"Content-Type": "application/json",
|
| 188 |
"Authorization": TOKEN
|