Development Status :: 3 - Alpha
pip install git+https://github.com/dsdanielpark/Gemini-API.git
This section aims to implement functionalities of the Gemini API. While there are many readily portable codes, updates may be delayed.
For commercial use cases, please refrain from using the unofficial Google Translate package included in python-gemini-api
for non-commercial purposes. Instead, kindly visit the official Google Cloud Translation website. Please use it responsibly, taking full responsibility for your actions, as python-gemini-api
package does not assume any implicit or explicit liability.
Official Google Translation API
- Support Languages: https://cloud.google.com/translate/docs/languages?hl=ko
Unofficial Google Trnaslator for non-profit purposes (such as feature testing)
- Support Languages: https://github.com/nidhaloff/deep-translator/blob/master/deep_translator/constants.py
It may not work as it is only available for certain accounts, regions, and other restrictions. Gemini UI offers a convenient way to share a specific answer from Gemini by generating a URL. This feature enables users to easily create and share URLs for individual answers.
Export Code to Repl.it
Using asynchronous implementation will be efficient when implementing ChatBots or something alone those lines.
GeminiAsync is not using requests library instead it is using httpx library and http2 protocol.
Please check the translation results in this folder.
- Copy the code of Core.py.
- Ask ChatGPT to translate like "Translate to Swift."
- Ask ChatGPT to optimize the code or provide any desired instructions until you're satisfied.
Gemini does not support temperature or hyperparameter adjustments, but it is possible to achieve the appearance of limiting the number of output tokens or the number of output sentences using simple algorithms, as follows:
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
prompt = "Hello, Gemini. What's the weather like in Seoul today?"
response = GeminiClient.generate_content(prompt)
# max_token==30
max_token(response, 30)
# max_sentence==2
max_sentence(response, 2)
Write a rough draft of the Gemini API release notes.
- Fixed missing aiohttp dependency for open router async client
- Cleaned up requirements import.
- Add verification(
verify
) argument inGemini
class. - Add cookies argument in
GeminiImage
class.
- Writes mostly private test code for errors and tests functionality.
- Rechecks robust implementation of parsing methods.
- Preparing to upgrade to major version three after a small patch.