Module: Olyx::Guardrails::Llm::AnalysisPipeline
- Defined in:
- lib/olyx/guardrails/llm/analysis_pipeline.rb
Overview
Applies normalization, selection, Boolean validation, and reason bounds.
Constant Summary collapse
- INVALID_SHAPE_ERROR =
'llm_provider must return a Hash or a schema model with deep_to_h/to_h'
Class Method Summary collapse
Class Method Details
.call(value) ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/olyx/guardrails/llm/analysis_pipeline.rb', line 16 def call(value) result = AnalysisNormalizer.call(value) return { error: INVALID_SHAPE_ERROR } unless result sanitized = ResultSanitizer.call(result) validation_error(sanitized) || bound_reason(sanitized) end |