Class: Langfuse::Models::Trace
- Inherits:
-
Object
- Object
- Langfuse::Models::Trace
- Defined in:
- lib/langfuse/models/trace.rb
Instance Attribute Summary collapse
-
#environment ⇒ Object
Returns the value of attribute environment.
-
#id ⇒ Object
Returns the value of attribute id.
-
#input ⇒ Object
Returns the value of attribute input.
-
#metadata ⇒ Object
Returns the value of attribute metadata.
-
#name ⇒ Object
Returns the value of attribute name.
-
#output ⇒ Object
Returns the value of attribute output.
-
#public ⇒ Object
Returns the value of attribute public.
-
#release ⇒ Object
Returns the value of attribute release.
-
#session_id ⇒ Object
Returns the value of attribute session_id.
-
#tags ⇒ Object
Returns the value of attribute tags.
-
#timestamp ⇒ Object
Returns the value of attribute timestamp.
-
#user_id ⇒ Object
Returns the value of attribute user_id.
-
#version ⇒ Object
Returns the value of attribute version.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Trace
constructor
A new instance of Trace.
- #to_h ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ Trace
Returns a new instance of Trace.
11 12 13 14 15 16 17 |
# File 'lib/langfuse/models/trace.rb', line 11 def initialize(attributes = {}) attributes.each do |key, value| send("#{key}=", value) if respond_to?("#{key}=") end @id ||= SecureRandom.uuid @timestamp ||= Time.now.utc end |
Instance Attribute Details
#environment ⇒ Object
Returns the value of attribute environment.
7 8 9 |
# File 'lib/langfuse/models/trace.rb', line 7 def environment @environment end |
#id ⇒ Object
Returns the value of attribute id.
7 8 9 |
# File 'lib/langfuse/models/trace.rb', line 7 def id @id end |
#input ⇒ Object
Returns the value of attribute input.
7 8 9 |
# File 'lib/langfuse/models/trace.rb', line 7 def input @input end |
#metadata ⇒ Object
Returns the value of attribute metadata.
7 8 9 |
# File 'lib/langfuse/models/trace.rb', line 7 def @metadata end |
#name ⇒ Object
Returns the value of attribute name.
7 8 9 |
# File 'lib/langfuse/models/trace.rb', line 7 def name @name end |
#output ⇒ Object
Returns the value of attribute output.
7 8 9 |
# File 'lib/langfuse/models/trace.rb', line 7 def output @output end |
#public ⇒ Object
Returns the value of attribute public.
7 8 9 |
# File 'lib/langfuse/models/trace.rb', line 7 def public @public end |
#release ⇒ Object
Returns the value of attribute release.
7 8 9 |
# File 'lib/langfuse/models/trace.rb', line 7 def release @release end |
#session_id ⇒ Object
Returns the value of attribute session_id.
7 8 9 |
# File 'lib/langfuse/models/trace.rb', line 7 def session_id @session_id end |
#tags ⇒ Object
Returns the value of attribute tags.
7 8 9 |
# File 'lib/langfuse/models/trace.rb', line 7 def @tags end |
#timestamp ⇒ Object
Returns the value of attribute timestamp.
7 8 9 |
# File 'lib/langfuse/models/trace.rb', line 7 def @timestamp end |
#user_id ⇒ Object
Returns the value of attribute user_id.
7 8 9 |
# File 'lib/langfuse/models/trace.rb', line 7 def user_id @user_id end |
#version ⇒ Object
Returns the value of attribute version.
7 8 9 |
# File 'lib/langfuse/models/trace.rb', line 7 def version @version end |
Instance Method Details
#to_h ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/langfuse/models/trace.rb', line 19 def to_h { id: @id, name: @name, userId: @user_id, input: @input, output: @output, sessionId: @session_id, metadata: @metadata, tags: @tags, public: @public, release: @release, version: @version, timestamp: @timestamp&.iso8601(3), environment: @environment }.compact end |