
Company News
Socket Joins the OpenJS Foundation
Socket is proud to join the OpenJS Foundation as a Silver Member, deepening our commitment to the long-term health and security of the JavaScript ecosystem.
eh-openai
Advanced tools
Ruby interface for calling OpenAI Assistant APIs
TODO: Replace UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org.
Install the gem and add to the application's Gemfile by executing:
$ bundle add UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG
If bundler is not being used to manage dependencies, install the gem by executing:
$ gem install UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG
First, obtain an API key from https://platform.openai.com/api-keys.
require "openai"
client = OpenAI::AssistantClient.new(apiKey = 'API_KEY')
# Get list assistants
client.get_list_assistants
client.get_list_assistants(limit = 2, order = SortOrder::ASC)
# Get assistant details by assistant id
client.get_assistant_by_id('asst_NUocaU9L32vGuCEPwXdzA17Ya')
# Get assistant run status of thread id and run id
client.get_run_status_by_thead_id_and_run_id(thread_id = 'thread_r0UdZWKXGMAyLfGOAIYbHNka', run_id = 'step_44RuaZU4oe8naEUwC2mK7gGf')
# Get list thread message by thread id
client.get_list_messages_by_thread_id(thread_id = 'thread_r0UdZWKXGMAyLfGOAIYbHNka')
client.get_list_messages_by_thread_id(thread_id = 'thread_r0UdZWKXGMAyLfGOAIYbHNka', limit = 2, order = SortOrder::ASC)
The gem is available as open source under the terms of the MIT License.
Everyone interacting in the OpenaiAssistant project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.
FAQs
Unknown package
We found that eh-openai demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket is proud to join the OpenJS Foundation as a Silver Member, deepening our commitment to the long-term health and security of the JavaScript ecosystem.

Security News
npm now links to Socket's security analysis on every package page. Here's what you'll find when you click through.

Security News
A compromised npm publish token was used to push a malicious postinstall script in cline@2.3.0, affecting the popular AI coding agent CLI with 90k weekly downloads.