Exception: PatientLLM::StructuredOutputError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/patient_llm/structured_output_error.rb

Overview

Raised when an agent declares an output schema but the model's response cannot be parsed as JSON. The unparseable text is available on the error.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, text: nil) ⇒ StructuredOutputError

Returns a new instance of StructuredOutputError.



10
11
12
13
# File 'lib/patient_llm/structured_output_error.rb', line 10

def initialize(message, text: nil)
  super(message)
  @text = text
end

Instance Attribute Details

#textString? (readonly)

Returns the raw response text that failed to parse.

Returns:

  • (String, nil)

    the raw response text that failed to parse



8
9
10
# File 'lib/patient_llm/structured_output_error.rb', line 8

def text
  @text
end