Class: OllamaChat::TokenEstimator::Estimate

Inherits:
Struct
  • Object
show all
Includes:
Utils::ValueFormatter
Defined in:
lib/ollama_chat/token_estimator.rb

Overview

Represents the result of a calculation including raw values and their human-readable formatted strings.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Utils::ValueFormatter

#format_bytes, #format_tokens

Instance Attribute Details

#bytesObject

Returns the value of attribute bytes

Returns:

  • (Object)

    the current value of bytes



13
14
15
# File 'lib/ollama_chat/token_estimator.rb', line 13

def bytes
  @bytes
end

#tokensObject

Returns the value of attribute tokens

Returns:

  • (Object)

    the current value of tokens



13
14
15
# File 'lib/ollama_chat/token_estimator.rb', line 13

def tokens
  @tokens
end

Instance Method Details

#bytes_formattedString

Returns the byte count as a formatted string.

Returns:

  • (String)

    The formatted byte size.



24
25
26
# File 'lib/ollama_chat/token_estimator.rb', line 24

def bytes_formatted
  format_bytes(bytes)
end

#tokens_formattedString

Returns the byte count in a formatted string (e.g., "1.2 KB").

Returns:

  • (String)

    The formatted byte size.



18
19
20
# File 'lib/ollama_chat/token_estimator.rb', line 18

def tokens_formatted
  format_tokens(tokens)
end