Class: Langchain::Processors::JSON

Inherits:
Base
  • Object
show all
Defined in:
lib/langchain/processors/json.rb

Constant Summary collapse

EXTENSIONS =
[".json"]
CONTENT_TYPES =
["application/json"]

Instance Method Summary collapse

Methods inherited from Base

#initialize

Methods included from DependencyHelper

#depends_on

Constructor Details

This class inherits a constructor from Langchain::Processors::Base

Instance Method Details

#parse(data) ⇒ Hash

Parse the document and return the text

Parameters:

  • data (File)

Returns:

  • (Hash)


12
13
14
# File 'lib/langchain/processors/json.rb', line 12

def parse(data)
  ::JSON.parse(data.read)
end