Class: ActiveAgent::Delegation::Budget::Violation

Inherits:
Struct
  • Object
show all
Defined in:
lib/active_agent/delegation/budget.rb

Overview

A limit that has been reached.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#allowedObject

Returns the value of attribute allowed

Returns:

  • (Object)

    the current value of allowed



33
34
35
# File 'lib/active_agent/delegation/budget.rb', line 33

def allowed
  @allowed
end

#limitObject

Returns the value of attribute limit

Returns:

  • (Object)

    the current value of limit



33
34
35
# File 'lib/active_agent/delegation/budget.rb', line 33

def limit
  @limit
end

#usedObject

Returns the value of attribute used

Returns:

  • (Object)

    the current value of used



33
34
35
# File 'lib/active_agent/delegation/budget.rb', line 33

def used
  @used
end

Instance Method Details

#messageString

Returns wording aimed at the calling model, not at a developer.

Returns:

  • (String)

    wording aimed at the calling model, not at a developer



35
36
37
38
# File 'lib/active_agent/delegation/budget.rb', line 35

def message
  "Delegation budget exhausted (#{limit}: #{format_number(used)} of #{format_number(allowed)} used). " \
    "Do not retry this tool; answer with the information you already have."
end