Giter Site home page Giter Site logo

gpt-shell's Introduction

GPT Python Shell Wrapper

This is a Python script that interacts with ChatGPT's API to generate responses based on user inputs.

The script allows you to specify prompts for GPT-3 and receive responses from the model. Additionally, the script can be configured to add system prompts, such as formatting responses as Markdown, keeping responses short and concise, and responding sarcastically to user prompts.

Setting Up

Before running the script, make sure that you have installed the required dependencies, including argparse and openai.

You will also need an OpenAI API key to use the API. Once you have your API key, export it as an environment variable in your terminal using the following command:

export OPENAI_API_KEY="sk-XXXX"

Usage

To use the script, navigate to the directory containing the script in your terminal and run it using the following command:

./gpt.py "prompt"

Replace "prompt" with the prompt you want to ask GPT-3. You can also include multiple prompts by separating them with spaces.

The script also supports optional flags for formatting responses as Markdown and enabling verbose mode. To format responses as Markdown, use the "-md" flag. To enable verbose mode, use the "-v" flag.

Once the script is running, you can enter additional prompts to continue chatting with GPT-3. To end the session, enter an empty string.

Create a Shell Shortcut

To create a shell shortcut for the script, make the script executable using the following command:

chmod +x gpt.py

Then, create an alias in your shell configuration file (e.g. ~/.bashrc or ~/.zshrc) using the following command:

alias gpt="/path/to/gpt.py"

Replace "/path/to" with the path to the directory containing the script.

References

gpt-shell's People

Contributors

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