Method: Langchain::Chunker::RecursiveText#initialize

Defined in:
lib/langchain/chunker/recursive_text.rb

#initialize(text, chunk_size: 1000, chunk_overlap: 200, separators: ["\n\n"]) ⇒ RecursiveText

Returns a new instance of RecursiveText.

Parameters:

  • text (String)
  • chunk_size (Integer) (defaults to: 1000)
  • chunk_overlap (Integer) (defaults to: 200)
  • separators (Array<String>) (defaults to: ["\n\n"])

18
19
20
21
22
23
# File 'lib/langchain/chunker/recursive_text.rb', line 18

def initialize(text, chunk_size: 1000, chunk_overlap: 200, separators: ["\n\n"])
  @text = text
  @chunk_size = chunk_size
  @chunk_overlap = chunk_overlap
  @separators = separators
end