uuid
Browse files
app.py
CHANGED
@@ -1,8 +1,11 @@
|
|
1 |
import gradio as gr
|
2 |
import json
|
|
|
3 |
|
4 |
# Define a function that takes a JSON object as input
|
5 |
def process_json(input_json):
|
|
|
|
|
6 |
# Parse the JSON object
|
7 |
data = json.loads(input_json)
|
8 |
|
@@ -12,7 +15,7 @@ def process_json(input_json):
|
|
12 |
user_token = data.get("user_token", "Unknown")
|
13 |
|
14 |
# Create a response JSON object
|
15 |
-
response_json = {"message": f"Hello, {user_id}!{user_token}"}
|
16 |
|
17 |
# Convert the response JSON object to a string
|
18 |
response_str = json.dumps(response_json)
|
|
|
1 |
import gradio as gr
|
2 |
import json
|
3 |
+
import uuid
|
4 |
|
5 |
# Define a function that takes a JSON object as input
|
6 |
def process_json(input_json):
|
7 |
+
id = uuid.uuid1()
|
8 |
+
|
9 |
# Parse the JSON object
|
10 |
data = json.loads(input_json)
|
11 |
|
|
|
15 |
user_token = data.get("user_token", "Unknown")
|
16 |
|
17 |
# Create a response JSON object
|
18 |
+
response_json = {"message": f"Hello, {user_id}!{user_token} random uuid {id.int}"}
|
19 |
|
20 |
# Convert the response JSON object to a string
|
21 |
response_str = json.dumps(response_json)
|