Class: Langfuse::ItemResult
- Inherits:
-
Object
- Object
- Langfuse::ItemResult
- Defined in:
- lib/langfuse/item_result.rb
Overview
Result of processing a single item in an experiment run
Captures the task output, associated trace, evaluations, and any errors for one dataset item or data hash processed by ExperimentRunner.
Instance Attribute Summary collapse
- #error ⇒ DatasetItemClient, ... readonly
- #evaluations ⇒ DatasetItemClient, ... readonly
- #item ⇒ DatasetItemClient, ... readonly
- #observation_id ⇒ DatasetItemClient, ... readonly
- #output ⇒ DatasetItemClient, ... readonly
- #trace_id ⇒ DatasetItemClient, ... readonly
Instance Method Summary collapse
-
#failed? ⇒ Boolean
True if the task raised an error.
-
#initialize(item:, output: nil, trace_id: nil, observation_id: nil, evaluations: [], error: nil) ⇒ ItemResult
constructor
A new instance of ItemResult.
-
#success? ⇒ Boolean
True if the task completed without error.
Constructor Details
#initialize(item:, output: nil, trace_id: nil, observation_id: nil, evaluations: [], error: nil) ⇒ ItemResult
Returns a new instance of ItemResult.
32 33 34 35 36 37 38 39 |
# File 'lib/langfuse/item_result.rb', line 32 def initialize(item:, output: nil, trace_id: nil, observation_id: nil, evaluations: [], error: nil) @item = item @output = output @trace_id = trace_id @observation_id = observation_id @evaluations = evaluations @error = error end |
Instance Attribute Details
#error ⇒ DatasetItemClient, ... (readonly)
24 25 26 |
# File 'lib/langfuse/item_result.rb', line 24 def error @error end |
#evaluations ⇒ DatasetItemClient, ... (readonly)
24 25 26 |
# File 'lib/langfuse/item_result.rb', line 24 def evaluations @evaluations end |
#item ⇒ DatasetItemClient, ... (readonly)
24 25 26 |
# File 'lib/langfuse/item_result.rb', line 24 def item @item end |
#observation_id ⇒ DatasetItemClient, ... (readonly)
24 25 26 |
# File 'lib/langfuse/item_result.rb', line 24 def observation_id @observation_id end |
#output ⇒ DatasetItemClient, ... (readonly)
24 25 26 |
# File 'lib/langfuse/item_result.rb', line 24 def output @output end |
#trace_id ⇒ DatasetItemClient, ... (readonly)
24 25 26 |
# File 'lib/langfuse/item_result.rb', line 24 def trace_id @trace_id end |
Instance Method Details
#failed? ⇒ Boolean
Returns true if the task raised an error.
45 |
# File 'lib/langfuse/item_result.rb', line 45 def failed? = !success? |
#success? ⇒ Boolean
Returns true if the task completed without error.
42 |
# File 'lib/langfuse/item_result.rb', line 42 def success? = error.nil? |