Class: RubyLLM::Agents::Tracker Private

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_llm/agents/tracker.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.

Internal collector used by RubyLLM::Agents.track to accumulate Result objects produced during a tracked block.

Not part of the public API — users interact with TrackReport instead.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(defaults: {}, request_id: nil, tags: {}) ⇒ Tracker

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 a new instance of Tracker.



14
15
16
17
18
19
# File 'lib/ruby_llm/agents/tracker.rb', line 14

def initialize(defaults: {}, request_id: nil, tags: {})
  @results = []
  @defaults = defaults
  @request_id = request_id || generate_request_id
  @tags = tags
end

Instance Attribute Details

#defaultsObject (readonly)

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.



12
13
14
# File 'lib/ruby_llm/agents/tracker.rb', line 12

def defaults
  @defaults
end

#request_idObject (readonly)

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.



12
13
14
# File 'lib/ruby_llm/agents/tracker.rb', line 12

def request_id
  @request_id
end

#resultsObject (readonly)

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.



12
13
14
# File 'lib/ruby_llm/agents/tracker.rb', line 12

def results
  @results
end

#tagsObject (readonly)

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.



12
13
14
# File 'lib/ruby_llm/agents/tracker.rb', line 12

def tags
  @tags
end

Instance Method Details

#<<(result) ⇒ Object

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.



21
22
23
# File 'lib/ruby_llm/agents/tracker.rb', line 21

def <<(result)
  @results << result
end