Skip to content

Releases: dsdanielpark/Gemini-API

2.4.12

20 May 10:03
Compare
Choose a tag to compare

Gemini Icon Gemini-API v2.4.12

| 2024-05-20 | There are some changes in logic depending on the region/country (IP) and account.

Users need to check the following to find the appropriate logic for themselves.

The package remains suitable for the most common use cases.

pip install python-gemini-api==2.4.12
pip install -q -U python-gemini-api

2.4.10

29 Apr 08:46
Compare
Choose a tag to compare

Gemini Icon Gemini-API v2.4.10

  • Most error fixes and feature tests have been completed. (2024-04-29)
  • We are always looking for contributors to the package. Please feel free to report any QA issues or errors.
pip install python-gemini-api==2.4.10
pip install -q -U python-gemini-api

2.4.6

24 Apr 10:50
f3b0955
Compare
Choose a tag to compare

Gemini Icon Gemini-API v2.4.6

pip install python-gemini-api==2.4.6
pip install -q -U python-gemini-api

2.4.2

04 Apr 10:21
Compare
Choose a tag to compare

Gemini Icon Gemini-API v2.4.2

Error fixed.

pip install python-gemini-api==2.4.2
pip install -q -U python-gemini-api

What's changed?

  • You can use gemini-advanced version by declaring env variable. (Experimental feature)
    import os
    os.environ["GEMINI_ULTRA"] = "1"
  • Error fix #24
  • New feature from 2.4.0
    [See Code Examples]
    Check out temporarily free Open-source LLM APIs with Open Router. (Free limit: 10 requests/minute)

Utilize free open-source LLM API through Open Router

OpenRouter offers temporary free inference for select models. Obtain an API key from Open Router API and check free models at Open Router models. Use models with a 0-dollar token cost primarily; other models may incur charges. See more free open-source LLM API guide

Note

You can easily receive responses from open LLMs without this package by following the instructions on here.

from gemini import OpenRouter

OPENROUTER_API_KEY = "<your_open_router_api_key>"
GemmaClient = OpenRouter(api_key=OPENROUTER_API_KEY, model="google/gemma-7b-it:free")

prompt = "Do you know UCA academy in Korea? https://blog.naver.com/ulsancoding"
response = GemmaClient.create_chat_completion(prompt)
print(response)

# payload = GemmaClient.generate_content(prompt)
# print(payload.json())

The free model list includes:

2.4.0

26 Mar 08:48
79b9211
Compare
Choose a tag to compare

Gemini Icon Gemini-API v2.4.0

This release includes various bug fixes and new features.

What's changed?

  • Adding temporary free access to open-source LLM APIs. Stably use Google's Gemma for free.
  • [Example codes] (Free limit: 10 requests/minute)

Installation 📦

pip install python-gemini-api==2.4.0

Utilize free open-source LLM API through Open Router in Gemini-API

OpenRouter offers temporary free inference for select models. Obtain an API key from Open Router API and check free models at Open Router models. Use models with a 0-dollar token cost primarily; other models may incur charges. See more free open-source LLM API guide

from gemini import OpenRouter

OPENROUTER_API_KEY = "<your_open_router_api_key>"
GemmaClient = OpenRouter(api_key=OPENROUTER_API_KEY, model="google/gemma-7b-it:free")

prompt = "Do you know UCA academy in Korea? https://blog.naver.com/ulsancoding"
response = GemmaClient.create_chat_completion(prompt)
print(response)

# payload = GemmaClient.generate_content(prompt)
# print(payload.json())

The free model list includes:

Note

You can easily receive responses from open LLMs without this package by following the instructions on here.



2.3.0

20 Mar 06:56
f0f9297
Compare
Choose a tag to compare

Gemini Icon Gemini-API v2.3.0

This release includes various bug fixes and new features.

What's changed?

  • Improved auto cookie strategy (#24), but further enhancements possible.
  • Resolved bug related to Gemini property error (#19).
  • Added multi-language support.

Installation 📦

pip install python-gemini-api==2.3.0

or

pip install -q -U python-gemini-api

Improvements in functionality other than error correction may be slow.
Thank you always for your love.

2.2.0

17 Mar 10:32
Compare
Choose a tag to compare

Gemini Icon Gemini-API 2.2.0

This release includes various bug fixes and new features.

What's changed?

  • The parsing strategy has changed due to payload changes in Gemini.
  • Returned output may include organized code snippets.
  • Fixed a type error. (#21)
  • Experimenting with STT (speech to text) and TTS (text to speech) features, but they are still incomplete. Will release as version 3.0.0 once fully developed.
  • For other errors, refer to the issue page. Make sure to read the following issue. (#14)

Installation 📦

pip install python-gemini-api==2.2.0

Improvements in functionality other than error correction may be slow. Thank you always for your love.

2.0.0

11 Mar 05:49
8872713
Compare
Choose a tag to compare

Gemini Icon Gemini API PyPI

Installation

pip install python-gemini-api==2.0.0
pip install git+https://github.com/dsdanielpark/Gemini-API.git

For the updated version, use the following command:

pip install -q -U python-gemini-api

Release Notes

This release includes various bug fixes and new features.

1.0.0

04 Mar 10:57
Compare
Choose a tag to compare

Gemini Icon Gemini API - v1.x.x

Development Status :: 1 - Planning

In February 2024, Bard underwent a rebranding and is now known as Gemini. The Bard API has transitioned to the Gemini API.

Going forward, only major version updates will be documented in the release notes. For other minor patches, please refer to the latest PyPI files.

$ pip install python-gemini-api
$ pip install -q -U python-gemini-api
from gemini import Gemini

cookies = {
    "key": "value"
}

GeminiClient = Gemini(cookies=cookies)

# GeminiClient = Gemini(cookie_fp="folder/cookie_file.json") # Or use cookie file path
# GeminiClient = Gemini(auto_cookies=True) # Or use auto_cookies paprameter

# Before proceeding, ensure that the GeminiClient object is defined without any errors.

prompt = "Hello, Gemini. What's the weather like in Seoul today?"
response = GeminiClient.generate_content(prompt)
print(response)

Full Changelog: https://github.com/dsdanielpark/Gemini-API/commits/1.0.0

Release Note

  • Development is ongoing. Stay tuned. (Some features work, but it's incomplete.)
  • Use a Chrome extension to fetch cookie values, as some cookies are not yet specified.
  • Still working on parsing the response text.
  • Only part of the text generation feature works.
  • Developing logic to automatically refresh cookie values, see auto_cookies for details.

0.1.6

02 Mar 13:34
Compare
Choose a tag to compare

Gemini Icon Gemini API - v0.1.6

In February 2024, Bard has changed its service name to Gemini.

Bard API to Gemini API

$ pip install python-gemini-api==0.1.6
$ pip install -q -U python-gemini-api
from gemini import Gemini

cookies = {
    "key": "value"
}

GeminiClient = Gemini(cookies=cookies)

# GeminiClient = Gemini(cookie_fp="folder/cookie_file.json") # Or use cookie file path
# GeminiClient = Gemini(auto_cookies=True) # Or use auto_cookies paprameter

# Before proceeding, ensure that the GeminiClient object is defined without any errors.

prompt = "Hello, Gemini. What's the weather like in Seoul today?"
response = GeminiClient.generate_content(prompt)
print(response)

Full Changelog: https://github.com/dsdanielpark/Gemini-API/commits/0.1.6

Release Note

  • Development is ongoing. Stay tuned. (Some features work, but it's incomplete.)
  • Use a Chrome extension to fetch cookie values, as some cookies are not yet specified.
  • Still working on parsing the response text.
  • Only part of the text generation feature works.
  • Developing logic to automatically refresh cookie values, see auto_cookies for details.