dsdanielpark / Bard-API

The unofficial python package that returns response of Google Bard through cookie value.
https://pypi.org/project/bardapi/
MIT License
5.33k stars 527 forks source link

Windows x86_x64 unstable #90

Closed lilbaby4 closed 1 year ago

lilbaby4 commented 1 year ago

Python 3.6> Anaconda 5.3.0 Windows 32bit 7 Ultimate Windows 64bit 7 Ultimate

pip install bardapi==0.1.22 poetry install bardapi==0.1.22

Unable to create grpcio 56 wheel in 32 bit and 64 bit virtual environments.

grpcio 1.38 was successfully installed on Windows 7 x86_x64

All bardapi builds fail to install for last 7 days on Windows architecture.

Linux successfully and smoothly build and install.

The issue is grpcio.

pip install bardapi==0.1.22 -e .[with_grpcio==1.38] failed

-e .[without_grpcio] failed


Prefer a solution without VMWare, Virtual machine.

dsdanielpark commented 1 year ago

We are currently preparing a simple version 0.1.22a release of Bard, where you can receive only the response from the branch. If the deployment is completed, we will notify you. Thank you.

lilbaby4 commented 1 year ago

That would be great. The historical versions of the Unofficial bardapi were simple and out of the box.

It is very exciting to see these improvements. Less is more. Otherwise, I got to write bash scripts to hang.

dsdanielpark commented 1 year ago

Version 0.1.23a

Due to certain dependency packages that are not compatible with 64bit windows(OS), we are releasing a lightweight alpha release of bard that only returns responses for simple requests. This release is a continuation of the pypi 0.1.18 version, which was maintained with lightweight and simple functionality.

pip install bardapi==0.1.23a

You can check out the alpha release through the following GitHub branch.



Version 0.1.24

If you want to utilize various features, please use version 0.1.24. Version 0.1.24 is the same version as 0.1.22, 0.1.23, and 0.1.24, taken as a measure to prevent the alpha release from being the latest distribution on PyPI.

pip install bardapi==0.1.24
lilbaby4 commented 1 year ago

Thank you for the swift release.

It installed without any argument.

Used code:

from bardapi import Bard import os import requests

os.environ['_BARD_API_KEY'] = '_BARD_API_KEY' os.environ['__Secure-1PSID'] = '_BARD_API_KEY'

session = requests.Session() session.headers = { "Host": "bard.google.com", "X-Same-Domain": "1", "User-Agent": "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36", "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8", "Origin": "https://bard.google.com/", "Referer": "https://bard.google.com/", } session.cookies.set("__Secure-1PSID", os.getenv("_BARD_API_KEY"))

bard = Bard(session=session, timeout=20)

answer1 = bard.get_answer("how do you make peanut butter with cheese")['content']

print(answer1)


Response: Line 122 TypeError: 'NoneType' object is not subscriptable

dsdanielpark commented 1 year ago
스크린샷 2023-07-03 오후 4 05 05

I have confirmed that there are no issues with the functionality. Please try removing the existing package and check various external factors such as the network. Alternatively, you can inspect the dependency packages or investigate #1 or other issues. If the error persists, please provide detailed information about the environment and the error.

lilbaby4 commented 1 year ago

I still have not been able to identify the issue on Windows 7.

I did notice the params were updated to boq_assistant-bard-web-server_20230627.10_p1

And not in the core.py

lilbaby4 commented 1 year ago

I am uninstalling Anaconda 5.3.0 and going to try to set the _BARD_API_KEY again as a Windows environment variable.

lilbaby4 commented 1 year ago

I had environmental problems, like you said.

Uninstalling Anaconda and reinstalling Python and updating my API key was a SUCCESS.

Thanks for your support and leadership. Issue closed.