Name | llama-index-llms-palm JSON |
Version |
0.3.0
JSON |
| download |
home_page | None |
Summary | llama-index llms palm integration |
upload_time | 2024-11-18 00:21:15 |
maintainer | None |
docs_url | None |
author | Your Name |
requires_python | <4.0,>=3.9 |
license | MIT |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# LlamaIndex Llms Integration: Palm
## Installation
To install the required packages, run:
```bash
%pip install llama-index-llms-palm
!pip install llama-index
!pip install -q google-generativeai
```
> **Note:** If you're using Colab, the above commands will install the necessary packages. If you see a notice about updating `pip`, you can do so with:
>
> ```bash
> pip install --upgrade pip
> ```
## Setup
### Import Libraries and Configure API Key
Import the necessary libraries and configure your PaLM API key:
```python
import pprint
import google.generativeai as palm
palm_api_key = "" # Add your API key here
palm.configure(api_key=palm_api_key)
```
### Define the Model
List and select the available models that support text generation:
```python
models = [
m
for m in palm.list_models()
if "generateText" in m.supported_generation_methods
]
model = models[0].name
print(model)
```
You should see output similar to:
```
models/text-bison-001
```
### Using the PaLM LLM Abstraction
Now you can use the PaLM model to generate text. Here’s how to complete a prompt:
```python
from llama_index.llms.palm import PaLM
model = PaLM(api_key=palm_api_key)
# Example prompt
prompt = "Once upon a time in a faraway land, there lived a"
response = model.complete(prompt)
print(response)
```
### LLM Implementation example
https://docs.llamaindex.ai/en/stable/examples/llm/palm/
Raw data
{
"_id": null,
"home_page": null,
"name": "llama-index-llms-palm",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.9",
"maintainer_email": null,
"keywords": null,
"author": "Your Name",
"author_email": "you@example.com",
"download_url": "https://files.pythonhosted.org/packages/0f/b3/6a21c40ef301b046f8259631026b59f8873a417dabf7745a9f3332b19602/llama_index_llms_palm-0.3.0.tar.gz",
"platform": null,
"description": "# LlamaIndex Llms Integration: Palm\n\n## Installation\n\nTo install the required packages, run:\n\n```bash\n%pip install llama-index-llms-palm\n!pip install llama-index\n!pip install -q google-generativeai\n```\n\n> **Note:** If you're using Colab, the above commands will install the necessary packages. If you see a notice about updating `pip`, you can do so with:\n>\n> ```bash\n> pip install --upgrade pip\n> ```\n\n## Setup\n\n### Import Libraries and Configure API Key\n\nImport the necessary libraries and configure your PaLM API key:\n\n```python\nimport pprint\nimport google.generativeai as palm\n\npalm_api_key = \"\" # Add your API key here\npalm.configure(api_key=palm_api_key)\n```\n\n### Define the Model\n\nList and select the available models that support text generation:\n\n```python\nmodels = [\n m\n for m in palm.list_models()\n if \"generateText\" in m.supported_generation_methods\n]\n\nmodel = models[0].name\nprint(model)\n```\n\nYou should see output similar to:\n\n```\nmodels/text-bison-001\n```\n\n### Using the PaLM LLM Abstraction\n\nNow you can use the PaLM model to generate text. Here\u2019s how to complete a prompt:\n\n```python\nfrom llama_index.llms.palm import PaLM\n\nmodel = PaLM(api_key=palm_api_key)\n\n# Example prompt\nprompt = \"Once upon a time in a faraway land, there lived a\"\nresponse = model.complete(prompt)\nprint(response)\n```\n\n### LLM Implementation example\n\nhttps://docs.llamaindex.ai/en/stable/examples/llm/palm/\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "llama-index llms palm integration",
"version": "0.3.0",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "23e3e465f4f7f0c51d81e112c5c07ca83938cd9acf24540def433d0559b0c553",
"md5": "45e20032d7f00fc878449694cc0c9e1d",
"sha256": "63b5deda76519678c7760c662fbbed7035b93af780b81d5191c22011592c8453"
},
"downloads": -1,
"filename": "llama_index_llms_palm-0.3.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "45e20032d7f00fc878449694cc0c9e1d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.9",
"size": 3913,
"upload_time": "2024-11-18T00:21:14",
"upload_time_iso_8601": "2024-11-18T00:21:14.919358Z",
"url": "https://files.pythonhosted.org/packages/23/e3/e465f4f7f0c51d81e112c5c07ca83938cd9acf24540def433d0559b0c553/llama_index_llms_palm-0.3.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "0fb36a21c40ef301b046f8259631026b59f8873a417dabf7745a9f3332b19602",
"md5": "b43a969e7b85d21272855c94dfa8b4b8",
"sha256": "bd86caae7269f6f40cb2b1006ebfcdf888c274c23b7454f46350c1f41b509ca4"
},
"downloads": -1,
"filename": "llama_index_llms_palm-0.3.0.tar.gz",
"has_sig": false,
"md5_digest": "b43a969e7b85d21272855c94dfa8b4b8",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.9",
"size": 3614,
"upload_time": "2024-11-18T00:21:15",
"upload_time_iso_8601": "2024-11-18T00:21:15.843918Z",
"url": "https://files.pythonhosted.org/packages/0f/b3/6a21c40ef301b046f8259631026b59f8873a417dabf7745a9f3332b19602/llama_index_llms_palm-0.3.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-18 00:21:15",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "llama-index-llms-palm"
}