llama_bot_rails 0.1.15 → 0.1.16

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: 2980680620ba107e40e8a37a0c885904d48ef1c1e48a2fe1ccfffc59257e72dc
4
- data.tar.gz: fbab7ffd1aa4fd6c43568bda008094cb4c5341626284aea8b9c0c4fbf565fd82
3
+ metadata.gz: 93621d8c4169b4479c690d9b3fbbf003ef9a69d9e0d8ad64362dad9b4b3e6709
4
+ data.tar.gz: e815526acf98b6aed447a9b2d1851092136aef0cc6c7e0049b170f140197680f
5
5
  SHA512:
6
- metadata.gz: 5f445dd978190f9e987979322e24d18e70a364deaf07e521a6bb1b6e26ecd6b9e82448a0a48a08c22e83942ac7f711c4719444a1fd8f20b6098e9990c552fa4e
7
- data.tar.gz: 1453feba5f8148ce85afcfcf2401b5763e39d1893678b71bcdb693a13090638ce7ead883caa6bc18f83cc8ee792f3da9e0bd8d660cd6a31e51b7390a8eb78104
6
+ metadata.gz: 9a767e02e6a3814f85f500736f2400d2cdeec1ad2bee9125699f4382824e937ecdb9b4ba293c5d4871f52a35f3be229d3474aefafdf62ef83db1f4036a92533b
7
+ data.tar.gz: bc98a9176e24f04a2b04b2074430ee013b633bd0cf4c20d8b081bdd59caf68af24d77ee57a189c9e7e6ef4ee754e12a06ae6e1f3721b34d5ed1050d743c183ca
@@ -39,14 +39,17 @@ module LlamaBotRails
39
39
  begin
40
40
  stream_from "chat_channel_#{params[:session_id]}" # Public stream for session-based messages <- this is the channel we're subscribing to in _websocket.html.erb
41
41
  Rails.logger.info "[LlamaBot] Subscribed to chat channel with session ID: #{params[:session_id]}"
42
-
42
+ @agent_state_builder_class = params[:agent_state_builder_class]
43
+ if @agent_state_builder_class.blank? #defaults to the config file if not provided
44
+ @agent_state_builder_class = LlamaBotRails.config.state_builder_class || 'LlamaBotRails::AgentStateBuilder'
45
+ end
46
+
43
47
  @connection_id = SecureRandom.uuid
44
48
  Rails.logger.info "[LlamaBot] Created new connection with ID: #{@connection_id}"
45
49
  Rails.logger.info "[LlamaBot] Secure API token generated."
46
50
 
47
51
  # Use a begin/rescue block to catch thread creation errors
48
52
  begin
49
-
50
53
  @worker = Thread.new do
51
54
  Thread.current[:connection_id] = @connection_id
52
55
  Thread.current.abort_on_exception = true # This will help surface errors
@@ -174,8 +177,7 @@ module LlamaBotRails
174
177
  private
175
178
 
176
179
  def state_builder_class
177
- builder_class_name = LlamaBotRails.config.state_builder_class || 'LlamaBotRails::AgentStateBuilder'
178
-
180
+ builder_class_name = @agent_state_builder_class
179
181
  begin
180
182
  builder_class_name.constantize
181
183
  rescue NameError => e
@@ -1,3 +1,3 @@
1
1
  module LlamaBotRails
2
- VERSION = "0.1.15"
2
+ VERSION = "0.1.16"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: llama_bot_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.15
4
+ version: 0.1.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kody Kendall