forked from phoenix/litellm-mirror
palm docs
This commit is contained in:
parent
6dfe3febf4
commit
5a86b574ec
2 changed files with 42 additions and 1 deletions
41
docs/my-website/docs/providers/palm.md
Normal file
41
docs/my-website/docs/providers/palm.md
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
# PaLM API - Google
|
||||||
|
https://developers.generativeai.google/products/palm
|
||||||
|
|
||||||
|
## Pre-requisites
|
||||||
|
* `pip install google-cloud-aiplatform`
|
||||||
|
* Authentication:
|
||||||
|
* run `gcloud auth application-default login` See [Google Cloud Docs](https://cloud.google.com/docs/authentication/external/set-up-adc)
|
||||||
|
* Alternatively you can set `application_default_credentials.json`
|
||||||
|
|
||||||
|
## Sample Usage
|
||||||
|
```python
|
||||||
|
import litellm
|
||||||
|
import os
|
||||||
|
|
||||||
|
os.environ['PALM_API_KEY'] = ""
|
||||||
|
response = completion(
|
||||||
|
model="palm/chat-bison",
|
||||||
|
messages=[{"role": "user", "content": "write code for saying hi from LiteLLM"}]
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
## Sample Usage - Streaming
|
||||||
|
```python
|
||||||
|
import litellm
|
||||||
|
import os
|
||||||
|
|
||||||
|
os.environ['PALM_API_KEY'] = ""
|
||||||
|
response = completion(
|
||||||
|
model="palm/chat-bison",
|
||||||
|
messages=[{"role": "user", "content": "write code for saying hi from LiteLLM"}],
|
||||||
|
stream=True
|
||||||
|
)
|
||||||
|
|
||||||
|
for chunk in response:
|
||||||
|
print(chunk)
|
||||||
|
```
|
||||||
|
|
||||||
|
## Chat Models
|
||||||
|
| Model Name | Function Call |
|
||||||
|
|------------------|--------------------------------------|
|
||||||
|
| chat-bison | `completion('palm/chat-bison', messages)` |
|
|
@ -1,4 +1,4 @@
|
||||||
# VertexAI / Google Palm
|
# VertexAI - Google
|
||||||
|
|
||||||
<a target="_blank" href="https://colab.research.google.com/github/BerriAI/litellm/blob/main/cookbook/liteLLM_VertextAI_Example.ipynb">
|
<a target="_blank" href="https://colab.research.google.com/github/BerriAI/litellm/blob/main/cookbook/liteLLM_VertextAI_Example.ipynb">
|
||||||
<img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/>
|
<img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue