Skip to main content
Version: 0.0.5 (stable)

agrag.common.schema_fingerprint.extraction_fingerprint

extraction_fingerprint(schema:GraphSchema, settings:ExtractionSettings, *, effective_mode:Literal['gliner', 'hybrid', 'llm'], llm_model:str | None, prompt_id:str | None, llm_output:LLMOutputSettings | None = None) -> str

Return the hash of everything the extractor reads besides structure.

The hash covers the entity, relation and property descriptions, the ExtractionSettings fields except escalation_budget and mode, and the effective mode. escalation_threshold is hashed only for hybrid. The LLM model name, prompt identity and LLM output options are hashed only when the effective mode is hybrid or llm. A new settings field is included until it is added to the exclude list.

Parameters:

  • schema (GraphSchema) – The schema whose descriptions the extractor reads.
  • settings (ExtractionSettings) – The extraction settings of the run.
  • effective_mode (Literal['gliner', 'hybrid', 'llm']) – The mode the run uses after the degrade rule.
  • llm_model (str | None) – The model name of the LLM slot, or None without an LLM.
  • prompt_id (str | None) – The prompt identity of the LLM tier, or None without an LLM.
  • llm_output (LLMOutputSettings | None) – The output options of the LLM slot, or None when the slot has none to report.

Returns:

  • str – The first 16 hex characters of the SHA-256 of the canonical data.