Skip to content

LlamaParseConfig

Base classes

Name Children Inherits
BaseConverterConfig
docler_config.converter_configs
Base configuration for document converters.

⋔ Inheritance diagram

graph TD
  525620694["converter_configs.LlamaParseConfig"]
  2232753316["converter_configs.BaseConverterConfig"]
  1396724084["provider.ProviderConfig"]
  1261767679["main.BaseSettings"]
  3879467795["main.BaseModel"]
  2751680898["builtins.object"]
  2232753316 --> 525620694
  1396724084 --> 2232753316
  1261767679 --> 1396724084
  3879467795 --> 1261767679
  2751680898 --> 3879467795

🛈 DocStrings

Bases: BaseConverterConfig

Configuration for LlamaParse-based converter.

Source code in src/docler_config/converter_configs.py
class LlamaParseConfig(BaseConverterConfig):
    """Configuration for LlamaParse-based converter."""

    type: Literal["llamaparse"] = Field("llamaparse", init=False)
    """Type discriminator for LlamaParse converter."""

    languages: set[SupportedLanguage] = Field(default_factory=default_languages)
    """List of supported languages for the converter."""

    api_key: SecretStr | None = None
    """LlamaParse API key. Falls back to LLAMAPARSE_API_KEY env var."""

    adaptive_long_table: bool = False
    """Whether to use adaptive long table."""

    parse_mode: LlamaParseMode = "parse_page_with_llm"
    """Legacy parse mode, used when no `tier` is set."""

    tier: LlamaParseTier | None = None
    """Parsing tier. Takes precedence over `parse_mode` when set."""

    skip_diagonal_text: bool = False
    """Whether to skip diagonal text."""

    disable_ocr: bool = False
    """Whether to disable OCR for images."""

    continuous_mode: bool = True
    """Merge tables spanning pages. Only supported with a `tier`."""

    html_tables: bool = False
    """Whether to output HTML tables instead of markdown."""

    model_config = SettingsConfigDict(env_prefix="LLAMAPARSE_")

    def get_provider(self) -> DocumentConverter:
        """Get the converter instance."""
        from docler.converters.llamaparse_provider import LlamaParseConverter

        return LlamaParseConverter(**self.get_config_fields())

adaptive_long_table class-attribute instance-attribute

adaptive_long_table: bool = False

Whether to use adaptive long table.

api_key class-attribute instance-attribute

api_key: SecretStr | None = None

LlamaParse API key. Falls back to LLAMAPARSE_API_KEY env var.

continuous_mode class-attribute instance-attribute

continuous_mode: bool = True

Merge tables spanning pages. Only supported with a tier.

disable_ocr class-attribute instance-attribute

disable_ocr: bool = False

Whether to disable OCR for images.

html_tables class-attribute instance-attribute

html_tables: bool = False

Whether to output HTML tables instead of markdown.

languages class-attribute instance-attribute

languages: set[SupportedLanguage] = Field(default_factory=default_languages)

List of supported languages for the converter.

parse_mode class-attribute instance-attribute

parse_mode: LlamaParseMode = 'parse_page_with_llm'

Legacy parse mode, used when no tier is set.

skip_diagonal_text class-attribute instance-attribute

skip_diagonal_text: bool = False

Whether to skip diagonal text.

tier class-attribute instance-attribute

tier: LlamaParseTier | None = None

Parsing tier. Takes precedence over parse_mode when set.

type class-attribute instance-attribute

type: Literal['llamaparse'] = Field('llamaparse', init=False)

Type discriminator for LlamaParse converter.

get_provider

get_provider() -> DocumentConverter

Get the converter instance.

Source code in src/docler_config/converter_configs.py
def get_provider(self) -> DocumentConverter:
    """Get the converter instance."""
    from docler.converters.llamaparse_provider import LlamaParseConverter

    return LlamaParseConverter(**self.get_config_fields())

:fa-brands-github: Show source on GitHub