CosmoAI commited on
Commit
c4d3111
·
1 Parent(s): c1f3d50

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -12
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
- # newdata = json.dumps(data)
54
- print(type(data))
55
- # print(data['text'])
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: