Class: Agentic::Verification::VerificationResult

Inherits:
Object
  • Object
show all
Defined in:
lib/agentic/verification/verification_result.rb

Overview

Represents the result of a verification process

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(task_id:, verified:, confidence:, messages: []) ⇒ VerificationResult

Initializes a new VerificationResult

Parameters:

  • task_id (String)

    The ID of the task that was verified

  • verified (Boolean)

    Whether the verification passed

  • confidence (Float)

    The confidence score (0.0-1.0) of the verification

  • messages (Array<String>) (defaults to: [])

    Messages from the verification process



24
25
26
27
28
29
# File 'lib/agentic/verification/verification_result.rb', line 24

def initialize(task_id:, verified:, confidence:, messages: [])
  @task_id = task_id
  @verified = verified
  @confidence = confidence
  @messages = messages
end

Instance Attribute Details

#confidenceFloat (readonly)

Returns The confidence score (0.0-1.0) of the verification.

Returns:

  • (Float)

    The confidence score (0.0-1.0) of the verification



14
15
16
# File 'lib/agentic/verification/verification_result.rb', line 14

def confidence
  @confidence
end

#messagesArray<String> (readonly)

Returns Messages from the verification process.

Returns:

  • (Array<String>)

    Messages from the verification process



17
18
19
# File 'lib/agentic/verification/verification_result.rb', line 17

def messages
  @messages
end

#task_idString (readonly)

Returns The ID of the task that was verified.

Returns:

  • (String)

    The ID of the task that was verified



8
9
10
# File 'lib/agentic/verification/verification_result.rb', line 8

def task_id
  @task_id
end

#verifiedBoolean (readonly)

Returns Whether the verification passed.

Returns:

  • (Boolean)

    Whether the verification passed



11
12
13
# File 'lib/agentic/verification/verification_result.rb', line 11

def verified
  @verified
end

Instance Method Details

#to_hHash

Converts the verification result to a hash

Returns:

  • (Hash)

    The verification result as a hash



40
41
42
43
44
45
46
47
# File 'lib/agentic/verification/verification_result.rb', line 40

def to_h
  {
    task_id: @task_id,
    verified: @verified,
    confidence: @confidence,
    messages: @messages
  }
end

#verified_with_confidence?(threshold: 0.8) ⇒ Boolean

Checks if the verification passed with high confidence

Parameters:

  • threshold (Float) (defaults to: 0.8)

    The confidence threshold

Returns:

  • (Boolean)

    Whether verification passed with confidence above the threshold



34
35
36
# File 'lib/agentic/verification/verification_result.rb', line 34

def verified_with_confidence?(threshold: 0.8)
  @verified && @confidence >= threshold
end