Class: Langfuse::Models::IngestionEvent
- Inherits:
-
Object
- Object
- Langfuse::Models::IngestionEvent
- Defined in:
- lib/langfuse/models/ingestion_event.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#id ⇒ Object
Returns the value of attribute id.
-
#metadata ⇒ Object
Returns the value of attribute metadata.
-
#timestamp ⇒ Object
Returns the value of attribute timestamp.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(type:, body:, metadata: nil) ⇒ IngestionEvent
constructor
A new instance of IngestionEvent.
- #to_h ⇒ Object
Constructor Details
#initialize(type:, body:, metadata: nil) ⇒ IngestionEvent
Returns a new instance of IngestionEvent.
8 9 10 11 12 13 14 |
# File 'lib/langfuse/models/ingestion_event.rb', line 8 def initialize(type:, body:, metadata: nil) @id = SecureRandom.uuid @type = type @timestamp = Time.now.utc.iso8601(3) # Millisecond precision @body = body @metadata = end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
6 7 8 |
# File 'lib/langfuse/models/ingestion_event.rb', line 6 def body @body end |
#id ⇒ Object
Returns the value of attribute id.
6 7 8 |
# File 'lib/langfuse/models/ingestion_event.rb', line 6 def id @id end |
#metadata ⇒ Object
Returns the value of attribute metadata.
6 7 8 |
# File 'lib/langfuse/models/ingestion_event.rb', line 6 def @metadata end |
#timestamp ⇒ Object
Returns the value of attribute timestamp.
6 7 8 |
# File 'lib/langfuse/models/ingestion_event.rb', line 6 def @timestamp end |
#type ⇒ Object
Returns the value of attribute type.
6 7 8 |
# File 'lib/langfuse/models/ingestion_event.rb', line 6 def type @type end |
Instance Method Details
#to_h ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/langfuse/models/ingestion_event.rb', line 16 def to_h { id: @id, type: @type, timestamp: @timestamp, body: @body.respond_to?(:to_h) ? @body.to_h : @body, metadata: @metadata }.compact end |