diff options
author | icebaker <icebaker@proton.me> | 2023-12-15 08:04:27 -0300 |
---|---|---|
committer | icebaker <icebaker@proton.me> | 2023-12-15 08:04:27 -0300 |
commit | fef3d5b3b2f823999fae68276382fe33872350c4 (patch) | |
tree | f41758bcc6c9e7e5805269afe4104a636dc17baa /logic/cartridge | |
parent | b9a22a449d33d254f2c1a7f3d2196712ff6d9b8a (diff) |
improving provider options
Diffstat (limited to 'logic/cartridge')
-rw-r--r-- | logic/cartridge/streaming.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/logic/cartridge/streaming.rb b/logic/cartridge/streaming.rb index a0f8700..6949b3a 100644 --- a/logic/cartridge/streaming.rb +++ b/logic/cartridge/streaming.rb @@ -7,7 +7,14 @@ module NanoBot module Cartridge module Streaming def self.enabled?(cartridge, interface) - return false if Helpers::Hash.fetch(cartridge, %i[provider settings stream]) == false + provider_stream = case Helpers::Hash.fetch(cartridge, %i[provider id]) + when 'openai' + Helpers::Hash.fetch(cartridge, %i[provider settings stream]) + when 'google' + Helpers::Hash.fetch(cartridge, %i[provider options stream]) + end + + return false if provider_stream == false specific_interface = Helpers::Hash.fetch(cartridge, [:interfaces, interface, :output, :stream]) |