Code Monkey home page Code Monkey logo

cli-chatbot's Introduction

CLI Chatbot

A GPT-powered Command Line Interface (CLI) chatbot that allows users to interact with an AI assistant via the terminal. It displays the cost and tokens used for each response. To exit the chat, simply type "exit", "quit" or use control+c.

Features

  • Interactive conversation with a GPT-4 or GPT-3.5-turbo powered AI chatbot.
  • Customizable chatbot personality.
  • Colorful command-line interface for enhanced user experience.
  • Displays the cost and tokens used for each response.

Installation

Prerequisites

  • Python ^3.11

Steps

  1. Clone the repository and navigate to the project directory.
git clone [email protected]:sdevgill/cli-chatbot.git
cd cli-chatbot
  1. Install Poetry, a package manager for Python:
curl -sSL https://install.python-poetry.org | python3 -
  1. Install the required packages:
poetry install
  1. Create and add your OpenAI API key to the .env file:
cp .env.example .env

Usage

  1. Activate the virtual environment:
poetry shell
  1. Run the chatbot:
python app.py
  1. Type your messages to the chatbot and press Enter. The chatbot will respond with its AI-generated message.

  2. Optionally, customize the chatbot's personality using the --personality flag:

python app.py --personality "a knowledgeable and insightful teacher"
python app.py --personality "rude and sarcastic"
  1. Optionally, to see the full response object when exiting, use the --show-response argument:
python app.py --show-response
  1. To exit the chat, simply type "exit", "quit" or use control+c.

License

This project is licensed under the terms of the MIT License.

cli-chatbot's People

Contributors

sdevgill 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.