Google Generative AI High level API client library and tools.
Project description
Google Generative AI Python Client
Get started using the PaLM API in Python. Check out the developer site for comprehensive documentation.
Installation and usage
Install from PyPI.
pip install google-generativeai
Get an API key from MakerSuite, then configure it here.
import google.generativeai as palm
palm.configure(api_key=os.environ["PALM_API_KEY"])
Use palm.generate_text
to have the model complete some initial text.
response = palm.generate_text(prompt="The opposite of hot is")
print(response.result) # cold.
Use palm.chat
to have a discussion with a model.
response = palm.chat(messages=["Hello."])
print(response.last) # 'Hello! What can I help you with?'
response.reply("Can you tell me a joke?")
Documentation
Checkout the full API docs, the guide and quick starts.
Colab magics
Once installed, use the Python client via the %%palm Colab magic. Read the full guide here.
%%palm
The best thing since sliced bread is
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file google_generativeai-0.2.1-py3-none-any.whl.
File metadata
- Download URL: google_generativeai-0.2.1-py3-none-any.whl
- Upload date:
- Size: 130.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
892c80f33fda68f531e97de67c7796f9c10f68708599506bba2388c53d1d332e
|
|
| MD5 |
1e9dcd818752fd5392c84516f9b844d3
|
|
| BLAKE2b-256 |
f40ad14c0482986fb488e4833399a29e972d63635d1f27b198e32fb28101f585
|