Exception: LittleGhost::ToolError
- Defined in:
- lib/little_ghost/errors.rb
Overview
Base class for expected failures while executing a Tool. Its message may be returned to the model, so it must be safe to disclose.
Instance Attribute Summary collapse
-
#framework_prompt ⇒ Object
readonly
:nodoc:.
Instance Method Summary collapse
-
#initialize(message = nil, framework_prompt: nil) ⇒ ToolError
constructor
Creates a safe Tool failure from application prose or a framework prompt reference.
Constructor Details
#initialize(message = nil, framework_prompt: nil) ⇒ ToolError
Creates a safe Tool failure from application prose or a framework prompt reference.
79 80 81 82 83 84 85 86 87 |
# File 'lib/little_ghost/errors.rb', line 79 def initialize( = nil, framework_prompt: nil) reference = framework_prompt if !reference && defined?(FrameworkPrompts::Reference) && .is_a?(FrameworkPrompts::Reference) reference = end @framework_prompt = reference = FrameworkPrompts.new.render_reference(reference) if reference super() end |
Instance Attribute Details
#framework_prompt ⇒ Object (readonly)
:nodoc:
76 77 78 |
# File 'lib/little_ghost/errors.rb', line 76 def framework_prompt @framework_prompt end |