HanaokaYuzu / Gemini-API

✨ Elegant async Python API for Google Gemini web app
https://pypi.org/project/gemini-webapi/
GNU Affero General Public License v3.0
171 stars 20 forks source link

about unofficial gemini apis.... #20

Closed 0wwafa closed 3 months ago

0wwafa commented 5 months ago

If you are interested, I found also another gemini api. I reverse engineered the api inside colab.

curl 'https://colab.research.google.com/language-services/converse?authuser=0' \
  -H 'accept: */*' \
  -H 'accept-language: en-US,en;q=0.9,it;q=0.8' \
  -H 'content-type: text/plain;charset=UTF-8' \
  -H 'cookie: ' [ login cookies] ' \
  -H 'origin: https://colab.research.google.com' \
  -H 'priority: u=1, i' \
  -H 'referer: https://colab.research.google.com/' \
  -H 'sec-ch-ua: "Microsoft Edge";v="125", "Chromium";v="125", "Not.A/Brand";v="24"' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'sec-ch-ua-platform: "Windows"' \
  -H 'sec-fetch-dest: empty' \
  -H 'sec-fetch-mode: cors' \
  -H 'sec-fetch-site: same-origin' \
  -H 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36 Edg/125.0.0.0' \
  --data-raw '["Hello!",[]," [system prompt] ",null,null,null]'

Where "hello" is the prompt and "[system prompt]" is the system prompt.

have fun until it lasts.

0wwafa commented 5 months ago

Also this is the FULL gemini.

0wwafa commented 5 months ago
Content-Length: 228

[["1. **I am a Large Language Model (LLM)**: I am a type of artificial intelligence (AI) trained on a massive amount of text data"],null,null,[],"95564080768283418",[97639593,97511271,1714258,97639595],"codey_gemit_m_streaming"]Content-Length: 429

[[". I am designed to understand and generate human language, and can perform various tasks such as answering questions, summarizing text, translating languages, and even writing creative content.\n\n2. **My Knowledge is Vast but Limited**: I have been trained on a vast and diverse dataset of text and code, which gives me a wide"],null,null,[],"95564080768283418",[97511271,97639595,97639593,1714258],"codey_gemit_m_streaming"]Content-Length: 733

[[" range of knowledge on various topics. However, my knowledge is not exhaustive and may not be up-to-date on recent events or specific details.\n\n3. **I am Still Under Development**: While I have been trained extensively, I am still under development and continuously learning. I may sometimes make mistakes, misunderstand requests, or generate inaccurate information.\n\n4. **I am Not a Perfect Writer**: While I can generate text that is grammatically correct and coherent, I am not a perfect writer. My writing style may not be as creative or engaging as that of a human writer, and I may not always capture the intended tone or"],null,null,[],"95564080768283418",[97511271,97639595,97639593,1714258],"codey_gemit_m_streaming"]Content-Length: 1432

[[" nuance of a request.\n\n5. **I can Generate Creative Content**: In addition to answering factual questions and summarizing information, I can also generate creative content such as stories, poems, and song lyrics. However, it is important to note that the quality and originality of the generated content may vary.\n\n6. **I am Trained to be Inclusive and Unbiased**: My training data includes a diverse range of perspectives and identities. I am designed to be inclusive and unbiased in my responses, and to avoid perpetuating harmful stereotypes or promoting discrimination.\n\n7. **I am Constantly Learning and Improving**: I am continuously learning from my interactions with users and the feedback I receive. This helps me improve my accuracy, knowledge base, and ability to generate more relevant and helpful responses.\n\n8. **I am Not a Replacement for Human Experts**: While I can provide information and insights on a wide range of topics, I am not a replacement for human experts. It is always advisable to consult with a qualified professional for important decisions or matters that require specialized knowledge.\n\n9. **I am Here to Help**: I am designed to assist users with their tasks and answer their questions to the best of my ability. Whether you need help with research, creative writing, or simply want to"],null,null,[],"95564080768283418",[97639595,1714258,97511271,97639593],"codey_gemit_m_streaming"]Content-Length: 154

[[" chat, I am here to provide information and support."],null,null,[],"95564080768283418",[97511271,97639595,97639593,1714258],"codey_gemit_m_streaming"]
HanaokaYuzu commented 5 months ago

This is interesting. Looks like this api:

Not planning to add support to it in this repository though, it could be a backup plan :)

foremtehan commented 4 months ago

Is this working? i received <title>Error 401 (Unauthorized)!!</title> instead. i added my cookies btw.

0wwafa commented 4 months ago

Is this working? i received <title>Error 401 (Unauthorized)!!</title> instead. i added my cookies btw.

yes. it is.. perhaps you are doing something wrong or you must first go to colab and start gemini at least once... no idea.