Git Product home page Git Product logo

oregpt's Introduction

oregpt

workflow license release python-version pypi

A tiny GPT CLI tool. You can chat with the GPT model developped by OpenAI and save the conversation as json.

Installation

Get your own OpenAI API Key

Assuming you have an environment variable with key named OPENAI_API_KEY. If you don't have a OpenAI API key visit here, generate one and add it as an environment variable

export OPENAI_API_KEY=<YOUR-OPENAI-API-KEY>

Instal from PyPI

You can install the package using pip:

$ pip install oregpt

Usage

Once you have installed oregpt, you can run it by typing:

$ oregpt

There are a few options:

$ oregpt --help
Usage: oregpt [OPTIONS]

Options:
  -V, -v, --version          Show the version and exit.
  -m, --model_name TEXT      Model name in OpenAI (e.g, gpt-3.5-turbo, gpt-4)
  -a, --assistant_role TEXT  Role setting for Assistant (AI)
  --help                     Show this message and exit.

Supported commands on chat

Commands such as saving and loading conversations are available as the following:

Command Description
/exit Exit from this chat tool
/quit Exit from this chat tool
/q Exit from this chat tool
/clear Clear chat history all
/history Show chat history in json format
/save Save chat history in json format
/load Load chat history from a json file
/help Show all commands which you can use in this chat tool

Configuration

You can specify the place of conversation log, style (color etc) and the model supported in /v1/chat/completions endpoint provided by OpenAI in ~/.config/oregpt/config.yml

❯ cat ~/.config/oregpt/config.yml
log: /tmp/oregpt/
openai:
    model: gpt-3.5-turbo
# You can also specify OpenAI's API key here
#     api_key: <your-api-key>
character:
    user:
        name: Me
        style: "#00BEFE"
    assistant:
        name: AI
        style: "#87CEEB"
        role: "You are a chat bot"
    system:
        name: System
        style: "#cc0000"

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.