Skip to content

Commit 9c99bcb

Browse files
authored
Update README.md (#11)
1 parent 06b968e commit 9c99bcb

File tree

1 file changed

+42
-1
lines changed

1 file changed

+42
-1
lines changed

README.md

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,42 @@
1-
This is a repo for the generative language client library.
1+
Google Generative AI Python Client
2+
==================================
3+
4+
[![PyPI version](https://badge.fury.io/py/google-generativeai.svg)](https://badge.fury.io/py/google-generativeai)
5+
![PyPI - Downloads](https://img.shields.io/pypi/dd/google-generativeai)
6+
7+
Get started using the PaLM API in Python. Check out the [developer site](https://developers.generativeai.google/)
8+
for comprehensive documentation.
9+
10+
## Installation and usage
11+
12+
Install from PyPI.
13+
```bash
14+
pip install google-generativeai
15+
```
16+
17+
Get an [API key from MakerSuite](https://makersuite.google.com/app/apikey), then configure it here.
18+
```python
19+
import google.generativeai as palm
20+
21+
palm.configure(api_key=os.environ['PALM_API_KEY'])
22+
```
23+
24+
Use the `palm.chat` function to have a discussion with a model.
25+
```python
26+
response = palm.chat(messages=["Hello."])
27+
print(response.last) # 'Hello! What can I help you with?'
28+
response.reply("Can you tell me a joke?")
29+
```
30+
31+
## Documentation
32+
33+
Checkout the full [API docs](https://developers.generativeai.google/api), the [guide](https://developers.generativeai.google/guide) and [quick starts](https://developers.generativeai.google/tutorials).
34+
35+
## Colab magics
36+
37+
Once installed, use the Python client via the `%%palm` Colab magic. Read the full guide [here](https://developers.generativeai.google/tools/notebook_magic).
38+
39+
```python
40+
%%palm
41+
The best thing since sliced bread is
42+
```

0 commit comments

Comments
 (0)