Class: RCrewAI::Knowledge::CsvSource

Inherits:
Source
  • Object
show all
Defined in:
lib/rcrewai/knowledge/sources.rb

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ CsvSource

Returns a new instance of CsvSource.



49
50
51
52
# File 'lib/rcrewai/knowledge/sources.rb', line 49

def initialize(path)
  super()
  @path = path
end

Instance Method Details

#readObject



54
55
56
57
# File 'lib/rcrewai/knowledge/sources.rb', line 54

def read
  require 'csv'
  CSV.read(@path).map { |row| row.join(', ') }.join("\n")
end