Git Product home page Git Product logo

gemini-chat's Introduction

Terminal Gemini AI Chat

Use the terminal to interact with Google's Gemini AI.

Features

  • Runs on Windows, Mac, and Linux
  • Test command npm run test - Gemini will tell you a joke and explain it
    • The jokes are rarely funny, while the explanations often are
  • Chat command npm run chat - Activates the interactive chat prompt
    • Use cases: Ask a question, code review/help, write an article, research
    • Type 'exit' to quit, or press CTRL/CMD+C
  • Image command npm run img - Activates the image query and text prompt
    • Use cases: Captioning an image, identifying what an image is, or what's in an image
    • Add images (jpg, png, gif) to the /images/ directory, then select image(s) when prompted

First time use

When any command above is first used a prompt with ask you for your Google AI Studio API key.

To skip this step manually create a .env file, then add the API KEY variable with your Google AI Studio API Key.

API_KEY=your-api-key
TOKENS=500
TEMPERATURE=0.9
TOPP=0.95
TOPK=3

Tokens

By default max tokens is set to 500, which is about 35,000 words.

A token is equivalent to about 4 characters. 100 tokens are about 60-80 English words.

Requirements

  • API Key from Google AI Studio
  • Node.js version 20 and above
    • Check Node.js version: node --version
  • Git * Optional but recommended
    • Check Git version: git --version

Install and setup project

Do not share confidential or personal information with Gemini AI.

  1. Get an API Key from Google AI Studio
  2. Open a terminal
    • Windows: Right-click the Start button and select: Windows PowerShell
    • Mac: Command + Space to open Spotlight search, type in Terminal and select
    • Linux: Press CTRL + ALT + T simultaneously
  3. In the terminal change locations to store this project, such as cd ~/Documents
    • Optionally create a Projects directory instead of using the Documents directory
      • Make the Projects directory: mkdir ~/Projects
      • Change directories into Projects: cd ~/Projects
  4. 2 methods to setup the project
    • Method 1 (with Git): Clone the project into the current directory
      • Via HTTPS: git clone https://github.com/ChrisWinters/gemini-chat.git
      • Via SSH: git clone [email protected]:ChrisWinters/gemini-chat.git
      • Via CLI: gh repo clone ChrisWinters/gemini-chat
    • Method 2 (without Git): Use curl to quickly download the pre-packaged zip file into the current directory
      • Windows terminal type: curl, press enter, then copy/paste the following Uri: https://github.com/ChrisWinters/gemini-chat/raw/main/gemini-chat.zip
      • Mac/Linux terminal: curl -c -O https://github.com/ChrisWinters/gemini-chat/raw/main/gemini-chat.zip
      • Unzip the gemini-chat.zip file
        • Windows terminal: tar -xf gemini-chat.zip
        • Mac terminal: tar -xvf gemini-chat.zip
        • Linux terminal: tar -xzf gemini-chat.zip
      • Delete the zip file: rm gemini-chat.zip
  5. Change directories into the Gemini chat directory: cd gemini-chat
  6. Install build packages: npm install
  7. Run any of the commands

Personal Gemini Chat is now ready to use.

Commands

Command Script Description
npm install Install dependencies
npm run test node index.js --test Runs test prompt
npm run chat node index.js --chat Runs interactive chat prompt
npm run img node index.js --img Runs image query prompt

Credits

Disclaimer

Use at your own risk. The Gemini Chat script comes with ABSOLUTELY NO WARRANTY, NO GUARANTEES, NO MERCHANTABILITY, AND NO FITNESS FOR A PARTICULAR PURPOSE.

License

Distributed under Apache 2.0 License

gemini-chat's People

Contributors

chriswinters avatar

Watchers

 avatar

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.