Exception: Ollama::SchemaViolationError

Inherits:
Error
  • Object
show all
Defined in:
lib/ollama/errors.rb

Overview

Raised when structured output does not match the requested JSON schema. Carries structured violation details for repair middleware.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message = nil, violations: []) ⇒ SchemaViolationError

Returns a new instance of SchemaViolationError.



15
16
17
18
# File 'lib/ollama/errors.rb', line 15

def initialize(message = nil, violations: [])
  super(message)
  @violations = Array(violations)
end

Instance Attribute Details

#violationsObject (readonly)

Returns the value of attribute violations.



13
14
15
# File 'lib/ollama/errors.rb', line 13

def violations
  @violations
end