Class: OllamaChat::TokenEstimator::Estimate
- Inherits:
-
Struct
- Object
- Struct
- OllamaChat::TokenEstimator::Estimate
- 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
-
#bytes ⇒ Object
Returns the value of attribute bytes.
-
#tokens ⇒ Object
Returns the value of attribute tokens.
Instance Method Summary collapse
-
#bytes_formatted ⇒ String
Returns the byte count as a formatted string.
-
#tokens_formatted ⇒ String
Returns the byte count in a formatted string (e.g., "1.2 KB").
Methods included from Utils::ValueFormatter
Instance Attribute Details
#bytes ⇒ Object
Returns the value of attribute bytes
13 14 15 |
# File 'lib/ollama_chat/token_estimator.rb', line 13 def bytes @bytes end |
#tokens ⇒ Object
Returns the value of attribute tokens
13 14 15 |
# File 'lib/ollama_chat/token_estimator.rb', line 13 def tokens @tokens end |
Instance Method Details
#bytes_formatted ⇒ String
Returns the byte count as a formatted string.
24 25 26 |
# File 'lib/ollama_chat/token_estimator.rb', line 24 def bytes_formatted format_bytes(bytes) end |
#tokens_formatted ⇒ String
Returns the byte count in a formatted string (e.g., "1.2 KB").
18 19 20 |
# File 'lib/ollama_chat/token_estimator.rb', line 18 def tokens_formatted format_tokens(tokens) end |