Skip to content

fix(analyzer): honour config_path for LangExtract recognizers in YAML registry#2153

Open
RonShakutai wants to merge 1 commit into
ronshaktuai/fix-langextract-paramsfrom
ronshakutai-fix-llm-recognizer-custom-yaml-config
Open

fix(analyzer): honour config_path for LangExtract recognizers in YAML registry#2153
RonShakutai wants to merge 1 commit into
ronshaktuai/fix-langextract-paramsfrom
ronshakutai-fix-llm-recognizer-custom-yaml-config

Conversation

@RonShakutai

Copy link
Copy Markdown
Contributor

Change Description

LM recognizers (BasicLangExtractRecognizer, AzureOpenAILangExtractRecognizer) configured via a recognizer-registry YAML now honour config_path.

Bug: these class names were missing from CONFIG_MODEL_MAP, so their YAML entry was validated by the strict PredefinedRecognizerConfig (no config_path field, no extra="allow"). Pydantic silently dropped config_path, and the recognizer fell back to its bundled default model (qwen2.5:1.5b) instead of the configured one.

Fix: add a LangExtractRecognizerConfig (extra="allow" + explicit config_path) mirroring the existing HuggingFace/GLiNER configs, and register both class names in CONFIG_MODEL_MAP. Now config_path survives validation and reaches the constructor.

Adds 3 regression tests. Verified end-to-end: an Ollama recognizer now builds with the configured model (e.g. llama3.2:3b).

Stacked on ronshaktuai/fix-langextract-params (#2150) — this PR targets that branch so it shows only the config_path commit.

Issue reference

N/A

Checklist

  • I have reviewed the contribution guidelines
  • I agree to follow this project's Code of Conduct
  • I confirm that I have the right to submit this contribution and that it does not knowingly contain proprietary or confidential code.
  • My code includes unit tests
  • All unit tests and lint checks pass locally
  • My PR contains documentation updates / additions if required

… registry

LM recognizers (BasicLangExtractRecognizer, AzureOpenAILangExtractRecognizer)
configured via a recognizer registry YAML silently ignored config_path: the
strict PredefinedRecognizerConfig schema has no config_path field and forbids
extras, so Pydantic dropped it and the recognizer fell back to its bundled
default model configuration.

Add a LangExtractRecognizerConfig model (extra=allow, explicit config_path
field) mirroring the existing HuggingFace/GLiNER configs, and register both
LM recognizer class names in CONFIG_MODEL_MAP so config_path (and other
recognizer-specific kwargs) survive validation and reach the constructor.

Adds regression tests covering config_path preservation via both the model
and the full ConfigurationValidator registry path.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant