Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ai-engine

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ai-engine

  • 0.4.2
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

AI::Engine

AI::Engine is the fastest way to get AI Assistants into your Rails app! It's a Rails Engine which sets up everything you need to start streaming from OpenAI Assistants in your Rails app.

Full docs can be found at RailsAI.com.

A demo app can be found here.

Usage

You can add AI::Engine to your Gemfile like this:

gem "ai-engine", "~> 0.3.0"

You then need to add the migrations for the gem:

bundle exec rails ai_engine:install:migrations

And run them:

bundle exec rails db:migrate

Full docs can be found at RailsAI.com.

Engine Development

Test local version in a Rails app

gem "ai-engine", path: "../ai-engine"

ENV

The dummy app needs a .env file in the root of the engine for manual and RSpec testing - see .env.example.

Dummy app

Run the dummy app from the root of the project with bin/dev in one tab and bin/rails s in another (so debugger will work).

Tests

Run the tests from the root of the project with rspec.

VCR

AI::Engine uses VCR to record HTTP requests and responses. By default, specs are run against recorded 'cassette' fixtures.

Set OPENAI_ACCESS_TOKEN= in your .env file to run the specs against a live API and re-record all cassettes - this will cost you money!

Release

First run the specs without VCR so they actually hit the API. This will cost 2 cents or more. Set OPENAI_ACCESS_TOKEN in your environment or pass it in like this:

OPENAI_ACCESS_TOKEN=123abc bundle exec rspec

Then update the version number in version.rb, update CHANGELOG.md, run bundle install to update Gemfile.lock, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

FAQs

Package last updated on 19 Sep 2024

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc