Ruby ChatGPT
CLI for interacting and conversing with OpenAI.
Stream text with GPT-3.5 from the command line! 🌊🤖
Demo for an article I wrote on my blog.
Installation
Install the gem:
$ gem install ruby-chatgpt
Usage
- Get your API key from https://platform.openai.com/account/api-keys.
- Set this value to the
OPENAI_API_KEY
environment variable.
Run the chatgpt
executable:
$ chatgpt
=> Enter a prompt (or "exit" to quit): What is the capital of Taiwan?
The capital of Taiwan is Taipei.
=> Enter a prompt (or "exit" to quit): How many people live in Taipei?
As an AI language model, I do not have access to real-time data. However, according to the United Nations, the estimated population of Taipei in 2021 is around 2.8 million.
=> Enter a prompt (or "exit" to quit):
Development
After checking out the repo, run bin/setup
to install dependencies. Then, run rake spec
to run the tests. You can also run bin/console
for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install
.
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/richo225/ruby-chatgpt. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.
License
The gem is available as open source under the terms of the MIT License.
Code of Conduct
Everyone interacting in the Ruby::Chatgpt project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.