Class: RubyLLM::Tokenizer::Analysis

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#idsObject

Returns the value of attribute ids

Returns:

  • (Object)

    the current value of ids



5
6
7
# File 'lib/ruby_llm/tokenizer/analysis.rb', line 5

def ids
  @ids
end

#modelObject

Returns the value of attribute model

Returns:

  • (Object)

    the current value of model



5
6
7
# File 'lib/ruby_llm/tokenizer/analysis.rb', line 5

def model
  @model
end

#tokensObject

Returns the value of attribute tokens

Returns:

  • (Object)

    the current value of tokens



5
6
7
# File 'lib/ruby_llm/tokenizer/analysis.rb', line 5

def tokens
  @tokens
end

Instance Method Details

#countObject



6
7
8
# File 'lib/ruby_llm/tokenizer/analysis.rb', line 6

def count
  ids.size
end

#to_hObject



10
11
12
# File 'lib/ruby_llm/tokenizer/analysis.rb', line 10

def to_h
  { tokens: tokens, ids: ids, model: model, count: count }
end