openai
openai copied to clipboard
Wrapper for calling OpenAI and GPT-3's HTTP APIs
**Motivation** We, at Vagas.com, are implementing a new feature and the "edits" endpoint will be required. One of our features uses "completions" to generate a text recommendation about a job...
``` OpenAI::Client.new(api_key: ENV.fetch("OPENAI_API_KEY"), default_engine: "gpt-3.5-turbo") res = openai_client.chat(prompt: prompt) Caused by OpenAI::Client::Error: This is a chat model and not supported in the v1/completions endpoint. Did you mean to use v1/chat/completions?...
Sample code, taken from README: ``` require 'openai' openai_client = OpenAI::Client.new(api_key: ENV.fetch("OPENAI_API_KEY"), default_engine: "ada") puts openai_client.engines ``` Error: ``` .gem/ruby/3.2.1/gems/openai-0.3.0/lib/openai/client.rb:30:in `initialize': unknown keywords: permissions, created (ArgumentError) Engine.new(**engine) ^^^^^^^^ ```