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 +4 -4
- data/app/channels/llama_bot_rails/chat_channel.rb +6 -4
- data/lib/llama_bot_rails/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 93621d8c4169b4479c690d9b3fbbf003ef9a69d9e0d8ad64362dad9b4b3e6709
|
4
|
+
data.tar.gz: e815526acf98b6aed447a9b2d1851092136aef0cc6c7e0049b170f140197680f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 =
|
178
|
-
|
180
|
+
builder_class_name = @agent_state_builder_class
|
179
181
|
begin
|
180
182
|
builder_class_name.constantize
|
181
183
|
rescue NameError => e
|