Skip to content

indentlabs/gpt3-gem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

A Ruby wrapper for using the GPT-3 API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages