Class: Assistant::TechnicalSupport::ResponseGroundingGate
- Inherits:
-
Object
- Object
- Assistant::TechnicalSupport::ResponseGroundingGate
- Includes:
- Service
- Defined in:
- app/services/assistant/technical_support/response_grounding_gate.rb
Overview
Audits one persisted Sunny Technical Support turn against the successful
tool results still present in the live transcript. Shadow mode records the
decision on the assistant message without changing its already-streamed text.
Defined Under Namespace
Classes: Result
Instance Method Summary collapse
-
#call ⇒ Result
Audits and persists one response, failing open on operational errors.
Methods included from Service
#attributes_used, #build_result, call, #logger
Methods included from Service::Initializer
Instance Method Details
#call ⇒ Result
Audits and persists one response, failing open on operational errors.
40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'app/services/assistant/technical_support/response_grounding_gate.rb', line 40 def call return Result.new(applicable: false, status: 'not_applicable') unless applicable? @response_message = return missing_response_result unless assessment = assess_response result_for(persist(assessment)) rescue ResponseGroundingAnalyzer::InvalidResponse => e record_failure(status: 'inconclusive', reason: 'invalid_structured_response', error: e) rescue StandardError => e record_failure(status: 'error', reason: 'assessment_failed', error: e) end |