Skip to content

Update ruby_llm gem as later versions now support Bedrock#14111

Draft
jamesspeake wants to merge 1 commit into
masterfrom
update-llm-gem
Draft

Update ruby_llm gem as later versions now support Bedrock#14111
jamesspeake wants to merge 1 commit into
masterfrom
update-llm-gem

Conversation

@jamesspeake

Copy link
Copy Markdown
Contributor

Noticed creating the local dev env was slow because we had pinned a git version of ruby_llm. So followed the advice of the comment in the code and changed it now that the releases support Bedrock as required.

Claude says: All releases are explicitly backward-compatible (1.16: "This release is backwards compatible"). The changes are additive or irrelevant to us:

  • v1.15 token-accounting normalization — the one change with an upgrade note. Only matters "if you display or store token counts directly." We don't — grep for .tokens/*_tokens/.usage came back empty.
  • Deprecated legacy on_* callbacks — we don't use any callbacks.
  • RubyLLM.paint, with_tools choice/calls, .cost helpers, new config options (faraday_adapter, deprecation_behavior, *_api_base) — all additive, none used by us.

Changelog

Technical

  • Update LLM gem

@jamesspeake jamesspeake marked this pull request as draft June 18, 2026 12:15
@jamesspeake

Copy link
Copy Markdown
Contributor Author

There is a test failure as office document types are now supported by the LLM - need to understand what the desired behaviour should actually be for us. @adessy maybe we can discuss as I think you know most about this.

Root cause: xlsx is now a supported attachment type - ruby_llm's attachment classifier gained a new :document category between your old pin (~1.12) and 1.16:

Old pin (1.12-era):
def type
return :image if image?
return :video if video?
return :audio if audio?
return :pdf if pdf?
return :text if text?
:unknown # ← xlsx landed here → rejected with UnsupportedAttachmentError
end

1.16:
def type
return :image if image?
return :video if video?
return :audio if audio?
return :pdf if pdf?
return :text if text?
return :document if document? # ← NEW
:unknown
end

DOCUMENT_EXTENSIONS = %w[doc docx dot key numbers odp ods odt pages pot pps ppt pptx rtf xls xlsx].freeze

So david.xlsx now matches document? (via that extension list) and is classified as a :document instead of :unknown. ruby_llm no longer rejects it, so RubyLLM::UnsupportedAttachmentError is never raised — hence "nothing was raised."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant