Name | gemini-ng JSON |
Version |
0.1.4
JSON |
| download |
home_page | None |
Summary | Next-generation Gemini API Client |
upload_time | 2024-04-20 17:21:14 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.11 |
license | Copyright (c) 2024 Ming Yang Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
keywords |
gemini
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Next-generation Gemini API Client
A human-friendly API client for the Gemini API, with support for text, image, and video inputs.
## Installation
```bash
pip install -U gemini-ng
```
## Usage
1. Set the `GEMINI_NG_API_KEY` environment variable with your [Google AI Studio API key](https://aistudio.google.com/app/apikey).
2. Use the client to interact with the Gemini API.
```python
from gemini_ng import GeminiClient
client = GeminiClient() # api key from environment variable `GEMINI_NG_API_KEY`
with client.start_chat(model="models/gemini-1.5-pro-latest") as chat:
image = client.upload_image("path/to/image.jpg")
video = client.upload_video("path/to/video.mp4", verbose=True)
prompt = [
video,
image,
"Describe the scene in the video and the image above in detail.",
]
rsp = chat.send_message(prompt)
print(rsp.candidates[0].text)
```
## License
This project is licensed under the terms of the MIT license. See the [LICENSE](LICENSE) file for details.
Raw data
{
"_id": null,
"home_page": null,
"name": "gemini-ng",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.11",
"maintainer_email": null,
"keywords": "Gemini",
"author": null,
"author_email": "Ming Yang <ymviv@qq.com>",
"download_url": "https://files.pythonhosted.org/packages/a4/8d/45e564576958b26b3a61871c67842cd073c7b7f11e7fa79e03001e21fe2b/gemini_ng-0.1.4.tar.gz",
"platform": null,
"description": "# Next-generation Gemini API Client\n\nA human-friendly API client for the Gemini API, with support for text, image, and video inputs.\n\n## Installation\n\n```bash\npip install -U gemini-ng\n```\n\n## Usage\n\n1. Set the `GEMINI_NG_API_KEY` environment variable with your [Google AI Studio API key](https://aistudio.google.com/app/apikey).\n\n2. Use the client to interact with the Gemini API.\n\n```python\nfrom gemini_ng import GeminiClient\n\nclient = GeminiClient() # api key from environment variable `GEMINI_NG_API_KEY`\n\nwith client.start_chat(model=\"models/gemini-1.5-pro-latest\") as chat:\n image = client.upload_image(\"path/to/image.jpg\")\n video = client.upload_video(\"path/to/video.mp4\", verbose=True)\n\n prompt = [\n video,\n image,\n \"Describe the scene in the video and the image above in detail.\",\n ]\n rsp = chat.send_message(prompt)\n\n print(rsp.candidates[0].text)\n```\n\n## License\n\nThis project is licensed under the terms of the MIT license. See the [LICENSE](LICENSE) file for details.\n",
"bugtrack_url": null,
"license": "Copyright (c) 2024 Ming Yang Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
"summary": "Next-generation Gemini API Client",
"version": "0.1.4",
"project_urls": {
"Documentation": "https://github.com/vivym/gemini-ng#readme",
"Issues": "https://github.com/vivym/gemini-ng/issues",
"Source": "https://github.com/vivym/gemini-ng"
},
"split_keywords": [
"gemini"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "fe97df1009106600900cc90f60218459c6c481c00b10ca02bfbc80ee5cc45501",
"md5": "6f9099682263da810e560b93fd464763",
"sha256": "82836ddfe3c4032c0e05f0666f0aee5da494180cf5468210c9917e26ef4dd0ef"
},
"downloads": -1,
"filename": "gemini_ng-0.1.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "6f9099682263da810e560b93fd464763",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.11",
"size": 13376,
"upload_time": "2024-04-20T17:21:11",
"upload_time_iso_8601": "2024-04-20T17:21:11.144803Z",
"url": "https://files.pythonhosted.org/packages/fe/97/df1009106600900cc90f60218459c6c481c00b10ca02bfbc80ee5cc45501/gemini_ng-0.1.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "a48d45e564576958b26b3a61871c67842cd073c7b7f11e7fa79e03001e21fe2b",
"md5": "259f7ac8a0bb2c650690e4047e44aaa4",
"sha256": "27cc2c93b6667b1126de29542a9ed2c2b6eabaa90ba5e1a191d5ef1c5c1618eb"
},
"downloads": -1,
"filename": "gemini_ng-0.1.4.tar.gz",
"has_sig": false,
"md5_digest": "259f7ac8a0bb2c650690e4047e44aaa4",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11",
"size": 11195,
"upload_time": "2024-04-20T17:21:14",
"upload_time_iso_8601": "2024-04-20T17:21:14.129648Z",
"url": "https://files.pythonhosted.org/packages/a4/8d/45e564576958b26b3a61871c67842cd073c7b7f11e7fa79e03001e21fe2b/gemini_ng-0.1.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-04-20 17:21:14",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "vivym",
"github_project": "gemini-ng#readme",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "gemini-ng"
}