Skip to main content
Version: Next

BasePydanticAiHtmlDistiller

Base class for the built-in HTML distillers.

A distiller reduces raw HTML to a compact representation that an LLM can read cheaply. Subclasses implement distill. The base stores the prompt notes and returns them from get_prompt_notes. Override get_prompt_notes when the notes depend on several constructor arguments.

The public interface is the PydanticAiHtmlDistiller protocol. The concrete distillers are PydanticAiCleanHtmlDistiller and PydanticAiSkeletonDistiller.

Hierarchy

Index

Methods

__init__

  • __init__(*, prompt_notes): None
  • Initialize a new instance.


    Parameters

    • optionalkeyword-onlyprompt_notes: str | None = None

      Short description of the final representation. Appended to the LLM task instructions by extractors. None means no notes are appended.

    Returns None

distill

  • distill(html): str
  • Convert raw HTML to a compact representation suitable for an LLM.


    Parameters

    • html: str

    Returns str

get_prompt_notes

  • get_prompt_notes(): str | None
  • Return the configured prompt notes, or None when not set.


    Returns str | None

Page Options