summaryrefslogtreecommitdiff
path: root/controllers
diff options
context:
space:
mode:
authoricebaker <icebaker@proton.me>2023-11-19 13:35:54 -0300
committericebaker <icebaker@proton.me>2023-11-19 13:35:54 -0300
commite89a1d57c49c94c16c37a8ee3a69b52a9e2b341b (patch)
treee82a7579534003f02de32d058f4a60d1d076240c /controllers
parentc470d63b169058d81f44569a5f1c4c1fb222279f (diff)
improving tool specifications
Diffstat (limited to 'controllers')
-rw-r--r--controllers/interfaces/repl.rb2
-rw-r--r--controllers/interfaces/tools.rb6
-rw-r--r--controllers/session.rb6
3 files changed, 6 insertions, 8 deletions
diff --git a/controllers/interfaces/repl.rb b/controllers/interfaces/repl.rb
index d4191b1..fd16ea6 100644
--- a/controllers/interfaces/repl.rb
+++ b/controllers/interfaces/repl.rb
@@ -37,8 +37,6 @@ module NanoBot
[proc { prompt }, proc { 'MISSING INPUT' }]
)
- Logic::Cartridge::Streaming.enabled?(cartridge, :repl)
-
Pry.commands.block_command(/(.*)/, 'handler') do |line|
session.print(prefix) unless prefix.nil?
session.evaluate_and_print(line, mode: 'repl')
diff --git a/controllers/interfaces/tools.rb b/controllers/interfaces/tools.rb
index d32afed..aa4fb61 100644
--- a/controllers/interfaces/tools.rb
+++ b/controllers/interfaces/tools.rb
@@ -10,7 +10,7 @@ module NanoBot
module Controllers
module Interfaces
module Tool
- def self.confirm(session, cartridge, mode, feedback)
+ def self.confirming(session, cartridge, mode, feedback)
yeses = Logic::Cartridge::Safety.yeses(cartridge)
default_answer = Logic::Cartridge::Safety.default_answer(cartridge)
dispatch_feedback(session, cartridge, mode, feedback)
@@ -52,7 +52,7 @@ module NanoBot
def self.dispatch_feedback(session, cartridge, mode, feedback)
enabled = Logic::Cartridge::Tools.feedback?(cartridge, mode.to_sym, feedback[:action].to_sym)
- enabled = true if feedback[:action].to_sym == :confirm
+ enabled = true if feedback[:action].to_sym == :confirming
return unless enabled
@@ -67,7 +67,7 @@ module NanoBot
else
message = "(#{feedback[:name]} #{feedback[:parameters].to_json})"
- message += " =>\n#{feedback[:output]}" if feedback[:action].to_sym == :response
+ message += " =>\n#{feedback[:output]}" if feedback[:action].to_sym == :responding
end
message = "#{adapter[:prefix]}#{message}#{adapter[:suffix]}"
diff --git a/controllers/session.rb b/controllers/session.rb
index b3cc7ef..378a11d 100644
--- a/controllers/session.rb
+++ b/controllers/session.rb
@@ -117,15 +117,15 @@ module NanoBot
needs_another_round = false
- @provider.evaluate(input, @cartridge) do |feedback|
+ @provider.evaluate(input, streaming, @cartridge) do |feedback|
needs_another_round = true if feedback[:needs_another_round]
updated_at = Time.now
if feedback[:interaction] &&
feedback.dig(:interaction, :meta, :tool, :action) &&
- feedback[:interaction][:meta][:tool][:action] == 'confirm'
- Interfaces::Tool.confirm(self, @cartridge, mode, feedback[:interaction][:meta][:tool])
+ feedback[:interaction][:meta][:tool][:action] == 'confirming'
+ Interfaces::Tool.confirming(self, @cartridge, mode, feedback[:interaction][:meta][:tool])
else
if feedback[:interaction] && feedback.dig(:interaction, :meta, :tool, :action)