Spaces:
Runtime error
Runtime error
Francisco Aranda
commited on
Commit
·
f420a36
1
Parent(s):
fa2c899
chore: normalize json result
Browse files
app.py
CHANGED
|
@@ -23,7 +23,7 @@ for webhook in client.webhooks:
|
|
| 23 |
async def record_events(record: rg.Record, type: str, timestamp: datetime):
|
| 24 |
print(f"Received event type {type} at {timestamp}: ", record)
|
| 25 |
|
| 26 |
-
incoming_events.put(record)
|
| 27 |
|
| 28 |
|
| 29 |
# Create a webhook for dataset events
|
|
@@ -31,7 +31,7 @@ async def record_events(record: rg.Record, type: str, timestamp: datetime):
|
|
| 31 |
async def dataset_events(dataset: rg.Dataset, type: str, timestamp: datetime):
|
| 32 |
print(f"Received event type {type} at {timestamp}: ", dataset)
|
| 33 |
|
| 34 |
-
incoming_events.put(
|
| 35 |
|
| 36 |
|
| 37 |
# Create a webhook for response events
|
|
@@ -39,7 +39,7 @@ async def dataset_events(dataset: rg.Dataset, type: str, timestamp: datetime):
|
|
| 39 |
async def response_events(response: rg.UserResponse, type: str, timestamp: datetime):
|
| 40 |
print(f"Received event type {type} at {timestamp}: ", response)
|
| 41 |
|
| 42 |
-
incoming_events.put(response)
|
| 43 |
|
| 44 |
|
| 45 |
def read_next_event():
|
|
|
|
| 23 |
async def record_events(record: rg.Record, type: str, timestamp: datetime):
|
| 24 |
print(f"Received event type {type} at {timestamp}: ", record)
|
| 25 |
|
| 26 |
+
incoming_events.put({"event": type, "data": record})
|
| 27 |
|
| 28 |
|
| 29 |
# Create a webhook for dataset events
|
|
|
|
| 31 |
async def dataset_events(dataset: rg.Dataset, type: str, timestamp: datetime):
|
| 32 |
print(f"Received event type {type} at {timestamp}: ", dataset)
|
| 33 |
|
| 34 |
+
incoming_events.put({"event": type, "data": dataset})
|
| 35 |
|
| 36 |
|
| 37 |
# Create a webhook for response events
|
|
|
|
| 39 |
async def response_events(response: rg.UserResponse, type: str, timestamp: datetime):
|
| 40 |
print(f"Received event type {type} at {timestamp}: ", response)
|
| 41 |
|
| 42 |
+
incoming_events.put({"event": type, "data": response})
|
| 43 |
|
| 44 |
|
| 45 |
def read_next_event():
|