Class: SentinelRb::Client::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/sentinel_rb/client/base.rb

Overview

Base class for LLM client implementations

Direct Known Subclasses

Mock, OpenAI

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Base

Returns a new instance of Base.



7
8
9
# File 'lib/sentinel_rb/client/base.rb', line 7

def initialize(config)
  @config = config
end

Instance Method Details

#analyze_content(prompt) ⇒ Hash

Abstract method: Analyze content for relevance and quality

Parameters:

  • prompt (String)

    Prompt text to analyze

Returns:

  • (Hash)

    Analysis results

Raises:

  • (NotImplementedError)


29
30
31
# File 'lib/sentinel_rb/client/base.rb', line 29

def analyze_content(prompt)
  raise NotImplementedError, "Subclasses must implement #analyze_content"
end

#fact_check(statement) ⇒ Hash

Abstract method: Check factual accuracy of a statement

Parameters:

  • statement (String)

    Statement to fact-check

Returns:

  • (Hash)

    Result with :accurate boolean and :confidence score

Raises:

  • (NotImplementedError)


22
23
24
# File 'lib/sentinel_rb/client/base.rb', line 22

def fact_check(statement)
  raise NotImplementedError, "Subclasses must implement #fact_check"
end

#similarity(text1, text2) ⇒ Float

Abstract method: Calculate semantic similarity between two texts

Parameters:

  • text1 (String)

    First text

  • text2 (String)

    Second text

Returns:

  • (Float)

    Similarity score between 0.0 and 1.0

Raises:

  • (NotImplementedError)


15
16
17
# File 'lib/sentinel_rb/client/base.rb', line 15

def similarity(text1, text2)
  raise NotImplementedError, "Subclasses must implement #similarity"
end