https://github.com/aliyeysides/openai-quickstart-ruby
Ruby example app from the OpenAI API quickstart tutorial
https://github.com/aliyeysides/openai-quickstart-ruby
ai artificial-intelligence openai ruby sinatra tutorial
Last synced: about 10 hours ago
JSON representation
Ruby example app from the OpenAI API quickstart tutorial
- Host: GitHub
- URL: https://github.com/aliyeysides/openai-quickstart-ruby
- Owner: aliyeysides
- Created: 2022-05-08T00:13:47.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-01-25T16:09:55.000Z (about 2 years ago)
- Last Synced: 2024-01-25T17:32:25.208Z (about 2 years ago)
- Topics: ai, artificial-intelligence, openai, ruby, sinatra, tutorial
- Language: CSS
- Homepage: https://beta.openai.com/docs/quickstart
- Size: 8.79 KB
- Stars: 5
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# (Unofficial) OpenAI API Quickstart - Ruby example app
This is an example pet name generator app used in the OpenAI API [quickstart tutorial](https://beta.openai.com/docs/quickstart). It uses the [Sinatra](http://sinatrarb.com/) web framework. Check out the tutorial or follow the instructions below to get set up.
## Setup
1. If you don’t have Ruby `>=3.1.0` installed, I recommend you [install it with rbenv](https://github.com/rbenv/rbenv)
2. Clone this repository
3. Navigate into the project directory
```bash
$ cd openai-quickstart-ruby
```
4. Install the `bundler` gem
```bash
$ gem install bundler
```
5. Install the requirements
```bash
$ bundle install
```
6. Make a copy of the example environment variables file
```bash
$ cp .env.example .env
```
7. Add your [API key](https://beta.openai.com/account/api-keys) to the newly created `.env` file
8. Run the app
```bash
$ ruby app.rb
```
You should now be able to access the app at [http://localhost:4567](http://localhost:4567)! For the full context behind this example app, check out the [tutorial](https://beta.openai.com/docs/quickstart).