fix(analyzer): honour config_path for LangExtract recognizers in YAML registry#2153
Open
RonShakutai wants to merge 1 commit into
Open
Conversation
… 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change Description
LM recognizers (
BasicLangExtractRecognizer,AzureOpenAILangExtractRecognizer) configured via a recognizer-registry YAML now honourconfig_path.Bug: these class names were missing from
CONFIG_MODEL_MAP, so their YAML entry was validated by the strictPredefinedRecognizerConfig(noconfig_pathfield, noextra="allow"). Pydantic silently droppedconfig_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"+ explicitconfig_path) mirroring the existing HuggingFace/GLiNER configs, and register both class names inCONFIG_MODEL_MAP. Nowconfig_pathsurvives 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).Issue reference
N/A
Checklist