Skip to content

Commit 84b54b3

Browse files
committed
Rename RubyLlm to RubyLLM
1 parent 4d50117 commit 84b54b3

File tree

18 files changed

+44
-44
lines changed

18 files changed

+44
-44
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ RubyLLM.chat
136136
### Non-Rails Applications
137137

138138
```ruby
139-
RubyLlm::Template.configure do |config|
139+
RubyLLM::Template.configure do |config|
140140
config.template_directory = "/path/to/your/prompts"
141141
end
142142
```
@@ -146,7 +146,7 @@ end
146146
The gem automatically configures itself to use `Rails.root.join("app", "prompts")`, but you can override this in `config/initializers/ruby_llm_template.rb`:
147147

148148
```ruby
149-
RubyLlm::Template.configure do |config|
149+
RubyLLM::Template.configure do |config|
150150
config.template_directory = Rails.root.join("app", "ai_prompts")
151151
end
152152
```
@@ -249,7 +249,7 @@ The gem provides clear error messages for common issues:
249249
```ruby
250250
begin
251251
RubyLLM.chat.with_template(:extract_metadata).complete
252-
rescue RubyLlm::Template::Error => e
252+
rescue RubyLLM::Template::Error => e
253253
puts e.message
254254
# "Template 'extract_metadata' not found in /path/to/prompts"
255255
# "Schema file 'extract_metadata/schema.rb' found but RubyLLM::Schema gem is not installed"

examples/basic_usage.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
require_relative "../lib/ruby_llm/template"
88

99
# Configure template directory
10-
RubyLlm::Template.configure do |config|
10+
RubyLLM::Template.configure do |config|
1111
config.template_directory = File.join(__dir__, "prompts")
1212
end
1313

@@ -91,7 +91,7 @@ def to_json_schema
9191

9292
# Mock chat object that demonstrates the extension
9393
class MockChat
94-
include RubyLlm::Template::ChatExtension
94+
include RubyLLM::Template::ChatExtension
9595

9696
def initialize
9797
@messages = []
@@ -135,7 +135,7 @@ def complete
135135
document: "Q3 Financial Report: Revenue increased 15% to $2.3M. Key challenges include supply chain delays affecting Q4 projections.",
136136
additional_context: "Focus on financial metrics and future outlook",
137137
focus_areas: ["revenue", "challenges", "projections"]).complete
138-
rescue RubyLlm::Template::Error => e
138+
rescue RubyLLM::Template::Error => e
139139
puts "❌ Error: #{e.message}"
140140
end
141141

lib/generators/ruby_llm_template/install_generator.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
require "rails/generators"
44

5-
module RubyLlmTemplate
5+
module RubyLLMTemplate
66
module Generators
77
class InstallGenerator < Rails::Generators::Base
88
desc "Install RubyLLM Template system"
@@ -15,7 +15,7 @@ def create_initializer
1515
create_file "config/initializers/ruby_llm_template.rb", <<~RUBY
1616
# frozen_string_literal: true
1717
18-
RubyLlm::Template.configure do |config|
18+
RubyLLM::Template.configure do |config|
1919
# Set the directory where your prompts are stored
2020
# Default: Rails.root.join("app", "prompts")
2121
# config.template_directory = Rails.root.join("app", "prompts")

lib/ruby_llm/template.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# Rails not available
1414
end
1515

16-
module RubyLlm
16+
module RubyLLM
1717
module Template
1818
class Error < StandardError; end
1919

@@ -41,15 +41,15 @@ def self.reset_configuration!
4141

4242
module RubyLLMChatTemplateExtension
4343
def self.extended(base)
44-
base.extend(RubyLlm::Template::ChatExtension)
44+
base.extend(RubyLLM::Template::ChatExtension)
4545
end
4646
end
4747

4848
# Hook into RubyLLM.chat to extend the returned object
4949
module RubyLLMTemplateHook
5050
def chat(*args, **kwargs)
5151
chat_instance = super
52-
chat_instance.extend(RubyLlm::Template::ChatExtension)
52+
chat_instance.extend(RubyLLM::Template::ChatExtension)
5353
chat_instance
5454
end
5555
end

lib/ruby_llm/template/chat_extension.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# frozen_string_literal: true
22

3-
module RubyLlm
3+
module RubyLLM
44
module Template
55
module ChatExtension
66
def with_template(template_name, context = {})
7-
loader = RubyLlm::Template::Loader.new(template_name)
7+
loader = RubyLLM::Template::Loader.new(template_name)
88

99
unless loader.template_exists?
10-
raise RubyLlm::Template::Error, "Template '#{template_name}' not found in #{RubyLlm::Template.configuration.template_directory}"
10+
raise RubyLLM::Template::Error, "Template '#{template_name}' not found in #{RubyLLM::Template.configuration.template_directory}"
1111
end
1212

1313
# Apply templates in a specific order to maintain conversation flow

lib/ruby_llm/template/configuration.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# frozen_string_literal: true
22

3-
module RubyLlm
3+
module RubyLLM
44
module Template
55
class Configuration
66
attr_writer :template_directory

lib/ruby_llm/template/loader.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
# RubyLLM::Schema not available, schema.rb files won't work
1010
end
1111

12-
module RubyLlm
12+
module RubyLLM
1313
module Template
1414
class Loader
1515
SUPPORTED_ROLES = %w[system user assistant schema].freeze
1616

1717
def initialize(template_name, template_directory: nil)
1818
@template_name = template_name.to_s
19-
@template_directory = Pathname.new(template_directory || RubyLlm::Template.configuration.template_directory)
19+
@template_directory = Pathname.new(template_directory || RubyLLM::Template.configuration.template_directory)
2020
@template_path = @template_directory.join(@template_name)
2121
end
2222

lib/ruby_llm/template/railtie.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# frozen_string_literal: true
22

3-
module RubyLlm
3+
module RubyLLM
44
module Template
55
class Railtie < Rails::Railtie
66
initializer "ruby_llm_template.configure" do |app|
77
# Set default template directory for Rails applications
8-
RubyLlm::Template.configure do |config|
8+
RubyLLM::Template.configure do |config|
99
config.template_directory ||= app.root.join("app", "prompts")
1010
end
1111
end

lib/ruby_llm/template/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# frozen_string_literal: true
22

3-
module RubyLlm
3+
module RubyLLM
44
module Template
55
VERSION = "0.1.4"
66
end

ruby_llm-template.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ require_relative "lib/ruby_llm/template/version"
44

55
Gem::Specification.new do |spec|
66
spec.name = "ruby_llm-template"
7-
spec.version = RubyLlm::Template::VERSION
7+
spec.version = RubyLLM::Template::VERSION
88
spec.authors = ["Daniel Friis"]
99
spec.email = ["[email protected]"]
1010

0 commit comments

Comments
 (0)