class RubyLLM::Attachment

An Attachment is a file sent to the model alongside a message. The source can be a local path, an http(s) URL, an IO-like object, an ActiveStorage object, or a provider-managed UploadedFile. Chat#ask builds attachments for you from its with: option:

chat.ask "What's in this image?", with: "ruby_conf.jpg"

Build one explicitly to return a file from a Tool:

RubyLLM::Attachment.new(doc.download_path)