Module: Ollama::Utils::FileArgument
- Defined in:
- lib/ollama/utils/file_argument.rb
Class Method Summary collapse
Class Method Details
.get_file_argument(prompt, default: nil) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/ollama/utils/file_argument.rb', line 4 def get_file_argument(prompt, default: nil) if prompt.present? && prompt.size < 2 ** 15 && File.basename(prompt).size < 2 ** 8 && File.exist?(prompt) then File.read(prompt) elsif prompt.present? prompt else default end end |