Last Updated on May 18, 2023 by mishou

I. Finding the value of the __Secure-1PSID Cookies of your Google Bard Account

You can learn how to find your API Key from the tutorial linked below:

Access Google Bard Easily with Python Package Bard-API

II. How to access Bard AI in Python

!pip install bardap
from bardapi import Bard
import os
# set your input text
input_text = "Show sample code to create DataFrame with column names, 'Names'and 'Math'and 'English using Polars."
response0 = Bard().get_answer(input_text)['content']

If you want to ask something about “response0” above, you can use f-stings. Run such code as below:

# set your input text
input_text = f'"Show the code to change the column tiles of df in {response0}"'

response1 = Bard().get_answer(input_text)['content']

By mishou

Leave a Reply

Your email address will not be published. Required fields are marked *