summaryrefslogtreecommitdiffhomepage
path: root/lib/dispatch/adapter/base.rb
blob: dbd136a334f56dfc13685353129cd58eeef1debc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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: [])
        -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