Method: Langchain::Processors::JSONL#parse

Defined in:
lib/langchain/processors/jsonl.rb

#parse(data) ⇒ Array of Hash

Parse the document and return the text

Parameters:

  • data (File)

Returns:

  • (Array of Hash)
[View source]

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