dsdanielpark / Bard-API

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

Notice: Changes to Bard's Internal API and Policies #80

Closed dsdanielpark closed 11 months ago

dsdanielpark commented 1 year ago

Notice: Changes to Bard's Internal API and Policies

It has been observed that the internal API and policies of Bard are currently undergoing changes.

If you are using a previous version, please update to version 0.1.18 or higher. We are also preparing updates by checking various features. Additionally, we are looking forward to receiving contributions from many individuals.

pip install bardapi>=0.1.18

Please collect any errors related to changes in the Google API interface here issue #80 and kindly provide corresponding solutions. Thank you in advance.

Contributors can adapt to these changes and continue reporting errors. However, if Response Errors persist due to API policy changes within Google, please consider using the following hf-transllm. It is expected that the release of Google's palm2 API is being planned and adjusted in the near future, but the details are not certain.

In addition, you can contribute by fixing any non-functioning features among the currently available ones due to API interface changes, and this applies to all projects I own.

I sincerely appreciate active community contributions!

Furthermore, I am fine-tuning and researching an open-source LLM model, aiming to release a high-quality LLM model soon, allowing users to utilize it like the Bard API. Please bear with me a little longer, and I kindly request your anticipation and interest.

Thank you!

Regards, Daniel






hf-transllm

If you want to test the open-llama model, which is released under the Apache License (allowing free commercial use) in various languages, you can try using the hf-transllm package. hf-transllm also supports multilingual inference for various LLMs stored in hugging face repository.


Example code of hf-transllm

In case the Google package is no longer available due to policy restrictions, here's a simple example code for using open-source language models (LLMs) in both English and multiple languages.
## Usage For the decoder models provided by Hugging Face, you can easily use them by either following a simple approach or overriding the inference method. You can explore various open-source language models at [this link](https://huggingface.co/models). Through the ranking information from [Open LLM Leader Board Report repository](https://github.com/dsdanielpark/Open-LLM-Leaderboard-Report), you can find information about good models. ### For LLM that use languages `other than English` ```python from transllm import LLMtranslator open_llama3b_kor = LLMtranslator('openlm-research/open_llama_3b', target_lang='ko', translator='google') # Korean trnaslated_answer = open_llama3b_kor.generate("나와 내 동년배들이 좋아하는 뉴진스에 대해서 알려줘") print(trnaslated_answer) ``` ### For LLM that use `English` Refer https://github.com/openlm-research/open_llama or using like this: ```python from transllm import LLMtranslator open_llama3b = LLMtranslator('openlm-research/open_llama_3b) answer = open_llama3b.generate("Tell me about the Korean girl group Newjeans.") print(answer) ```



Google Palm API

It is also recommended to use Google's official API services. Currently, BARD is not officially provided, but it is expected to be available along with PALM2. However, you can explore various generative natural language processing models from Google other than BARD. Please refer to the following official documents.

Syed007Hassan commented 1 year ago

I have updated the package

image

But still getting the error of

image

phamxtien commented 1 year ago

I update and it runs mooth

Syed007Hassan commented 1 year ago

It is working but it can break at any time, better to use Palm API. https://developers.generativeai.google/guide/palm_api_overview?authuser=1