Class: LLM::Repl::Status Private

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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.

Parameters:

  • provider (String, Symbol)


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

#textString 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.

Returns:

  • (String)


35
36
37
# File 'lib/llm/repl/status.rb', line 35

def text
  @text
end

Instance Method Details

#context_barString

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.

Returns:

  • (String)


20
21
22
23
24
25
# File 'lib/llm/repl/status.rb', line 20

def context_bar
  LLM::Repl::Bar.new(
    used: @agent.usage.total_tokens,
    total: @agent.context_window
  ).to_s
end

#costString

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.

Returns:

  • (String)


29
30
31
# File 'lib/llm/repl/status.rb', line 29

def cost
  "$#{@agent.cost}"
end