Class: Langfuse::Models::Score

Inherits:
Object
  • Object
show all
Defined in:
lib/langfuse/models/score.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Score

Returns a new instance of Score.



9
10
11
12
13
14
# File 'lib/langfuse/models/score.rb', line 9

def initialize(attributes = {})
  attributes.each do |key, value|
    send("#{key}=", value) if respond_to?("#{key}=")
  end
  @id ||= SecureRandom.uuid
end

Instance Attribute Details

#commentObject

Returns the value of attribute comment.



6
7
8
# File 'lib/langfuse/models/score.rb', line 6

def comment
  @comment
end

#config_idObject

Returns the value of attribute config_id.



6
7
8
# File 'lib/langfuse/models/score.rb', line 6

def config_id
  @config_id
end

#data_typeObject

Returns the value of attribute data_type.



6
7
8
# File 'lib/langfuse/models/score.rb', line 6

def data_type
  @data_type
end

#environmentObject

Returns the value of attribute environment.



6
7
8
# File 'lib/langfuse/models/score.rb', line 6

def environment
  @environment
end

#idObject

Returns the value of attribute id.



6
7
8
# File 'lib/langfuse/models/score.rb', line 6

def id
  @id
end

#nameObject

Returns the value of attribute name.



6
7
8
# File 'lib/langfuse/models/score.rb', line 6

def name
  @name
end

#observation_idObject

Returns the value of attribute observation_id.



6
7
8
# File 'lib/langfuse/models/score.rb', line 6

def observation_id
  @observation_id
end

#trace_idObject

Returns the value of attribute trace_id.



6
7
8
# File 'lib/langfuse/models/score.rb', line 6

def trace_id
  @trace_id
end

#valueObject

Returns the value of attribute value.



6
7
8
# File 'lib/langfuse/models/score.rb', line 6

def value
  @value
end

Instance Method Details

#to_hObject



16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/langfuse/models/score.rb', line 16

def to_h
  {
    id: @id,
    traceId: @trace_id,
    name: @name,
    value: @value,
    observationId: @observation_id,
    comment: @comment,
    dataType: @data_type,
    configId: @config_id,
    environment: @environment
  }.compact
end