Class: Langfuse::Score
- Inherits:
-
Object
- Object
- Langfuse::Score
- 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) ⇒ Score
constructor
A new instance of Score.
- #to_dict ⇒ Object
Constructor Details
#initialize(data) ⇒ Score
Returns a new instance of Score.
35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/langfuse/evaluation.rb', line 35 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.
33 34 35 |
# File 'lib/langfuse/evaluation.rb', line 33 def comment @comment end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
33 34 35 |
# File 'lib/langfuse/evaluation.rb', line 33 def created_at @created_at end |
#data_type ⇒ Object (readonly)
Returns the value of attribute data_type.
33 34 35 |
# File 'lib/langfuse/evaluation.rb', line 33 def data_type @data_type end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
33 34 35 |
# File 'lib/langfuse/evaluation.rb', line 33 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
33 34 35 |
# File 'lib/langfuse/evaluation.rb', line 33 def name @name end |
#observation_id ⇒ Object (readonly)
Returns the value of attribute observation_id.
33 34 35 |
# File 'lib/langfuse/evaluation.rb', line 33 def observation_id @observation_id end |
#trace_id ⇒ Object (readonly)
Returns the value of attribute trace_id.
33 34 35 |
# File 'lib/langfuse/evaluation.rb', line 33 def trace_id @trace_id end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
33 34 35 |
# File 'lib/langfuse/evaluation.rb', line 33 def value @value end |
Instance Method Details
#to_dict ⇒ Object
48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/langfuse/evaluation.rb', line 48 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 |