Socket
Book a DemoInstallSign in
Socket

bdd_openai

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bdd_openai

1.1.0
bundlerRubygems
Version published
Maintainers
1
Created
Source

BddOpenai

This gem is a personal exercise to get familiar with Ruby and Gem creating. gem Gem include only one top level namespace of TestOpenai which you can find all you need inside. Starting by creating an instance of BddOpenai::FileClient.

For this exercise, the client will provide wrapper to some of OpenAI File APIs. API doc can bbe found here:

  • https://platform.openai.com/docs/api-reference/files

Other reference links:

Installation

You can install the gem normally through RubyGems.org.

Install the gem and add to the application's Gemfile by executing:

$ bundle add bdd_openai

If bundler is not being used to manage dependencies, install the gem by executing:

$ gem install bdd_openai

Usage

Visit spec/bdd_openai/files/client_spec.rb for full sample code. Or:

You can direct interact with gem by:

require "bdd_openai"

client = BddOpenai::FileClient.new(ENV["OPENAI_API_KEY"])

client.list_files

client.upload_file("assistants", "spec/fixtures/sample.pdf")

client.delete_file("file-id")

client.retrieve_file("file-id")

Testing

  • Copy file .env.sample to .env and fill in your personal OpenAI API's key
  • Run
bundle install
rspec

Test coverage

The repository is integrated with SimpleCov to generate test coverage report. You can find the report at coverage/index.html after running the test.

test_coverage_screenshot

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/brendondaoateh/bdd_openai.

FAQs

Package last updated on 13 Dec 2023

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.