Class: FactDb::Transformers::TextTransformer
- Defined in:
- lib/fact_db/transformers/text_transformer.rb
Overview
Transforms results into human-readable text format. Useful for direct LLM consumption or debugging.
Instance Method Summary collapse
-
#transform(results) ⇒ String
Transform results to text format.
Instance Method Details
#transform(results) ⇒ String
Transform results to text format.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/fact_db/transformers/text_transformer.rb', line 12 def transform(results) sections = [] # Entities section sections << format_entities_section(results) unless results.entities.empty? # Facts section sections << format_facts_section(results) unless results.facts.empty? if sections.empty? "No results found for query: #{results.query}" else sections.join("\n\n") end end |