Module: LightGptProxy::Templates

Defined in:
lib/light_gpt_proxy/templates.rb,
lib/light_gpt_proxy/templates/ollama_template.rb,
lib/light_gpt_proxy/templates/copilot_template.rb,
lib/light_gpt_proxy/templates/open_ai_template.rb

Defined Under Namespace

Classes: CopilotTemplate, OllamaTemplate, OpenAiTemplate

Class Method Summary collapse

Class Method Details

.namesObject



13
14
15
16
17
# File 'lib/light_gpt_proxy/templates.rb', line 13

def self.names
  @names ||= constants.map(&:to_s)
                      .select { |n| n.end_with?('Template') && n != 'Template' }
                      .map { |n| n.gsub(/Template\z/, '').gsub(/([a-z\d])([A-Z])/, '\1_\2').downcase }.freeze
end

.template(name) ⇒ Object



11
# File 'lib/light_gpt_proxy/templates.rb', line 11

def self.template(name) = const_get("#{name.to_s.split('_').collect(&:capitalize).join}Template")