From 3dc22548895718ffc7396227267ecbb4902b62f9 Mon Sep 17 00:00:00 2001 From: icebaker Date: Wed, 10 Jan 2024 20:05:48 -0300 Subject: improving markdown parser --- components/embedding.rb | 2 +- components/providers/openai.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'components') diff --git a/components/embedding.rb b/components/embedding.rb index f08ff3d..4dd2e6c 100644 --- a/components/embedding.rb +++ b/components/embedding.rb @@ -45,7 +45,7 @@ module NanoBot def self.clojure(source:, parameters:, values:, safety:) ensure_safety!(safety) - raise 'TODO: sandboxed Clojure through Babashka not implemented' if safety[:sandboxed] + raise 'Sandboxed Clojure not supported.' if safety[:sandboxed] raise 'invalid Clojure parameter name' if parameters.include?('injected-parameters') diff --git a/components/providers/openai.rb b/components/providers/openai.rb index e71f143..79b935e 100644 --- a/components/providers/openai.rb +++ b/components/providers/openai.rb @@ -140,7 +140,7 @@ module NanoBot begin @client.chat(parameters: Logic::OpenAI::Tokens.apply_policies!(cartridge, payload)) rescue StandardError => e - raise e.class, e.response[:body] if e.response && e.response[:body] + raise e.class, e.response[:body] if e.respond_to?(:response) && e.response && e.response[:body] raise e end @@ -148,7 +148,7 @@ module NanoBot begin result = @client.chat(parameters: Logic::OpenAI::Tokens.apply_policies!(cartridge, payload)) rescue StandardError => e - raise e.class, e.response[:body] if e.response && e.response[:body] + raise e.class, e.response[:body] if e.respond_to?(:response) && e.response && e.response[:body] raise e end -- cgit v1.2.3