summaryrefslogtreecommitdiff
path: root/logic/providers
diff options
context:
space:
mode:
authoricebaker <113217272+icebaker@users.noreply.github.com>2023-12-28 21:01:33 -0300
committerGitHub <noreply@github.com>2023-12-28 21:01:33 -0300
commit8b7b90c9601eb3d73ae443142aab2c9d8168cb62 (patch)
tree540270080c6cc6d61b6c2f81e9b70c81f0e60f28 /logic/providers
parent347ac029c922fbb3843ec22324527f2c6b3ba9a9 (diff)
parent94d7aa2b726a09abfac85f472eef8921d14c16a9 (diff)
Merge pull request #12 from icebaker/ib-mistral-ai
Adding support for Mistral AI and upgrading gemini-ai
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