Class: LlmCostTracker::Integrations::Anthropic::BatchResultsCapture
- Inherits:
-
Object
- Object
- LlmCostTracker::Integrations::Anthropic::BatchResultsCapture
show all
- Includes:
- Enumerable
- Defined in:
- lib/llm_cost_tracker/integrations/anthropic.rb
Instance Method Summary
collapse
Constructor Details
Returns a new instance of BatchResultsCapture.
124
125
126
|
# File 'lib/llm_cost_tracker/integrations/anthropic.rb', line 124
def initialize(raw_stream)
@raw_stream = raw_stream
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name) ⇒ Object
141
142
143
144
145
|
# File 'lib/llm_cost_tracker/integrations/anthropic.rb', line 141
def method_missing(name, ...)
return super unless @raw_stream.respond_to?(name)
@raw_stream.public_send(name, ...)
end
|
Instance Method Details
#each(&block) ⇒ Object
128
129
130
131
132
133
134
135
|
# File 'lib/llm_cost_tracker/integrations/anthropic.rb', line 128
def each(&block)
return enum_for(:each) unless block
@raw_stream.each do |response|
LlmCostTracker::Integrations::Anthropic.record_batch_result(response)
block.call(response)
end
end
|
#respond_to_missing?(name, include_private = false) ⇒ Boolean
137
138
139
|
# File 'lib/llm_cost_tracker/integrations/anthropic.rb', line 137
def respond_to_missing?(name, include_private = false)
@raw_stream.respond_to?(name, include_private) || super
end
|