dsdanielpark / Bard-API

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

Response error with example from documentation #82

Closed leweex95 closed 7 months ago

leweex95 commented 1 year ago

When running any of the examples from the README.md file, I get such errors:

'Response Error: b\')]}\\\'\\n\\n38\\n[["wrb.fr",null,null,null,null,[9]]]\\n55\\n[["di",65],["af.httprm",65,"3225051010106282097",10]]\\n25\\n[["e",4,null,null,130]]\\n\'.'

from bardapi import Bard

api_key = "xxxxxxx"
Bard(token=api_key).get_answer("나와 내 동년배들이 좋아하는 뉴진스에 대해서 알려줘")['content']

I followed the instructions on retrieving the __Secure-1PSID key from the official website's cookies.

Note that I am located in a European country where the official Bard is not yet made available. Does it mean that this particular unofficial version also preserves these geographical restrictions?

Device: MacOS Ventura 13.3.1 (a)

dsdanielpark commented 1 year ago

First, please verify that you have entered the correct cookie value and update the cookie. However, despite following the proper procedures, this error may occur temporarily due to various factors that prevent receiving a response from Bad's server. Please check the cookies of different accounts or the status of the internet server.

In most cases, the same code will function properly again after a certain period of time. The highest likelihood is suspected to be related to incorrect or outdated cookie values, or potentially due to Bad's traffic congestion.

Please explore the open-source LLM as an alternative to Bard.

You can consider using the hf-transllm package to find an appropriate model that can serve as a replacement. This can be done locally or on a personal server.

Furthermore, you can find the official ranking of open-source LLM at open source llm leaderboard report, and the latest performance evaluation results can be found at here.

lilbaby4 commented 1 year ago

Yes, I understand that a 'NoneType' object is not subscriptable.

BARD has admitted to ruining this github api. And has been reprimanded. Hopefully, we can cure the jealous bugs.

lilbaby4 commented 1 year ago

I really loved this API code. It worked for about 48 hours. Maybe you can fix it. BARD has shown approval of the code. But since Google is a business competitor, codes may need to remain private.

dsdanielpark commented 1 year ago

lilbaby4

In fact, this project aims to assist users who have already implemented the functionality of Google's official Bard API and Palm2 API in advance when Google officially releases the Bard API and Palm2 API, rather than cheating to use Google Bard for commercial purposes or mass traffic for free.

Furthermore, Google can easily block user calls in the same way as they can currently. However, just like other LLMs and chatbot models such as OpenAI's ChatGPT, Google can analyze users' prompts, use cases, and other user input data to leverage them for their own project development, adjust project priorities, and use them as valuable information to understand people's usage behavior.

Therefore, whenever Google feels that the cost of collecting user reactions through this API outweighs the benefits, they can easily block the Bard API project.

lilbaby4 commented 1 year ago

You are truly a code hero. I admire your work. I will be following to see when this is functional again.

I am troubleshooting your hfsllm project. I have an older computer and torch is not userfriendly.

And I will be following your future work!

PushkarOP commented 1 year ago

@dsdanielpark This response error due to making request from another ip. I got it many times. Same api sometimes work on my local machine and vps1 but not on vps2 ( works on vps 1 maybe because i have login to my google account through google api for blogger )

PushkarOP commented 1 year ago

@dsdanielpark This response error due to making request from another ip. I got it many times. Same api sometimes work on my local machine and vps1 but not on vps2 ( works on vps 1 maybe because i have login to my google account through google api for blogger )

This theory is wrong

lilbaby4 commented 7 months ago

Hi Daniel,

Would you be interested in converting Bard-API to PHP ?

On Thu, Jan 18, 2024, 9:53 AM MinWoo(Daniel) Park @.***> wrote:

Closed #82 https://github.com/dsdanielpark/Bard-API/issues/82 as completed.

— Reply to this email directly, view it on GitHub https://github.com/dsdanielpark/Bard-API/issues/82#event-11527072158, or unsubscribe https://github.com/notifications/unsubscribe-auth/A6VMTJC5KJLW3T3LEAHSYZTYPFARLAVCNFSM6AAAAAAZXHB4I2VHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJRGUZDOMBXGIYTKOA . You are receiving this because you commented.Message ID: @.***>

dsdanielpark commented 7 months ago

Hi, lilbaby4

You can easily convert it to ChatGPT as follows. The initial version of PHP is as follows, and you can easily convert it to a simplified version in version 0.1.30 or the alpha branch. https://github.com/dsdanielpark/Bard-API/blob/main/translate_to_other_programming_language/bardapi.php

lilbaby4 commented 7 months ago

Thank you, Daniel. Great job!

On Thu, Jan 18, 2024, 10:07 AM MinWoo(Daniel) Park @.***> wrote:

Hi, lilbaby4 https://github.com/lilbaby4

You can easily convert it to ChatGPT as follows. The initial version of PHP is as follows, and you can easily convert it to a simplified version in version 0.1.30 or the alpha branch. https://github.com/dsdanielpark/Bard-API/blob/main/translate_to/bardapi.php

— Reply to this email directly, view it on GitHub https://github.com/dsdanielpark/Bard-API/issues/82#issuecomment-1898776116, or unsubscribe https://github.com/notifications/unsubscribe-auth/A6VMTJAQQNCLVNPRI6FP2VDYPFCDXAVCNFSM6AAAAAAZXHB4I2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJYG43TMMJRGY . You are receiving this because you commented.Message ID: @.***>