Skip to content

1.9.1

Latest

Choose a tag to compare

@crmne crmne released this 05 Nov 09:36
· 3 commits to main since this release

RubyLLM 1.9.1: Rails Namespaces, Vertex AI Auth & Anthropic Uploads ๐Ÿ›ค๏ธ๐Ÿ”

A focused patch release that keeps ActiveRecord integrations humming in namespaced apps, restores Anthropic uploads, and hardens Vertex AI auth while smoothing out MySQL migrations and attachment handling.

๐Ÿงญ Namespaced ActiveRecord Chats Keep Their Foreign Keys

acts_as_* helpers now accept explicit foreign key overrides, matching Railsโ€™ association API, so namespaced chats and tool calls work even when their FK column doesnโ€™t follow the default pattern.

class Support::Message < ActiveRecord::Base
  acts_as_message chat_class: "Support::Conversation",
                  chat_foreign_key: "conversation_id",
                  tool_call_class: "Support::ToolCall",
                  tool_calls_foreign_key: "support_tool_call_id"
end
  • Fixes the regression introduced in 1.8.x for engines and modularized apps.
  • Generators include the right foreign keys out of the box when you opt into namespaces.

๐Ÿš† Zeitwerk Eager Loading Behaves Outside Rails

The Railtie is now safely ignored during eager loading when Rails::Railtie isnโ€™t defined, preventing NameError crashes in gems and background workers that depend on RubyLLM but donโ€™t run inside Rails.

๐Ÿ“Ž Attachments Understand Uploaded Files

RubyLLM::Attachment detects ActionDispatch::Http::UploadedFile, Pathname, and Active Storage blobs automatically, preserving filenames and content types so file flows stay intact across providers.

attachment = RubyLLM::Attachment.new(params[:file])
attachment.filename # => original upload name
  • Normalizes MIME detection and rewinds IO sources for consistent encoding.
  • Anthropic uploads once again serialize local PDFs/images correctly after the 1.9.0 regression fix.

๐Ÿ” Vertex AI Auth Uses googleauth the Right Way

Swapped fetch_access_token! for apply when building Vertex AI headers, keeping compatibility with recent googleauth releases and avoiding token caching errors.

๐Ÿ—„๏ธ MySQL JSON Columns Skip Illegal Defaults

Rails generators detect MySQL adapters and omit default values for JSON columns, eliminating migration errors on Aurora/MySQL deployments.

๐Ÿงช Reliability Tweaks

Fresh specs cover RubyLLM::Utils coercion helpers so nested hashes and key transforms stay stable as we expand provider support.

Installation

gem "ruby_llm", "1.9.1"

Upgrading from 1.9.0

bundle update ruby_llm

Merged PRs

New Contributors

Full Changelog: 1.9.0...1.9.1