focusit commited on
Commit
8d5cf87
·
1 Parent(s): dd12eb0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -4,7 +4,7 @@ import os
4
  import json
5
  from bardapi import Bard
6
 
7
- token = os.environ.get('_BARD_API_KEY')
8
 
9
 
10
 
@@ -23,10 +23,10 @@ def bardChat(data):
23
  }
24
 
25
  # Set the "__Secure-1PSID" cookie with the Bard API key
26
- session.cookies.set("__Secure-1PSID", token)
27
 
28
  # Create a Bard object with the session and a timeout of 30 seconds
29
- bard = Bard(token=token, session=session, timeout=30)
30
  answer = bard.get_answer(data)['content']
31
  print(answer)
32
 
 
4
  import json
5
  from bardapi import Bard
6
 
7
+ bardKey = os.environ.get('_BARD_API_KEY')
8
 
9
 
10
 
 
23
  }
24
 
25
  # Set the "__Secure-1PSID" cookie with the Bard API key
26
+ session.cookies.set("__Secure-1PSID", barkKey)
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