Sycophant.Citation (sycophant v0.5.0)

Copy Markdown

Provider-agnostic citation attached to assistant text.

Unifies the location variants emitted by providers (currently Anthropic's five) behind a single shape. Citations are decoded from responses, attached to Sycophant.Message.Content.Text parts, and aggregated on Sycophant.Response.citations.

Summary

Types

t()

@type t() :: %Sycophant.Citation{
  __type__: binary(),
  cited_text: nil | binary(),
  document_index: nil | integer(),
  document_title: nil | binary(),
  end_index: nil | integer(),
  file_id: nil | binary(),
  source: nil | binary(),
  start_index: nil | integer(),
  title: nil | binary(),
  type:
    nil
    | :page_location
    | :char_location
    | :content_block_location
    | :web_search_result_location
    | :search_result_location,
  unit: nil | :page | :char | :block,
  url: nil | binary()
}

Functions

t()