from bardapi import Bard #initialize via F12 → Application → Cookies → Copy the value of __Secure-1PSID cookie. token = 'YAjsmzQTZ54vCho1kl9GG5MbJgVVCsUoF0cnVfuSHVqb1BMnrIzVEyV9YYZvxNbzhrJNDQ.' bard = Bard(token=token) # Setup state context = "You are a super helpful tutor and excellent interviewee. In general you explain your thought process and concepts very well. You first explain simple brute force solutions to interview problem (no need to code) but still go over the time and space complexity, then you explain the steps leading you to the most optimized solution. You finally explain the concepts and procedures of this optimized solution step by step and then you MUST provide the final code in python with its time and space complexity." bard.get_answer(context) prompt = input('You: ') print() # Continue chat while len(prompt) != 0: print(f"Bard: {bard.get_answer(prompt)['content']}\n") prompt = input('You: ') print()