Class: Assistant::TechnicalSupport::CaseReplayEvidence::ProductEvidence

Inherits:
Object
  • Object
show all
Defined in:
app/services/assistant/technical_support/case_replay_evidence/product_evidence.rb

Overview

Reads citation provenance from successful read-only product-catalog tools.
Only explicit URL, URI, href, or citation fields are accepted; descriptive
product text cannot smuggle an unrelated URL into the evidence set.

Constant Summary collapse

Payload =
Assistant::TechnicalSupport::CaseReplayEvidence::ToolPayload
TOOLS =
%w[browse_product_line get_product search_products].freeze

Instance Method Summary collapse

Constructor Details

#initialize(tool_trace) ⇒ ProductEvidence

Returns a new instance of ProductEvidence.



10
11
12
# File 'app/services/assistant/technical_support/case_replay_evidence/product_evidence.rb', line 10

def initialize(tool_trace)
  @tool_trace = tool_trace
end

Instance Method Details

#citation_urlsObject



14
15
16
17
18
19
20
21
# File 'app/services/assistant/technical_support/case_replay_evidence/product_evidence.rb', line 14

def citation_urls
  tool_trace.filter_map do |call|
    next unless TOOLS.include?(call.name)

    payload = valid_payload(call)
    Assistant::TechnicalSupport::ResponseGroundingCitationUrls.from_payload(payload) if payload
  end.flatten.uniq
end