Class: Langchain::Processors::JSONL
- Defined in:
- lib/langchain/processors/jsonl.rb
Constant Summary collapse
- EXTENSIONS =
[".jsonl"]
- CONTENT_TYPES =
["application/jsonl", "application/json-lines", "application/jsonlines"]
Instance Method Summary collapse
-
#parse(data) ⇒ Array of Hash
Parse the document and return the text.
Methods inherited from Base
Methods included from DependencyHelper
Constructor Details
This class inherits a constructor from Langchain::Processors::Base
Instance Method Details
#parse(data) ⇒ Array of Hash
Parse the document and return the text
12 13 14 15 16 |
# File 'lib/langchain/processors/jsonl.rb', line 12 def parse(data) data.read.lines.map do |line| ::JSON.parse(line) end end |