Class: Langfuse::Event
- Inherits:
-
Object
- Object
- Langfuse::Event
- Defined in:
- lib/langfuse/event.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#input ⇒ Object
readonly
Returns the value of attribute input.
-
#level ⇒ Object
readonly
Returns the value of attribute level.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#output ⇒ Object
readonly
Returns the value of attribute output.
-
#parent_observation_id ⇒ Object
readonly
Returns the value of attribute parent_observation_id.
-
#start_time ⇒ Object
readonly
Returns the value of attribute start_time.
-
#status_message ⇒ Object
readonly
Returns the value of attribute status_message.
-
#trace_id ⇒ Object
readonly
Returns the value of attribute trace_id.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
-
#initialize(client:, trace_id:, name:, id: nil, start_time: nil, input: nil, output: nil, metadata: nil, level: nil, status_message: nil, parent_observation_id: nil, version: nil, **kwargs) ⇒ Event
constructor
A new instance of Event.
- #to_dict ⇒ Object
Constructor Details
#initialize(client:, trace_id:, name:, id: nil, start_time: nil, input: nil, output: nil, metadata: nil, level: nil, status_message: nil, parent_observation_id: nil, version: nil, **kwargs) ⇒ Event
Returns a new instance of Event.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/langfuse/event.rb', line 6 def initialize(client:, trace_id:, name:, id: nil, start_time: nil, input: nil, output: nil, metadata: nil, level: nil, status_message: nil, parent_observation_id: nil, version: nil, **kwargs) @client = client @id = id || Utils.generate_id @trace_id = trace_id @name = name @start_time = start_time || Utils. @input = input @output = output @metadata = || {} @level = level @status_message = @parent_observation_id = parent_observation_id @version = version @kwargs = kwargs # Create the event create_event end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
3 4 5 |
# File 'lib/langfuse/event.rb', line 3 def client @client end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
3 4 5 |
# File 'lib/langfuse/event.rb', line 3 def id @id end |
#input ⇒ Object (readonly)
Returns the value of attribute input.
3 4 5 |
# File 'lib/langfuse/event.rb', line 3 def input @input end |
#level ⇒ Object (readonly)
Returns the value of attribute level.
3 4 5 |
# File 'lib/langfuse/event.rb', line 3 def level @level end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
3 4 5 |
# File 'lib/langfuse/event.rb', line 3 def @metadata end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/langfuse/event.rb', line 3 def name @name end |
#output ⇒ Object (readonly)
Returns the value of attribute output.
3 4 5 |
# File 'lib/langfuse/event.rb', line 3 def output @output end |
#parent_observation_id ⇒ Object (readonly)
Returns the value of attribute parent_observation_id.
3 4 5 |
# File 'lib/langfuse/event.rb', line 3 def parent_observation_id @parent_observation_id end |
#start_time ⇒ Object (readonly)
Returns the value of attribute start_time.
3 4 5 |
# File 'lib/langfuse/event.rb', line 3 def start_time @start_time end |
#status_message ⇒ Object (readonly)
Returns the value of attribute status_message.
3 4 5 |
# File 'lib/langfuse/event.rb', line 3 def @status_message end |
#trace_id ⇒ Object (readonly)
Returns the value of attribute trace_id.
3 4 5 |
# File 'lib/langfuse/event.rb', line 3 def trace_id @trace_id end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
3 4 5 |
# File 'lib/langfuse/event.rb', line 3 def version @version end |
Instance Method Details
#to_dict ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/langfuse/event.rb', line 27 def to_dict { id: @id, trace_id: @trace_id, name: @name, start_time: @start_time, input: @input, output: @output, metadata: @metadata, level: @level, status_message: @status_message, parent_observation_id: @parent_observation_id, version: @version }.merge(@kwargs).compact end |