Project

pleasegpt

0.0
No release in over a year
A Ruby gem that provides a wrapper around the OpenAI API. It allows you to generate natural language text based on a given prompt.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 0.8.1
~> 2.8, >= 2.8.1
~> 2.1
~> 0.3.0
~> 13.0
~> 3.0
~> 1.21
 Project Readme

PleaseGPT

PleaseGPT is a Ruby gem that provides a simple wrapper around the OpenAI GPT-3 API. It allows you to generate natural language text based on a given prompt.

GitHub Workflow Status (with event) Gem

Requirements

A OpenAi API Key. Just go here, signup and create your key: https://platform.openai.com/account/api-keys.

Installation

To use PleaseGPT in your Ruby project, you can install it via Rubygems to use in your terminal:

gem install pleasegpt

# or add to your Gemfile:

gem 'pleasegpt'

Usage

If you gonna use special character in your input, use "your-input"

pleasegpt help                        # Show all commands
pleasegpt load-key                    # Save OpenAI key in a Env file. (Required)
pleasegpt "any text or question"      # Reply your request
pleasegpt -c "your question"          # When requesting a command, will reply only the command.
pleasegpt autocomplete "your-text"    # Complete your partial request
pleasegpt suggest "your-text"         # Suggest a new text based on your request

In your code

Once you have an API key loaded in the environment, you can use the PleaseGPT::Api.generate_text method to generate text based on a prompt:

require 'pleasegpt'

prompt = 'Explain Big O Notation for a 12 years old in less than 30 words'

response = PleaseGPT::Api.generate_text(prompt)
puts response

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/rafaover/pleasegpt. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor code of conduct.