llama_bot_rails 0.1.10 → 0.1.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a76c323b0d08220d2952ce3c1c3962dd203e645556123306fd9beb58c6ae17e6
4
- data.tar.gz: 9e7c143edb324d49097ddabad7006635027ea6150cb07407702110546f0503c0
3
+ metadata.gz: ab8f2052c6695abc545b10879f23262d1c444011c28aa60e035fe94e12e62e35
4
+ data.tar.gz: 21532f0afe7f6bf345da06b89e0e472d6e219eba9a3da0a5387a09a2f3ddbc39
5
5
  SHA512:
6
- metadata.gz: 232cd0a6410caffa47b25d0fd0e62a69ba9fdfdc779f7adc9ded2cab80879544dffc1de5a4a65e1dabfeadad6b4c0a5ff410d26d71e0ed44101ec9ab00ef0af2
7
- data.tar.gz: 730c59884b06bbb671955a2d128c31c6e6b85c24fe6b70120bb7d67af5249d88696eb7069d99689598ed35dc2aaa422626111fe8d3f6b154d2c68dde3d72cda6
6
+ metadata.gz: a4400caf025fb253e8734003046a8256d6dcd6862ef6ddc9b45a3ac7a0a016749ef77eccf5ed9b17d5310ed1029a98af4873737765471d17aa665e0f60c7865c
7
+ data.tar.gz: 5ee28cfaa7c097dcce2fd95490c3721643abc0600cdbb3bd591bb255a2d21c27558810f43194206a10ae4ea0de7ee1ec71e9c5c0c62defb731238751fc8f1dd5
@@ -532,7 +532,7 @@
532
532
  <div class="logo-container">
533
533
  <img src="https://service-jobs-images.s3.us-east-2.amazonaws.com/7rl98t1weu387r43il97h6ipk1l7" alt="LlamaBot Logo" class="logo">
534
534
  </div>
535
- <h1>LlamaBot Chat</h1>
535
+ <h1>Lenny the Llama</h1>
536
536
  </div>
537
537
  <button class="compose-button" onclick="startNewConversation()">
538
538
  <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
data/config/routes.rb CHANGED
@@ -1,6 +1,8 @@
1
1
  LlamaBotRails::Engine.routes.draw do
2
2
  post "agent/command", to: "agent#command"
3
3
  get "agent/chat", to: "agent#chat"
4
+ get "/", to: "agent#chat"
5
+ get "/ws", to: "agent#chat_ws"
4
6
  get "agent/chat_ws", to: "agent#chat_ws"
5
7
  get "agent/threads", to: "agent#threads"
6
8
  get "agent/chat-history/:thread_id", to: "agent#chat_history"
@@ -11,8 +11,8 @@ module LlamaBotRails
11
11
  end
12
12
 
13
13
  config.llama_bot_rails = ActiveSupport::OrderedOptions.new
14
- config.llama_bot_rails.websocket_url = 'ws://localhost:8000/ws' # <-- default
15
- config.llama_bot_rails.llamabot_api_url = "http://localhost:8000"
14
+ config.llama_bot_rails.websocket_url = ENV['LLAMABOT_WEBSOCKET_URL'] || 'ws://llamabot-backend:8000/ws' # <-- default for Docker Compose
15
+ config.llama_bot_rails.llamabot_api_url = ENV['LLAMABOT_API_URL'] || "http://llamabot-backend:8000" # <-- default for Docker Compose
16
16
  config.llama_bot_rails.enable_console_tool = true
17
17
 
18
18
  initializer "llama_bot_rails.assets.precompile" do |app|
@@ -6,7 +6,7 @@ module LlamaBotRails
6
6
  #This class is responsible for initiating HTTP requests to the FastAPI backend that takes us to LangGraph.
7
7
  class LlamaBot
8
8
  def self.get_threads
9
- uri = URI('http://localhost:8000/threads')
9
+ uri = URI("#{Rails.application.config.llama_bot_rails.llamabot_api_url}/threads")
10
10
  response = Net::HTTP.get_response(uri)
11
11
  JSON.parse(response.body)
12
12
  rescue => e
@@ -15,7 +15,7 @@ module LlamaBotRails
15
15
  end
16
16
 
17
17
  def self.get_chat_history(thread_id)
18
- uri = URI("http://localhost:8000/chat-history/#{thread_id}")
18
+ uri = URI("#{Rails.application.config.llama_bot_rails.llamabot_api_url}/chat-history/#{thread_id}")
19
19
  response = Net::HTTP.get_response(uri)
20
20
  JSON.parse(response.body)
21
21
  rescue => e
@@ -26,7 +26,7 @@ module LlamaBotRails
26
26
  def self.send_agent_message(agent_params)
27
27
  return enum_for(__method__, agent_params) unless block_given?
28
28
 
29
- uri = URI("http://localhost:8000/llamabot-chat-message")
29
+ uri = URI("#{Rails.application.config.llama_bot_rails.llamabot_api_url}/llamabot-chat-message")
30
30
  http = Net::HTTP.new(uri.host, uri.port)
31
31
 
32
32
  request = Net::HTTP::Post.new(uri)
@@ -0,0 +1,19 @@
1
+ module LlamaBotRails
2
+ class Railtie < ::Rails::Railtie
3
+ config.before_configuration do |app|
4
+ llama_bot_path = Rails.root.join("app", "llama_bot")
5
+
6
+ # Add to autoload paths if it exists and isn't already included
7
+ if llama_bot_path.exist? && !app.config.autoload_paths.include?(llama_bot_path.to_s)
8
+ app.config.autoload_paths << llama_bot_path.to_s
9
+ Rails.logger&.info "[LlamaBot] Added #{llama_bot_path} to autoload_paths"
10
+ end
11
+
12
+ # Add to eager load paths if it exists and isn't already included
13
+ if llama_bot_path.exist? && !app.config.eager_load_paths.include?(llama_bot_path.to_s)
14
+ app.config.eager_load_paths << llama_bot_path.to_s
15
+ Rails.logger&.info "[LlamaBot] Added #{llama_bot_path} to eager_load_paths"
16
+ end
17
+ end
18
+ end
19
+ end
@@ -1,3 +1,3 @@
1
1
  module LlamaBotRails
2
- VERSION = "0.1.10"
2
+ VERSION = "0.1.11"
3
3
  end
metadata CHANGED
@@ -1,13 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: llama_bot_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.10
4
+ version: 0.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kody Kendall
8
+ autorequire:
8
9
  bindir: bin
9
10
  cert_chain: []
10
- date: 1980-01-02 00:00:00.000000000 Z
11
+ date: 2025-07-11 00:00:00.000000000 Z
11
12
  dependencies:
12
13
  - !ruby/object:Gem::Dependency
13
14
  name: rails
@@ -129,6 +130,7 @@ files:
129
130
  - lib/llama_bot_rails/agent_state_builder.rb
130
131
  - lib/llama_bot_rails/engine.rb
131
132
  - lib/llama_bot_rails/llama_bot.rb
133
+ - lib/llama_bot_rails/railtie.rb
132
134
  - lib/llama_bot_rails/tools/rails_console_tool.rb
133
135
  - lib/llama_bot_rails/version.rb
134
136
  - lib/tasks/llama_bot_rails_tasks.rake
@@ -137,6 +139,7 @@ licenses:
137
139
  - MIT
138
140
  metadata:
139
141
  homepage_uri: https://llamapress.ai
142
+ post_install_message:
140
143
  rdoc_options: []
141
144
  require_paths:
142
145
  - lib
@@ -151,7 +154,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
151
154
  - !ruby/object:Gem::Version
152
155
  version: '0'
153
156
  requirements: []
154
- rubygems_version: 3.6.7
157
+ rubygems_version: 3.5.16
158
+ signing_key:
155
159
  specification_version: 4
156
160
  summary: LlamaBotRails is a gem that turns your existing Rails App into an AI Agent
157
161
  by connecting it to an open source LangGraph agent, LlamaBot.