Class: Ask::RAG::Loader::Base
- Inherits:
-
Object
- Object
- Ask::RAG::Loader::Base
- Defined in:
- lib/ask/rag/loader/base.rb
Instance Method Summary collapse
-
#lazy_load(path) ⇒ Enumerator<Ask::Document>
Load a file and return a lazy enumerator of documents.
-
#load(path) ⇒ Array<Ask::Document>
Load a file and return an array of Ask::Document objects.
Instance Method Details
#lazy_load(path) ⇒ Enumerator<Ask::Document>
Load a file and return a lazy enumerator of documents. Override in subclasses that support streaming.
21 22 23 |
# File 'lib/ask/rag/loader/base.rb', line 21 def lazy_load(path) load(path).each end |
#load(path) ⇒ Array<Ask::Document>
Load a file and return an array of Ask::Document objects. Subclasses implement #load to produce documents from a specific format.
12 13 14 |
# File 'lib/ask/rag/loader/base.rb', line 12 def load(path) raise NotImplementedError, "#{self.class} must implement #load" end |