Class: Langfuse::Models::Event
- Inherits:
-
Object
- Object
- Langfuse::Models::Event
- Defined in:
- lib/langfuse/models/event.rb
Instance Attribute Summary collapse
-
#environment ⇒ Object
Returns the value of attribute environment.
-
#id ⇒ Object
Returns the value of attribute id.
-
#input ⇒ Object
Returns the value of attribute input.
-
#level ⇒ Object
Returns the value of attribute level.
-
#metadata ⇒ Object
Returns the value of attribute metadata.
-
#name ⇒ Object
Returns the value of attribute name.
-
#output ⇒ Object
Returns the value of attribute output.
-
#parent_observation_id ⇒ Object
Returns the value of attribute parent_observation_id.
-
#start_time ⇒ Object
Returns the value of attribute start_time.
-
#status_message ⇒ Object
Returns the value of attribute status_message.
-
#trace_id ⇒ Object
Returns the value of attribute trace_id.
-
#version ⇒ Object
Returns the value of attribute version.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Event
constructor
A new instance of Event.
- #to_h ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ Event
Returns a new instance of Event.
11 12 13 14 15 16 17 |
# File 'lib/langfuse/models/event.rb', line 11 def initialize(attributes = {}) attributes.each do |key, value| send("#{key}=", value) if respond_to?("#{key}=") end @id ||= SecureRandom.uuid @start_time ||= Time.now.utc end |
Instance Attribute Details
#environment ⇒ Object
Returns the value of attribute environment.
7 8 9 |
# File 'lib/langfuse/models/event.rb', line 7 def environment @environment end |
#id ⇒ Object
Returns the value of attribute id.
7 8 9 |
# File 'lib/langfuse/models/event.rb', line 7 def id @id end |
#input ⇒ Object
Returns the value of attribute input.
7 8 9 |
# File 'lib/langfuse/models/event.rb', line 7 def input @input end |
#level ⇒ Object
Returns the value of attribute level.
7 8 9 |
# File 'lib/langfuse/models/event.rb', line 7 def level @level end |
#metadata ⇒ Object
Returns the value of attribute metadata.
7 8 9 |
# File 'lib/langfuse/models/event.rb', line 7 def @metadata end |
#name ⇒ Object
Returns the value of attribute name.
7 8 9 |
# File 'lib/langfuse/models/event.rb', line 7 def name @name end |
#output ⇒ Object
Returns the value of attribute output.
7 8 9 |
# File 'lib/langfuse/models/event.rb', line 7 def output @output end |
#parent_observation_id ⇒ Object
Returns the value of attribute parent_observation_id.
7 8 9 |
# File 'lib/langfuse/models/event.rb', line 7 def parent_observation_id @parent_observation_id end |
#start_time ⇒ Object
Returns the value of attribute start_time.
7 8 9 |
# File 'lib/langfuse/models/event.rb', line 7 def start_time @start_time end |
#status_message ⇒ Object
Returns the value of attribute status_message.
7 8 9 |
# File 'lib/langfuse/models/event.rb', line 7 def @status_message end |
#trace_id ⇒ Object
Returns the value of attribute trace_id.
7 8 9 |
# File 'lib/langfuse/models/event.rb', line 7 def trace_id @trace_id end |
#version ⇒ Object
Returns the value of attribute version.
7 8 9 |
# File 'lib/langfuse/models/event.rb', line 7 def version @version end |
Instance Method Details
#to_h ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/langfuse/models/event.rb', line 19 def to_h { id: @id, traceId: @trace_id, name: @name, startTime: @start_time&.iso8601(3), metadata: @metadata, input: @input, output: @output, level: @level, statusMessage: @status_message, parentObservationId: @parent_observation_id, version: @version, environment: @environment }.compact end |