CosmoAI commited on
Commit
03a774e
·
1 Parent(s): 9a8b22b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -51,10 +51,13 @@ def responsenew(data):
51
  # print(f"{data[0]['text']}")
52
  print(f"\n\n{data}")
53
  # print(data['text'])
54
- # text = json.loads(data)
55
- decoder = json.JSONDecoder()
56
- text = decoder.decode(data)
57
- print(text[0]['text'])
 
 
 
58
  # uid = text['uid']
59
  response = palm.chat( messages=data)
60
  print(f"\n{response.last}")
 
51
  # print(f"{data[0]['text']}")
52
  print(f"\n\n{data}")
53
  # print(data['text'])
54
+ text = json.loads(data)
55
+ # decoder = json.JSONDecoder()
56
+ data_list = text["data"]
57
+ item = data_list[0]
58
+ item_one = item["text"]
59
+ # text = decoder.decode(data)
60
+ print("finally: ",item_one)
61
  # uid = text['uid']
62
  response = palm.chat( messages=data)
63
  print(f"\n{response.last}")