Class: Langfuse::Types::SpanAttributes
- Inherits:
-
Object
- Object
- Langfuse::Types::SpanAttributes
- Defined in:
- lib/langfuse/types.rb
Overview
Attributes for Langfuse span observations
Spans are used to track operations, functions, or logical units of work. They can contain other spans, generations, or events as children.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#environment ⇒ String?
Environment where the operation is running (e.g., 'production', 'staging').
-
#input ⇒ Object?
Input data for the operation being tracked.
-
#level ⇒ String?
Severity level of the observation (DEBUG, DEFAULT, WARNING, ERROR).
-
#metadata ⇒ Hash?
Additional metadata as key-value pairs.
-
#output ⇒ Object?
Output data from the operation.
-
#status_message ⇒ String?
Human-readable status message.
-
#version ⇒ String?
Version identifier for the code/model being tracked.
Instance Method Summary collapse
-
#initialize(input: nil, output: nil, metadata: nil, level: nil, status_message: nil, version: nil, environment: nil) ⇒ SpanAttributes
constructor
Initialize a new SpanAttributes instance.
-
#to_h ⇒ Hash
Convert attributes to a hash representation.
Constructor Details
#initialize(input: nil, output: nil, metadata: nil, level: nil, status_message: nil, version: nil, environment: nil) ⇒ SpanAttributes
Initialize a new SpanAttributes instance
rubocop:disable Metrics/ParameterLists
132 133 134 135 136 137 138 139 140 141 142 |
# File 'lib/langfuse/types.rb', line 132 def initialize(input: nil, output: nil, metadata: nil, level: nil, status_message: nil, version: nil, environment: nil) # rubocop:enable Metrics/ParameterLists @input = input @output = output @metadata = @level = level @status_message = @version = version @environment = environment end |
Instance Attribute Details
#environment ⇒ String?
Returns Environment where the operation is running (e.g., 'production', 'staging').
120 121 122 |
# File 'lib/langfuse/types.rb', line 120 def environment @environment end |
#input ⇒ Object?
Returns Input data for the operation being tracked.
102 103 104 |
# File 'lib/langfuse/types.rb', line 102 def input @input end |
#level ⇒ String?
Returns Severity level of the observation (DEBUG, DEFAULT, WARNING, ERROR).
111 112 113 |
# File 'lib/langfuse/types.rb', line 111 def level @level end |
#metadata ⇒ Hash?
Returns Additional metadata as key-value pairs.
108 109 110 |
# File 'lib/langfuse/types.rb', line 108 def @metadata end |
#output ⇒ Object?
Returns Output data from the operation.
105 106 107 |
# File 'lib/langfuse/types.rb', line 105 def output @output end |
#status_message ⇒ String?
Returns Human-readable status message.
114 115 116 |
# File 'lib/langfuse/types.rb', line 114 def @status_message end |
#version ⇒ String?
Returns Version identifier for the code/model being tracked.
117 118 119 |
# File 'lib/langfuse/types.rb', line 117 def version @version end |
Instance Method Details
#to_h ⇒ Hash
Convert attributes to a hash representation
Returns a hash with all non-nil attributes. Nil values are excluded.
149 150 151 152 153 154 155 156 157 158 159 |
# File 'lib/langfuse/types.rb', line 149 def to_h { input: @input, output: @output, metadata: @metadata, level: @level, status_message: @status_message, version: @version, environment: @environment }.compact end |