Giter Club home page Giter Club logo

gemini-api's Introduction

Hello, I'm MinWoo(Daniel) Park

Linkedin Badge Hits

  • I am a passionate developer adept at leveraging Machine Learning and Deep Learning technologies to address challenges across diverse domains.
  • My extensive experience and knowledge in fields such as LLM, Natural Language Processing, Computer Vision, and the medical and healthcare sectors have enabled me to connect the dots and craft sophisticated solutions for a broad range of industry problems.
  • Currently, I am focusing on advancing the field ofthe state-of-the-art LLM (Language Model) technology.
  • I believe that all the knowledge I have gained will converge at the end of my journey.


For more details

trophy

Contents

On 2023-11-07, I have decided to make the majority of repositories and Hugging Face models private.



Large Language Model

  • The code for LLM projects will remain private. Due to ethical issues, the model's performance will be disclosed once it is verified after development.
  • sLLM, Jindo: Jindo is a relatively small sLLM that includes various experiments. It aims to develop multi-modal and domain-specific highly personalized models, but it is not recommended for general use as it is primarily used for experiments.
  • GORANI: The project is actively underway. GORANI is being developed as an English language model for comparison with other LLMs and to assess its technical capabilities. It is planned to be distributed under a research-purpose license.
  • KORANI: KORANI is a Korean-specific LLM developed based on Jindo and GORANI's accumulated technology. It is based on the 13B Llama2 chat, transformed into an LLM, with the goal of making it available under a commercial license.

Huggingface

Link: https://huggingface.co/danielpark

Project Title Backbone Description
ko-llama-2-jindo-7b-instruct LLaMA2-7b Korean LLM model efficiently fine-tuned with QLoRA (Efficient Finetuning of Quantized LLMs)
ko-llama-2-jindo-13b-instruct LLaMA2-13b Korean LLM model efficiently fine-tuned with QLoRA
ko-llama-2-jindo-7b-instruct-ggml LLaMA2-7b Model weights transformed through GGML(Generic Graph Machine Learning) to efficiently perform inference using GPU and CPU.
ko-llama-2-jindo-7b-instruct-4bit-128g-gptq LLaMA2-7b Model weights using LLaMA2 as the backbone, one-shot weight quantized with GPTQ(Accurate Post-Training Quantization for Generative Pre-trained Transformers) to increase inference speed.

Projects

Project Description Repo
Bard API Interfaces with Google Bard API to retrieve responses. GitHub
Amazing Bard Prompts Includes curated Google Bard prompts for enhanced utilization. GitHub
ExceptNotifier Enriches try-except with comprehensive error messages. GitHub
Co Coder Python package that treamlines error debugging from Chat GPT and Google Bard. GitHub
GPT BERT Medical QA Chatbot Research repository focused on GPT 2 fine-tuning for medical domain. GitHub
Korean news topic classification using KO BERT Classifies Korean news articles into eight categories using fine-tuned Korean BERT. GitHub
Multi-objective recommender Recommendation system leveraging user behavior data for improved accuracy. GitHub

Packages

Pypi link: https://pypi.org/user/archi-park/

Package Description Repo
bardapi The python package that returns Response of Google Bard through API. GitHub
arxiv2text Converting PDF files to text, mainly with a focus on arXiv papers. GitHub
transllm LLMtranslator translates and generates text in multiple languages. GitHub
translang Translation Service API Module. GitHub
catchexception Nightly version of ExceptNotifier GitHub
googlebardapi The python package that returns Response of Google Bard through API. GitHub
cocoder Python package that treamlines error debugging from Chat GPT and Google Bard. GitHub
exceptnotifier With Python's try-except to receive notifications about Errors or Successes in your code through messenger app or email. GitHub
utilfunction The Python package utilfunction wraps and distributes useful functions in an easy-to-use way. GitHub
quickshow Quick-Show provides simply but powerful insight plots GitHub
googledriver The Python package google drive facilitates access to files uploaded to Google Drive. GitHub
youtuber Support tools including crawler, video editing, YouTube API, etc. GitHub
docfilter The Python package docfilter is used to detect and remove inappropriate information from text. GitHub
kmi2122 This dataset includes some macroeconomic indicators for South Korea in 2021-2022. GitHub
corpusshow Corpus-Show makes it easier and faster to visualize corpus through sentence embedding of corpus. GitHub
edanif EDA-NIf creates a dataframe containing meta information of NIfTi files and provides several useful features. GitHub

Dockerhub

Link: https://hub.docker.com/u/parkminwoo91


Work Experience

01 Internal Projects (2017 - 2022)

  • Inflow Analysis/Product Selection/Trend Analysis/Price Trend/Logistics Demand Prediction Model (2017-2018, Recommender System, Natural Language Processing)
  • Analysis of National Health Insurance Service (NHIS) Data and Development of Biological Age Calculation Algorithm, Disease Prevalence Prediction (2020, Machine Learning)
  • Detection of Overhead Wires using Big Data from Korea Electric Power Corporation (KEPCO) (2021, Computer Vision)
  • Development Planning of Food Ingredient Discovery and Characterization Platform (2021, Machine Learning, Natural Language Processing)
  • Software Development for Automating Protein Mechanisms, Interactions, and Molecular Structure Extraction and Analysis from Alzheimer's Disease Papers (2021, Natural Language Processing, Computer Vision)
  • Prediction of Diseases and Physical Vitality based on Animal Metabolite (Fur/Blood) Datasets (2021, Machine Learning, Natural Language Processing)
  • Anomaly Signs Prediction, Health Index Forecast, Gut Microbiome Data Analysis using National Health Insurance Data (2021, Machine Learning, Natural Language Processing)
  • Development Planning for Heat Efficiency and Energy Optimization Algorithms in Sihwabanwol Industrial Complex (2021, Optimization)
  • Development of Automatic Brain Structure Segmentation and Tumor Area Segmentation Model using MRI and CT Images and Skull Extraction Algorithms (2022, Computer Vision)
  • Development of Body Type Classification and 3D Body Shape Change Prediction Model based on Time-Series Korean Body Data Collection (2022, Computer Vision)
  • Algorithm and Deep Learning Model Development for Extracting Drawing Factors from Engineering Drawings (2022, Computer Vision)
  • Algorithm for Visualization and Analysis of Noise Sources, Automation Pipeline for Noise Source Localization and Clustering (2022, Computer Vision)

02 Personal Projects (2022 - 2023)

  • Bard-API: Unofficial Python Package for Fetching Responses from Google Bard (GitHub Star 5.4k, Downloads 379k, 2023, Python Development)
  • ExceptNotifier: Package for Sending Detailed Error Messages to Users via Messenger when Errors Occur in try-except Statements (Downloads 27k, 2023, Python Development)
  • All About LLM: Documentation of Papers and Projects on Large Language Models (2023, LLM)
  • Ko LLaMa2 Jindo: Project Focused on Creating a Korean Natural Language Model, Entire Pipeline Construction and Lightweighting (2023, LLM)
  • GORANI: Multipurpose Korean LLM Development Project based on LLaMA2 (2023, LLM)
  • HF Trans LLM: Translator Project for Multilingual Translation and Text Generation (2023, LLM, Python Development)
  • Korean Open LLM Datasets-chain: Project for Collecting/Processing Korean LLM Datasets (2023, Python Development, LLM)
  • Open LLM Datasets: Compilation of Datasets and Papers Used in Open LLM (2023, Python Development, LLM)
  • Open LLM Leaderboard-report: Visualization of Performance of Open Source LLMs based on Four Metrics for Performance Comparison (2023, LLM)
  • Medical QA Bert Chat GPT: Fine-tuning GPT-2 for Question-Answering in the Medical Domain (2023, LLM)
  • Translang: Translation Service Module Providing API for Language Translation (2023, Python Development)
  • Fine-tuned-korean-bert-news-article-classifier: Model Development for News Article Topic Classification, Comparing BERT Implementations in Various Frameworks (2023, LLM)
  • Multi Objective Recommender: Project to Build a Multi-Objective Recommendation System based on Real E-commerce Sessions (2023, Recommender System)
  • Co Coder: Python Package to Simplify Debugging using OpenAI Chat GPT and Google Bard (2023, Python Development)
  • EDA-Nif: Organizing Metadata of Medical AI Nifti Files and Providing Some Functions such as Image Registration and Arbitrary Slicing (2022, AI for Life)

gemini-api's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

gemini-api's Issues

Image Generation issue

Code Used:

from gemini import Gemini, GeminiImage

prompt = "Create illustrations of Seoul, South Korea."
response = GeminiClient.generate_content(prompt)

generated_images = response.generated_images # Check generated images [Dict]

GeminiImage.save_sync(generated_images, save_path="cached_folder")

Error:

Failed to download https://lh3.googleusercontent.com/bard/ADjfeTdRTWhsRmVFNH5LQJ7DRSghoivB2a50_FohrJQJtWe6CS4IMBWjjYcLFxgEUn6LtcC8dbM9wPOtxuJO92Ez_RhqcfZnH9k5EFwjL5YvCLy2PPC9jKy9PCDiONVJvAa47YD6K_XPWSjpK84_GoI1gHC6T4GUNj-FP3ezLqJjrofV1gUBFn7SBDLykYKrU7_o_xK0iaCs3Kb_UkpSpUqc5MRqaMQoMCf4EQm8gjVSFnfGGI43fcGs7CPb6_5ey4os203Hv8JA-SoyF1bYzF718H6Kq0D01dAq4KiC86aB1HzDcEpwWElOHBAxcQ9qAUHWWRpleUfq3ZZUOd4MS1o: Invalid type for url.  Expected str or httpx.URL, got <class 'pydantic_core._pydantic_core.Url'>: Url('https://lh3.googleusercontent.com/bard/ADjfeTdRTWhsRmVFNH5LQJ7DRSghoivB2a50_FohrJQJtWe6CS4IMBWjjYcLFxgEUn6LtcC8dbM9wPOtxuJO92Ez_RhqcfZnH9k5EFwjL5YvCLy2PPC9jKy9PCDiONVJvAa47YD6K_XPWSjpK84_GoI1gHC6T4GUNj-FP3ezLqJjrofV1gUBFn7SBDLykYKrU7_o_xK0iaCs3Kb_UkpSpUqc5MRqaMQoMCf4EQm8gjVSFnfGGI43fcGs7CPb6_5ey4os203Hv8JA-SoyF1bYzF718H6Kq0D01dAq4KiC86aB1HzDcEpwWElOHBAxcQ9qAUHWWRpleUfq3ZZUOd4MS1o')
Failed to download https://lh3.googleusercontent.com/bard/ADjfeTcTUw6txdmEd2o1EWED4rK5thrOeZO5xygpxYAy4fSkpd7qUuSBrtRafc5m9bYdbgoivXVKQEFWA7sXw3JHMnMi4BhM6q_dpEjiCIHxRloVLWJ7NRPTvmz_uf4gUrga3u0TSpo0OkIBlIdakvlj4WRy_dftihKOMwdarrrkrCM08rTPjnE5ASuvZC9RtD9xgaxpIGMfBAH1iXJRs6EHd9mQwiN03tlyHz_p0gXkV-H6y670lXCngR9h6ZCire0jJYsSLiU7HL0xu1_PLBDNylb7IDDzNWT1bN_ZVdx15jAb03jG5Plp38uJ3L8bEkAxDJVjV5E601d9eO-jD5Q: Invalid type for url.  Expected str or httpx.URL, got <class 'pydantic_core._pydantic_core.Url'>: Url('https://lh3.googleusercontent.com/bard/ADjfeTcTUw6txdmEd2o1EWED4rK5thrOeZO5xygpxYAy4fSkpd7qUuSBrtRafc5m9bYdbgoivXVKQEFWA7sXw3JHMnMi4BhM6q_dpEjiCIHxRloVLWJ7NRPTvmz_uf4gUrga3u0TSpo0OkIBlIdakvlj4WRy_dftihKOMwdarrrkrCM08rTPjnE5ASuvZC9RtD9xgaxpIGMfBAH1iXJRs6EHd9mQwiN03tlyHz_p0gXkV-H6y670lXCngR9h6ZCire0jJYsSLiU7HL0xu1_PLBDNylb7IDDzNWT1bN_ZVdx15jAb03jG5Plp38uJ3L8bEkAxDJVjV5E601d9eO-jD5Q')
Failed to download https://lh3.googleusercontent.com/bard/ADjfeTc1HGdWthxSjOuYeEUr5l3KPLTCuZyPrQEs9O0tD0eM-wZj_XDtjVX8i9-BqrW6EScAKpw29MMnaunZGANeLH1K16C2avYWUXDqY5zBQ3oqHVvWffUcN6YTZij3smFZ-58KzvC51E2t20Jayd9rYWcn6ZyZKV3cKEEQ2Lx1fV8zSyBIT5MMNdII6QofiV2hlvNKmC6QF5n8cC0ZejEvhDOLctw_IIosJWX3jh-bAPnNf8GmqEVoFBd6253ewoCUOlxDcaey9Iyn_q7CiXrj_f0rOx3kYVnPQGexZHnE3718Wa7Aum0l8EEcjZpsqcniOIEyFYIu2dw4zmsN2Do: Invalid type for url.  Expected str or httpx.URL, got <class 'pydantic_core._pydantic_core.Url'>: Url('https://lh3.googleusercontent.com/bard/ADjfeTc1HGdWthxSjOuYeEUr5l3KPLTCuZyPrQEs9O0tD0eM-wZj_XDtjVX8i9-BqrW6EScAKpw29MMnaunZGANeLH1K16C2avYWUXDqY5zBQ3oqHVvWffUcN6YTZij3smFZ-58KzvC51E2t20Jayd9rYWcn6ZyZKV3cKEEQ2Lx1fV8zSyBIT5MMNdII6QofiV2hlvNKmC6QF5n8cC0ZejEvhDOLctw_IIosJWX3jh-bAPnNf8GmqEVoFBd6253ewoCUOlxDcaey9Iyn_q7CiXrj_f0rOx3kYVnPQGexZHnE3718Wa7Aum0l8EEcjZpsqcniOIEyFYIu2dw4zmsN2Do')
Traceback (most recent call last):
  File "/home/container/app.py", line 37, in <module>
    GeminiImage.save_sync(generated_images, save_path="cached_folder")
  File "/home/container/.local/lib/python3.11/site-packages/gemini/src/model/image.py", line 116, in save_sync
    GeminiImage.validate_images(image_data)
  File "/home/container/.local/lib/python3.11/site-packages/gemini/src/model/image.py", line 20, in validate_images
    raise ValueError("Input is empty. Please provide images to proceed.")
ValueError: Input is empty. Please provide images to proceed.

Response in 0.1.6 as a string

Hello! In version 0.1.6, the response comes in the form of a string, but not in json format for further selection of the correct response. In addition, there are a lot of unnecessary special characters from the site layout.

integration/compatibility with visual programming platforms

I know this is an "unofficial" api, but I'm wondering if there are any plans, or how hard it would be, to integrate this api with some visual programming platform, something like flowise, langflow or chainforge. I know these platforms wouldn't officially support this, but the code is open-source so it is possible. Any thoughts on this?

Still not usable

  1. GeminiClient = Gemini(cookie_fp="cookies.json")
    For this case instructions recommends ExportThisCookies, but does not mentioned that downloaded with it cookies.txt is not real json: it is necessary to trim cookies = to make it valid json.
    But even with this I have no success:

    Error loading cookie file: 'Gemini' object has no attribute 'session'
    Traceback (most recent call last):
      File "D:\AI\Gemini-API\test2.py", line 11, in <module>
        GeminiClient = Gemini(cookie_fp="cookies.json") # Or use cookie file path
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "D:\AI\Gemini-API\gemini\core.py", line 66, in __init__
        self.session = session or self._initialize_session()
                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "D:\AI\Gemini-API\gemini\core.py", line 94, in _initialize_session
        self._set_sid_and_nonce()
      File "D:\AI\Gemini-API\gemini\core.py", line 213, in _set_sid_and_nonce
        self._nonce = re.search(r'"SNlM0e":"(.*?)"', response.text).group(1)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    AttributeError: 'NoneType' object has no attribute 'group'
    
  2. GeminiClient = Gemini(cookies=cookies) (where cookies are __Secure-1PSID, __Secure-1PSIDTS)
    I get an output, but it is not very helpful:

    {'metadata': ['c_409da1520e77ed5f', 'r_f3670ae69c52a4e1'], 'candidates': {'rcid': 'rc_594f1013ce897401', 'text': 'http://googleusercontent.com/card_content/0', 'web_images': [], 'generated_images': []}}
    
  3. GeminiClient = Gemini(auto_cookies=True) does not work:

    Traceback (most recent call last):
      File "D:\AI\Gemini-API\test.py", line 3, in <module>
        GeminiClient = Gemini(auto_cookies=True)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^
      File "D:\AI\Gemini-API\gemini\core.py", line 66, in __init__
        self.session = session or self._initialize_session()
                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "D:\AI\Gemini-API\gemini\core.py", line 92, in _initialize_session
        self._set_cookies_automatically()
      File "D:\AI\Gemini-API\gemini\core.py", line 141, in _set_cookies_automatically
        if len(getattr(self, "cookies", {})) > 5:
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    TypeError: object of type 'NoneType' has no len()
    

Originally posted by @johnd0e in #2 (comment)

The issue is still relevant for v2.2.0

ModuleNotFoundError: No module named 'gemini.src.module'

Describe the bug

ModuleNotFoundError: No module named 'gemini.src.module'

Version
OS: windows 11
Python: 3.12.2
Gemini API: 2.4.0
Using proxy: No
Legion: (i do not understand this)

Code

from gemini import Gemini

cookies_dict= #redacted
GeminiClient = Gemini(cookies=cookies_dict)

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

Error

Traceback (most recent call last):
  File "C:\Users\Ayush\Desktop\Project\jarvis\brain\bard.py", line 1, in <module>
    from gemini import Gemini
  File "C:\Users\Ayush\AppData\Local\Programs\Python\Python312\Lib\site-packages\gemini\__init__.py", line 5, in <module>
    from .src.module.openrouter.client import OpenRouter
ModuleNotFoundError: No module named 'gemini.src.module'

Notice: To Bard API Contributors

Hello Bard API contributors,

Are you keeping well?

We are in the process of redeveloping a Python package that works with the updated Gemini, with the kind assistance of Antonio Cheong.

I hope this message finds you well. I wanted to inform you that with the transition from Bard to Gemini, we have updated the package repository accordingly.

There have been some slight changes in the parser section. However, I apologize for proceeding with the transition without your permission, driven by the desire to clean up the previous codebase.

Once the existing package stabilizes to some extent, we plan to override it from Bard API. For now, we will gradually port the legacy codes from the Gemini-API package repository.

If any of you, Bard API contributors, could submit even an empty commit to the Gemini-API, we will promptly merge it. Additionally, your assistance in various tasks such as porting legacy codes, documentation, etc., would be greatly appreciated.

I wish you all a happy and prosperous year in 2024, and please feel free to reach out if there's anything I can assist you with!

Thank you and gratitude for your contributions.

Best regards,
Daniel

CBoYXD, veonua, thewh1teagle, jjkoh95, yihong0618, nishantchauhan949, MeemeeLab, #9kota113, sachnun, amit9021, zeelsheladiya, ayansengupta17, thecodekitchen, SalimLouDev, Qewertyy, senseibence, mirusu400, szv99, sudoAlireza

The response text is a empty URL, which cannot be seen. {'metadata': ['c_cd648c1c943cb00f', 'r_f093111e78855c35'], 'candidates': {'rcid': 'rc_97ec8a9d7ddbed62', 'text': 'http://googleusercontent.com/card_content/0', 'web_images': [], 'generated_images': []}}

Describe the bug
The response text is returned in a URL format that cannot be seen.

Version
OS: Windows 11
Python: 3.12.2
Gemini API: 1.0.4
Using proxy: No
Region: Poland

Code

from gemini import Gemini

cookies = {
    "__Secure-1PSID" : "fullfilled",
    "__Secure-1PSIDTS" : "fullfilled",
    "__Secure-1PSIDCC" : "fullfilled", # I use this because in BardCookies it works
    "NID" : "fullfilled",
  }

GeminiClient = Gemini(cookies=cookies)

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

Error

{'metadata': ['c_cd648c1c943cb00f', 'r_f093111e78855c35'], 'candidates': {'rcid': 'rc_97ec8a9d7ddbed62', 'text': 'http://googleusercontent.com/card_content/0', 'web_images': [], 'generated_images': []}}

ImportError

ImportError: cannot import name 'Gemini' from 'gemini' (/home/runner/Bard-ai/.pythonlibs/lib/python3.10/site-packages/gemini/init.py)

1.0.0 not working

After update to 1.0.0 i always see error 400 when i want to get response. All cookies are fresh and correct, code was work in 0.1.6

It returns message "maximum recursion depth exceeded"

Describe the bug
Gemini returns message "maximum recursion depth exceeded"

Version
OS: Ubuntu 23.10
Python: 3.11
Gemini API: 2.0.0
Using proxy: None
Legion:

Code

from gemini import Gemini

cookies = {} # I input my cookies here as decribe in README
GeminiClient = Gemini(cookies=cookies)

prompt = "hello, how are you?"
response = GeminiClient.generate_content(prompt)

print(response.response.dict)

Error

It returns "maximum recursion depth exceeded"
I check on gemini.google.com/app, 
it has sent prompt to gemini but not get answer from gemini.google.com/app as below image 
Bard API still runs smooth!

image

Unable to reuse sessions.

Could you please provide me the code for using Gemini API, in a reusable session? Please do the needful and its my humble request.

Notice: Reverse Engineering and Feature Testing Ongoing Until April 1, 2024

Please compile the major issues here until then. We are aware of most errors during the development process, and we are continuously working to make the error messages clearer.

Currently, we are focusing on checking the logic for receiving a normal response through reverse engineering and for automatically updating the cookie values in real-time.

Additionally, you can contribute to the initial package development at any time through a pull request. Any type of contribution is appreciated, but we ask for a significant amount of development for your first pull request.

Thank you.

ImportError: cannot import name 'GeminiClient' from 'gemini'

from gemini import Gemini
from gemini import GeminiClient

async def main():
cookies = {

I setup all the cookies as per the instructions in readme file

}

client = GeminiClient(cookies=cookies)
await client.async_init()


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

'NoneType' object has no attribute 'group'

💚💜 Thank you for interest. ❤️💛
Please make sure to check for more efficient package management.

To Reproduce

  • [v] I have read README.md. Please read me.
  • [v] I have searched for existing issues and FAQ (Most of the issues are duplicates.)
  • [v] I installed the appropriate version and confirmed that the previous version was properly removed upon reinstallation.
  • [v] I also checked the environment (not only on a single local machine but also on Google Colab, different Google accounts, and tried resetting cookies, etc. Please make sure to attempt these steps if necessary, and test the functionality in a new virtual environment if needed.)

Describe the bug
not working gemini, writes ↓

Version
OS: Win11
Python: 3.11.7
Gemini API: usa
Using proxy: no
Legion:

Code

cookies = {
    "key": google_api_key # google_api_key : str
}

GeminiClient = Gemini(cookies=cookies)

Error

'NoneType' object has no attribute 'group'
  File "D:\MH\gemini.py", line 18, in <module>
    GeminiClient = Gemini(cookies=cookies)
                   ^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'group'

SNlM0e token value not found. Double-check cookies dict value or pass it as Gemini(cookies=Dict())

Traceback (most recent call last):
File "c:\Users\Divyanshi\Desktop\New\app.py", line 22, in
GeminiClient = Gemini(cookies=cookies)
^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Divyanshi\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\gemini\core.py", line 97, in init
self.token = self._get_snim0e()
^^^^^^^^^^^^^^^^^^
File "C:\Users\Divyanshi\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\gemini\core.py", line 221, in _get_snim0e
raise Exception(
Exception: SNlM0e token value not found. Double-check cookies dict value or pass it as Gemini(cookies=Dict())

Response None

I have tried multiple times, but the response is still None. I hope you can help me resolve it.
Screenshot 2024-03-18 140726

Input should be a valid list [type=list_type, input_value='Gönderilen resimde "Saf...ihtimalini artırıyor.', input_type=str]

My gemini api version = 2.1.0

Traceback (most recent call last):
File "C:\Users\Gumus\Desktop\gemini_api\main.py", line 7, in
response = GeminiClient.generate_content("Bu resmi bana açıklarmısın?", image=image_path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Gumus\AppData\Local\Programs\Python\Python312\Lib\site-packages\gemini\core.py", line 263, in generate_content
return self._create_model_output(parsed_response)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Gumus\AppData\Local\Programs\Python\Python312\Lib\site-packages\gemini\core.py", line 275, in _create_model_output
candidates = self.collect_candidates(parsed_response)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Gumus\AppData\Local\Programs\Python\Python312\Lib\site-packages\gemini\core.py", line 308, in collect_candidates
collected.append(GeminiCandidate(**current))
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Gumus\AppData\Local\Programs\Python\Python312\Lib\site-packages\pydantic\main.py", line 171, in init
self.pydantic_validator.validate_python(data, self_instance=self)
pydantic_core._pydantic_core.ValidationError: 1 validation error for GeminiCandidate
code
Input should be a valid list [type=list_type, input_value='Gönderilen resimde "Saf...ihtimalini artırıyor.', input_type=str]
For further information visit https://errors.pydantic.dev/2.6/v/list_type

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.