Class: DSPy::Scores::ScoreEvent

Inherits:
T::Struct
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/dspy/scores/score_event.rb

Overview

Represents a score to be sent to Langfuse Immutable struct with all score attributes

Instance Method Summary collapse

Instance Method Details

#to_langfuse_payloadObject



40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/dspy/scores/score_event.rb', line 40

def to_langfuse_payload
  payload = {
    id: id,
    name: name,
    value: value,
    dataType: data_type.serialize
  }

  payload[:comment] = comment if comment
  payload[:traceId] = trace_id if trace_id
  payload[:observationId] = observation_id if observation_id

  payload
end