AutoParser Configuration#
The settings for AutoParser (most noteably the LLM choices and API key, and schema locations)
are configured using the Config class. This can be initialised by providing either a dictionary
or JSON/TOML config file to the setup_config function at the top of your python file.
- adtl.autoparser.setup_config(path: Path | str | dict) Config#
Initializes the config singleton from a file.
Class definitions#
The various options and defaults are described here:
- class adtl.autoparser.config.config.Config(*, name: str = 'autoparser', description: str = 'Configuration for ADTL autoparser', language: str, schemas: dict[str, str], column_mappings: ColumnMappingConfig = DefaultColumnMappingConfig(source_field='Field Name', source_type='Field Type', source_description='Description', common_values='Common Values', choices=None), llm_provider: Literal['openai', 'gemini'] | None = None, llm_model: str | None = None, api_key: SecretStr | None = None, choice_delimiter: str = ',', choice_delimiter_map: str = '=', num_refs: int = 3, max_common_count: int = 25, min_common_frequency: float | None = None, long_tables: dict[str, LongTableConfig] | None = None)#
- check_llm_setup() None#
Check if the LLM is set up correctly. Raises an error if the LLM is not configured, and points to the potential error.
- model_config: ClassVar[ConfigDict] = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_post_init(context: Any) None#
Set up the LLM.