Skip to content

A CLI tool which utilizes Gemini 1.5 pro model to provide text-based responses and process context of last 50 messages using queue data structure

License

Notifications You must be signed in to change notification settings

ImonChakraborty/jynx-gemini-context-CLI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TextGenAI-on-CLI-with-gemini (Jynx)

     ____.                     
    |    |___.__. ____ ___  ___
    |    <   |  |/    \\  \/  /
/\__|    |\___  |   |  \>    < 
\________|/_____|___|__/__/\__\

This is a command-line tool for generating text using generative AI. It leverages the power of Gemini 1.5 pro, a versatile language model trained by Google, to create natural language text. It uses a JSON file to keep track of the last 50 prompts and responses using a simple FIFO (First In First Out) technique, specifically a queue data structure to keep track of context while keeping the valuable token limit under control while conversing.

Features

  • Text Generation: Generate creative and coherent text based on prompts.
  • Usage of chat history: Implementation of soft training data using chat history.
  • Context Awareness of last 50 conversations: Adjust parameters like temperature and max length for varied output.
  • CLI Interface: Easy-to-use command-line interface for quick and dynamic text generation with animation.

Installation

  1. Install Python (if not already installed).

  2. Clone this repository:

    git clone https://github.com/ImonChakraborty/jynx-gemini-context-CLI.git
    
  3. Install dependencies:

    pip install -r requirements.txt
    

Before You start using it

  • Get your API key: Go to https://aistudio.google.com/app/apikey and generate your api key.

  • Copy your API key: Paste Your API key. image

  • Change the Location of the history JSON File:

    1. For Windows:-

      image

    2. For Linux:-

      Screenshot_29-Jun_13-46-46_10500

  • Change it as per your use case: image

Usage

image

To access it from Terminal in Windows

  1. Open terminal:

    notepad $PROFILE
    

if it is not available, refer to this video: https://youtu.be/E5tMwtoTd30?si=U7kVp21rw834Omqs

  1. Paste this on $PROFILE:

    function jynx {python.exe "D:\programming\Python\TextGenAi.py" $args}
    
  2. Save the powershell profile config and now you can use it on terminal itself: image

To access it from Linux terminal

  1. Open terminal / Konsole / Kitty / Alacritty / whatever you use

  2. If you use bash:

    nano .bashrc
    
  3. If you use zsh:

    nano .zshrc
    
  4. Write:

    alias jynx="python Documents/TextGenAi.py"
    
  5. Save & exit, now you can use it natively like this: image

License

  • This project is licensed under the MIT License. See the LICENSE file for details.

Releases

No releases published

Packages

No packages published

Languages