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
308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 |
# File 'lib/langfuse/types.rb', line 308 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.
292 293 294 |
# File 'lib/langfuse/types.rb', line 292 def environment @environment end |
#input ⇒ Object?
Returns Input data that initiated the trace.
277 278 279 |
# File 'lib/langfuse/types.rb', line 277 def input @input end |
#metadata ⇒ Hash?
Returns Additional metadata for the trace.
283 284 285 |
# File 'lib/langfuse/types.rb', line 283 def @metadata end |
#name ⇒ String?
Returns Human-readable name for the trace.
262 263 264 |
# File 'lib/langfuse/types.rb', line 262 def name @name end |
#output ⇒ Object?
Returns Final output data from the trace.
280 281 282 |
# File 'lib/langfuse/types.rb', line 280 def output @output end |
#public ⇒ Boolean?
Returns Whether this trace should be publicly visible.
289 290 291 |
# File 'lib/langfuse/types.rb', line 289 def public @public end |
#release ⇒ String?
Returns Release identifier for deployment tracking.
274 275 276 |
# File 'lib/langfuse/types.rb', line 274 def release @release end |
#session_id ⇒ String?
Returns Session identifier for grouping related traces.
268 269 270 |
# File 'lib/langfuse/types.rb', line 268 def session_id @session_id end |
#tags ⇒ Array<String>?
Returns Tags for categorizing and filtering traces.
286 287 288 |
# File 'lib/langfuse/types.rb', line 286 def @tags end |
#user_id ⇒ String?
Returns Identifier for the user associated with this trace.
265 266 267 |
# File 'lib/langfuse/types.rb', line 265 def user_id @user_id end |
#version ⇒ String?
Returns Version identifier for the code/application.
271 272 273 |
# File 'lib/langfuse/types.rb', line 271 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.
329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 |
# File 'lib/langfuse/types.rb', line 329 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 |