google-generativeai


Namegoogle-generativeai JSON
Version 0.5.2 PyPI version JSON
download
home_pagehttps://github.com/google/generative-ai-python
SummaryGoogle Generative AI High level API client library and tools.
upload_time2024-04-18 21:11:40
maintainerNone
docs_urlNone
authorGoogle LLC
requires_python>=3.9
licenseApache 2.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Google AI Python SDK for the Gemini API

[![PyPI version](https://badge.fury.io/py/google-generativeai.svg)](https://badge.fury.io/py/google-generativeai)
![Python support](https://img.shields.io/pypi/pyversions/google-generativeai)
![PyPI - Downloads](https://img.shields.io/pypi/dd/google-generativeai)

The Google AI Python SDK is the easiest way for Python developers to build with the Gemini API. The Gemini API gives you access to Gemini [models](https://ai.google.dev/models/gemini) created by [Google DeepMind](https://deepmind.google/technologies/gemini/#introduction). Gemini models are built from the ground up to be multimodal, so you can reason seamlessly across text, images, and code. 

## Get started with the Gemini API
1. Go to [Google AI Studio](https://aistudio.google.com/).
2. Login with your Google account.
3. [Create](https://aistudio.google.com/app/apikey) an API key.
4. Try a Python SDK [quickstart](https://github.com/google-gemini/gemini-api-cookbook/blob/main/quickstarts/Prompting.ipynb) in the [Gemini API Cookbook](https://github.com/google-gemini/gemini-api-cookbook/).
5. For detailed instructions, try the 
[Python SDK tutorial](https://ai.google.dev/tutorials/python_quickstart) on [ai.google.dev](https://ai.google.dev).

## Usage example
See the [Gemini API Cookbook](https://github.com/google-gemini/gemini-api-cookbook/) or [ai.google.dev](https://ai.google.dev) for complete code.

Install from [PyPI](https://pypi.org/project/google-generativeai).

`pip install -U google-generativeai`

Import the SDK and configure your API key.

```python
import google.generativeai as genai
import os

genai.configure(api_key=os.environ["GOOGLE_API_KEY"])
```

Create a model and run a prompt.

```python
model = genai.GenerativeModel('gemini-1.0-pro-latest')
response = model.generate_content("The opposite of hot is")
print(response.text)
```

## Documentation

See the [Gemini API Cookbook](https://github.com/google-gemini/gemini-api-cookbook/) or [ai.google.dev](https://ai.google.dev) for complete documentation.

## Contributing

See [Contributing](https://github.com/google/generative-ai-python/blob/main/CONTRIBUTING.md) for more information on contributing to the Google AI Python SDK.

## License

The contents of this repository are licensed under the [Apache License, version 2.0](http://www.apache.org/licenses/LICENSE-2.0).

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/google/generative-ai-python",
    "name": "google-generativeai",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": null,
    "author": "Google LLC",
    "author_email": "googleapis-packages@google.com",
    "download_url": null,
    "platform": "Posix; MacOS X; Windows",
    "description": "# Google AI Python SDK for the Gemini API\n\n[![PyPI version](https://badge.fury.io/py/google-generativeai.svg)](https://badge.fury.io/py/google-generativeai)\n![Python support](https://img.shields.io/pypi/pyversions/google-generativeai)\n![PyPI - Downloads](https://img.shields.io/pypi/dd/google-generativeai)\n\nThe Google AI Python SDK is the easiest way for Python developers to build with the Gemini API. The Gemini API gives you access to Gemini [models](https://ai.google.dev/models/gemini) created by [Google DeepMind](https://deepmind.google/technologies/gemini/#introduction). Gemini models are built from the ground up to be multimodal, so you can reason seamlessly across text, images, and code. \n\n## Get started with the Gemini API\n1. Go to [Google AI Studio](https://aistudio.google.com/).\n2. Login with your Google account.\n3. [Create](https://aistudio.google.com/app/apikey) an API key.\n4. Try a Python SDK [quickstart](https://github.com/google-gemini/gemini-api-cookbook/blob/main/quickstarts/Prompting.ipynb) in the [Gemini API Cookbook](https://github.com/google-gemini/gemini-api-cookbook/).\n5. For detailed instructions, try the \n[Python SDK tutorial](https://ai.google.dev/tutorials/python_quickstart) on [ai.google.dev](https://ai.google.dev).\n\n## Usage example\nSee the [Gemini API Cookbook](https://github.com/google-gemini/gemini-api-cookbook/) or [ai.google.dev](https://ai.google.dev) for complete code.\n\nInstall from [PyPI](https://pypi.org/project/google-generativeai).\n\n`pip install -U google-generativeai`\n\nImport the SDK and configure your API key.\n\n```python\nimport google.generativeai as genai\nimport os\n\ngenai.configure(api_key=os.environ[\"GOOGLE_API_KEY\"])\n```\n\nCreate a model and run a prompt.\n\n```python\nmodel = genai.GenerativeModel('gemini-1.0-pro-latest')\nresponse = model.generate_content(\"The opposite of hot is\")\nprint(response.text)\n```\n\n## Documentation\n\nSee the [Gemini API Cookbook](https://github.com/google-gemini/gemini-api-cookbook/) or [ai.google.dev](https://ai.google.dev) for complete documentation.\n\n## Contributing\n\nSee [Contributing](https://github.com/google/generative-ai-python/blob/main/CONTRIBUTING.md) for more information on contributing to the Google AI Python SDK.\n\n## License\n\nThe contents of this repository are licensed under the [Apache License, version 2.0](http://www.apache.org/licenses/LICENSE-2.0).\n",
    "bugtrack_url": null,
    "license": "Apache 2.0",
    "summary": "Google Generative AI High level API client library and tools.",
    "version": "0.5.2",
    "project_urls": {
        "Homepage": "https://github.com/google/generative-ai-python"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3b2ca82d94e8829d64e1dae2e28cfe8da6010888a8e2dcb942901d4197f73546",
                "md5": "760859f080847a3833e6fc2bebaf685b",
                "sha256": "56f39485a0a673c93c21ec31c17809cc6a964193fb77b7ce809ad15d0dd72d7b"
            },
            "downloads": -1,
            "filename": "google_generativeai-0.5.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "760859f080847a3833e6fc2bebaf685b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 146781,
            "upload_time": "2024-04-18T21:11:40",
            "upload_time_iso_8601": "2024-04-18T21:11:40.722596Z",
            "url": "https://files.pythonhosted.org/packages/3b/2c/a82d94e8829d64e1dae2e28cfe8da6010888a8e2dcb942901d4197f73546/google_generativeai-0.5.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-18 21:11:40",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "google",
    "github_project": "generative-ai-python",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "google-generativeai"
}
        
Elapsed time: 0.34200s