Skip to content
This repository has been archived by the owner on Jun 12, 2024. It is now read-only.

2.4.2

Compare
Choose a tag to compare
@dsdanielpark dsdanielpark released this 04 Apr 10:21
· 90 commits to main since this release

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: