Module: MagicQuery::Prompt::Templates
- Defined in:
- lib/magic_query/prompt/templates.rb
Class Method Summary collapse
Class Method Details
.base_prompt ⇒ Object
6 7 8 |
# File 'lib/magic_query/prompt/templates.rb', line 6 def self.base_prompt File.read(File.join(__dir__, 'base_prompt.txt')) end |
.format_rules(rules) ⇒ Object
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/magic_query/prompt/templates.rb', line 20 def self.format_rules(rules) return '' if rules.nil? || rules.empty? rules_text = "Database Rules and Conventions:\n\n" rules_text += format_naming_conventions(rules[:naming_conventions]) rules_text += format_relationships(rules[:relationships]) rules_text += format_business_rules(rules[:business_rules]) rules_text += format_table_rules(rules[:tables]) rules_text end |
.format_schema(schema) ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'lib/magic_query/prompt/templates.rb', line 10 def self.format_schema(schema) return '' if schema.nil? || schema.empty? schema_text = "Database Schema:\n\n" schema.each do |table_name, table_info| schema_text += format_table(table_name, table_info) end schema_text end |