Class: Langchain::Data
- Inherits:
-
Object
- Object
- Langchain::Data
- Defined in:
- lib/langchain/data.rb
Overview
Abstraction for data loaded by a Loader
Instance Attribute Summary collapse
-
#source ⇒ String
readonly
URL or Path of the data source.
Instance Method Summary collapse
- #chunks(opts = {}) ⇒ Array<String>
-
#initialize(data, source: nil, chunker: Langchain::Chunker::Text) ⇒ Data
constructor
A new instance of Data.
- #value ⇒ String
Constructor Details
Instance Attribute Details
#source ⇒ String (readonly)
URL or Path of the data source
8 9 10 |
# File 'lib/langchain/data.rb', line 8 def source @source end |
Instance Method Details
#chunks(opts = {}) ⇒ Array<String>
25 26 27 |
# File 'lib/langchain/data.rb', line 25 def chunks(opts = {}) @chunker_klass.new(@data, **opts).chunks end |
#value ⇒ String
19 20 21 |
# File 'lib/langchain/data.rb', line 19 def value @data end |