Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,17 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: ['3.1', '3.2', '3.3', '3.4']
ruby-version: ['3.1', '3.2', '3.3', '3.4', 'jruby-head']
rails-version: ['rails-7.1', 'rails-7.2', 'rails-8.0']
exclude:
# Rails 8 requires Ruby 3.2+
- ruby-version: '3.1'
rails-version: 'rails-8.0'
# JRuby only supports up to 7.1 right now
- ruby-version: 'jruby-head'
rails-version: 'rails-8.0'
- ruby-version: 'jruby-head'
rails-version: 'rails-7.2'

steps:
- uses: actions/checkout@v4
Expand Down
8 changes: 6 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ gemspec

group :development do
gem 'appraisal'
gem 'async'
gem 'bundler', '>= 2.0'
gem 'codecov'
gem 'dotenv'
Expand All @@ -25,7 +24,12 @@ group :development do
gem 'rubocop-rspec'
gem 'simplecov', '>= 0.21'
gem 'simplecov-cobertura'
gem 'sqlite3'

# database drivers for MRI and JRuby
gem 'activerecord-jdbcsqlite3-adapter', platform: 'jruby'
gem 'jdbc-sqlite3', platform: 'jruby'
gem 'sqlite3', platform: 'mri'

gem 'vcr'
gem 'webmock', '~> 3.18'
gem 'yard', '>= 0.9'
Expand Down
4 changes: 3 additions & 1 deletion gemfiles/rails_7.1.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ group :development do
gem "rubocop-rspec"
gem "simplecov", ">= 0.21"
gem "simplecov-cobertura"
gem "sqlite3"
gem 'sqlite3', platform: 'mri'
gem 'jdbc-sqlite3', platform: 'jruby'
gem 'activerecord-jdbcsqlite3-adapter', platform: 'jruby'
gem "vcr"
gem "webmock", "~> 3.18"
gem "yard", ">= 0.9"
Expand Down
34 changes: 33 additions & 1 deletion gemfiles/rails_7.1.gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: ..
specs:
ruby_llm (1.3.0rc1)
ruby_llm (1.3.1)
base64
event_stream_parser (~> 1)
faraday (>= 1.10.0)
Expand Down Expand Up @@ -72,6 +72,11 @@ GEM
activemodel (= 7.1.5.1)
activesupport (= 7.1.5.1)
timeout (>= 0.4.0)
activerecord-jdbc-adapter (71.0-java)
activerecord (~> 7.1.3)
activerecord-jdbcsqlite3-adapter (71.0-java)
activerecord-jdbc-adapter (= 71.0)
jdbc-sqlite3 (~> 3.8, < 4)
activestorage (7.1.5.1)
actionpack (= 7.1.5.1)
activejob (= 7.1.5.1)
Expand Down Expand Up @@ -101,6 +106,7 @@ GEM
base64 (0.3.0)
benchmark (0.4.1)
bigdecimal (3.2.1)
bigdecimal (3.2.1-java)
builder (3.3.0)
childprocess (5.1.0)
logger (~> 1.5)
Expand All @@ -115,11 +121,13 @@ GEM
rexml
crass (1.0.6)
date (3.4.1)
date (3.4.1-java)
diff-lcs (1.6.2)
docile (1.4.1)
dotenv (3.1.8)
drb (2.2.3)
erb (5.0.1)
erb (5.0.1-java)
erubi (1.13.1)
event_stream_parser (1.0.0)
faraday (2.13.1)
Expand All @@ -138,18 +146,23 @@ GEM
concurrent-ruby (~> 1.1)
webrick (~> 1.7)
websocket-driver (~> 0.7)
ffi (1.17.2-java)
globalid (1.2.1)
activesupport (>= 6.1)
hashdiff (1.2.0)
i18n (1.14.7)
concurrent-ruby (~> 1.0)
iniparse (1.5.0)
io-console (0.8.0)
io-console (0.8.0-java)
irb (1.15.2)
pp (>= 0.6.0)
rdoc (>= 4.0.0)
reline (>= 0.4.2)
jar-dependencies (0.5.5)
jdbc-sqlite3 (3.46.1.1)
json (2.12.2)
json (2.12.2-java)
language_server-protocol (3.17.0.5)
lint_roller (1.1.0)
logger (1.7.0)
Expand Down Expand Up @@ -179,6 +192,9 @@ GEM
net-smtp (0.5.1)
net-protocol
nio4r (2.7.4)
nio4r (2.7.4-java)
nokogiri (1.18.8-java)
racc (~> 1.4)
nokogiri (1.18.8-x86_64-linux-gnu)
racc (~> 1.4)
overcommit (0.67.1)
Expand All @@ -196,11 +212,19 @@ GEM
pry (0.15.2)
coderay (~> 1.1)
method_source (~> 1.0)
pry (0.15.2-java)
coderay (~> 1.1)
method_source (~> 1.0)
spoon (~> 0.0)
psych (5.2.6)
date
stringio
psych (5.2.6-java)
date
jar-dependencies (>= 0.1.7)
public_suffix (6.0.2)
racc (1.8.1)
racc (1.8.1-java)
rack (3.1.15)
rack-session (2.1.1)
base64 (>= 0.1.0)
Expand Down Expand Up @@ -291,6 +315,8 @@ GEM
simplecov (~> 0.19)
simplecov-html (0.13.1)
simplecov_json_formatter (0.1.4)
spoon (0.0.6)
ffi
sqlite3 (2.6.0-x86_64-linux-gnu)
stringio (3.1.7)
thor (1.3.2)
Expand All @@ -311,20 +337,26 @@ GEM
websocket-driver (0.8.0)
base64
websocket-extensions (>= 0.1.0)
websocket-driver (0.8.0-java)
base64
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
yard (0.9.37)
zeitwerk (2.7.3)

PLATFORMS
universal-java-21
x86_64-linux

DEPENDENCIES
activerecord-jdbcsqlite3-adapter
appraisal
bundler (>= 2.0)
codecov
dotenv
ferrum
irb
jdbc-sqlite3
nokogiri
overcommit (>= 0.66)
pry (>= 0.14)
Expand Down
4 changes: 4 additions & 0 deletions spec/ruby_llm/chat_error_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@

it 'handles context length exceeded errors' do # rubocop:disable RSpec/ExampleLength,RSpec/MultipleExpectations
skip('Ollama does not throw an error for context length exceeded') if provider == :ollama

# Configure Psych to allow large input (JRuby's ext provider SnakeYAML has a low limit by default)
Psych::Parser.code_point_limit = 20_000_000 if Psych::Parser.respond_to?(:code_point_limit=)

# Create a huge conversation
massive_text = 'a' * 1_000_000

Expand Down