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.



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

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.



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

def comment
  @comment
end

#config_idObject

Returns the value of attribute config_id.



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

def config_id
  @config_id
end

#data_typeObject

Returns the value of attribute data_type.



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

def data_type
  @data_type
end

#environmentObject

Returns the value of attribute environment.



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

def environment
  @environment
end

#idObject

Returns the value of attribute id.



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

def id
  @id
end

#nameObject

Returns the value of attribute name.



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

def name
  @name
end

#observation_idObject

Returns the value of attribute observation_id.



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

def observation_id
  @observation_id
end

#trace_idObject

Returns the value of attribute trace_id.



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

def trace_id
  @trace_id
end

#valueObject

Returns the value of attribute value.



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

def value
  @value
end

Instance Method Details

#to_hObject



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

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