Class: RubyLLM::Tokenizer::Registry::Entry

Inherits:
Struct
  • Object
show all
Defined in:
lib/ruby_llm/tokenizer/registry.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#backendObject

Returns the value of attribute backend

Returns:

  • (Object)

    the current value of backend



12
13
14
# File 'lib/ruby_llm/tokenizer/registry.rb', line 12

def backend
  @backend
end

#matchObject

Returns the value of attribute match

Returns:

  • (Object)

    the current value of match



12
13
14
# File 'lib/ruby_llm/tokenizer/registry.rb', line 12

def match
  @match
end

#optionsObject

Returns the value of attribute options

Returns:

  • (Object)

    the current value of options



12
13
14
# File 'lib/ruby_llm/tokenizer/registry.rb', line 12

def options
  @options
end

Instance Method Details

#matches?(model) ⇒ Boolean

Returns:

  • (Boolean)


13
14
15
16
17
18
19
# File 'lib/ruby_llm/tokenizer/registry.rb', line 13

def matches?(model)
  case match
  when Regexp then match.match?(model.to_s)
  when String then match == model.to_s
  else false
  end
end