Class: Langfuse::Evaluation
- Inherits:
-
Object
- Object
- Langfuse::Evaluation
- Defined in:
- lib/langfuse/evaluation.rb
Instance Attribute Summary collapse
-
#comment ⇒ Object
readonly
Returns the value of attribute comment.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#data_type ⇒ Object
readonly
Returns the value of attribute data_type.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#observation_id ⇒ Object
readonly
Returns the value of attribute observation_id.
-
#trace_id ⇒ Object
readonly
Returns the value of attribute trace_id.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(data) ⇒ Evaluation
constructor
A new instance of Evaluation.
- #to_dict ⇒ Object
Constructor Details
#initialize(data) ⇒ Evaluation
Returns a new instance of Evaluation.
5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/langfuse/evaluation.rb', line 5 def initialize(data) @data = data.is_a?(Hash) ? Utils.deep_symbolize_keys(data) : data @id = @data[:id] @name = @data[:name] @value = @data[:value] @data_type = @data[:data_type] @comment = @data[:comment] @trace_id = @data[:trace_id] @observation_id = @data[:observation_id] @created_at = @data[:created_at] end |
Instance Attribute Details
#comment ⇒ Object (readonly)
Returns the value of attribute comment.
3 4 5 |
# File 'lib/langfuse/evaluation.rb', line 3 def comment @comment end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
3 4 5 |
# File 'lib/langfuse/evaluation.rb', line 3 def created_at @created_at end |
#data_type ⇒ Object (readonly)
Returns the value of attribute data_type.
3 4 5 |
# File 'lib/langfuse/evaluation.rb', line 3 def data_type @data_type end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
3 4 5 |
# File 'lib/langfuse/evaluation.rb', line 3 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/langfuse/evaluation.rb', line 3 def name @name end |
#observation_id ⇒ Object (readonly)
Returns the value of attribute observation_id.
3 4 5 |
# File 'lib/langfuse/evaluation.rb', line 3 def observation_id @observation_id end |
#trace_id ⇒ Object (readonly)
Returns the value of attribute trace_id.
3 4 5 |
# File 'lib/langfuse/evaluation.rb', line 3 def trace_id @trace_id end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
3 4 5 |
# File 'lib/langfuse/evaluation.rb', line 3 def value @value end |
Instance Method Details
#to_dict ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/langfuse/evaluation.rb', line 18 def to_dict { id: @id, name: @name, value: @value, data_type: @data_type, comment: @comment, trace_id: @trace_id, observation_id: @observation_id, created_at: @created_at }.compact end |