Class: Ace::LLM::Molecules::FormatHandlers::Markdown
- Defined in:
- lib/ace/llm/molecules/format_handlers.rb
Overview
Markdown format handler
Instance Method Summary collapse
-
#format(response, **_options) ⇒ String
Format response as Markdown with YAML front matter.
Methods inherited from Base
#build_cost_summary, #format_cost, #generate_summary
Instance Method Details
#format(response, **_options) ⇒ String
Format response as Markdown with YAML front matter
131 132 133 134 135 136 137 138 139 140 141 142 143 144 |
# File 'lib/ace/llm/molecules/format_handlers.rb', line 131 def format(response, **) validate_response(response) = response[:metadata] || {} content = response[:text] if .empty? content else # Create YAML front matter yaml_front_matter = .to_yaml.chomp "#{yaml_front_matter}\n---\n\n#{content}" end end |