Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -48,19 +48,10 @@ palm.configure(api_key=os.environ["PALM_KEY"])
|
|
| 48 |
|
| 49 |
def responsenew(data):
|
| 50 |
idval = str(uuid.uuid4())
|
| 51 |
-
# print(f"{data[0]['text']}")
|
| 52 |
print(f"\n\n{data}")
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
# text = json.loads(data)
|
| 57 |
-
# decoder = json.JSONDecoder()
|
| 58 |
-
# data_list = text["data"]
|
| 59 |
-
# item = data_list[0]
|
| 60 |
-
# item_one = item["text"]
|
| 61 |
-
# text = decoder.decode(data)
|
| 62 |
-
# print("finally: ",item_one)
|
| 63 |
-
# uid = text['uid']
|
| 64 |
response = palm.chat( messages=data)
|
| 65 |
print(f"\n{response.last}")
|
| 66 |
if data is not None:
|
|
|
|
| 48 |
|
| 49 |
def responsenew(data):
|
| 50 |
idval = str(uuid.uuid4())
|
|
|
|
| 51 |
print(f"\n\n{data}")
|
| 52 |
+
items = json.loads(data)
|
| 53 |
+
text = items['text']
|
| 54 |
+
print(text)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
response = palm.chat( messages=data)
|
| 56 |
print(f"\n{response.last}")
|
| 57 |
if data is not None:
|