Registry / http-client / ruby-openai

ruby-openai

JSON →
library8.3.0rbrubygemsunverified

A Ruby client for the OpenAI API.

gem install ruby-openai
INSTALL
IMPORT
SIG · RUBY-OPENAI
R
ruby-openai
http-clientrubyv8.3.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

OpenAI
require 'ruby-openai'

Send a chat completion request to OpenAI.

require 'ruby-openai' client = OpenAI::Client.new(access_token: ENV['OPENAI_API_KEY']) response = client.chat(parameters: { model: 'gpt-3.5-turbo', messages: [{ role: 'user', content: 'Hello!' }] }) puts response.dig('choices', 0, 'message', 'content')
Debug
Known issues

No known issues recorded.

Upgrade
Version history
8.3.0latest on RubyGems
Audit
Dependencies

No dependency data recorded yet.

Agent activity
15 hits · last 30 days
node
14
Resources
ruby-openai — gem install ruby-openai · libregistry