summaryrefslogtreecommitdiff
path: root/logic/providers/cohere/tokens.rb
diff options
context:
space:
mode:
authoricebaker <icebaker@proton.me>2023-12-29 16:10:42 -0300
committericebaker <icebaker@proton.me>2023-12-29 16:10:42 -0300
commitd9a5079555d24a88f68a79dd84207e9cfb034e3c (patch)
tree0ac0593bee23a38062bc1af3e3e4c443dac24a8a /logic/providers/cohere/tokens.rb
parent91c635366bab160b81b2c1690234f97040d0d60b (diff)
adding support to cohere
Diffstat (limited to 'logic/providers/cohere/tokens.rb')
-rw-r--r--logic/providers/cohere/tokens.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/logic/providers/cohere/tokens.rb b/logic/providers/cohere/tokens.rb
new file mode 100644
index 0000000..f7d3f55
--- /dev/null
+++ b/logic/providers/cohere/tokens.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+module NanoBot
+ module Logic
+ module Cohere
+ module Tokens
+ def self.apply_policies!(_cartridge, payload)
+ if payload[:chat_history]
+ payload[:chat_history] = payload[:chat_history].map { |message| message.except(:_meta) }
+ end
+
+ payload
+ end
+ end
+ end
+ end
+end