Class: Assistant::TechnicalSupport::ResponseGroundingClaimCitations
- Inherits:
-
Object
- Object
- Assistant::TechnicalSupport::ResponseGroundingClaimCitations
- Includes:
- Service
- Defined in:
- app/services/assistant/technical_support/response_grounding_claim_citations.rb
Overview
Finds supported claims whose cited source is not one of the tool results
the grader identified as supporting that exact claim.
Instance Method Summary collapse
-
#call ⇒ Array<Integer>
Returns one-based indexes for claims lacking a bound citation.
-
#citation_required? ⇒ Boolean
Reports whether any supported claim relies on canonical tool evidence and therefore requires a citation in the answer.
Methods included from Service
#attributes_used, #build_result, call, #logger
Methods included from Service::Initializer
Instance Method Details
#call ⇒ Array<Integer>
Returns one-based indexes for claims lacking a bound citation.
19 20 21 22 23 |
# File 'app/services/assistant/technical_support/response_grounding_claim_citations.rb', line 19 def call claims.each_with_index.filter_map do |claim, index| index + 1 if claim.supported? && citation_required_for?(claim) && cited_urls_for(claim).empty? end end |
#citation_required? ⇒ Boolean
Reports whether any supported claim relies on canonical tool evidence
and therefore requires a citation in the answer.
29 30 31 |
# File 'app/services/assistant/technical_support/response_grounding_claim_citations.rb', line 29 def citation_required? claims.any? { |claim| claim.supported? && citation_required_for?(claim) } end |