module RubyLLM::FileStore::Converters::Office
Reads the text of Word documents, Excel workbooks, and PowerPoint decks (.docx, .xlsx, .pptx) on this machine, with no service and no cost: a paragraph per line, a table or sheet row per line with tabs between cells, and a heading for each sheet and slide, with a slideโs speaker notes under it. Excel dates read as dates, like 2026-03-31. Text comes back in document order, without layout or images.
Public Class Methods
Source
# File lib/ruby_llm/file_store/converters/office.rb, line 26 def call(attachment) kind = TYPES[attachment.mime_type] return unless kind send(kind, Zip.new(attachment.content.to_s.b)) rescue Zip::Error, Zlib::Error nil rescue StandardError => e RubyLLM.logger.warn { "Could not read an Office file: #{e.class}" } nil end
Returns the text of attachment, or nil when it is not a document, workbook, or deck it can read. A file it canโt read never raises.
Source
# File lib/ruby_llm/file_store/converters/office.rb, line 39 def local? true end
Returns true: it reads files on this machine, for free.