From 5a86b574ecbb258a8db15ac4e0975fea103d38a9 Mon Sep 17 00:00:00 2001 From: ishaan-jaff Date: Tue, 26 Sep 2023 12:42:08 -0700 Subject: [PATCH] palm docs --- docs/my-website/docs/providers/palm.md | 41 ++++++++++++++++++++++++ docs/my-website/docs/providers/vertex.md | 2 +- 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 docs/my-website/docs/providers/palm.md diff --git a/docs/my-website/docs/providers/palm.md b/docs/my-website/docs/providers/palm.md new file mode 100644 index 000000000..2287d40d3 --- /dev/null +++ b/docs/my-website/docs/providers/palm.md @@ -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)` | \ No newline at end of file diff --git a/docs/my-website/docs/providers/vertex.md b/docs/my-website/docs/providers/vertex.md index b8726b70f..1dedd1450 100644 --- a/docs/my-website/docs/providers/vertex.md +++ b/docs/my-website/docs/providers/vertex.md @@ -1,4 +1,4 @@ -# VertexAI / Google Palm +# VertexAI - Google Open In Colab