Class: Langchain::Processors::CSV
- Defined in:
- lib/langchain/processors/csv.rb
Defined Under Namespace
Classes: InvalidChunkMode
Constant Summary collapse
- EXTENSIONS =
[".csv"]
- CONTENT_TYPES =
["text/csv"]
- CHUNK_MODE =
{ row: "row", file: "file" }
Instance Method Summary collapse
-
#parse(data) ⇒ String
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) ⇒ String
Parse the document and return the text
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/langchain/processors/csv.rb', line 20 def parse(data) case chunk_mode when CHUNK_MODE[:row] chunk_row(data) when CHUNK_MODE[:file] chunk_file(data) else raise InvalidChunkMode end end |