Git Product home page Git Product logo

gemini2tg's Introduction

中文版说明

Gemini2TG

Gemini2TG is a project that deploys Google Gemini's API to a Telegram bot, giving you your own AI bot.

  1. This script integrates Google Gemini Pro and Google Gemini Pro Vision, eliminating the need for manual switching.
  2. When entering text, it uses Google Gemini Pro, and for image with text, it uses Gemini Pro Vision.
  3. Additionally, Google Gemini Pro supports contextual understanding.
  4. You can start a new chat when sending "/start" to your bot

Obtaining API Key

Before you start using Gemini2TG, you need to obtain a Google API key.

  1. Click here to get the Google Gemini API Get Google Gemini API.
  2. Click here to get the Telegram bot API Get Telegram bot API.

Installation and Configuration

Docker

wget -O setup.sh https://raw.githubusercontent.com/zhuchangyi/Gemini2tg/main/setup.sh && chmod +x setup.sh && ./setup.sh
wget -O Dockerfile https://raw.githubusercontent.com/zhuchangyi/Gemini2tg/main/Dockerfile
docker build -t gemini2tg .
docker run -v "$(pwd)/config.json:/app/config.json" gemini2tg

On system

I am using Ubuntu

wget -O gemini2tg.sh https://raw.githubusercontent.com/zhuchangyi/Gemini2tg/main/gemini2tg.sh && chmod +x gemini2tg.sh && ./gemini2tg.sh 

To stop running the script

SCRIPT_NAME="script.py"
PID=$(ps aux | grep $SCRIPT_NAME | grep -v "grep" | awk '{print $2}')
if [ -z "$PID" ]; then
    echo "Process not found."
else
    echo "Killing process with PID: $PID"
    sudo kill $PID
fi

Samples

vison test text test

gemini2tg's People

Contributors

zhuchangyi avatar

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

Watchers

 avatar

gemini2tg's Issues

error log

If there is something wrong while running the script:
check the log file under /Gemini2tg folder by using

cd Gemini2tg 
cat gemini2tg_install.log

The log shows the version of Python and pip lists
if you want to delete the script using:

sudo rm -rf Gemini2tg

Script error

At the end of the script we have an error and the robot does not work here is the error

" Python script downloaded successfully.
Gemini2tg is running in the background.
root@BoomieAIBOT:~# nohup: appending output to 'nohup.out'
nohup: appending output to 'nohup.out'
nohup: failed to run command 'python3.9': No such file or directory "

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.