Class: RosettAi::AiConfig::CostControls

Inherits:
Object
  • Object
show all
Defined in:
lib/rosett_ai/ai_config/cost_controls.rb

Overview

Advisory cost tier preferences for AI tool usage.

Cost controls are purely advisory — rosett-ai is a compiler, not a runtime. These preferences guide model selection and are compiled into engine-specific configuration hints.

Constant Summary collapse

TIERS =
['economy', 'standard', 'premium'].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(preferred_tier: 'standard', monthly_budget_note: nil) ⇒ CostControls

Returns a new instance of CostControls.

Parameters:

  • preferred_tier (String) (defaults to: 'standard')

    one of TIERS

  • monthly_budget_note (String, nil) (defaults to: nil)

    advisory budget note



20
21
22
23
24
25
# File 'lib/rosett_ai/ai_config/cost_controls.rb', line 20

def initialize(preferred_tier: 'standard', monthly_budget_note: nil)
  validate_tier!(preferred_tier)

  @preferred_tier = preferred_tier.freeze
  @monthly_budget_note = monthly_budget_note&.freeze
end

Instance Attribute Details

#monthly_budget_noteObject (readonly)

Returns the value of attribute monthly_budget_note.



16
17
18
# File 'lib/rosett_ai/ai_config/cost_controls.rb', line 16

def monthly_budget_note
  @monthly_budget_note
end

#preferred_tierObject (readonly)

Returns the value of attribute preferred_tier.



16
17
18
# File 'lib/rosett_ai/ai_config/cost_controls.rb', line 16

def preferred_tier
  @preferred_tier
end

Instance Method Details

#to_hHash

Returns serializable representation.

Returns:

  • (Hash)

    serializable representation



28
29
30
31
32
# File 'lib/rosett_ai/ai_config/cost_controls.rb', line 28

def to_h
  hash = { 'preferred_tier' => @preferred_tier }
  hash['monthly_budget_note'] = @monthly_budget_note if @monthly_budget_note
  hash
end