summaryrefslogtreecommitdiffhomepage
path: root/lib/dispatch/adapter/interface/base.rb
diff options
context:
space:
mode:
authorAdam Malczewski <[email protected]>2026-04-28 14:11:16 +0900
committerAdam Malczewski <[email protected]>2026-04-28 14:11:16 +0900
commit07277435c0688ad9f5fa682633b86b99ef5bb854 (patch)
tree3e650e97bcbd229f942330542a333dcad1844542 /lib/dispatch/adapter/interface/base.rb
downloaddispatch-adapter-interface-07277435c0688ad9f5fa682633b86b99ef5bb854.tar.gz
dispatch-adapter-interface-07277435c0688ad9f5fa682633b86b99ef5bb854.zip
update
Diffstat (limited to 'lib/dispatch/adapter/interface/base.rb')
-rw-r--r--lib/dispatch/adapter/interface/base.rb31
1 files changed, 31 insertions, 0 deletions
diff --git a/lib/dispatch/adapter/interface/base.rb b/lib/dispatch/adapter/interface/base.rb
new file mode 100644
index 0000000..4b7a6ed
--- /dev/null
+++ b/lib/dispatch/adapter/interface/base.rb
@@ -0,0 +1,31 @@
+# frozen_string_literal: true
+
+module Dispatch
+ module Adapter
+ class Base
+ def chat(_messages, system: nil, tools: [], stream: false, max_tokens: nil, thinking: nil, &_block)
+ raise NotImplementedError, "#{self.class}#chat must be implemented"
+ end
+
+ def model_name
+ raise NotImplementedError, "#{self.class}#model_name must be implemented"
+ end
+
+ def count_tokens(_messages, system: nil, tools: []) # rubocop:disable Lint/UnusedMethodArgument
+ -1
+ end
+
+ def list_models
+ raise NotImplementedError, "#{self.class}#list_models must be implemented"
+ end
+
+ def provider_name
+ self.class.name
+ end
+
+ def max_context_tokens
+ nil
+ end
+ end
+ end
+end