Class: LLM::Repl::Status Private
- Inherits:
-
Object
- Object
- LLM::Repl::Status
- Defined in:
- lib/llm/repl/status.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
The LLM::Repl::Status class stores the small status line shown at the top of the REPL.
Instance Attribute Summary collapse
- #text ⇒ String (also: #to_s) private
Instance Method Summary collapse
- #context_bar ⇒ String private
- #cost ⇒ String private
- #initialize(agent) ⇒ LLM::Repl::Status constructor private
Constructor Details
#initialize(agent) ⇒ LLM::Repl::Status
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
12 13 14 15 16 |
# File 'lib/llm/repl/status.rb', line 12 def initialize(agent) @agent = agent @provider = agent.llm.name @text = "idle" end |
Instance Attribute Details
#text ⇒ String Also known as: to_s
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
35 36 37 |
# File 'lib/llm/repl/status.rb', line 35 def text @text end |
Instance Method Details
#context_bar ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
20 21 22 23 24 25 |
# File 'lib/llm/repl/status.rb', line 20 def LLM::Repl::Bar.new( used: @agent.usage.total_tokens, total: @agent.context_window ).to_s end |
#cost ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
29 30 31 |
# File 'lib/llm/repl/status.rb', line 29 def cost "$#{@agent.cost}" end |