Class: Agents::RunContext

Inherits:
Object
  • Object
show all
Defined in:
lib/agents/run_context.rb

Defined Under Namespace

Classes: Usage

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(context, callbacks: {}) ⇒ RunContext

Initialize a new RunContext with execution context and usage tracking



65
66
67
68
69
70
# File 'lib/agents/run_context.rb', line 65

def initialize(context, callbacks: {})
  @context = context
  @usage = Usage.new
  @callbacks = callbacks || {}
  @callback_manager = CallbackManager.new(@callbacks)
end

Instance Attribute Details

#callback_managerObject (readonly)

Returns the value of attribute callback_manager.



59
60
61
# File 'lib/agents/run_context.rb', line 59

def callback_manager
  @callback_manager
end

#callbacksObject (readonly)

Returns the value of attribute callbacks.



59
60
61
# File 'lib/agents/run_context.rb', line 59

def callbacks
  @callbacks
end

#contextObject (readonly)

Returns the value of attribute context.



59
60
61
# File 'lib/agents/run_context.rb', line 59

def context
  @context
end

#usageObject (readonly)

Returns the value of attribute usage.



59
60
61
# File 'lib/agents/run_context.rb', line 59

def usage
  @usage
end