Bardapi

Pre-requirements

  1. Google Bard Cookies

  2. pip install bardapi

Get cookies

  1. F12 (DevTools)

  2. Application

  3. Storage -> Cookies -> https://bard.google.com -> Search "1PSID" -> Cookie Value

    1. __Secure-1PSID

    2. __Secure-1PSIDTS

    3. __Secure-1PSIDCC

Install packages

Code

Connect to Bard with cookies

New Session

Reusable Session

Ask with Promt

Convert answer to dictionary

Convert dictionary to dataframe

Ask about image

Text to Speech

Troubleshooting

Solution: Refresh browser, get cookie again and then rerun code

References

Last updated