Bard-API
Bard-API copied to clipboard
Google Official API
This Bard API Package is unofficial Python package.
As you may know, this repository was provided for testing certain functionalities due to the delayed release of Google Bard's official API (which has not been released yet). In the early stages, the cookie values were static, allowing for stable usage. However, it has become unstable recently due to frequent changes in cookie values within 15-20 minutes or even faster.
Furthermore, since Bard Advanced API is expected to be publicly available in 2024, this repository will become a public archive upon the official API's release. The Bard website is currently presenting responses randomly from a range of diverse AI models, such as PaLM2 and Gemini. You can test the functionalities through the web UI on the Bard website.
I hope that this package has been of some help to other developers and that it has contributed to open-source projects, even if only slightly. I sincerely thank all the contributors and community participants. I wish you all the best and hope that the new year brings only good things.
To ensure stable usage, we strongly recommend replacing your code with Google's official API, which we introduce as follows.
Google API Console
- Web: https://console.cloud.google.com/apis/library?pli=1
Google PaLM API
You can explore information about various generative AI models by Google. Although the palm2 API seems to be under preparation, you can check out demos related to palm2 on the demo page.
PaLM API
Try demo at https://makersuite.google.com/app/prompts/new_text.
who are you?
>> I am powered by PaLM 2, which stands for Pathways Language Model 2, a large language model from Google AI.
Google Generative AI
- Official Page: https://blog.google/technology/ai/google-palm-2-ai-large-language-model/
- GitHub: https://github.com/GoogleCloudPlatform/generative-ai
- Try Demo: https://makersuite.google.com/app/prompts/new_text.
- Official Library: https://makersuite.google.com/app/library
- Get API Key: https://makersuite.google.com/app/apikey
- Quick Start Tutorial: https://developers.generativeai.google/tutorials/text_quickstart
Quick Start
$ pip install -q google-generativeai
import pprint
import google.generativeai as palm
palm.configure(api_key='YOUR_API_KEY')
models = [m for m in palm.list_models() if 'generateText' in m.supported_generation_methods]
model = models[0].name
print(model)
prompt = "Who are you?"
completion = palm.generate_text(
model=model,
prompt=prompt,
temperature=0,
# The maximum length of the response
max_output_tokens=800,
)
print(completion.result)
Google PaLM 2
- Paper: https://arxiv.org/abs/2305.10403
- Web: https://blog.google/technology/ai/google-palm-2-ai-large-language-model/
- Official API On PaLM API.
Google Gemini
- Paper: https://storage.googleapis.com/deepmind-media/gemini/gemini_1_report.pdf
- Web: https://blog.google/technology/ai/google-gemini-ai/#capabilities
- Code Guide: https://ai.google.dev/tutorials/python_quickstart
- Official API On Google AI Studio.
Google AI Studio
Google AI Studio creates a new Google Cloud project for each new API key. You also can create an API key in an existing Google Cloud project. All projects are subject to the Google Cloud Platform Terms of Service.
- Web: https://makersuite.google.com/app/apikey
Note: The Gemini API is currently in public preview. Production applications are not supported yet.
Google Bard
- Web: https://bard.google.com/chat
- Update News: https://bard.google.com/updates
- The official API is not available yet.
Google Generative AI Github
- Github: https://github.com/GoogleCloudPlatform/generative-ai