Project

gpt3

0.0
No commit activity in last 3 years
No release in over 3 years
An unofficial wrapper for using the GPT-3 Sandbox API in Ruby.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies
 Project Readme

gpt-3-gem

An easy interface for interacting with OpenAI from Ruby or Ruby on Rails.

Configuration

Setup is easy. Just set your OpenAI Secret Key in an OPENAI_SK environment variable.

export OPENAI_SK=<your key here>

Usage

To generate a prompt completion, use the Completion class. For example,

GPT3::Completion.create("Once upon a midnight dreary,",
  max_tokens: 512,
  engine: 'davinci',
  temperature: 0.5,
  n: 1,
  stop: nil
)

Please see OpenAI's docs for what each parameter does. You can also pass verbose: true for some debug output that prints the original prompt and params.