Class: RubyLLM::DownloadedFile
- Inherits:
-
String
- Object
- String
- RubyLLM::DownloadedFile
- Includes:
- Support::Inspectable
- Defined in:
- lib/ruby_llm/downloaded_file.rb
Overview
Constant Summary
Constants included from Support::Inspectable
Support::Inspectable::TRUNCATE_AT
Instance Method Summary collapse
-
#save(path) ⇒ Object
Writes the file bytes to
path, expanding it first. -
#to_blob ⇒ Object
Returns the raw file bytes as a String.
Methods included from Support::Inspectable
#full_inspect, #inspect, #pretty_print
Instance Method Details
#save(path) ⇒ Object
Writes the file bytes to path, expanding it first. Returns path.
file.save("report.pdf")
22 23 24 25 |
# File 'lib/ruby_llm/downloaded_file.rb', line 22 def save(path) File.binwrite(File.(path), to_blob) path end |
#to_blob ⇒ Object
Returns the raw file bytes as a String.
14 15 16 |
# File 'lib/ruby_llm/downloaded_file.rb', line 14 def to_blob to_s end |