Class: Smith::Workflow::Composite::EffectsPreflight

Inherits:
Object
  • Object
show all
Extended by:
Dry::Initializer
Defined in:
lib/smith/workflow/composite/effects_preflight.rb

Instance Method Summary collapse

Instance Method Details

#callObject



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/smith/workflow/composite/effects_preflight.rb', line 23

def call
  next_total_tokens = total_tokens
  next_total_cost = total_cost
  next_usage = incoming_usage
  next_ledger = ledger
  next_tools = incoming_tools
  tool_results = baseline.tool_results + next_tools
  EffectsApplication.new(
    usage_entries: baseline.usage_entries + next_usage,
    tool_results:,
    total_tokens: next_total_tokens,
    total_cost: next_total_cost,
    ledger: next_ledger,
    baseline:
  )
end