Exception: SavvyOpenrouter::StructuredOutputError
- Inherits:
-
StandardError
- Object
- StandardError
- SavvyOpenrouter::StructuredOutputError
- Defined in:
- lib/savvy_openrouter/structured_output_error.rb
Overview
Raised when json_object/json_schema was requested but the successful response body does not contain usable JSON in assistant/output text. Optional require “savvy_openrouter/patterns”.
reason: :empty_content, :invalid_json, :no_choices
Instance Attribute Summary collapse
-
#reason ⇒ Object
readonly
Returns the value of attribute reason.
-
#response_body ⇒ Object
readonly
Returns the value of attribute response_body.
Instance Method Summary collapse
-
#initialize(message, reason:, response_body: nil) ⇒ StructuredOutputError
constructor
A new instance of StructuredOutputError.
Constructor Details
#initialize(message, reason:, response_body: nil) ⇒ StructuredOutputError
Returns a new instance of StructuredOutputError.
11 12 13 14 15 |
# File 'lib/savvy_openrouter/structured_output_error.rb', line 11 def initialize(, reason:, response_body: nil) @reason = reason @response_body = response_body super() end |
Instance Attribute Details
#reason ⇒ Object (readonly)
Returns the value of attribute reason.
9 10 11 |
# File 'lib/savvy_openrouter/structured_output_error.rb', line 9 def reason @reason end |
#response_body ⇒ Object (readonly)
Returns the value of attribute response_body.
9 10 11 |
# File 'lib/savvy_openrouter/structured_output_error.rb', line 9 def response_body @response_body end |