Class: SentinelRb::Analyzers::Base
- Inherits:
-
Object
- Object
- SentinelRb::Analyzers::Base
- Defined in:
- lib/sentinel_rb/analyzers/base.rb
Overview
Base class for all prompt analyzers
Direct Known Subclasses
BaseModelUsage, DangerousTools, FewShotBias, IrrelevantInfo, Misinformation
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#prompt ⇒ Object
readonly
Returns the value of attribute prompt.
Instance Method Summary collapse
-
#call ⇒ Array<Hash>
Abstract method: Perform analysis on the prompt.
-
#initialize(prompt, config, client) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(prompt, config, client) ⇒ Base
Returns a new instance of Base.
9 10 11 12 13 |
# File 'lib/sentinel_rb/analyzers/base.rb', line 9 def initialize(prompt, config, client) @prompt = prompt @config = config @client = client end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
7 8 9 |
# File 'lib/sentinel_rb/analyzers/base.rb', line 7 def client @client end |
#config ⇒ Object (readonly)
Returns the value of attribute config.
7 8 9 |
# File 'lib/sentinel_rb/analyzers/base.rb', line 7 def config @config end |
#prompt ⇒ Object (readonly)
Returns the value of attribute prompt.
7 8 9 |
# File 'lib/sentinel_rb/analyzers/base.rb', line 7 def prompt @prompt end |
Instance Method Details
#call ⇒ Array<Hash>
Abstract method: Perform analysis on the prompt
17 18 19 |
# File 'lib/sentinel_rb/analyzers/base.rb', line 17 def call raise NotImplementedError, "Subclasses must implement #call" end |