Class: Langfuse::Models::IngestionEvent

Inherits:
Object
  • Object
show all
Defined in:
lib/langfuse/models/ingestion_event.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#bodyObject

Returns the value of attribute body.



6
7
8
# File 'lib/langfuse/models/ingestion_event.rb', line 6

def body
  @body
end

#idObject

Returns the value of attribute id.



6
7
8
# File 'lib/langfuse/models/ingestion_event.rb', line 6

def id
  @id
end

#metadataObject

Returns the value of attribute metadata.



6
7
8
# File 'lib/langfuse/models/ingestion_event.rb', line 6

def 
  @metadata
end

#timestampObject

Returns the value of attribute timestamp.



6
7
8
# File 'lib/langfuse/models/ingestion_event.rb', line 6

def timestamp
  @timestamp
end

#typeObject

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_hObject



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