Perplexed.Answer.Candidate (Perplexed v0.1.0)

Copy Markdown View Source

One unique search hit an answer considered.

relevance (0 to 1) and reason come from the ranking call, which sees only the title, URL and description. queries lists every query that returned the hit. status is what happened to it:

  • :used - scraped and given to the summary.
  • :unreadable - kept, but every scraper failed; scrape_error says why.
  • :duplicate - scraped, but it landed on a page another source already covers.
  • :not_needed - kept, but max_sources was already filled.
  • :dropped - ranked below min_relevance.

Summary

Types

status()

@type status() :: :used | :unreadable | :duplicate | :not_needed | :dropped

t()

@type t() :: %Perplexed.Answer.Candidate{
  description: String.t() | nil,
  id: pos_integer(),
  queries: [String.t()],
  reason: String.t() | nil,
  relevance: float() | nil,
  scrape_error: term(),
  status: status(),
  title: String.t() | nil,
  url: String.t()
}