Module: Ace::LLM::Molecules::FormatHandlers
- Defined in:
- lib/ace/llm/molecules/format_handlers.rb
Overview
Format handlers for different output formats
Defined Under Namespace
Classes: Base, JSON, Markdown, Text
Class Method Summary collapse
-
.get_handler(format) ⇒ Base
Factory method to get format handler.
-
.supported_formats ⇒ Array<String>
Get list of supported formats.
Class Method Details
.get_handler(format) ⇒ Base
Factory method to get format handler
162 163 164 165 166 167 168 169 170 171 172 173 |
# File 'lib/ace/llm/molecules/format_handlers.rb', line 162 def self.get_handler(format) case format.to_s.downcase when "json" JSON.new when "markdown", "md" Markdown.new when "text", "txt" Text.new else raise Ace::LLM::Error, "Unsupported format: #{format}" end end |
.supported_formats ⇒ Array<String>
Get list of supported formats
177 178 179 |
# File 'lib/ace/llm/molecules/format_handlers.rb', line 177 def self.supported_formats ["json", "markdown", "text"] end |