Class: Langfuse::Types::TraceAttributes
- Inherits:
-
Object
- Object
- Langfuse::Types::TraceAttributes
- Defined in:
- lib/langfuse/types.rb
Overview
Attributes for Langfuse traces
Traces are the top-level containers that group related observations together. They represent a complete workflow, request, or user interaction.
Instance Attribute Summary collapse
-
#environment ⇒ String?
Environment where the trace was captured.
-
#input ⇒ Object?
Input data that initiated the trace.
-
#metadata ⇒ Hash?
Additional metadata for the trace.
-
#name ⇒ String?
Human-readable name for the trace.
-
#output ⇒ Object?
Final output data from the trace.
-
#public ⇒ Boolean?
Whether this trace should be publicly visible.
-
#release ⇒ String?
Release identifier for deployment tracking.
-
#session_id ⇒ String?
Session identifier for grouping related traces.
-
#tags ⇒ Array<String>?
Tags for categorizing and filtering traces.
-
#user_id ⇒ String?
Identifier for the user associated with this trace.
-
#version ⇒ String?
Version identifier for the code/application.
Instance Method Summary collapse
-
#initialize(name: nil, user_id: nil, session_id: nil, version: nil, release: nil, input: nil, output: nil, metadata: nil, tags: nil, public: nil, environment: nil) ⇒ TraceAttributes
constructor
Initialize a new TraceAttributes instance.
-
#to_h ⇒ Hash
Convert attributes to a hash representation.
Constructor Details
#initialize(name: nil, user_id: nil, session_id: nil, version: nil, release: nil, input: nil, output: nil, metadata: nil, tags: nil, public: nil, environment: nil) ⇒ TraceAttributes
Initialize a new TraceAttributes instance
rubocop:disable Metrics/ParameterLists
294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 |
# File 'lib/langfuse/types.rb', line 294 def initialize(name: nil, user_id: nil, session_id: nil, version: nil, release: nil, input: nil, output: nil, metadata: nil, tags: nil, public: nil, environment: nil) # rubocop:enable Metrics/ParameterLists @name = name @user_id = user_id @session_id = session_id @version = version @release = release @input = input @output = output @metadata = @tags = @public = public @environment = environment end |
Instance Attribute Details
#environment ⇒ String?
Returns Environment where the trace was captured.
278 279 280 |
# File 'lib/langfuse/types.rb', line 278 def environment @environment end |
#input ⇒ Object?
Returns Input data that initiated the trace.
263 264 265 |
# File 'lib/langfuse/types.rb', line 263 def input @input end |
#metadata ⇒ Hash?
Returns Additional metadata for the trace.
269 270 271 |
# File 'lib/langfuse/types.rb', line 269 def @metadata end |
#name ⇒ String?
Returns Human-readable name for the trace.
248 249 250 |
# File 'lib/langfuse/types.rb', line 248 def name @name end |
#output ⇒ Object?
Returns Final output data from the trace.
266 267 268 |
# File 'lib/langfuse/types.rb', line 266 def output @output end |
#public ⇒ Boolean?
Returns Whether this trace should be publicly visible.
275 276 277 |
# File 'lib/langfuse/types.rb', line 275 def public @public end |
#release ⇒ String?
Returns Release identifier for deployment tracking.
260 261 262 |
# File 'lib/langfuse/types.rb', line 260 def release @release end |
#session_id ⇒ String?
Returns Session identifier for grouping related traces.
254 255 256 |
# File 'lib/langfuse/types.rb', line 254 def session_id @session_id end |
#tags ⇒ Array<String>?
Returns Tags for categorizing and filtering traces.
272 273 274 |
# File 'lib/langfuse/types.rb', line 272 def @tags end |
#user_id ⇒ String?
Returns Identifier for the user associated with this trace.
251 252 253 |
# File 'lib/langfuse/types.rb', line 251 def user_id @user_id end |
#version ⇒ String?
Returns Version identifier for the code/application.
257 258 259 |
# File 'lib/langfuse/types.rb', line 257 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.
315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 |
# File 'lib/langfuse/types.rb', line 315 def to_h { name: @name, user_id: @user_id, session_id: @session_id, version: @version, release: @release, input: @input, output: @output, metadata: @metadata, tags: @tags, public: @public, environment: @environment }.compact end |