summaryrefslogtreecommitdiff
path: root/logic/providers
diff options
context:
space:
mode:
Diffstat (limited to 'logic/providers')
-rw-r--r--logic/providers/google/tokens.rb2
-rw-r--r--logic/providers/mistral/tokens.rb14
-rw-r--r--logic/providers/openai/tokens.rb2
3 files changed, 14 insertions, 4 deletions
diff --git a/logic/providers/google/tokens.rb b/logic/providers/google/tokens.rb
index 3d5492f..0d74928 100644
--- a/logic/providers/google/tokens.rb
+++ b/logic/providers/google/tokens.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require 'openai'
-
module NanoBot
module Logic
module Google
diff --git a/logic/providers/mistral/tokens.rb b/logic/providers/mistral/tokens.rb
new file mode 100644
index 0000000..7aa64b7
--- /dev/null
+++ b/logic/providers/mistral/tokens.rb
@@ -0,0 +1,14 @@
+# frozen_string_literal: true
+
+module NanoBot
+ module Logic
+ module Mistral
+ module Tokens
+ def self.apply_policies!(_cartridge, payload)
+ payload[:messages] = payload[:messages].map { |message| message.except(:_meta) }
+ payload
+ end
+ end
+ end
+ end
+end
diff --git a/logic/providers/openai/tokens.rb b/logic/providers/openai/tokens.rb
index 60efa60..828b774 100644
--- a/logic/providers/openai/tokens.rb
+++ b/logic/providers/openai/tokens.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require 'openai'
-
module NanoBot
module Logic
module OpenAI