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.
9 10 11 12 13 14 15 |
# File 'lib/langfuse/models/ingestion_event.rb', line 9 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.
7 8 9 |
# File 'lib/langfuse/models/ingestion_event.rb', line 7 def body @body end |
#id ⇒ Object
Returns the value of attribute id.
7 8 9 |
# File 'lib/langfuse/models/ingestion_event.rb', line 7 def id @id end |
#metadata ⇒ Object
Returns the value of attribute metadata.
7 8 9 |
# File 'lib/langfuse/models/ingestion_event.rb', line 7 def @metadata end |
#timestamp ⇒ Object
Returns the value of attribute timestamp.
7 8 9 |
# File 'lib/langfuse/models/ingestion_event.rb', line 7 def @timestamp end |
#type ⇒ Object
Returns the value of attribute type.
7 8 9 |
# File 'lib/langfuse/models/ingestion_event.rb', line 7 def type @type end |
Instance Method Details
#to_h ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'lib/langfuse/models/ingestion_event.rb', line 17 def to_h { id: @id, type: @type, timestamp: @timestamp, body: @body.respond_to?(:to_h) ? @body.to_h : @body, metadata: @metadata }.compact end |