Class: RcrewAI::Rails::KnowledgeSource

Inherits:
ApplicationRecord show all
Defined in:
app/models/rcrewai/rails/knowledge_source.rb

Constant Summary collapse

TYPE_MAP =
{
  "string" => RCrewAI::Knowledge::StringSource,
  "file"   => RCrewAI::Knowledge::FileSource,
  "pdf"    => RCrewAI::Knowledge::PdfSource,
  "csv"    => RCrewAI::Knowledge::CsvSource,
  "url"    => RCrewAI::Knowledge::UrlSource,
}.freeze

Instance Method Summary collapse

Instance Method Details

#to_rcrew_sourceObject

Maps this row to the matching core Source object.



22
23
24
# File 'app/models/rcrewai/rails/knowledge_source.rb', line 22

def to_rcrew_source
  TYPE_MAP.fetch(source_type).new(value)
end