Class: PromptCanary::Result

Inherits:
Object
  • Object
show all
Defined in:
lib/prompt_canary/result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(text:, version_used:, model:, latency_ms:, tokens:, error:, recorded_at:) ⇒ Result

Returns a new instance of Result.



7
8
9
10
11
12
13
14
15
16
# File 'lib/prompt_canary/result.rb', line 7

def initialize(text:, version_used:, model:, latency_ms:, tokens:, error:, recorded_at:)
  @text = text
  @version_used = version_used
  @model = model
  @latency_ms = latency_ms
  @tokens = tokens
  @error = error
  @recorded_at = recorded_at
  freeze
end

Instance Attribute Details

#errorObject (readonly)

Returns the value of attribute error.



5
6
7
# File 'lib/prompt_canary/result.rb', line 5

def error
  @error
end

#latency_msObject (readonly)

Returns the value of attribute latency_ms.



5
6
7
# File 'lib/prompt_canary/result.rb', line 5

def latency_ms
  @latency_ms
end

#modelObject (readonly)

Returns the value of attribute model.



5
6
7
# File 'lib/prompt_canary/result.rb', line 5

def model
  @model
end

#recorded_atObject (readonly)

Returns the value of attribute recorded_at.



5
6
7
# File 'lib/prompt_canary/result.rb', line 5

def recorded_at
  @recorded_at
end

#textObject (readonly)

Returns the value of attribute text.



5
6
7
# File 'lib/prompt_canary/result.rb', line 5

def text
  @text
end

#tokensObject (readonly)

Returns the value of attribute tokens.



5
6
7
# File 'lib/prompt_canary/result.rb', line 5

def tokens
  @tokens
end

#version_usedObject (readonly)

Returns the value of attribute version_used.



5
6
7
# File 'lib/prompt_canary/result.rb', line 5

def version_used
  @version_used
end