focusit commited on
Commit
91bc706
·
1 Parent(s): f3bd4a1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -7,6 +7,7 @@ from bardapi import Bard
7
  bardKey = os.environ.get('_BARD_API_KEY')
8
 
9
 
 
10
  def bardChat(data):
11
  # Create a session object using the requests library
12
  session = requests.Session()
@@ -25,19 +26,19 @@ def bardChat(data):
25
  session.cookies.set("__Secure-1PSID", bardKey)
26
 
27
  # Create a Bard object with the session and a timeout of 30 seconds
28
- bard = Bard(session=session, timeout=30)
29
  answer = bard.get_answer(data)['content']
30
  print(answer)
31
 
32
  return json.dumps({'message':answer,'action':'null'})
33
 
34
 
35
- # def responsenew(data):
36
- # return bardChat(data)
37
 
38
 
39
  gradio_interface = gradio.Interface(
40
- fn = bardChat,
41
  inputs = "text",
42
  outputs = "text"
43
  )
 
7
  bardKey = os.environ.get('_BARD_API_KEY')
8
 
9
 
10
+
11
  def bardChat(data):
12
  # Create a session object using the requests library
13
  session = requests.Session()
 
26
  session.cookies.set("__Secure-1PSID", bardKey)
27
 
28
  # Create a Bard object with the session and a timeout of 30 seconds
29
+ bard = Bard(token = bardKey, session=session, timeout=30)
30
  answer = bard.get_answer(data)['content']
31
  print(answer)
32
 
33
  return json.dumps({'message':answer,'action':'null'})
34
 
35
 
36
+ def responsenew(data):
37
+ return bardChat(data)
38
 
39
 
40
  gradio_interface = gradio.Interface(
41
+ fn = responsenew,
42
  inputs = "text",
43
  outputs = "text"
44
  )