Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -18,6 +18,7 @@ Options:
|
|
18 |
"""
|
19 |
|
20 |
API_URL = os.getenv("API_URL")
|
|
|
21 |
|
22 |
examples = [
|
23 |
[
|
@@ -77,7 +78,7 @@ examples = [
|
|
77 |
|
78 |
def query(payload):
|
79 |
print(payload)
|
80 |
-
response = requests.request("POST", API_URL, json=payload)
|
81 |
print(response)
|
82 |
return json.loads(response.content.decode("utf-8"))
|
83 |
|
|
|
18 |
"""
|
19 |
|
20 |
API_URL = os.getenv("API_URL")
|
21 |
+
TOKEN = os.getenv("TOKEN")
|
22 |
|
23 |
examples = [
|
24 |
[
|
|
|
78 |
|
79 |
def query(payload):
|
80 |
print(payload)
|
81 |
+
response = requests.request("POST", API_URL, json=payload, headers={"Authorization": f"Bearer {TOKEN}"})
|
82 |
print(response)
|
83 |
return json.loads(response.content.decode("utf-8"))
|
84 |
|